bundle.js 982 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. console.log('zh:TEST环境');
  893. }
  894. else {
  895. console.log('zh:SC环境');
  896. }
  897. let url = urlMid + reqUrl;
  898. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  899. if (isDev) {
  900. url = urlTop + reqUrl;
  901. }
  902. else {
  903. url = urlTop + "prod-api/" + reqUrl;
  904. }
  905. }
  906. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  907. if (reqUrl.indexOf("/api/game/") >= 0) {
  908. }
  909. const keyForLoginInfo = "userInfo";
  910. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  911. if (userInfoData != null) {
  912. try {
  913. let bb = JSON.parse(userInfoData);
  914. if (bb) {
  915. let token = bb.token;
  916. headers.push("Authorization");
  917. headers.push(`Bearer ${token}`);
  918. }
  919. }
  920. catch (e) {
  921. }
  922. }
  923. let httpObj = new Laya.HttpRequest();
  924. httpObj.http.timeout = 5000;
  925. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  926. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  927. httpObj.send(url, data, 'post', 'text', headers);
  928. function errorHandler(error) {
  929. if (call) {
  930. call("{'msg':'Network exception','code':500}");
  931. }
  932. else {
  933. alert("Tip:Please check your network connection.");
  934. }
  935. }
  936. function completeHandler(data) {
  937. if (data && data.length > 0) {
  938. let jsonData = JSON.parse(data);
  939. if (call)
  940. call(jsonData);
  941. }
  942. }
  943. }
  944. sendGet(url, call) {
  945. let httpObj = new Laya.HttpRequest();
  946. httpObj.http.timeout = 5000;
  947. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  948. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  949. httpObj.send(url, '', 'get');
  950. function errorHandler(error) {
  951. console.log("errorHandler:" + error);
  952. }
  953. function completeHandler(data) {
  954. if (data && data.length > 0) {
  955. if (call)
  956. call(data);
  957. }
  958. }
  959. }
  960. }
  961. HttpMgr._instance = null;
  962. class LightShader extends Laya.Sprite {
  963. constructor() {
  964. super();
  965. this._time = 0;
  966. this._sin = 0;
  967. this.initShader();
  968. }
  969. initShader() {
  970. var vs = `
  971. #define FSHIGHPRECISION
  972. attribute vec4 posuv;
  973. uniform vec2 size;
  974. varying vec4 v_texcoord;
  975. void main() {
  976. vec4 pos = vec4(posuv.xy,0.,1.);
  977. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  978. gl_Position=pos1;
  979. v_texcoord.xy = posuv.xy;
  980. }
  981. `;
  982. var ps = `
  983. #define FSHIGHPRECISION
  984. precision highp float;
  985. varying vec4 v_texcoord;
  986. uniform vec2 size;
  987. uniform sampler2D texture;
  988. uniform float u_Time;
  989. void main() {
  990. vec4 color= texture2D(texture, v_texcoord.xy);
  991. float width = 0.2;
  992. float start = u_Time;
  993. float offset = 1.0;
  994. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  995. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  996. {
  997. color.r=1.1;
  998. color.g=1.1;
  999. color.b=1.1;
  1000. gl_FragColor = color;
  1001. } else {
  1002. gl_FragColor = color;
  1003. }
  1004. }
  1005. `;
  1006. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1007. this.customRenderEnable = true;
  1008. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1009. }
  1010. customRender(context, x, y) {
  1011. this.onUpdate();
  1012. if (!this.texture)
  1013. return;
  1014. let xx = x - this.pivotX;
  1015. let yy = y - this.pivotY;
  1016. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1017. }
  1018. onUpdate() {
  1019. this._time += 2 * Laya.timer.delta * 0.001;
  1020. this._sin = Math.sin(this._time);
  1021. if (this._sin > 0.99) {
  1022. this._sin = 0;
  1023. this._time = 0;
  1024. }
  1025. this.shaderValue['u_Time'] = this._sin;
  1026. }
  1027. }
  1028. LightShader.DissolveSurfaceSaveName = 9997;
  1029. class UIBase extends fairygui.Window {
  1030. constructor() {
  1031. super();
  1032. this.isEject = true;
  1033. this.isHide = true;
  1034. this.showbanner = true;
  1035. this.className = "";
  1036. this.isMuti = false;
  1037. this.showbanner = false;
  1038. this.onConstructor();
  1039. }
  1040. checkActive(show) {
  1041. }
  1042. getUIName() {
  1043. return UIBase.uiName;
  1044. }
  1045. onConstructor() {
  1046. try {
  1047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoadedForBase));
  1048. console.log("zh: base加载arial字体成功");
  1049. }
  1050. catch (error) {
  1051. console.log("zh: base加载arial字体失败");
  1052. }
  1053. }
  1054. onFontLoadedForBase() {
  1055. try {
  1056. Laya.Text.defaultFont = "arial";
  1057. console.log("zh: base 设置arial字体成功");
  1058. }
  1059. catch (error) {
  1060. console.log("zh: base 设置arial字体失败");
  1061. }
  1062. }
  1063. onInit() {
  1064. if (!!this.contentPane) {
  1065. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1066. }
  1067. this.setPivot(0.5, 0.5, false);
  1068. }
  1069. doShowAnimation() {
  1070. if (!this.isEject)
  1071. return;
  1072. super.doShowAnimation();
  1073. Laya.Tween.clearTween(this);
  1074. this.scaleX = this.scaleY = 0.8;
  1075. let tweenFunc1 = (func) => {
  1076. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1077. };
  1078. let tweenFunc2 = (func) => {
  1079. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1080. };
  1081. tweenFunc1(tweenFunc2);
  1082. }
  1083. show(...args) {
  1084. super.show();
  1085. this._openParam = args;
  1086. this.isHide = false;
  1087. xGame.uiMgr.checkUIState();
  1088. }
  1089. moveBannerButton() {
  1090. }
  1091. showBannerButton() {
  1092. this.bannerButton.visible = true;
  1093. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1094. this.bannerButton.touchable = true;
  1095. }));
  1096. }
  1097. hide() {
  1098. super.hide();
  1099. this.isHide = true;
  1100. xGame.uiMgr.checkUIState();
  1101. }
  1102. Dispose() {
  1103. super.dispose();
  1104. }
  1105. myUpdate(delay) {
  1106. }
  1107. refresh() { }
  1108. setGlobalFont(root) {
  1109. try {
  1110. console.log('zh: setGlobalFont start');
  1111. let fontName = "arial";
  1112. const setFont = (obj) => {
  1113. if (obj instanceof fairygui.GTextField) {
  1114. obj.font = fontName;
  1115. }
  1116. if (obj instanceof fairygui.GComponent) {
  1117. for (let i = 0; i < obj.numChildren; i++) {
  1118. setFont(obj.getChildAt(i));
  1119. }
  1120. }
  1121. };
  1122. const rootNode = root || this.contentPane;
  1123. if (rootNode) {
  1124. setFont(rootNode);
  1125. }
  1126. }
  1127. catch (error) {
  1128. console.log('zh: setGlobalFont error=' + error);
  1129. }
  1130. finally {
  1131. console.log('zh: setGlobalFont end');
  1132. }
  1133. }
  1134. addUIClick(obj, func, arr = null) {
  1135. obj.onClick(this, func, arr);
  1136. obj.onClick(this, this.playBtnSound);
  1137. }
  1138. offUIClick(obj, func) {
  1139. obj.offClick(this, func);
  1140. }
  1141. playBtnSound() {
  1142. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1143. }
  1144. }
  1145. UIBase.lastShowBanner = 0;
  1146. UIBase.showBannerNum = 0;
  1147. UIBase.uiName = "";
  1148. class ui_UIDraw extends fgui.GComponent {
  1149. static createInstance() {
  1150. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1151. }
  1152. onConstruct() {
  1153. this.n_bj = (this.getChild("n_bj"));
  1154. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1155. this.myNode = (this.getChild("myNode"));
  1156. this.extraNode = (this.getChild("extraNode"));
  1157. this.closeNode = (this.getChild("closeNode"));
  1158. this.moneyNode = (this.getChild("moneyNode"));
  1159. this.n38 = (this.getChild("n38"));
  1160. this.talkNode = (this.getChild("talkNode"));
  1161. this.secretary = (this.getChild("secretary"));
  1162. this.drawBtn = (this.getChild("drawBtn"));
  1163. this.t0 = this.getTransition("t0");
  1164. }
  1165. }
  1166. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1167. class ui_UIBox extends fgui.GComponent {
  1168. static createInstance() {
  1169. return (fgui.UIPackage.createObject("game", "UIBox"));
  1170. }
  1171. onConstruct() {
  1172. this.n0 = (this.getChild("n0"));
  1173. this.n12 = (this.getChild("n12"));
  1174. this.n1 = (this.getChild("n1"));
  1175. this.n2 = (this.getChild("n2"));
  1176. this.bar = (this.getChild("bar"));
  1177. this.closeBtn = (this.getChild("closeBtn"));
  1178. this.openBtn = (this.getChild("openBtn"));
  1179. this.t0 = this.getTransition("t0");
  1180. this.t1 = this.getTransition("t1");
  1181. }
  1182. }
  1183. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1184. class LocalStorageManager {
  1185. test1() {
  1186. LocalStorageManager.setItem("playerName", "Tom");
  1187. LocalStorageManager.setItem("playerLevel", 5);
  1188. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1189. const name = LocalStorageManager.getItem("playerName");
  1190. const level = LocalStorageManager.getItem("playerLevel");
  1191. const data = LocalStorageManager.getItem("playerData");
  1192. console.log(name);
  1193. console.log(level);
  1194. console.log(data);
  1195. LocalStorageManager.removeItem("playerLevel");
  1196. }
  1197. static setItem(key, value) {
  1198. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1199. }
  1200. static getItem(key) {
  1201. const data = Laya.LocalStorage.getItem(key);
  1202. if (data === null)
  1203. return null;
  1204. try {
  1205. return JSON.parse(data);
  1206. }
  1207. catch (e) {
  1208. return data;
  1209. }
  1210. }
  1211. static removeItem(key) {
  1212. Laya.LocalStorage.removeItem(key);
  1213. }
  1214. static clear() {
  1215. Laya.LocalStorage.clear();
  1216. }
  1217. static hasJosnKey(key) {
  1218. var value = Laya.LocalStorage.getJSON(key);
  1219. if (value != null) {
  1220. return true;
  1221. }
  1222. else {
  1223. return false;
  1224. }
  1225. }
  1226. static hasKey(key) {
  1227. return Laya.LocalStorage.getItem(key) !== null;
  1228. }
  1229. }
  1230. class GlobalManager {
  1231. constructor() {
  1232. }
  1233. registerMethod(name, method) {
  1234. console.log('zh: 注册全局方法', name);
  1235. this[name] = method;
  1236. }
  1237. callMethod(name, ...args) {
  1238. console.log('zh: 调用全局方法', name);
  1239. if (this[name]) {
  1240. return this[name](...args);
  1241. }
  1242. else {
  1243. console.error(`zh: 全局方法 Method ${name} not found`);
  1244. }
  1245. }
  1246. }
  1247. GlobalManager.instance = new GlobalManager();
  1248. class JSBridgeUtils {
  1249. constructor() { }
  1250. static get instance() {
  1251. if (!this._instance) {
  1252. this._instance = new JSBridgeUtils();
  1253. }
  1254. return this._instance;
  1255. }
  1256. initBridge() {
  1257. if (!Laya.Browser.onAndroid) {
  1258. console.log('zh:非android dev');
  1259. return;
  1260. }
  1261. let cfg = window['conchConfig'];
  1262. if (cfg) {
  1263. var os = cfg.getOS();
  1264. if (os == "Conch-android") {
  1265. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1266. if (this.bridge) {
  1267. return true;
  1268. }
  1269. else {
  1270. return false;
  1271. }
  1272. }
  1273. else {
  1274. return false;
  1275. }
  1276. }
  1277. else {
  1278. return false;
  1279. }
  1280. }
  1281. testAd1() {
  1282. if (!Laya.Browser.onAndroid) {
  1283. console.log('zh:非android dev');
  1284. return;
  1285. }
  1286. if (!this.initBridge()) {
  1287. return;
  1288. }
  1289. let rs = this.bridge.call("testString", "hello");
  1290. console.log('zh:testString rs=' + rs);
  1291. }
  1292. testAdCallBack() {
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log("zh:testAdCallBack start");
  1297. const defaultObj = { code: 200, msg: "req update Ui" };
  1298. const reqObj = { code: 300, msg: "hello java ui" };
  1299. this.bridge.callWithBack((rsStr) => {
  1300. const rsObj = JSON.parse(rsStr);
  1301. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1302. }, "testAsyncCallback", JSON.stringify(reqObj));
  1303. }
  1304. showInternAd(mark) {
  1305. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1306. if (boo1) {
  1307. console.log('zh: VIP SPID = 1,免除插页AD');
  1308. return false;
  1309. }
  1310. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1311. if (boo7) {
  1312. console.log('zh: VIP SPID = 7,免除任何AD');
  1313. return false;
  1314. }
  1315. console.log('zh:showInternAd start');
  1316. if (!Laya.Browser.onAndroid) {
  1317. console.log('zh:showInternAd 非android dev');
  1318. return false;
  1319. }
  1320. if (!this.initBridge()) {
  1321. return false;
  1322. }
  1323. let rs = this.bridge.call("showInternAd", mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:showInternAd OK");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:showInternAd FAILL:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. exitAndCloseGame() {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. console.log('zh:开始关闭游戏-');
  1348. this.bridge.call("exitAndCloseGame");
  1349. }
  1350. checkAdForUserOrderForSpid17(spid) {
  1351. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1352. if (userInfo != null) {
  1353. if (!userInfo.buySpids) {
  1354. userInfo.buySpids = { 1: false, 7: false };
  1355. }
  1356. else {
  1357. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1358. }
  1359. let boo = userInfo.buySpids[spid];
  1360. if (!boo) {
  1361. console.log('zh:刷新一下用户的AD权利');
  1362. DataMgr.loadUserSpOrderForAd();
  1363. }
  1364. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1365. return boo;
  1366. }
  1367. return false;
  1368. }
  1369. showRewardAd(mark) {
  1370. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1371. if (boo7) {
  1372. console.log('zh: VIP SPID = 7,免除任何AD');
  1373. return false;
  1374. }
  1375. if (!Laya.Browser.onAndroid) {
  1376. return false;
  1377. }
  1378. if (!this.initBridge()) {
  1379. return false;
  1380. }
  1381. let rs = this.bridge.call("showRewardAd", mark);
  1382. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1383. try {
  1384. const result = JSON.parse(rs);
  1385. if (result.code === 200) {
  1386. console.log("zh:广告显示成功");
  1387. return true;
  1388. }
  1389. else {
  1390. console.warn("zh:广告显示失败:", result.msg);
  1391. return false;
  1392. }
  1393. }
  1394. catch (e) {
  1395. console.error("zh:解析桥接返回值失败:", e);
  1396. return false;
  1397. }
  1398. }
  1399. logEventForAdNoParams(eventName) {
  1400. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1401. if (!Laya.Browser.onAndroid) {
  1402. return;
  1403. }
  1404. if (!this.initBridge()) {
  1405. return;
  1406. }
  1407. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1408. this.bridge.call("logEventForAdNoParams", eventName);
  1409. }
  1410. logEventForAdHaveParams(eventName, jsonStr) {
  1411. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1419. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1420. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1421. }
  1422. logEventForFirebase(eventName, jsonStr) {
  1423. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1424. if (!Laya.Browser.onAndroid) {
  1425. return;
  1426. }
  1427. if (!this.initBridge()) {
  1428. return;
  1429. }
  1430. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1431. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1432. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1433. }
  1434. testNetTip() {
  1435. if (Laya.Browser.onAndroid) {
  1436. let boo = this.getNetworkAvailable();
  1437. this.showToast2("Network error, reward unavailable");
  1438. return;
  1439. }
  1440. }
  1441. getNetworkAvailable() {
  1442. if (!Laya.Browser.onAndroid) {
  1443. return;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. console.log("zh:getNetworkAvailable boo=" + boo);
  1450. return boo;
  1451. }
  1452. showToast2(msg) {
  1453. if (!Laya.Browser.onAndroid) {
  1454. return;
  1455. }
  1456. if (!this.initBridge()) {
  1457. return;
  1458. }
  1459. this.bridge.call("showToast2", msg);
  1460. }
  1461. showConfirmationDialogForExit(title, msg) {
  1462. if (!Laya.Browser.onAndroid) {
  1463. return;
  1464. }
  1465. if (!this.initBridge()) {
  1466. return;
  1467. }
  1468. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1469. }
  1470. loginOutForApp() {
  1471. if (!Laya.Browser.onAndroid) {
  1472. return;
  1473. }
  1474. if (!this.initBridge()) {
  1475. return;
  1476. }
  1477. this.bridge.call("loginOutForApp");
  1478. }
  1479. startGgPay(token, ggSpid, spid) {
  1480. if (!Laya.Browser.onAndroid) {
  1481. return;
  1482. }
  1483. if (!this.initBridge()) {
  1484. return;
  1485. }
  1486. let jsonObj = {
  1487. token: token,
  1488. ggSpid: ggSpid,
  1489. spid: spid,
  1490. spsl: 1
  1491. };
  1492. let reqData = JSON.stringify(jsonObj);
  1493. console.log("zh:startGgPay ts reqData=" + reqData);
  1494. this.bridge.call("startGgPay", reqData);
  1495. }
  1496. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1497. if (!Laya.Browser.onAndroid) {
  1498. return;
  1499. }
  1500. if (!this.initBridge()) {
  1501. return;
  1502. }
  1503. let jsonObj = {
  1504. token: token,
  1505. ggSpid: ggSpid,
  1506. spid: spid,
  1507. spsl: 1
  1508. };
  1509. let reqData = JSON.stringify(jsonObj);
  1510. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1511. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1512. }
  1513. nativeCallJs(msg) {
  1514. console.log("zh:nativeCallJs received data: 1111", msg);
  1515. if (msg === 'Ad1') {
  1516. GlobalManager.instance.callMethod('Ad1');
  1517. console.log("zh: Ad1 奖励发送成功");
  1518. }
  1519. else if (msg === 'Ad2') {
  1520. GlobalManager.instance.callMethod('Ad2');
  1521. console.log("zh: Ad2 奖励发送成功");
  1522. }
  1523. else if (msg === 'Ad3') {
  1524. GlobalManager.instance.callMethod('Ad3');
  1525. console.log("zh: Ad3 奖励发送成功");
  1526. }
  1527. else if (msg === 'Ad4') {
  1528. GlobalManager.instance.callMethod('Ad4');
  1529. console.log("zh: Ad4 奖励发送成功");
  1530. }
  1531. else if (msg === 'Ad5') {
  1532. console.log("zh: Ad5 奖励发送成功");
  1533. GlobalManager.instance.callMethod('Ad5');
  1534. }
  1535. }
  1536. }
  1537. class UIBox extends UIBase {
  1538. constructor() {
  1539. super();
  1540. this.boxNum = 0;
  1541. this.boxMax = 10;
  1542. this.inAd = false;
  1543. this.isClose = false;
  1544. }
  1545. onConstructor() {
  1546. this.ui = ui_UIBox.createInstance();
  1547. this.contentPane = this.ui;
  1548. this.isEject = false;
  1549. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1550. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1551. Laya.timer.loop(1000, this, this.update);
  1552. }
  1553. update() {
  1554. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1555. this.boxNum -= 1;
  1556. this.upBar();
  1557. }
  1558. }
  1559. upBar() {
  1560. if (this.boxNum > this.boxMax)
  1561. this.boxNum = this.boxMax;
  1562. this.ui.bar.value = this.boxNum * 10;
  1563. }
  1564. show() {
  1565. super.show();
  1566. this.isClose = false;
  1567. this.boxNum = 0;
  1568. this.inAd = false;
  1569. this.upBar();
  1570. this.ui.t0.play();
  1571. this.ui.closeBtn.visible = false;
  1572. Laya.timer.once(3000, this, () => {
  1573. this.ui.closeBtn.visible = true;
  1574. this.ui.bar.alpha = 1;
  1575. });
  1576. Laya.timer.once(500, this, () => {
  1577. this.ui.t1.play();
  1578. });
  1579. this.setGlobalFont(this.ui);
  1580. }
  1581. hide() {
  1582. Laya.timer.clearAll(this);
  1583. Moyu.showBannerAd(false);
  1584. super.hide();
  1585. }
  1586. onOpenBox() {
  1587. this.boxNum++;
  1588. if (this.boxNum < this.boxMax) {
  1589. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1590. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1591. }
  1592. }
  1593. else if (this.boxNum == this.boxMax) {
  1594. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1595. this.ui.openBtn.c1.selectedIndex = 13;
  1596. this.inAd = true;
  1597. }
  1598. else
  1599. this.getAward();
  1600. }
  1601. else if (this.inAd) {
  1602. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1603. if (Laya.Browser.onAndroid) {
  1604. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1605. if (!boo) {
  1606. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1607. return;
  1608. }
  1609. }
  1610. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1611. }
  1612. else {
  1613. console.log('zh:AD 失败,直接发放奖励');
  1614. this.qjff_AD_for_UIBOX_onOpenBox();
  1615. }
  1616. }
  1617. this.upBar();
  1618. }
  1619. qjff_AD_for_UIBOX_onOpenBox() {
  1620. this.getAward();
  1621. }
  1622. onCloseBox() {
  1623. if (this.isClose)
  1624. this.hide();
  1625. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1626. this.isClose = true;
  1627. PlatMgr.showBanner(true, 0, 3000);
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. getAward() {
  1633. let str = "";
  1634. if (Math.random() < 0.5) {
  1635. let max = Moyu.isLegal ? 500 : 2500;
  1636. let num = xGame.tools.random(max, 500 + max);
  1637. DataMgr.setCoin(num);
  1638. str = "金币x" + num;
  1639. }
  1640. else {
  1641. let max = Moyu.isLegal ? 10 : 30;
  1642. let num = xGame.tools.random(max, 30 + max);
  1643. DataMgr.setDiamond(num);
  1644. str = "钻石x" + num;
  1645. }
  1646. xGame.showTip("恭喜获得-" + str);
  1647. this.hide();
  1648. }
  1649. }
  1650. UIBox.uiName = "UIBox";
  1651. class ui_UITry extends fgui.GComponent {
  1652. static createInstance() {
  1653. return (fgui.UIPackage.createObject("game", "UITry"));
  1654. }
  1655. onConstruct() {
  1656. this.n11 = (this.getChild("n11"));
  1657. this.myNode = (this.getChild("myNode"));
  1658. this.t0 = this.getTransition("t0");
  1659. }
  1660. }
  1661. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1662. class UITry extends UIBase {
  1663. constructor() {
  1664. super();
  1665. this.closeTime = 0;
  1666. this.closeNum = 0;
  1667. this.skillUrl = xGame.common.skillIconList;
  1668. }
  1669. onConstructor() {
  1670. this.ui = ui_UITry.createInstance();
  1671. this.contentPane = this.ui;
  1672. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1673. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1674. }
  1675. show() {
  1676. super.show();
  1677. this.closeNum = 0;
  1678. this.closeTime = 15;
  1679. this.ui.t0.play();
  1680. PlatMgr.showRateBanner();
  1681. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1682. Laya.timer.loop(1000, this, this.updateTime);
  1683. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1684. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1685. xGame.common.gameMgr.gamePause = true;
  1686. this.setGlobalFont(this.ui);
  1687. }
  1688. updateTime() {
  1689. if (this.closeTime > 1) {
  1690. this.closeTime--;
  1691. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1692. }
  1693. else
  1694. this.hide();
  1695. }
  1696. hide() {
  1697. Laya.timer.clearAll(this);
  1698. Moyu.showBannerAd(false);
  1699. super.hide();
  1700. xGame.common.gameMgr.gamePause = false;
  1701. }
  1702. onTry() {
  1703. console.log('zh:qjff_AD_for_uitry');
  1704. if (Laya.Browser.onAndroid) {
  1705. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1706. if (!boo) {
  1707. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1708. return;
  1709. }
  1710. }
  1711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1712. }
  1713. else {
  1714. console.log('zh:AD 失败,直接发放奖励');
  1715. this.qjff_AD_for_uitry();
  1716. }
  1717. }
  1718. qjff_AD_for_uitry() {
  1719. let select = xGame.common.curPlayerSkillType;
  1720. DataMgr.gameData.trySkill = select;
  1721. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1722. DataMgr.saveGameData();
  1723. DataMgr.setBigSkill(select, 1);
  1724. xGame.showTip("Trial Successful");
  1725. this.hide();
  1726. }
  1727. onCancel() {
  1728. if (this.closeNum > 0) {
  1729. this.closeNum--;
  1730. if (this.closeNum < 2)
  1731. this.hide();
  1732. return;
  1733. }
  1734. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1735. this.onTry();
  1736. }
  1737. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1738. this.closeNum = 3;
  1739. }
  1740. else
  1741. this.hide();
  1742. }
  1743. }
  1744. UITry.uiName = "UITry";
  1745. class PlatMgr {
  1746. static initConfig() {
  1747. this.lastVt = 0;
  1748. if (!Moyu.platConfig)
  1749. return;
  1750. for (let k in Moyu.platConfig) {
  1751. let pd = this[k];
  1752. let pc = Moyu.platConfig[k];
  1753. if (pd != undefined && pc != undefined)
  1754. this[k] = pc;
  1755. }
  1756. Moyu.setBannerPos(0.5, 1);
  1757. }
  1758. static rand100(num) {
  1759. return xGame.tools.random(0, 100) < num;
  1760. }
  1761. static isMisVideo() {
  1762. let dt = Laya.timer.currTimer - this.lastVt;
  1763. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1764. this.lastVt = Laya.timer.currTimer;
  1765. return true;
  1766. }
  1767. else {
  1768. if (this.rand100(this.fullVideoRate)) {
  1769. console.log('zh:插屏 ad start');
  1770. JSBridgeUtils.instance.showInternAd('platMgr');
  1771. }
  1772. return false;
  1773. }
  1774. }
  1775. static showVideo(call, type) {
  1776. Moyu.showVideoAd(() => {
  1777. this.lastVt = Laya.timer.currTimer;
  1778. call && call();
  1779. }, type);
  1780. }
  1781. static showInsert(delay = false) {
  1782. if (this.getRand() < this.insertRate) {
  1783. let dt = delay ? this.insertDelay : 0;
  1784. console.log('zh:插屏 ad start');
  1785. JSBridgeUtils.instance.showInternAd('gameInsert');
  1786. }
  1787. }
  1788. static gameInsert() {
  1789. let t = this.getRand();
  1790. let r = this.gameInsertRate;
  1791. if (t < r) {
  1792. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1793. }
  1794. }
  1795. static showRateBanner() {
  1796. if (this.getRand() < this.bannerRate)
  1797. this.showBanner(true, this.bannerDelay, 3000);
  1798. }
  1799. static showBanner(show, delay = 0, hide = 0) {
  1800. if (2 > 1) {
  1801. console.log('zh:显示showBanner广告 直接返回');
  1802. return;
  1803. }
  1804. if (!show)
  1805. Moyu.showBannerAd(false);
  1806. else {
  1807. Laya.timer.clear(this, this.bannerShow);
  1808. if (delay > 0)
  1809. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1810. else
  1811. this.bannerShow(true);
  1812. if (hide > 0)
  1813. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1814. }
  1815. }
  1816. static bannerShow(show) {
  1817. if (2 > 1) {
  1818. console.log('zh:显示showBanner广告 直接返回');
  1819. return;
  1820. }
  1821. Moyu.showBannerAd(show);
  1822. console.log("showBanner" + show);
  1823. }
  1824. static getRand() {
  1825. return xGame.tools.random(0, 100);
  1826. }
  1827. static openBox() {
  1828. if (this.getRand() < this.boxRate)
  1829. xGame.uiMgr.Show(UIBox);
  1830. }
  1831. static openTry() {
  1832. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1833. return;
  1834. if (this.getRand() < this.tryRate)
  1835. xGame.uiMgr.Show(UITry);
  1836. else if (DataMgr.gameData.gameCount == 1)
  1837. xGame.uiMgr.Show(UITry);
  1838. }
  1839. }
  1840. PlatMgr.forceShare = 0;
  1841. PlatMgr.signAdRate = 0;
  1842. PlatMgr.forceVideoRate = 0;
  1843. PlatMgr.forceVideoGap = 0;
  1844. PlatMgr.fullVideoRate = 0;
  1845. PlatMgr.gameInsertRate = 0;
  1846. PlatMgr.insertGap = 0;
  1847. PlatMgr.insertDelay = 0;
  1848. PlatMgr.insertRate = 0;
  1849. PlatMgr.boxRate = 0;
  1850. PlatMgr.boxVideoRate = 0;
  1851. PlatMgr.boxInsertRate = 0;
  1852. PlatMgr.boxBannerRate = 0;
  1853. PlatMgr.tryRate = 0;
  1854. PlatMgr.tryClose3Rate = 0;
  1855. PlatMgr.tryVideoRate = 0;
  1856. PlatMgr.bannerRate = 0;
  1857. PlatMgr.lastVt = 0;
  1858. class ui_UIAddProp extends fgui.GComponent {
  1859. static createInstance() {
  1860. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1861. }
  1862. onConstruct() {
  1863. this.n11 = (this.getChild("n11"));
  1864. this.myNode = (this.getChild("myNode"));
  1865. this.closeBtn = (this.getChild("closeBtn"));
  1866. this.t0 = this.getTransition("t0");
  1867. }
  1868. }
  1869. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1870. class SpineMgr {
  1871. constructor(name, loadCb = null) {
  1872. this.loaded = false;
  1873. this.spineName = '';
  1874. this.loadedCallback = loadCb;
  1875. this.templet = new Laya.Templet();
  1876. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1877. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1878. if (name === 'mishu') {
  1879. this.templet.loadAni('spine/nvmishu.sk');
  1880. }
  1881. else {
  1882. this.templet.loadAni(`spine/${name}.sk`);
  1883. }
  1884. this.templet.lock = true;
  1885. this.spineName = name;
  1886. }
  1887. onError() {
  1888. console.log("zh:spine加载出错");
  1889. }
  1890. parseComplete() {
  1891. this.loaded = true;
  1892. this.loadedCallback && this.loadedCallback();
  1893. }
  1894. dispose() {
  1895. if (this.templet && !this.templet.destroyed) {
  1896. this.templet.destroy();
  1897. }
  1898. this.templet = null;
  1899. }
  1900. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1901. if (!this.loaded) {
  1902. return;
  1903. }
  1904. let spine;
  1905. if (mySpine) {
  1906. spine = mySpine;
  1907. }
  1908. else {
  1909. spine = this.createSpine(data, parent);
  1910. }
  1911. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1912. if (!isLoop) {
  1913. spine.on(Laya.Event.STOPPED, this, () => {
  1914. spine.offAll(Laya.Event.STOPPED);
  1915. callback && callback(spine);
  1916. });
  1917. }
  1918. return spine;
  1919. }
  1920. createSpine(data, parent, type = 1) {
  1921. let spine;
  1922. spine = this.templet.buildArmature(type);
  1923. spine.showSkinByIndex(0);
  1924. parent.addChild(spine);
  1925. spine.pos(data.x, data.y);
  1926. spine.scale(data.scaleX, data.scaleY, true);
  1927. return spine;
  1928. }
  1929. }
  1930. var AIState;
  1931. (function (AIState) {
  1932. AIState[AIState["none"] = 0] = "none";
  1933. AIState[AIState["idle"] = 1] = "idle";
  1934. AIState[AIState["reset"] = 2] = "reset";
  1935. AIState[AIState["move"] = 3] = "move";
  1936. AIState[AIState["wait"] = 4] = "wait";
  1937. AIState[AIState["select"] = 5] = "select";
  1938. AIState[AIState["turn"] = 6] = "turn";
  1939. AIState[AIState["shoot"] = 7] = "shoot";
  1940. AIState[AIState["leave"] = 8] = "leave";
  1941. })(AIState || (AIState = {}));
  1942. class AIPlayer {
  1943. constructor() {
  1944. this.dtime = 30;
  1945. this.awayTime = 0;
  1946. this.awayNum = 0;
  1947. this.hideTime = 0;
  1948. this.rootMoveTime = 0;
  1949. this.isGuide = false;
  1950. this.state = AIState.none;
  1951. this.waitTime = 0;
  1952. this.forceNum = 0;
  1953. this.forceMax = 0;
  1954. this.ballSize = 33;
  1955. this.selectNum = 0;
  1956. this.destRot = 0;
  1957. this.aiLv = 10;
  1958. this.kickBall = [];
  1959. this.lineBall = [];
  1960. this.scoreBall = [];
  1961. this.holeBall = [];
  1962. this.turnNum = 0;
  1963. this.setNum = 0;
  1964. this.setMax = 0;
  1965. this.setRate = 0;
  1966. this.rectL = 0;
  1967. this.rectR = 0;
  1968. this.rectT = 0;
  1969. this.rectB = 0;
  1970. this.rootPos = { x: 0, y: 0 };
  1971. this.bestForce = 0;
  1972. this.bestAngle = 180;
  1973. this.bestPos = { x: 0, y: 0 };
  1974. this.bestKick = { x: 0, y: 0 };
  1975. this.posList = [];
  1976. this.posIdx = 0;
  1977. this.chatTime = 3000;
  1978. this.tempDir1 = new Laya.Vector2();
  1979. this.tempDir2 = new Laya.Vector2();
  1980. this.tempDir3 = new Laya.Vector2();
  1981. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1982. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1983. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1984. this.gameSrc = xGame.common.gameUI;
  1985. this.hideTime = Laya.timer.currTimer;
  1986. Moyu.setOnTipCall((id) => {
  1987. if (id == 20012)
  1988. this.hideTime = Laya.timer.currTimer;
  1989. else
  1990. (id == 20011);
  1991. {
  1992. let dt = Laya.timer.currTimer - this.hideTime;
  1993. console.log("onshow" + dt);
  1994. if (dt > 30000 && this.state > AIState.none)
  1995. xGame.common.gameMgr.aiGameEnd(false);
  1996. }
  1997. }, this);
  1998. }
  1999. init() {
  2000. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2001. this.awayTime = xGame.tools.random(5000, 10000);
  2002. this.awayNum = 0;
  2003. this.hideTime = Laya.timer.currTimer;
  2004. let rect = xGame.common.d2World.borderRect;
  2005. this.rectL = Math.ceil(rect.x) + 17;
  2006. this.rectT = Math.ceil(rect.y) + 17;
  2007. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2008. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2009. this.wBall = xGame.common.d2World.rootBall;
  2010. this.ballSize = this.wBall.gameObj.width - 1;
  2011. if (this.posList.length < 1) {
  2012. let dp = 40;
  2013. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2014. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2015. let dx = i < this.rectR ? i : this.rectR;
  2016. let dy = j < this.rectB ? j : this.rectB;
  2017. let order = xGame.tools.random(0, 1000);
  2018. this.posList.push({ x: dx, y: dy, order: order });
  2019. }
  2020. }
  2021. this.posList.sort(function (a, b) {
  2022. return a.order - b.order;
  2023. });
  2024. this.setMax = this.posList.length;
  2025. }
  2026. this.state = AIState.idle;
  2027. }
  2028. setAiLevel(num) {
  2029. this.aiLv = num;
  2030. }
  2031. initBall() {
  2032. this.rootPos.x = this.wBall.gameObj.x;
  2033. this.rootPos.y = this.wBall.gameObj.y;
  2034. this.initHoleBall();
  2035. }
  2036. initHoleBall() {
  2037. this.kickBall = [];
  2038. this.lineBall = [];
  2039. this.scoreBall = [];
  2040. this.holeBall = [];
  2041. this.selectNum = 0;
  2042. this.forceNum = 0;
  2043. this.forceMax = 0;
  2044. this.turnNum = 0;
  2045. let list = xGame.common.d2World.ballArr;
  2046. if (list.length < 20 && !this.isGuide) {
  2047. let holes = xGame.common.gameMgr.holePosList;
  2048. for (let i = 0; i < list.length; i++) {
  2049. let obj = list[i];
  2050. if (!obj)
  2051. continue;
  2052. obj.kickPos.x = 0;
  2053. obj.kickPos.y = 0;
  2054. obj.poleAngle = 0;
  2055. obj.hard = 0;
  2056. obj.borderDis = 0;
  2057. obj.kickAngle = 180;
  2058. if (obj.number == 0)
  2059. continue;
  2060. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2061. continue;
  2062. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2063. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2064. continue;
  2065. }
  2066. let b = obj.gameObj;
  2067. let wbp = this.rootPos;
  2068. let bx = wbp.x - b.x;
  2069. let by = wbp.y - b.y;
  2070. obj.borderDis = xGame.tools.random(0, 100);
  2071. this.kickBall.push(obj);
  2072. if (!this.isLine(wbp, obj))
  2073. continue;
  2074. obj.kickAngle = xGame.tools.random(90, 180);
  2075. obj.kickPos.x = b.x;
  2076. obj.kickPos.y = b.y;
  2077. this.lineBall.push(obj);
  2078. let minDis = 999999;
  2079. let hole = false;
  2080. for (let j = 0; j < holes.length; j++) {
  2081. let hp = holes[j];
  2082. if (bx >= 0 && hp.x > b.x + 100)
  2083. continue;
  2084. if (bx <= 0 && hp.x < b.x - 100)
  2085. continue;
  2086. if (by < -10 && hp.y < wbp.y)
  2087. continue;
  2088. if (by > 10 && hp.y > wbp.y)
  2089. continue;
  2090. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2091. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2092. if (dis < minDis) {
  2093. let dx = b.x - this.tempDir1.x * this.ballSize;
  2094. let dy = b.y - this.tempDir1.y * this.ballSize;
  2095. this.tempDir3.x = this.tempDir1.x;
  2096. this.tempDir3.y = this.tempDir1.y;
  2097. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2098. obj.kickPos.x = dx;
  2099. obj.kickPos.y = dy;
  2100. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2101. if (num > 1)
  2102. num = 1;
  2103. obj.kickAngle = Math.acos(num) * 57.3;
  2104. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2105. dis = dis * 2;
  2106. if (Math.abs(hp.x - 600) < 100)
  2107. dis += 50;
  2108. obj.hard = dis + obj.kickAngle * 3;
  2109. hole = true;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. if (hole) {
  2115. this.scoreBall.push(obj);
  2116. this.holeBall.push(obj);
  2117. }
  2118. }
  2119. this.scoreBall.sort(function (a, b) {
  2120. return a.hard - b.hard;
  2121. });
  2122. this.holeBall.sort(function (a, b) {
  2123. return a.kickAngle - b.kickAngle;
  2124. });
  2125. this.kickBall.sort(function (a, b) {
  2126. return a.borderDis - b.borderDis;
  2127. });
  2128. }
  2129. else {
  2130. let max = list.length - 1;
  2131. let i = xGame.tools.random(0, max);
  2132. for (i; i <= max; i++) {
  2133. let idx = i >= max ? i -= max : i;
  2134. let obj = list[idx];
  2135. if (obj && obj.number != 0) {
  2136. obj.kickAngle = xGame.tools.random(90, 180);
  2137. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2138. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2139. this.lineBall.push(obj);
  2140. break;
  2141. }
  2142. }
  2143. }
  2144. }
  2145. selectBall() {
  2146. let ball = null;
  2147. this.destRot = 0;
  2148. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2149. let ai = 110 - this.aiLv * 10;
  2150. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2151. let score = false;
  2152. if (this.scoreBall.length < 1) {
  2153. if (this.lineBall.length < 1) {
  2154. for (let i = 0; i < this.kickBall.length; i++) {
  2155. let list = [];
  2156. let bo = this.kickBall[i];
  2157. let bobj = bo.gameObj;
  2158. let rect = xGame.common.d2World.borderRect;
  2159. let mobj = this.wBall.gameObj;
  2160. let minb = bobj.y - rect.y - 20;
  2161. let minw = mobj.y - rect.y - 50;
  2162. if (minb > 0 && minw > 0) {
  2163. let dlenx = 0;
  2164. let dleny = mobj.y - rect.y;
  2165. let spx = mobj.x;
  2166. let spy = rect.y - dleny;
  2167. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2168. }
  2169. minb = rect.y + rect.height - bobj.y - 20;
  2170. minw = rect.y + rect.height - mobj.y - 50;
  2171. if (minb > 0 && minw > 0) {
  2172. let dlenx = 0;
  2173. let dleny = rect.y + rect.height - mobj.y;
  2174. let spx = mobj.x;
  2175. let spy = rect.y + rect.height + dleny;
  2176. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2177. }
  2178. minb = bobj.x - rect.x - 20;
  2179. minw = mobj.x - rect.x - 50;
  2180. if (minb > 0 && minw > 0) {
  2181. let dlenx = mobj.x - rect.x;
  2182. let dleny = 0;
  2183. let spx = rect.x - dlenx;
  2184. let spy = mobj.y;
  2185. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2186. }
  2187. minb = rect.x + rect.width - bobj.x - 20;
  2188. minw = rect.x + rect.width - mobj.x - 50;
  2189. if (minb > 0 && minw > 0) {
  2190. let dlenx = rect.x + rect.width - mobj.x;
  2191. let dleny = 0;
  2192. let spx = rect.x + rect.width + dlenx;
  2193. let spy = mobj.y;
  2194. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2195. }
  2196. list.sort(function (a, b) {
  2197. return a.order - b.order;
  2198. });
  2199. for (let i = 0; i < list.length; i++) {
  2200. let data = list[i];
  2201. let mx = mobj.x - bobj.x;
  2202. let my = mobj.y - bobj.y;
  2203. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2204. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2205. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2206. if (num > 1)
  2207. num = 1;
  2208. let cos = Math.acos(num);
  2209. if (cos > 1.57)
  2210. cos = 1.57;
  2211. else if (cos < 0.01)
  2212. cos = 0.01;
  2213. let tan = Math.tan(cos);
  2214. let dx = tan * data.dleny;
  2215. let dy = tan * data.dlenx;
  2216. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2217. if (Math.abs(bx - 667) < 40)
  2218. continue;
  2219. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2220. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2221. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2222. this.forceMax = dis * 0.08;
  2223. this.destRot += mis * 0.1;
  2224. this.setKick(bx, by);
  2225. return true;
  2226. }
  2227. }
  2228. }
  2229. }
  2230. else {
  2231. ball = xGame.common.getRandArrEle(this.lineBall);
  2232. }
  2233. }
  2234. else {
  2235. for (let i = 0; i < this.scoreBall.length; i++) {
  2236. if (i < this.scoreBall.length - 1) {
  2237. let rand = 70 + this.aiLv * 10 + i * 10;
  2238. if (xGame.tools.random(0, 100) < rand) {
  2239. ball = this.scoreBall[i];
  2240. break;
  2241. }
  2242. }
  2243. else {
  2244. ball = this.scoreBall[i];
  2245. break;
  2246. }
  2247. }
  2248. score = true;
  2249. this.selectNum++;
  2250. }
  2251. if (!ball)
  2252. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2253. if (this.selectNum >= max) {
  2254. let dx = ball.gameObj.x;
  2255. let dy = ball.gameObj.y;
  2256. let kickAngle = 0;
  2257. if (score) {
  2258. dx = ball.kickPos.x;
  2259. dy = ball.kickPos.y;
  2260. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2261. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2262. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2263. if (adot > 1)
  2264. adot = 1;
  2265. kickAngle = Math.acos(adot) * 57.3;
  2266. if (kickAngle > 45) {
  2267. let kdx = ball.kickPos.x - ball.gameObj.x;
  2268. let kdy = ball.kickPos.y - ball.gameObj.y;
  2269. dx = ball.kickPos.x - kdx * mis * 0.3;
  2270. dy = ball.kickPos.y - kdy * mis * 0.3;
  2271. }
  2272. else
  2273. this.destRot += mis;
  2274. }
  2275. else if (ball.poleAngle != 0) {
  2276. this.destRot += ball.poleAngle;
  2277. }
  2278. if (xGame.common.gameMode == 0) {
  2279. let af = kickAngle * 0.08;
  2280. this.forceMax = ball.hard * 0.1 + af * af;
  2281. }
  2282. this.setKick(dx, dy);
  2283. }
  2284. else {
  2285. let rand = this.aiLv * 5 + 40;
  2286. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2287. ball = xGame.common.getRandArrEle(this.scoreBall);
  2288. else
  2289. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2290. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2291. if (xGame.tools.random(0, 100) > rand) {
  2292. this.selectNum = max;
  2293. }
  2294. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2295. this.selectNum++;
  2296. }
  2297. ball.onClick(0, true);
  2298. }
  2299. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2300. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2301. let balls = xGame.common.d2World.ballArr;
  2302. let max = xGame.tools.getDis(hx, hy, bx, by);
  2303. for (let index = 0; index < balls.length; index++) {
  2304. let obj = balls[index];
  2305. if (obj.number == 0)
  2306. continue;
  2307. if (obj.number == bn || obj.number == dn)
  2308. continue;
  2309. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2310. if (dis * dis > max)
  2311. continue;
  2312. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2313. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2314. if (num > 1)
  2315. num = 1;
  2316. if (num < 0)
  2317. continue;
  2318. let gap = Math.sin(Math.acos(num)) * dis;
  2319. if (gap < this.ballSize)
  2320. return true;
  2321. }
  2322. return false;
  2323. }
  2324. isLine(xy, ball) {
  2325. let bx = xy.x;
  2326. let by = xy.y;
  2327. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2328. let dis = ball.getDestDis(xy);
  2329. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2330. let sin = Math.sin(angle);
  2331. let cos = Math.cos(angle);
  2332. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2333. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2334. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2335. let dx = bx + this.tempDir2.x * dis;
  2336. let dy = by + this.tempDir2.y * dis;
  2337. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2338. sin = Math.sin(-angle);
  2339. cos = Math.cos(-angle);
  2340. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2341. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2342. dx = bx + this.tempDir2.x * dis;
  2343. dy = by + this.tempDir2.y * dis;
  2344. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2345. if (isr && isl)
  2346. return false;
  2347. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2348. }
  2349. return true;
  2350. }
  2351. turnPole() {
  2352. this.turnNum++;
  2353. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2354. let dr = rot - this.destRot;
  2355. let abs = Math.abs(dr) % 360;
  2356. if (abs > 180) {
  2357. if (rot > 180)
  2358. rot -= 360;
  2359. if (this.destRot > 180)
  2360. this.destRot -= 360;
  2361. }
  2362. let max = this.turnNum * 5 + this.aiLv * 5;
  2363. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2364. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2365. let at = xGame.tools.random(1000, 2000);
  2366. if (!this.onAway(3))
  2367. at += xGame.tools.random(10000, 15000);
  2368. this.setState(AIState.shoot, at);
  2369. }
  2370. else {
  2371. let mr = 0;
  2372. if (abs > 3)
  2373. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2374. else if (Math.random() > 0.6)
  2375. mr = xGame.tools.random(1, 10) * 0.1;
  2376. mr = dr > 0 ? -mr : mr;
  2377. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2378. }
  2379. }
  2380. setKick(dx, dy) {
  2381. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2382. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2383. this.tempDir1.x = 0;
  2384. this.tempDir1.y = 1;
  2385. this.tempDir2.y = -this.tempDir2.y;
  2386. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2387. if (num > 1)
  2388. num = 1;
  2389. let rot = Math.acos(num) * 57.3;
  2390. if (this.tempDir2.x < 0)
  2391. rot = 360 - rot;
  2392. this.destRot += rot;
  2393. if (!xGame.common.gameMgr.finishOneShoot) {
  2394. this.forceMax += xGame.tools.random(10, 50);
  2395. this.forceMax -= this.aiLv * 2;
  2396. if (this.forceMax < 20)
  2397. this.forceMax = 20;
  2398. }
  2399. if (this.forceMax > 100)
  2400. this.forceMax = 101;
  2401. else if (this.forceMax < 10)
  2402. this.forceMax += xGame.tools.random(0, 10);
  2403. if (xGame.common.gameMode == 1)
  2404. this.forceMax = xGame.tools.random(80, 100);
  2405. else
  2406. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2407. let max = 2000 - this.aiLv * 100;
  2408. if (Math.random() > 0.8)
  2409. max += xGame.tools.random(100, 2000);
  2410. this.setState(AIState.turn, xGame.tools.random(500, max));
  2411. }
  2412. shoot() {
  2413. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2414. if (Math.random() > 0.8) {
  2415. this.gameSrc.aiForce(1);
  2416. this.setState(AIState.wait);
  2417. }
  2418. }
  2419. else {
  2420. let df = xGame.tools.random(3, 8);
  2421. if (this.forceNum < this.forceMax)
  2422. this.forceNum += df;
  2423. else
  2424. this.forceNum -= df;
  2425. let startY = this.gameSrc.ui.powerNode.y;
  2426. let height = this.gameSrc.ui.powerNode.height;
  2427. let force = startY + height * this.forceNum * 0.01;
  2428. this.gameSrc.aiForce(2, force);
  2429. }
  2430. }
  2431. reset() {
  2432. for (let i = 0; i < 4; i++) {
  2433. this.setRate--;
  2434. this.setNum++;
  2435. let pos = this.posList[this.posIdx];
  2436. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2437. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2438. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2439. this.rootPos.x = 387;
  2440. if (this.rootPos.x < this.rectL)
  2441. this.rootPos.x = this.rectL;
  2442. else if (this.rootPos.x > this.rectR)
  2443. this.rootPos.x = this.rectR;
  2444. if (this.rootPos.y < this.rectT)
  2445. this.rootPos.y = this.rectT;
  2446. else if (this.rootPos.y > this.rectB)
  2447. this.rootPos.y = this.rectB;
  2448. this.posIdx++;
  2449. let max = this.posList.length;
  2450. if (this.posIdx >= max)
  2451. this.posIdx -= max;
  2452. this.initHoleBall();
  2453. let ball = null;
  2454. if (this.scoreBall.length > 0)
  2455. ball = this.scoreBall[0];
  2456. else if (this.lineBall.length > 0)
  2457. ball = xGame.common.getRandArrEle(this.lineBall);
  2458. if (ball && ball.kickAngle < this.bestAngle) {
  2459. this.bestAngle = ball.kickAngle;
  2460. this.bestKick.x = ball.kickPos.x;
  2461. this.bestKick.y = ball.kickPos.y;
  2462. this.bestPos.x = this.rootPos.x;
  2463. this.bestPos.y = this.rootPos.y;
  2464. this.bestForce = ball.hard * 0.08;
  2465. }
  2466. }
  2467. if (this.setNum >= this.setMax)
  2468. this.setMax = 0;
  2469. if (this.setRate < 1) {
  2470. this.setState(AIState.move, 0);
  2471. this.rootMoveTime = Laya.timer.currTimer;
  2472. this.gameSrc.aiRootMove(true);
  2473. }
  2474. }
  2475. delayLine() {
  2476. this.gameSrc.aiRootMove(false);
  2477. }
  2478. move() {
  2479. if (this.bestPos.x < 1)
  2480. this.bestPos = this.rootPos;
  2481. let wObj = this.wBall.gameObj;
  2482. let destx = wObj.x;
  2483. let desty = wObj.y;
  2484. let dx = Math.abs(destx - this.bestPos.x);
  2485. let dy = Math.abs(desty - this.bestPos.y);
  2486. let mx = 3 + dx * 0.03;
  2487. let my = 3 + dy * 0.03;
  2488. if (dx < 4 && dy < 4) {
  2489. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2490. dt = dt < 1000 ? 1000 - dt : 0;
  2491. if (this.setMax > 0) {
  2492. let min = this.setMax * 0.3 + this.aiLv * 5;
  2493. this.setRate = xGame.tools.random(min, this.setMax);
  2494. this.setState(AIState.reset, 0);
  2495. }
  2496. else {
  2497. this.destRot = 0;
  2498. this.forceMax = this.bestForce;
  2499. this.setKick(this.bestKick.x, this.bestKick.y);
  2500. }
  2501. if (dt > 100) {
  2502. Laya.timer.clear(this, this.delayLine);
  2503. Laya.timer.once(dt, this, this.delayLine);
  2504. }
  2505. else
  2506. this.gameSrc.aiRootMove(false);
  2507. }
  2508. else {
  2509. if (dx > 4)
  2510. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2511. if (dy > 4)
  2512. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2513. this.gameSrc.onRootMove({ x: destx, y: desty });
  2514. }
  2515. }
  2516. resetRoot() {
  2517. this.bestAngle = 180;
  2518. this.bestForce = 0;
  2519. this.setMax = this.posList.length;
  2520. this.posIdx = xGame.tools.random(0, this.setMax);
  2521. let min = this.setMax * 0.3 + this.aiLv * 5;
  2522. this.setRate = xGame.tools.random(min, this.setMax);
  2523. let max = 2000 - this.aiLv * 100;
  2524. if (Math.random() > 0.8)
  2525. max += xGame.tools.random(100, 1000);
  2526. if (this.isGuide)
  2527. this.setState(AIState.select, 500);
  2528. else if (this.onAway(2))
  2529. this.setState(AIState.reset, xGame.tools.random(400, max));
  2530. else
  2531. this.setState(AIState.none);
  2532. if (xGame.common.gameMgr.finishOneShoot)
  2533. this.chat();
  2534. }
  2535. runAI() {
  2536. if (this.state > AIState.idle)
  2537. return;
  2538. this.initBall();
  2539. this.onGame(2500);
  2540. if (Math.random() > 0.6)
  2541. this.chat();
  2542. }
  2543. stopRun() {
  2544. this.setState(AIState.idle);
  2545. }
  2546. onGame(base) {
  2547. let max = base - this.aiLv * 100;
  2548. if (Math.random() > 0.8)
  2549. max += xGame.tools.random(100, 1000);
  2550. if (this.onAway(2))
  2551. this.setState(AIState.select, xGame.tools.random(500, max));
  2552. else
  2553. this.setState(AIState.none);
  2554. }
  2555. setState(sta, wt = 0) {
  2556. if (this.state == AIState.none)
  2557. return;
  2558. this.state = sta;
  2559. this.waitTime = wt;
  2560. }
  2561. onUpdate() {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.awayTime -= this.dtime;
  2565. if (this.awayTime < 1) {
  2566. this.awayTime = xGame.tools.random(6000, 10000);
  2567. this.awayNum += (11 - this.aiLv);
  2568. this.onAway(1);
  2569. }
  2570. if (this.waitTime >= 0) {
  2571. this.waitTime -= this.dtime;
  2572. return;
  2573. }
  2574. switch (this.state) {
  2575. case AIState.idle:
  2576. this.chat();
  2577. break;
  2578. case AIState.reset:
  2579. this.reset();
  2580. break;
  2581. case AIState.move:
  2582. this.move();
  2583. break;
  2584. case AIState.leave:
  2585. this.state = AIState.none;
  2586. xGame.common.gameMgr.aiGameEnd(true);
  2587. break;
  2588. case AIState.select:
  2589. this.selectBall();
  2590. break;
  2591. case AIState.turn:
  2592. this.turnPole();
  2593. break;
  2594. case AIState.shoot:
  2595. this.shoot();
  2596. break;
  2597. }
  2598. }
  2599. onAway(type) {
  2600. if (type == 1) {
  2601. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2602. let num = this.awayNum + db * 20;
  2603. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2604. xGame.common.gameMgr.aiLeave();
  2605. this.setState(AIState.leave, 6666);
  2606. }
  2607. }
  2608. else if (type == 2) {
  2609. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2610. let num = this.awayNum + db * 30;
  2611. if (xGame.tools.random(0, 10000) < num)
  2612. return false;
  2613. }
  2614. else if (type == 3) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 10;
  2617. if (xGame.tools.random(0, 4000) < num)
  2618. return false;
  2619. }
  2620. return true;
  2621. }
  2622. chat() {
  2623. if (this.chatTime > 0) {
  2624. this.chatTime -= this.dtime;
  2625. return;
  2626. }
  2627. this.chatTime = xGame.tools.random(2000, 10000);
  2628. let rand = xGame.tools.random(0, 100);
  2629. if (rand < 15)
  2630. this.talk();
  2631. else if (rand < 35)
  2632. this.emotion();
  2633. }
  2634. talk() {
  2635. xGame.common.talkMgr.showAITalk(0);
  2636. }
  2637. emotion() {
  2638. xGame.common.talkMgr.showAIEmotion(0);
  2639. }
  2640. resetAI() {
  2641. this.stopRun();
  2642. this.state = AIState.none;
  2643. }
  2644. }
  2645. class Partical extends Laya.Script3D {
  2646. constructor() {
  2647. super();
  2648. this.duration = 2000;
  2649. }
  2650. ;
  2651. onAwake() {
  2652. this.gameObj = this.owner;
  2653. }
  2654. onEnable() {
  2655. this.openTimer();
  2656. }
  2657. openTimer() {
  2658. Laya.timer.once(this.duration, this, this.disappear);
  2659. }
  2660. setCallback(obj, callback) {
  2661. this.obj = obj;
  2662. this.callback = callback;
  2663. Laya.timer.clearAll(this);
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. disappear() {
  2667. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2668. this.callback && this.callback(this.obj);
  2669. }
  2670. }
  2671. class Ball extends Laya.Script3D {
  2672. constructor() {
  2673. super();
  2674. this.posV3 = new Laya.Vector3();
  2675. this.rotRate = 2.1;
  2676. this.rotSpeed = new Laya.Vector3();
  2677. this.myIndex = 0;
  2678. }
  2679. onAwake() {
  2680. this.gameObj = this.owner;
  2681. this.transform = this.gameObj.transform;
  2682. this.ballNode = this.gameObj.getChildByName("Ball");
  2683. this.shadowNode = this.gameObj.getChildByName("shadow");
  2684. }
  2685. initSelf(index, x, y, owner) {
  2686. this.d2BallSrc = owner;
  2687. this.myIndex = index;
  2688. this.setAlbedoTexture();
  2689. this.setTransPos(x, y);
  2690. this.setScale();
  2691. this.ballNode.transform.localRotationEulerX = 90;
  2692. if (index == 0) {
  2693. }
  2694. }
  2695. setAlbedoTexture(isIce = false) {
  2696. let url;
  2697. if (isIce) {
  2698. url = `res/d3Res/ballTexture/ice.jpg`;
  2699. }
  2700. else {
  2701. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2702. }
  2703. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2704. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2705. }));
  2706. }
  2707. runFireworks(obj, delay, callback) {
  2708. Laya.timer.clearAll(this);
  2709. Laya.timer.once(delay + 1, this, () => {
  2710. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2711. fire.transform.localPositionX = this.transform.localPositionX;
  2712. fire.transform.localPositionY = this.transform.localPositionY;
  2713. fire.transform.localPositionZ = this.transform.localPositionZ;
  2714. let src = fire.getComponent(Partical);
  2715. src.duration = 1000;
  2716. src.setCallback(obj, callback);
  2717. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2718. eft.transform.localPositionX = this.transform.localPositionX;
  2719. eft.transform.localPositionY = this.transform.localPositionY;
  2720. eft.transform.localPositionZ = this.transform.localPositionZ;
  2721. });
  2722. }
  2723. setTransPos(x, y) {
  2724. this.setRotation();
  2725. xGame.common.pos2to3Convert(x, y, this.posV3);
  2726. this.transform.localPositionX = this.posV3.x;
  2727. this.transform.localPositionY = 0;
  2728. this.transform.localPositionZ = this.posV3.z;
  2729. this.transform.localRotationEulerX = 0;
  2730. this.transform.localRotationEulerY = 0;
  2731. this.transform.localRotationEulerZ = 0;
  2732. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2733. this.shadowNode.transform.localPositionY = 0.1;
  2734. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2735. }
  2736. setRotation() {
  2737. if (this.d2BallSrc.canRot) {
  2738. let speed = this.d2BallSrc.rigy.linearVelocity;
  2739. this.rotSpeed.x = speed.x * this.rotRate;
  2740. this.rotSpeed.z = speed.y * this.rotRate;
  2741. this.rotSpeed.y = this.d2BallSrc.rotY;
  2742. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2743. }
  2744. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2745. this.rotSpeed.x = this.rotSpeed.y = 0;
  2746. this.rotSpeed.y = this.d2BallSrc.rotY;
  2747. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2748. }
  2749. }
  2750. setScale() {
  2751. let radius = xGame.common.d2World.rootBall.ui.width;
  2752. let scale = xGame.common.scale2to3Convert(radius);
  2753. this.transform.localScaleX = scale;
  2754. this.transform.localScaleY = scale;
  2755. this.transform.localScaleZ = scale;
  2756. }
  2757. playInHoleEft() {
  2758. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2759. eft.transform.position = this.transform.position;
  2760. }
  2761. playIceEft() {
  2762. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2763. eft.transform.position = this.transform.position;
  2764. }
  2765. get scaleXYZ() {
  2766. return this.transform.localScaleX;
  2767. }
  2768. set scaleXYZ(val) {
  2769. this.transform.localScaleX = val;
  2770. this.transform.localScaleY = val;
  2771. this.transform.localScaleZ = val;
  2772. }
  2773. get posX() {
  2774. return this.transform.localPositionX;
  2775. }
  2776. set posX(val) {
  2777. this.transform.localPositionX = val;
  2778. }
  2779. get posY() {
  2780. return this.transform.localPositionY;
  2781. }
  2782. set posY(val) {
  2783. this.transform.localPositionY = val;
  2784. }
  2785. get posZ() {
  2786. return this.transform.localPositionZ;
  2787. }
  2788. set posZ(val) {
  2789. this.transform.localPositionZ = val;
  2790. }
  2791. destroySelf() {
  2792. this.posV3 = null;
  2793. this.rotSpeed = null;
  2794. this.d2BallSrc = null;
  2795. this.ballNode = null;
  2796. this.gameObj.destroy(true);
  2797. this.transform = null;
  2798. this.destroy();
  2799. }
  2800. }
  2801. class ui_D2Ball extends fgui.GComponent {
  2802. static createInstance() {
  2803. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2804. }
  2805. onConstruct() {
  2806. this.myIcon = (this.getChild("myIcon"));
  2807. this.inner = (this.getChild("inner"));
  2808. this.n8 = (this.getChild("n8"));
  2809. this.n4 = (this.getChild("n4"));
  2810. this.wrongTips = (this.getChild("wrongTips"));
  2811. this.rightTips = (this.getChild("rightTips"));
  2812. this.breathAni = this.getTransition("breathAni");
  2813. }
  2814. }
  2815. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2816. class D2BallSrc extends Laya.Script {
  2817. constructor() {
  2818. super();
  2819. this.number = 0;
  2820. this.startX = 0;
  2821. this.startY = 0;
  2822. this.angleV2 = new Laya.Vector2();
  2823. this.isRootBall = false;
  2824. this.isBlackBall = false;
  2825. this.ballType = "";
  2826. this.canRot = true;
  2827. this.rotY = 0;
  2828. this.poleAngle = 0;
  2829. this.kickPos = { x: 0, y: 0 };
  2830. this.hard = 0;
  2831. this.kickAngle = 0;
  2832. this.borderDis = 0;
  2833. this.speedP10 = 5.6;
  2834. this.lastSpeed = { x: 0, y: 0 };
  2835. this.stillSpeed = 0.12;
  2836. this.ballFunc = "normal";
  2837. this.isRunSkillAni = false;
  2838. this.isInHole = false;
  2839. this.iceOwner = "";
  2840. this.forceRun = false;
  2841. this.myUNID = "";
  2842. this.rectL = 0;
  2843. this.rectR = 0;
  2844. this.rectT = 0;
  2845. this.rectB = 0;
  2846. this.forceVec = new Laya.Vector2();
  2847. this.lastDis = 0;
  2848. this.helpOut = { type: "", x: 0, y: 0 };
  2849. }
  2850. initSelf(number, x, y, d3Ball) {
  2851. if (!this.gameObj)
  2852. this.gameObj = this.owner;
  2853. this.number = number;
  2854. this.startX = x;
  2855. this.startY = y;
  2856. this.d3Ball = d3Ball;
  2857. this.isRootBall = false;
  2858. this.isBlackBall = false;
  2859. this.ballType = "";
  2860. if (number == 0) {
  2861. this.isRootBall = true;
  2862. }
  2863. else if (number == 8) {
  2864. this.isBlackBall = true;
  2865. }
  2866. else {
  2867. if (number <= 7) {
  2868. this.ballType = ballCamp.full;
  2869. }
  2870. else {
  2871. this.ballType = ballCamp.flower;
  2872. }
  2873. }
  2874. this.setInfo();
  2875. this.setD3Ball();
  2876. this.owner["mySrc"] = this;
  2877. this.rigy.linearDamping = 1;
  2878. D2BallSrc._unid++;
  2879. this.myUNID = "d2ball" + D2BallSrc._unid;
  2880. let rect = xGame.common.d2World.borderRect;
  2881. this.rectL = Math.ceil(rect.x) + 20;
  2882. this.rectT = Math.ceil(rect.y) + 20;
  2883. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2884. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2885. }
  2886. setInfo() {
  2887. this.gameObj.x = this.startX;
  2888. this.gameObj.y = this.startY;
  2889. let radius = this.ui.width / 2;
  2890. this.gameObj.width = radius * 2;
  2891. this.gameObj.height = radius * 2;
  2892. if (xGame.common.showDebug) {
  2893. this.ui.myIcon.alpha = 1;
  2894. this.ui.inner.alpha = 1;
  2895. }
  2896. else {
  2897. this.ui.myIcon.alpha = 0;
  2898. this.ui.inner.alpha = 0;
  2899. }
  2900. }
  2901. setD3Ball() {
  2902. this.d3Ball = this.d3Ball;
  2903. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2904. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2905. }
  2906. onUpdate() {
  2907. if (xGame.common.gameMgr.gamePause)
  2908. return;
  2909. if (this.isInHole)
  2910. return;
  2911. if (!xGame.common.d2World.openCheckStill)
  2912. return;
  2913. this.runBall();
  2914. }
  2915. runBall() {
  2916. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2917. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2918. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2919. this.judgeBorder();
  2920. }
  2921. getDestDis(dest) {
  2922. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2923. }
  2924. setmyXY(x, y) {
  2925. this.d3BallSrc.setTransPos(x, y);
  2926. }
  2927. getSpeed() {
  2928. let speed = this.rigy.linearVelocity;
  2929. return speed.x * speed.x + speed.y * speed.y;
  2930. }
  2931. onTriggerEnter(collider) {
  2932. if (!collider || !collider.owner)
  2933. return;
  2934. let coll = "collide";
  2935. let speed = this.getSpeed();
  2936. let sv2 = this.speedP10 * this.speedP10;
  2937. if (collider.label == "ball") {
  2938. if (speed < 9 && this.number != 0)
  2939. coll = "";
  2940. else if (speed < sv2)
  2941. coll = "collide_4";
  2942. else if (speed < sv2 * 6.2)
  2943. coll = "collide_3";
  2944. else if (speed < sv2 * 25)
  2945. coll = "collide_2";
  2946. else if (speed < sv2 * 56)
  2947. coll = "collide_1";
  2948. xGame.soundMgr.playSound(coll);
  2949. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2950. if (collider.owner) {
  2951. let rig = collider.owner.getComponent(D2BallSrc);
  2952. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2953. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2954. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2955. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2956. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2957. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2958. let rx = 0;
  2959. let ry = 0;
  2960. if (this.gameObj.x < this.rectL)
  2961. rx = vx;
  2962. else if (this.gameObj.x > this.rectR)
  2963. rx = -vx;
  2964. else if (this.gameObj.y < this.rectT)
  2965. ry = vy;
  2966. else if (this.gameObj.y > this.rectB)
  2967. ry = -vy;
  2968. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2969. }
  2970. }
  2971. if (this.number != 0) {
  2972. return;
  2973. }
  2974. else {
  2975. if (this.forceRun) {
  2976. console.log("randon force");
  2977. this.applyForce(collider);
  2978. }
  2979. }
  2980. if (xGame.common.d2World.isOnSameLine) {
  2981. xGame.common.d2World.isOnSameLine = false;
  2982. this.rigy.linearVelocity = { x: 0, y: 0 };
  2983. }
  2984. if (xGame.common.gameMgr.firstColliObj == null) {
  2985. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2986. xGame.common.gameMgr.isTouchedBall = true;
  2987. }
  2988. }
  2989. else {
  2990. xGame.common.recoverCameraView();
  2991. let wallStr = "";
  2992. if (speed < 9) { }
  2993. else if (speed < sv2) { }
  2994. else if (speed < sv2 * 6.2)
  2995. wallStr = "wall_30";
  2996. else if (speed < sv2 * 25)
  2997. wallStr = "wall_50";
  2998. else if (speed < sv2 * 56)
  2999. wallStr = "wall_80";
  3000. xGame.soundMgr.playSound(wallStr);
  3001. }
  3002. }
  3003. applyForce(collider) {
  3004. let src = collider.owner.mySrc;
  3005. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3006. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3007. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3008. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3009. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3010. }
  3011. checkWrongBall(playEft = true) {
  3012. if (this.isInHole)
  3013. return;
  3014. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3015. if (this.number != 0 && playEft)
  3016. this.d3BallSrc.playInHoleEft();
  3017. let coll = "inpocket_1";
  3018. let speed = this.getSpeed();
  3019. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3020. if (speed < 9 && this.number != 0)
  3021. coll = "";
  3022. else if (speed < sv2 * 6.2)
  3023. coll = "inpocket_4";
  3024. else if (speed < sv2 * 25)
  3025. coll = "collide_3";
  3026. else if (speed < sv2 * 56)
  3027. coll = "collide_2";
  3028. xGame.soundMgr.playSound(coll);
  3029. this.isInHole = true;
  3030. if (this.number == 0) {
  3031. console.log("白球进了。。");
  3032. this.reset();
  3033. this.rigy.linearVelocity = { x: 0, y: 0 };
  3034. this.hideSelf();
  3035. xGame.common.gameUI.ui.whiteAni.visible = true;
  3036. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3037. xGame.common.gameUI.ui.whiteAni.visible = false;
  3038. }));
  3039. }
  3040. else {
  3041. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3042. xGame.common.d2World.removeOneBall(this);
  3043. this.destroySelf();
  3044. xGame.common.playHappySound(this.number);
  3045. this.runFlyEft();
  3046. }
  3047. }
  3048. runFlyEft() {
  3049. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3050. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3051. }
  3052. }
  3053. hideSelf() {
  3054. if (this.d3Ball)
  3055. this.d3Ball.active = false;
  3056. }
  3057. showSelf() {
  3058. this.isInHole = false;
  3059. if (this.d3Ball && !this.d3Ball.active)
  3060. this.d3Ball.active = true;
  3061. }
  3062. isStill() {
  3063. let speed = this.rigy.linearVelocity;
  3064. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3065. this.rigy.linearVelocity = { x: 0, y: 0 };
  3066. return true;
  3067. }
  3068. return false;
  3069. }
  3070. reset() {
  3071. }
  3072. destroySelf() {
  3073. this.d3BallSrc.destroySelf();
  3074. if (!this.ui.isDisposed) {
  3075. this.ui.removeFromParent();
  3076. this.ui.dispose();
  3077. this.ui = null;
  3078. }
  3079. this.outColli = null;
  3080. this.innerColli = null;
  3081. this.rigy = null;
  3082. this.d3Ball = null;
  3083. this.d3BallSrc = null;
  3084. this.angleV2 = null;
  3085. this.gameObj.destroy(true);
  3086. this.destroy();
  3087. }
  3088. judgeBorder() {
  3089. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3090. return;
  3091. }
  3092. if (this.destroyed)
  3093. return;
  3094. if (xGame.common.gameMode == GameMode.classic)
  3095. return;
  3096. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3097. if (isOver) {
  3098. this.checkWrongBall();
  3099. }
  3100. }
  3101. onClick(e, force = false) {
  3102. if (this.number == 0)
  3103. return;
  3104. if (force) {
  3105. }
  3106. else {
  3107. if (xGame.common.d2World.openCheckStill)
  3108. return;
  3109. if (!xGame.common.gameMgr.selfTurn) {
  3110. return;
  3111. }
  3112. }
  3113. if (!xGame.common.gameMgr.finishOneShoot)
  3114. return;
  3115. let root = xGame.common.d2World.rootBall.gameObj;
  3116. let x = this.gameObj.x - root.x;
  3117. let y = this.gameObj.y - root.y;
  3118. let angle = xGame.common.getfguiRotation(x, y);
  3119. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3120. xGame.common.d2World.getHelpLine();
  3121. xGame.common.clickedBall = true;
  3122. this.checkGuide();
  3123. }
  3124. checkGuide() {
  3125. let guide = DataMgr.getSkillGuide();
  3126. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3127. xGame.common.guideStep++;
  3128. xGame.common.gameUI.ui.guide1.visible = false;
  3129. xGame.common.gameUI.ui.guide2.visible = true;
  3130. }
  3131. }
  3132. checkDistance(disX, disY, angle) {
  3133. let diameter = this.gameObj.width - 1;
  3134. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3135. if (!this.lastDis)
  3136. this.lastDis = dis;
  3137. else {
  3138. if (dis > this.lastDis) {
  3139. this.helpOut.type = "remove";
  3140. return this.helpOut;
  3141. }
  3142. }
  3143. if (dis <= Math.pow(diameter, 2)) {
  3144. let del = 0.01;
  3145. let offest = 0;
  3146. let realX = disX - this.gameObj.x;
  3147. let realY = disY - this.gameObj.y;
  3148. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3149. offest += del;
  3150. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3151. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3152. }
  3153. this.helpOut.type = "ok";
  3154. this.helpOut.x = realX + this.gameObj.x;
  3155. this.helpOut.y = realY + this.gameObj.y;
  3156. return this.helpOut;
  3157. }
  3158. else {
  3159. this.helpOut.type = "no";
  3160. return this.helpOut;
  3161. }
  3162. }
  3163. clearBallEft() {
  3164. this.clearBallRightEft();
  3165. this.clearBallWrongEft();
  3166. }
  3167. clearBallRightEft() {
  3168. this.ui.breathAni.stop();
  3169. this.ui.rightTips.visible = false;
  3170. }
  3171. clearBallWrongEft() {
  3172. this.ui.wrongTips.visible = false;
  3173. }
  3174. showWrongEft() {
  3175. if (!xGame.common.gameMgr.selfTurn)
  3176. return;
  3177. this.ui.wrongTips.visible = true;
  3178. }
  3179. showRightEft() {
  3180. if (!xGame.common.gameMgr.selfTurn)
  3181. return;
  3182. this.ui.rightTips.visible = true;
  3183. this.ui.rightTips.scaleX = 1;
  3184. this.ui.rightTips.scaleY = 1;
  3185. this.ui.breathAni.play();
  3186. }
  3187. setBallFunc(type, owner) {
  3188. if (type == "ice") {
  3189. this.ballFunc = type;
  3190. this.d3BallSrc.setAlbedoTexture(true);
  3191. this.rigy.type = "static";
  3192. this.iceOwner = owner;
  3193. }
  3194. else {
  3195. if (owner == this.iceOwner) {
  3196. this.ballFunc = type;
  3197. this.d3BallSrc.setAlbedoTexture(false);
  3198. this.rigy.type = "dynamic";
  3199. }
  3200. }
  3201. }
  3202. }
  3203. D2BallSrc._unid = 0;
  3204. class D2RootBallSrc extends D2BallSrc {
  3205. constructor() {
  3206. super();
  3207. this.maxSpeed = 0;
  3208. this.classicMaxSpeed = 2.2;
  3209. this.bigSkillMaxSpeed = 4;
  3210. this.angle = 0;
  3211. this.allPercent = 0;
  3212. this.linearPercent = 0;
  3213. this.anglePercent = 0;
  3214. this.maxAngleRate = 0.6;
  3215. this.baseRot = 7;
  3216. this.angleMax = 0;
  3217. this.speed = new Laya.Vector2();
  3218. this.rotSpeed = new Laya.Vector2();
  3219. }
  3220. isStill() {
  3221. let speed = this.rigy.linearVelocity;
  3222. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3223. if (this.anglePercent <= 0.1) {
  3224. this.rigy.linearVelocity = { x: 0, y: 0 };
  3225. return true;
  3226. }
  3227. }
  3228. return false;
  3229. }
  3230. reset() {
  3231. this.linearPercent = 0;
  3232. this.anglePercent = 0;
  3233. }
  3234. setSpeed(percent, angle) {
  3235. this.allPercent = percent;
  3236. this.angle = angle;
  3237. this.setAngleSpeed();
  3238. this.setLinearSpeed();
  3239. let hit = "hit";
  3240. if (percent < 25)
  3241. hit = "hit03";
  3242. else if (percent < 50)
  3243. hit = "hit02";
  3244. else if (percent < 75)
  3245. hit = "hit01";
  3246. xGame.soundMgr.playSound(hit);
  3247. }
  3248. setAngleSpeed() {
  3249. let offest = xGame.common.rodOffest;
  3250. let radius = 82;
  3251. let rate = Math.abs(offest.y / radius) * 0.5;
  3252. if (offest.y > 0)
  3253. this.angleMax = -this.baseRot * 2;
  3254. else
  3255. this.angleMax = this.baseRot;
  3256. this.rotY = -offest.x / radius * 100;
  3257. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3258. this.linearPercent = this.allPercent - this.anglePercent;
  3259. }
  3260. setLinearSpeed() {
  3261. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3262. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3263. if (!xGame.common.longHelpLine) {
  3264. let offset = -150 + xGame.common.randomNum(0, 300);
  3265. offset /= 100;
  3266. this.angle += offset;
  3267. }
  3268. }
  3269. }
  3270. let sin = Math.sin(this.angle * Math.PI / 180);
  3271. let cos = Math.cos(this.angle * Math.PI / 180);
  3272. switch (xGame.common.gameMode) {
  3273. case GameMode.classic:
  3274. this.maxSpeed = this.classicMaxSpeed;
  3275. break;
  3276. case GameMode.bigMove:
  3277. this.maxSpeed = this.bigSkillMaxSpeed;
  3278. break;
  3279. case GameMode.placeBall:
  3280. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3281. if (data.type == 1) {
  3282. this.maxSpeed = this.bigSkillMaxSpeed;
  3283. }
  3284. else {
  3285. this.maxSpeed = this.classicMaxSpeed;
  3286. }
  3287. break;
  3288. default:
  3289. break;
  3290. }
  3291. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3292. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3293. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3294. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3295. this.rigy.applyLinearImpulseToCenter(this.speed);
  3296. }
  3297. onUpdate() {
  3298. if (this.anglePercent > 0.1) {
  3299. this.anglePercent *= 0.97;
  3300. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3301. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3302. this.rigy.applyForceToCenter(this.rotSpeed);
  3303. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3304. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3305. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3306. if (num > 0.9)
  3307. this.canRot = true;
  3308. }
  3309. else
  3310. this.canRot = true;
  3311. if (Math.abs(this.rotY) > 0.1)
  3312. this.rotY *= 0.98;
  3313. super.onUpdate();
  3314. }
  3315. destroySelf() {
  3316. super.destroySelf();
  3317. this.speed = null;
  3318. }
  3319. }
  3320. class D2Ball extends Laya.Sprite {
  3321. constructor(isRootBall = false) {
  3322. super();
  3323. this.ui = ui_D2Ball.createInstance();
  3324. this.pivotX = this.ui.width / 2;
  3325. this.pivotY = this.ui.width / 2;
  3326. this.x = 0;
  3327. this.y = 0;
  3328. this.addChild(this.ui.displayObject);
  3329. this.ui.displayObject.x += this.ui.width / 2;
  3330. this.ui.displayObject.y += this.ui.width / 2;
  3331. if (isRootBall) {
  3332. this.d2Src = this.addComponent(D2RootBallSrc);
  3333. }
  3334. else {
  3335. this.d2Src = this.addComponent(D2BallSrc);
  3336. }
  3337. this.d2Src.ui = this.ui;
  3338. this.addCircleCollider();
  3339. this.addInnerCircleCollider();
  3340. this.addRigyBody();
  3341. }
  3342. addCircleCollider() {
  3343. let colli = xGame.common.getCollider("circle");
  3344. colli.radius = this.ui.width / 2;
  3345. this.addComponentIntance(colli);
  3346. this.d2Src.outColli = colli;
  3347. colli.label = "ball";
  3348. }
  3349. addInnerCircleCollider() {
  3350. let colli = xGame.common.getCollider("circle");
  3351. colli.radius = this.ui.inner.width / 2;
  3352. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3353. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3354. this.addComponentIntance(colli);
  3355. this.d2Src.innerColli = colli;
  3356. colli.label = "inner";
  3357. }
  3358. addRigyBody() {
  3359. let rigy = xGame.common.getRigbody();
  3360. rigy.type = "dynamic";
  3361. this.addComponentIntance(rigy);
  3362. this.d2Src.rigy = rigy;
  3363. }
  3364. disposeSelf() {
  3365. if (!this.ui.isDisposed) {
  3366. this.ui.dispose();
  3367. this.ui.removeFromParent();
  3368. this.ui = null;
  3369. }
  3370. }
  3371. }
  3372. class ui_D2Gan extends fgui.GComponent {
  3373. static createInstance() {
  3374. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3375. }
  3376. onConstruct() {
  3377. this.myIcon = (this.getChild("myIcon"));
  3378. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3379. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3380. this.self = (this.getChild("self"));
  3381. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3382. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3383. this.ai = (this.getChild("ai"));
  3384. }
  3385. }
  3386. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3387. class D2Gan {
  3388. constructor() {
  3389. this.offset = 0.15;
  3390. this.cell = 1.5;
  3391. this.onBallCell = 0.4;
  3392. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3393. this.moveNum = 70;
  3394. this.rulerRate = 0.1;
  3395. this.ui = ui_D2Gan.createInstance();
  3396. this.changeSelfRod();
  3397. this.changeAIRod();
  3398. }
  3399. changeSelfRod() {
  3400. let index = DataMgr.getCurBallRod();
  3401. let data = cfgTable.ballrodData[index + 1];
  3402. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3403. this.selfMySpine && this.selfMySpine.dispose();
  3404. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3405. if (data.spine) {
  3406. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3407. this.selfMySpine = new SpineMgr(data.spine, () => {
  3408. let xx = this.ui.selfEftRoot.width / 2;
  3409. let yy = this.ui.selfEftRoot.height / 2;
  3410. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3411. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3412. outSpine.rotation = -90;
  3413. });
  3414. }
  3415. }
  3416. changeAIRod() {
  3417. let length = Object.keys(cfgTable.ballrodData).length;
  3418. let rand = Math.floor(length * Math.random()) + 1;
  3419. let data = cfgTable.ballrodData[rand];
  3420. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3421. this.aiMySpine && this.aiMySpine.dispose();
  3422. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3423. if (data.spine) {
  3424. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3425. this.aiMySpine = new SpineMgr(data.spine, () => {
  3426. let xx = this.ui.aiEftRoot.width / 2;
  3427. let yy = this.ui.aiEftRoot.height / 2;
  3428. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3429. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3430. outSpine.rotation = -90;
  3431. });
  3432. }
  3433. }
  3434. setGanLastInfo() {
  3435. this.lastInfo.rotation = this.ui.rotation;
  3436. this.lastInfo.x = this.ui.x;
  3437. this.lastInfo.y = this.ui.y;
  3438. }
  3439. rotateSelf(flag, isRuler = false) {
  3440. let angle;
  3441. flag = flag * this.offset;
  3442. if (xGame.common.d2World.isHelpLineOnBall) {
  3443. angle = flag * this.onBallCell;
  3444. }
  3445. else {
  3446. angle = flag * this.cell;
  3447. }
  3448. if (isRuler) {
  3449. angle *= this.rulerRate;
  3450. }
  3451. this.ui.rotation += angle;
  3452. xGame.common.d2World.getHelpLine();
  3453. }
  3454. checkDistance() {
  3455. let target = xGame.common.d2World.targetBall;
  3456. let root = xGame.common.d2World.rootBall;
  3457. if (target == null) {
  3458. return 1;
  3459. }
  3460. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3461. if (dis <= 2500) {
  3462. return 5;
  3463. }
  3464. return 1;
  3465. }
  3466. rotDest(rot) {
  3467. this.ui.rotation = rot;
  3468. xGame.common.d2World.getHelpLine();
  3469. }
  3470. storagePower(powerNum) {
  3471. let pos = (powerNum / 100) * this.moveNum;
  3472. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3473. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3474. this.ui.x = this.lastInfo.x + xx;
  3475. this.ui.y = this.lastInfo.y + yy;
  3476. }
  3477. shoot() {
  3478. this.storagePower(0);
  3479. this.ui.visible = false;
  3480. }
  3481. destroySelf() {
  3482. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3483. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3484. this.selfMySpine && this.selfMySpine.dispose();
  3485. this.aiMySpine && this.aiMySpine.dispose();
  3486. this.lastInfo = null;
  3487. if (!this.ui.isDisposed) {
  3488. this.ui.removeFromParent();
  3489. this.ui.dispose();
  3490. }
  3491. }
  3492. }
  3493. class ui_HelpLine extends fgui.GComponent {
  3494. static createInstance() {
  3495. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3496. }
  3497. onConstruct() {
  3498. this.n10 = (this.getChild("n10"));
  3499. this.rect = (this.getChild("rect"));
  3500. this.dir11 = (this.getChild("dir11"));
  3501. this.dir = (this.getChild("dir"));
  3502. this.rootDir = (this.getChild("rootDir"));
  3503. this.dirDot = (this.getChild("dirDot"));
  3504. }
  3505. }
  3506. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3507. class D2HelpLine {
  3508. constructor() {
  3509. this.starX = 0;
  3510. this.starY = 0;
  3511. this.ui = ui_HelpLine.createInstance();
  3512. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3513. this.starX = this.ui.rect.x;
  3514. this.starY = this.ui.rect.y;
  3515. }
  3516. shoot() {
  3517. this.ui.visible = false;
  3518. }
  3519. destroySelf() {
  3520. if (this.ui.isDisposed) {
  3521. this.ui.removeFromParent();
  3522. this.ui.dispose();
  3523. }
  3524. }
  3525. }
  3526. class D2World extends Laya.Script {
  3527. constructor() {
  3528. super();
  3529. this.ballArr = [];
  3530. this.openCheckStill = false;
  3531. this.checkArr = [];
  3532. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3533. this.isHelpLineOnBall = false;
  3534. this.isOnSameLine = false;
  3535. this.reflectAngle = 0;
  3536. this.powerPercent = 0;
  3537. this.inHolesSpeed = [];
  3538. this.outDir = new Laya.Vector2();
  3539. this.rootDir = new Laya.Vector2();
  3540. this.aiLv = 0;
  3541. this.rootPos = new Laya.Vector2();
  3542. this.tempDir1 = new Laya.Vector2();
  3543. this.tempDir2 = new Laya.Vector2();
  3544. this.tempDir3 = new Laya.Vector2();
  3545. this.ballSize = 33;
  3546. this.destRot = 0;
  3547. }
  3548. initSelf() {
  3549. this.createBalls();
  3550. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3551. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3552. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3553. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3554. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3555. }
  3556. setBorderRect() {
  3557. let ui = xGame.common.gameUI.ui;
  3558. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3559. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3560. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3561. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3562. this.borderRect.x = starX;
  3563. this.borderRect.y = starY;
  3564. this.borderRect.width = width;
  3565. this.borderRect.height = height;
  3566. }
  3567. resetGame() {
  3568. this.openCheckStill = false;
  3569. let temp;
  3570. for (let index = 0; index < this.ballArr.length; index++) {
  3571. temp = this.ballArr[index];
  3572. temp.destroySelf();
  3573. }
  3574. xGame.common.d3World.ballRoot.destroyChildren();
  3575. xGame.common.gameUI.ui.ballNode.removeChildren();
  3576. console.log("进入摧毁逻辑");
  3577. this.d2Gan.destroySelf();
  3578. this.d2HelpLine.destroySelf();
  3579. this.ballArr = [];
  3580. }
  3581. setD2Gan() {
  3582. let ballNode = this.rootBall.ui;
  3583. let d2Gan = new D2Gan();
  3584. this.d2Gan = d2Gan;
  3585. let ganNode = d2Gan.ui;
  3586. ballNode.addChild(ganNode);
  3587. ganNode.pivotX = ganNode.pivotX;
  3588. ganNode.pivotY = ganNode.pivotY;
  3589. ganNode.x = ganNode.myIcon.width / 2;
  3590. ganNode.y = this.rootBall.gameObj.width;
  3591. d2Gan.setGanLastInfo();
  3592. }
  3593. setHelpLine() {
  3594. let d2Help = new D2HelpLine();
  3595. this.d2HelpLine = d2Help;
  3596. }
  3597. createBalls() {
  3598. let cfg;
  3599. switch (xGame.common.gameMode) {
  3600. case GameMode.classic:
  3601. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3602. break;
  3603. case GameMode.bigMove:
  3604. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3605. break;
  3606. case GameMode.placeBall:
  3607. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3608. break;
  3609. default:
  3610. break;
  3611. }
  3612. cfg = JSON.parse(JSON.stringify(cfg));
  3613. for (const key in cfg) {
  3614. if (cfg[key].value == 0) {
  3615. this.createRootBall(cfg[key]);
  3616. delete cfg[key];
  3617. break;
  3618. }
  3619. }
  3620. this.createOtherBalls(cfg);
  3621. }
  3622. createRootBall(data) {
  3623. let root = new D2Ball(true);
  3624. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3625. this.rootBall = root.d2Src;
  3626. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3627. let d3BallSrc = d3Ball.getComponent(Ball);
  3628. xGame.common.d3World.rootBall = d3Ball;
  3629. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3630. let xx = data.x;
  3631. let yy = data.y;
  3632. let numer = data.value;
  3633. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3634. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3635. this.ballArr.push(this.rootBall);
  3636. this.setD2Gan();
  3637. this.setHelpLine();
  3638. }
  3639. createOtherBalls(cfg) {
  3640. let temp;
  3641. let src;
  3642. let data;
  3643. for (const key in cfg) {
  3644. data = cfg[key];
  3645. temp = new D2Ball();
  3646. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3647. src = temp.d2Src;
  3648. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3649. src.initSelf(data.value, data.x, data.y, d3Ball);
  3650. this.ballArr.push(src);
  3651. }
  3652. }
  3653. shoot(percent) {
  3654. this.powerPercent = percent;
  3655. this.openCheckStill = true;
  3656. let d2Angle = this.d2Gan.ui.rotation;
  3657. this.rootBall.setSpeed(percent, d2Angle);
  3658. this.clearBallAllEft();
  3659. this.changePlayerView();
  3660. }
  3661. onUpdate() {
  3662. if (!this.openCheckStill)
  3663. return;
  3664. this.checkStill();
  3665. }
  3666. checkStill() {
  3667. for (let index = 0; index < this.ballArr.length; index++) {
  3668. if (!this.ballArr[index].isStill()) {
  3669. return;
  3670. }
  3671. }
  3672. xGame.eventMgr.event(ALL_BALL_STOP);
  3673. }
  3674. allBallStop() {
  3675. this.openCheckStill = false;
  3676. xGame.common.recoverCameraView();
  3677. }
  3678. waitShoot() {
  3679. if (!this.d2Gan.ui.isDisposed) {
  3680. this.d2Gan.ui.visible = true;
  3681. }
  3682. if (!this.d2HelpLine.ui.isDisposed) {
  3683. this.d2HelpLine.ui.visible = true;
  3684. }
  3685. this.clearBallAllEft();
  3686. this.showBallRightEft();
  3687. this.getHelpLine();
  3688. this.inHolesSpeed = [];
  3689. this.selectOneBall();
  3690. }
  3691. _getAllBallArr() {
  3692. let arr = this.ballArr;
  3693. let outArr = [];
  3694. for (let index = 0; index < arr.length; index++) {
  3695. if (arr[index] instanceof D2RootBallSrc)
  3696. continue;
  3697. if (arr[index].ballFunc == "ice")
  3698. continue;
  3699. if (arr[index].destroyed)
  3700. continue;
  3701. outArr.push(arr[index]);
  3702. }
  3703. return outArr;
  3704. }
  3705. _getBlackObj() {
  3706. let arr = this.ballArr;
  3707. for (let index = 0; index < arr.length; index++) {
  3708. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3709. return arr[index];
  3710. }
  3711. }
  3712. }
  3713. selectOneBall() {
  3714. let all = this._getAllBallArr();
  3715. let target;
  3716. switch (xGame.common.gameMode) {
  3717. case GameMode.classic:
  3718. if (xGame.common.gameMgr.selfTurn) {
  3719. let self = xGame.common.gameMgr.selfBallArr;
  3720. let black = this._getBlackObj();
  3721. if (xGame.common.gameMgr.ensureBallType) {
  3722. if (self.length > 0) {
  3723. let out = [];
  3724. for (let j = 0; j < all.length; j++) {
  3725. if (self.indexOf(all[j].number) > -1) {
  3726. out.push(all[j]);
  3727. }
  3728. }
  3729. target = this.selectBestEnterOne(out);
  3730. }
  3731. else {
  3732. target = this.selectBestEnterOne([black]);
  3733. }
  3734. }
  3735. else {
  3736. target = this.selectBestEnterOne(all);
  3737. }
  3738. }
  3739. else {
  3740. target = this.selectBestEnterOne(all);
  3741. }
  3742. break;
  3743. case GameMode.bigMove:
  3744. target = this.selectBestEnterOne(all);
  3745. break;
  3746. case GameMode.placeBall:
  3747. if (all.length > 0) {
  3748. target = this.selectBestEnterOne(all);
  3749. }
  3750. break;
  3751. default:
  3752. break;
  3753. }
  3754. if (target && !target.destroyed && target.onClick) {
  3755. target.onClick(0, true);
  3756. let num = -200 + xGame.common.randomNum(0, 400);
  3757. num /= 150;
  3758. if (xGame.common.longHelpLine) {
  3759. num = 0;
  3760. }
  3761. this.destRot += num;
  3762. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3763. }
  3764. }
  3765. removeOneBall(ball) {
  3766. for (let index = 0; index < this.ballArr.length; index++) {
  3767. if (this.ballArr[index].id == ball.id) {
  3768. this.ballArr.splice(index, 1);
  3769. break;
  3770. }
  3771. }
  3772. }
  3773. getHelpLine() {
  3774. this.d2HelpLine.ui.dirDot.visible = false;
  3775. this.isOnSameLine = false;
  3776. let startX = this.rootBall.gameObj.x;
  3777. let startY = this.rootBall.gameObj.y;
  3778. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3779. if (dis == null) {
  3780. this.d2HelpLine.ui.visible = false;
  3781. console.error("辅助线异常");
  3782. return;
  3783. }
  3784. this.d2HelpLine.ui.visible = true;
  3785. let angle = this.d2Gan.ui.rotation;
  3786. let radius = 16.5;
  3787. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3788. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3789. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3790. if (colliObj == null) {
  3791. this.getColliPos(disX, disY, radius, angle);
  3792. xGame.common.d2World.isHelpLineOnBall = false;
  3793. this.targetBall = null;
  3794. this.reflectAngle = 0;
  3795. this.showBallWrongEft();
  3796. }
  3797. else {
  3798. let target = colliObj.src;
  3799. let radius = 16.5;
  3800. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3801. dis1 = Math.sqrt(dis1);
  3802. let realDis = colliObj.disHon - dis1;
  3803. let dir = colliObj.dir;
  3804. let xx = startX + dir.x * realDis;
  3805. let yy = startY + dir.y * realDis;
  3806. this.getColliPos(xx, yy, radius, angle);
  3807. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3808. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3809. let offset = xGame.common.rodOffest;
  3810. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3811. this.isOnSameLine = true;
  3812. }
  3813. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3814. xGame.common.d2World.isHelpLineOnBall = true;
  3815. this.targetBall = target;
  3816. this.reflectAngle = reflectAngle;
  3817. this.showBallWrongEft();
  3818. if (xGame.common.longHelpLine) {
  3819. this.delayReflectLine(target, reflectAngle);
  3820. }
  3821. }
  3822. }
  3823. getBorderDot(startX, startY, angle) {
  3824. let radius = 17;
  3825. let distance;
  3826. let isDone;
  3827. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3828. isDone = this.judgeUpDown(distance, angle, startX);
  3829. if (isDone != null) {
  3830. return isDone;
  3831. }
  3832. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3833. isDone = this.judgeUpDown(distance, angle, startX);
  3834. if (isDone != null) {
  3835. return isDone;
  3836. }
  3837. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3838. isDone = this.judgeLeftRight(distance, angle, startY);
  3839. if (isDone != null) {
  3840. return isDone;
  3841. }
  3842. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3843. isDone = this.judgeLeftRight(distance, angle, startY);
  3844. if (isDone != null) {
  3845. return isDone;
  3846. }
  3847. }
  3848. judgeUpDown(distance, angle, startX) {
  3849. let flag = Math.sin(angle * Math.PI / 180);
  3850. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3851. if (distance >= 0) {
  3852. if (flag > 0) {
  3853. if (temp < this.borderRect.x + this.borderRect.width) {
  3854. return distance;
  3855. }
  3856. }
  3857. else {
  3858. if (temp > this.borderRect.x) {
  3859. return distance;
  3860. }
  3861. }
  3862. }
  3863. }
  3864. judgeLeftRight(distance, angle, starY) {
  3865. let flag = -Math.cos(angle * Math.PI / 180);
  3866. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3867. if (distance >= 0) {
  3868. if (flag > 0) {
  3869. if (temp < this.borderRect.y + this.borderRect.height) {
  3870. return distance;
  3871. }
  3872. }
  3873. else {
  3874. if (temp > this.borderRect.y) {
  3875. return distance;
  3876. }
  3877. }
  3878. }
  3879. }
  3880. clearBallAllEft() {
  3881. let temp;
  3882. for (let index = 0; index < this.ballArr.length; index++) {
  3883. temp = this.ballArr[index];
  3884. temp.clearBallEft();
  3885. }
  3886. }
  3887. showBallRightEft() {
  3888. let gameMgr = xGame.common.gameMgr;
  3889. let temp;
  3890. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3891. if (targetArr.length <= 0)
  3892. return;
  3893. for (let index = 0; index < this.ballArr.length; index++) {
  3894. temp = this.ballArr[index];
  3895. if (targetArr.indexOf(temp.number) > -1) {
  3896. temp.showRightEft();
  3897. }
  3898. }
  3899. }
  3900. showBallWrongEft() {
  3901. let gameMgr = xGame.common.gameMgr;
  3902. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3903. if (targetArr.length <= 0)
  3904. return;
  3905. let temp;
  3906. for (let index = 0; index < this.ballArr.length; index++) {
  3907. temp = this.ballArr[index];
  3908. if (this.targetBall && this.targetBall.number == temp.number) {
  3909. if (targetArr.indexOf(temp.number) <= -1) {
  3910. temp.showWrongEft();
  3911. }
  3912. else {
  3913. temp.clearBallWrongEft();
  3914. }
  3915. }
  3916. else {
  3917. temp.clearBallWrongEft();
  3918. }
  3919. }
  3920. }
  3921. getColliPos(x, y, radius, angle) {
  3922. this.d2HelpLine.ui.x = x;
  3923. this.d2HelpLine.ui.y = y;
  3924. let dirX = x - this.rootBall.gameObj.x;
  3925. let dirY = y - this.rootBall.gameObj.y;
  3926. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3927. if (rectH <= 0)
  3928. rectH = 0;
  3929. this.d2HelpLine.ui.rect.height = 0;
  3930. this.d2HelpLine.ui.rect.height = rectH;
  3931. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3932. if (rectH < this.rootBall.gameObj.width) {
  3933. this.d2HelpLine.ui.rect.visible = false;
  3934. }
  3935. else {
  3936. this.d2HelpLine.ui.rect.visible = true;
  3937. }
  3938. this.d2HelpLine.ui.dir.visible = false;
  3939. this.d2HelpLine.ui.rootDir.visible = false;
  3940. }
  3941. getReflectLine(x, y, radius, target) {
  3942. this.d2HelpLine.ui.dir.visible = true;
  3943. let dirX = target.x - x;
  3944. let dirY = target.y - y;
  3945. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3946. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3947. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3948. this.d2HelpLine.ui.dir.height = 48;
  3949. this.d2HelpLine.ui.dir.rotation = angle;
  3950. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3951. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3952. return angle;
  3953. }
  3954. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3955. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3956. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3957. let targetX = target.gameObj.x;
  3958. let targetY = target.gameObj.y;
  3959. this.outDir.setValue(targetX - xx, targetY - yy);
  3960. this.rootDir.setValue(rtX - xx, rtY - yy);
  3961. let ver = Math.PI / 2;
  3962. let sin = Math.sin(ver);
  3963. let cos = Math.cos(ver);
  3964. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3965. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3966. this.outDir.setValue(outX, outY);
  3967. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3968. Laya.Vector2.normalize(this.outDir, this.outDir);
  3969. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3970. if (Math.abs(result) <= 0.08) {
  3971. this.d2HelpLine.ui.rootDir.visible = false;
  3972. return;
  3973. }
  3974. if (result > 0) {
  3975. angle += 90;
  3976. }
  3977. else if (result < 0) {
  3978. angle -= 90;
  3979. }
  3980. this.d2HelpLine.ui.rootDir.visible = true;
  3981. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3982. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3983. this.d2HelpLine.ui.rootDir.rotation = angle;
  3984. }
  3985. delayReflectLine(obj, angle) {
  3986. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3987. return;
  3988. }
  3989. this.isOnSameLine = false;
  3990. let startX = obj.gameObj.x;
  3991. let startY = obj.gameObj.y;
  3992. let dis = this.getBorderDot(startX, startY, angle);
  3993. if (dis == null) {
  3994. this.d2HelpLine.ui.dirDot.visible = false;
  3995. return;
  3996. }
  3997. this.d2HelpLine.ui.visible = true;
  3998. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3999. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4000. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4001. if (colliObj == null) {
  4002. this.setDelayLine(disX, disY, obj, angle);
  4003. }
  4004. else {
  4005. let radius = 16;
  4006. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4007. dis1 = Math.sqrt(dis1);
  4008. let realDis = colliObj.disHon - dis1;
  4009. let dir = colliObj.dir;
  4010. let xx = startX + dir.x * realDis;
  4011. let yy = startY + dir.y * realDis;
  4012. this.setDelayLine(xx, yy, obj, angle);
  4013. }
  4014. }
  4015. setDelayLine(x, y, obj, angle) {
  4016. let dirX = x - obj.gameObj.x;
  4017. let dirY = y - obj.gameObj.y;
  4018. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4019. if (rectH <= 0)
  4020. rectH = 0;
  4021. this.d2HelpLine.ui.dir.height = rectH;
  4022. this.d2HelpLine.ui.dirDot.visible = true;
  4023. this.d2HelpLine.ui.dirDot.x = 17;
  4024. this.d2HelpLine.ui.dirDot.y = 17;
  4025. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4026. ;
  4027. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4028. }
  4029. changePlayerView() {
  4030. if (Math.random() >= 0.7)
  4031. return;
  4032. if (!this.targetBall) {
  4033. return;
  4034. }
  4035. if (!xGame.common.gameMgr.selfTurn)
  4036. return;
  4037. switch (xGame.common.gameMode) {
  4038. case GameMode.classic:
  4039. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4040. if (this.targetBall.number != 8) {
  4041. return;
  4042. }
  4043. }
  4044. break;
  4045. case GameMode.bigMove:
  4046. return;
  4047. case GameMode.placeBall:
  4048. break;
  4049. default:
  4050. break;
  4051. }
  4052. let startX = this.targetBall.gameObj.x;
  4053. let startY = this.targetBall.gameObj.y;
  4054. let angle = this.reflectAngle;
  4055. let dis = this.getBorderDot(startX, startY, angle);
  4056. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4057. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4058. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4059. if (colliObj) {
  4060. return;
  4061. }
  4062. let offset = 40;
  4063. let posObj = xGame.common.gameMgr.posObj;
  4064. let temp;
  4065. let radius;
  4066. let tarX, tarY;
  4067. for (const key in posObj) {
  4068. temp = posObj[key];
  4069. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4070. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4071. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4072. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4073. xGame.common.showOneCamera("angle" + key);
  4074. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4075. Laya.physicsTimer.scale = 0.7;
  4076. break;
  4077. }
  4078. }
  4079. }
  4080. selectBestEnterOne(arr) {
  4081. this.aiLv = xGame.tools.random(1, 11);
  4082. this.aiLv = 10;
  4083. this.wBall = xGame.common.d2World.rootBall;
  4084. this.rootPos.x = this.wBall.gameObj.x;
  4085. this.rootPos.y = this.wBall.gameObj.y;
  4086. this.initHoleBall(arr);
  4087. return this.selectBall();
  4088. }
  4089. selectBall() {
  4090. let ball = null;
  4091. this.destRot = 0;
  4092. let ai = 110 - this.aiLv * 10;
  4093. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4094. let score = false;
  4095. if (this.scoreBall.length < 1) {
  4096. if (this.lineBall.length < 1) {
  4097. for (let i = 0; i < this.kickBall.length; i++) {
  4098. let list = [];
  4099. let bo = this.kickBall[i];
  4100. let bobj = bo.gameObj;
  4101. let rect = xGame.common.d2World.borderRect;
  4102. let mobj = this.wBall.gameObj;
  4103. let minb = bobj.y - rect.y - 20;
  4104. let minw = mobj.y - rect.y - 50;
  4105. if (minb > 0 && minw > 0) {
  4106. let dlenx = 0;
  4107. let dleny = mobj.y - rect.y;
  4108. let spx = mobj.x;
  4109. let spy = rect.y - dleny;
  4110. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4111. }
  4112. minb = rect.y + rect.height - bobj.y - 20;
  4113. minw = rect.y + rect.height - mobj.y - 50;
  4114. if (minb > 0 && minw > 0) {
  4115. let dlenx = 0;
  4116. let dleny = rect.y + rect.height - mobj.y;
  4117. let spx = mobj.x;
  4118. let spy = rect.y + rect.height + dleny;
  4119. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4120. }
  4121. minb = bobj.x - rect.x - 20;
  4122. minw = mobj.x - rect.x - 50;
  4123. if (minb > 0 && minw > 0) {
  4124. let dlenx = mobj.x - rect.x;
  4125. let dleny = 0;
  4126. let spx = rect.x - dlenx;
  4127. let spy = mobj.y;
  4128. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4129. }
  4130. minb = rect.x + rect.width - bobj.x - 20;
  4131. minw = rect.x + rect.width - mobj.x - 50;
  4132. if (minb > 0 && minw > 0) {
  4133. let dlenx = rect.x + rect.width - mobj.x;
  4134. let dleny = 0;
  4135. let spx = rect.x + rect.width + dlenx;
  4136. let spy = mobj.y;
  4137. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4138. }
  4139. list.sort(function (a, b) {
  4140. return a.order - b.order;
  4141. });
  4142. for (let i = 0; i < list.length; i++) {
  4143. let data = list[i];
  4144. let mx = mobj.x - bobj.x;
  4145. let my = mobj.y - bobj.y;
  4146. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4147. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4148. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4149. if (num > 1)
  4150. num = 1;
  4151. let cos = Math.acos(num);
  4152. if (cos > 1.57)
  4153. cos = 1.57;
  4154. else if (cos < 0.01)
  4155. cos = 0.01;
  4156. let tan = Math.tan(cos);
  4157. let dx = tan * data.dleny;
  4158. let dy = tan * data.dlenx;
  4159. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4160. if (Math.abs(bx - 667) < 40)
  4161. continue;
  4162. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4163. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4164. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4165. this.forceMax = dis * 0.08;
  4166. this.destRot += mis * 0.1;
  4167. this.setKick(bx, by);
  4168. return true;
  4169. }
  4170. }
  4171. }
  4172. }
  4173. else {
  4174. ball = xGame.common.getRandArrEle(this.lineBall);
  4175. }
  4176. }
  4177. else {
  4178. for (let i = 0; i < this.scoreBall.length; i++) {
  4179. if (i < this.scoreBall.length - 1) {
  4180. let rand = 70 + this.aiLv * 10 + i * 10;
  4181. if (xGame.tools.random(0, 100) < rand) {
  4182. ball = this.scoreBall[i];
  4183. break;
  4184. }
  4185. }
  4186. else {
  4187. ball = this.scoreBall[i];
  4188. break;
  4189. }
  4190. }
  4191. score = true;
  4192. this.selectNum++;
  4193. }
  4194. if (!ball)
  4195. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4196. let dx = ball.gameObj.x;
  4197. let dy = ball.gameObj.y;
  4198. let kickAngle = 0;
  4199. if (score) {
  4200. dx = ball.kickPos.x;
  4201. dy = ball.kickPos.y;
  4202. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4203. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4204. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4205. if (adot > 1)
  4206. adot = 1;
  4207. kickAngle = Math.acos(adot) * 57.3;
  4208. if (kickAngle > 45) {
  4209. let kdx = ball.kickPos.x - ball.gameObj.x;
  4210. let kdy = ball.kickPos.y - ball.gameObj.y;
  4211. dx = ball.kickPos.x - kdx * mis * 0.3;
  4212. dy = ball.kickPos.y - kdy * mis * 0.3;
  4213. }
  4214. else
  4215. this.destRot += mis;
  4216. }
  4217. else if (ball.poleAngle != 0) {
  4218. this.destRot += ball.poleAngle;
  4219. }
  4220. if (xGame.common.gameMode == 0) {
  4221. let af = kickAngle * 0.08;
  4222. this.forceMax = ball.hard * 0.1 + af * af;
  4223. }
  4224. this.setKick(dx, dy);
  4225. return ball;
  4226. }
  4227. initHoleBall(arr) {
  4228. this.kickBall = [];
  4229. this.lineBall = [];
  4230. this.scoreBall = [];
  4231. this.holeBall = [];
  4232. this.selectNum = 0;
  4233. this.forceNum = 0;
  4234. this.forceMax = 0;
  4235. this.turnNum = 0;
  4236. let list = arr;
  4237. let holes = xGame.common.gameMgr.holePosList;
  4238. let self = xGame.common.aiPlayer;
  4239. for (let i = 0; i < list.length; i++) {
  4240. let obj = list[i];
  4241. if (!obj)
  4242. continue;
  4243. obj.kickPos.x = 0;
  4244. obj.kickPos.y = 0;
  4245. obj.poleAngle = 0;
  4246. obj.hard = 0;
  4247. obj.borderDis = 0;
  4248. obj.kickAngle = 180;
  4249. let b = obj.gameObj;
  4250. let wbp = this.rootPos;
  4251. let bx = wbp.x - b.x;
  4252. let by = wbp.y - b.y;
  4253. obj.borderDis = xGame.tools.random(0, 100);
  4254. this.kickBall.push(obj);
  4255. if (!this.isLine(wbp, obj))
  4256. continue;
  4257. obj.kickAngle = xGame.tools.random(90, 180);
  4258. obj.kickPos.x = b.x;
  4259. obj.kickPos.y = b.y;
  4260. this.lineBall.push(obj);
  4261. let minDis = 999999;
  4262. let hole = false;
  4263. for (let j = 0; j < holes.length; j++) {
  4264. let hp = holes[j];
  4265. if (bx >= 0 && hp.x > b.x + 100)
  4266. continue;
  4267. if (bx <= 0 && hp.x < b.x - 100)
  4268. continue;
  4269. if (by < -10 && hp.y < wbp.y)
  4270. continue;
  4271. if (by > 10 && hp.y > wbp.y)
  4272. continue;
  4273. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4274. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4275. if (dis < minDis) {
  4276. let dx = b.x - this.tempDir1.x * this.ballSize;
  4277. let dy = b.y - this.tempDir1.y * this.ballSize;
  4278. this.tempDir3.x = this.tempDir1.x;
  4279. this.tempDir3.y = this.tempDir1.y;
  4280. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4281. obj.kickPos.x = dx;
  4282. obj.kickPos.y = dy;
  4283. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4284. if (num > 1)
  4285. num = 1;
  4286. obj.kickAngle = Math.acos(num) * 57.3;
  4287. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4288. dis = dis * 2;
  4289. if (Math.abs(hp.x - 600) < 100)
  4290. dis += 50;
  4291. obj.hard = dis + obj.kickAngle * 3;
  4292. hole = true;
  4293. }
  4294. }
  4295. }
  4296. }
  4297. if (hole) {
  4298. this.scoreBall.push(obj);
  4299. this.holeBall.push(obj);
  4300. }
  4301. }
  4302. this.scoreBall.sort(function (a, b) {
  4303. return a.hard - b.hard;
  4304. });
  4305. this.holeBall.sort(function (a, b) {
  4306. return a.kickAngle - b.kickAngle;
  4307. });
  4308. this.kickBall.sort(function (a, b) {
  4309. return a.borderDis - b.borderDis;
  4310. });
  4311. }
  4312. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4313. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4314. let balls = xGame.common.d2World.ballArr;
  4315. let max = xGame.tools.getDis(hx, hy, bx, by);
  4316. for (let index = 0; index < balls.length; index++) {
  4317. let obj = balls[index];
  4318. if (obj.number == 0)
  4319. continue;
  4320. if (obj.number == bn || obj.number == dn)
  4321. continue;
  4322. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4323. if (dis * dis > max)
  4324. continue;
  4325. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4326. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4327. if (num > 1)
  4328. num = 1;
  4329. if (num < 0)
  4330. continue;
  4331. let gap = Math.sin(Math.acos(num)) * dis;
  4332. if (gap < this.ballSize)
  4333. return true;
  4334. }
  4335. return false;
  4336. }
  4337. isLine(xy, ball) {
  4338. let bx = xy.x;
  4339. let by = xy.y;
  4340. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4341. let dis = ball.getDestDis(xy);
  4342. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4343. let sin = Math.sin(angle);
  4344. let cos = Math.cos(angle);
  4345. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4348. let dx = bx + this.tempDir2.x * dis;
  4349. let dy = by + this.tempDir2.y * dis;
  4350. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4351. sin = Math.sin(-angle);
  4352. cos = Math.cos(-angle);
  4353. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4354. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4355. dx = bx + this.tempDir2.x * dis;
  4356. dy = by + this.tempDir2.y * dis;
  4357. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4358. if (isr && isl)
  4359. return false;
  4360. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4361. }
  4362. return true;
  4363. }
  4364. setKick(dx, dy) {
  4365. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4366. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4367. this.tempDir1.x = 0;
  4368. this.tempDir1.y = 1;
  4369. this.tempDir2.y = -this.tempDir2.y;
  4370. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4371. if (num > 1)
  4372. num = 1;
  4373. let rot = Math.acos(num) * 57.3;
  4374. if (this.tempDir2.x < 0)
  4375. rot = 360 - rot;
  4376. this.destRot += rot;
  4377. }
  4378. }
  4379. class ui_UIGame extends fgui.GComponent {
  4380. static createInstance() {
  4381. return (fgui.UIPackage.createObject("game", "UIGame"));
  4382. }
  4383. onConstruct() {
  4384. this.c1 = this.getController("c1");
  4385. this.d3Root = (this.getChild("d3Root"));
  4386. this.clickNode = (this.getChild("clickNode"));
  4387. this.d2Root = (this.getChild("d2Root"));
  4388. this.topNode = (this.getChild("topNode"));
  4389. this.n72 = (this.getChild("n72"));
  4390. this.n40 = (this.getChild("n40"));
  4391. this.rulerNode = (this.getChild("rulerNode"));
  4392. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4393. this.n50 = (this.getChild("n50"));
  4394. this.keduNode = (this.getChild("keduNode"));
  4395. this.powerTxt = (this.getChild("powerTxt"));
  4396. this.powerNode = (this.getChild("powerNode"));
  4397. this.colorNode = (this.getChild("colorNode"));
  4398. this.powerEft = (this.getChild("powerEft"));
  4399. this.myPowerNode = (this.getChild("myPowerNode"));
  4400. this.ganNode = (this.getChild("ganNode"));
  4401. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4402. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4403. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4404. this.skillRod = (this.getChild("skillRod"));
  4405. this.border = (this.getChild("border"));
  4406. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4407. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4408. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4409. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4410. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4411. this.guanyuNode = (this.getChild("guanyuNode"));
  4412. this.helpBtn = (this.getChild("helpBtn"));
  4413. this.wordsBtn = (this.getChild("wordsBtn"));
  4414. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4415. this.returnBtn = (this.getChild("returnBtn"));
  4416. this.ballNode = (this.getChild("ballNode"));
  4417. this.whiteAni = (this.getChild("whiteAni"));
  4418. this.blackAni = (this.getChild("blackAni"));
  4419. this.selfTurn = (this.getChild("selfTurn"));
  4420. this.aiTurn = (this.getChild("aiTurn"));
  4421. this.deskNode = (this.getChild("deskNode"));
  4422. this.moveNode = (this.getChild("moveNode"));
  4423. this.selfTalk = (this.getChild("selfTalk"));
  4424. this.aiTalk = (this.getChild("aiTalk"));
  4425. this.d2Node = (this.getChild("d2Node"));
  4426. this.snowNode = (this.getChild("snowNode"));
  4427. this.guide2 = (this.getChild("guide2"));
  4428. this.guide1 = (this.getChild("guide1"));
  4429. this.guide3 = (this.getChild("guide3"));
  4430. this.guideNode = (this.getChild("guideNode"));
  4431. }
  4432. }
  4433. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4434. class ui_UIGameEnd extends fgui.GComponent {
  4435. static createInstance() {
  4436. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4437. }
  4438. onConstruct() {
  4439. this.c1 = this.getController("c1");
  4440. this.n22 = (this.getChild("n22"));
  4441. this.n2 = (this.getChild("n2"));
  4442. this.n52 = (this.getChild("n52"));
  4443. this.n53 = (this.getChild("n53"));
  4444. this.coinNode = (this.getChild("coinNode"));
  4445. this.closeNode = (this.getChild("closeNode"));
  4446. this.moneyNode = (this.getChild("moneyNode"));
  4447. this.secretary = (this.getChild("secretary"));
  4448. this.n27 = (this.getChild("n27"));
  4449. this.n29 = (this.getChild("n29"));
  4450. this.talkNode = (this.getChild("talkNode"));
  4451. this.n38 = (this.getChild("n38"));
  4452. this.n39 = (this.getChild("n39"));
  4453. this.n40 = (this.getChild("n40"));
  4454. this.awardNode = (this.getChild("awardNode"));
  4455. this.starNumNode = (this.getChild("starNumNode"));
  4456. this.n47 = (this.getChild("n47"));
  4457. this.conditionNode = (this.getChild("conditionNode"));
  4458. this.isGetAward = (this.getChild("isGetAward"));
  4459. this.leftBtn = (this.getChild("leftBtn"));
  4460. this.rightBtn = (this.getChild("rightBtn"));
  4461. this.btnNode = (this.getChild("btnNode"));
  4462. }
  4463. }
  4464. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4465. class ui_UIAddCoin extends fgui.GComponent {
  4466. static createInstance() {
  4467. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4468. }
  4469. onConstruct() {
  4470. this.n11 = (this.getChild("n11"));
  4471. this.myNode = (this.getChild("myNode"));
  4472. this.t0 = this.getTransition("t0");
  4473. }
  4474. }
  4475. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4476. class UIAddCoin extends UIBase {
  4477. constructor() {
  4478. super();
  4479. this.coinNum = 2000;
  4480. }
  4481. onConstructor() {
  4482. this.ui = ui_UIAddCoin.createInstance();
  4483. this.contentPane = this.ui;
  4484. this.isEject = false;
  4485. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4486. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4487. }
  4488. show() {
  4489. super.show();
  4490. this.ui.t0.play();
  4491. this.setGlobalFont(this.ui);
  4492. }
  4493. videoAddCoin() {
  4494. console.log('zh:qjff_AD_for_UIAddCoin');
  4495. if (Laya.Browser.onAndroid) {
  4496. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4497. if (!boo) {
  4498. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4499. return;
  4500. }
  4501. }
  4502. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4503. }
  4504. else {
  4505. console.log('zh:AD 失败,直接发放奖励');
  4506. this.qjff_AD_for_UIAddCoin();
  4507. }
  4508. }
  4509. qjff_AD_for_UIAddCoin() {
  4510. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4511. this.hide();
  4512. }
  4513. }
  4514. UIAddCoin.uiName = "UIAddCoin";
  4515. class ui_UIInvitation extends fgui.GComponent {
  4516. static createInstance() {
  4517. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4518. }
  4519. onConstruct() {
  4520. this.n14 = (this.getChild("n14"));
  4521. this.myNode = (this.getChild("myNode"));
  4522. this.t0 = this.getTransition("t0");
  4523. }
  4524. }
  4525. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4526. class UIInvitation extends UIBase {
  4527. constructor() {
  4528. super();
  4529. }
  4530. onConstructor() {
  4531. this.ui = ui_UIInvitation.createInstance();
  4532. this.contentPane = this.ui;
  4533. this.isEject = false;
  4534. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4535. }
  4536. show() {
  4537. super.show();
  4538. this.setGlobalFont(this.ui);
  4539. }
  4540. enterGame() {
  4541. xGame.common.gameMode = GameMode.classic;
  4542. DataMgr.setChallengeTimes(1);
  4543. xGame.common.passAwardCoin = 2000;
  4544. let need = xGame.common.classicNiceNeddCoin;
  4545. if (DataMgr.coinEnough(need)) {
  4546. DataMgr.setCoin(-need);
  4547. xGame.eventMgr.event(RESTART_GAME, true);
  4548. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4549. }
  4550. else {
  4551. xGame.eventMgr.event(RESTART_GAME, true);
  4552. }
  4553. this.hide();
  4554. }
  4555. hide() {
  4556. super.hide();
  4557. }
  4558. }
  4559. UIInvitation.uiName = "UIInvitation";
  4560. class ui_UIMain extends fgui.GComponent {
  4561. static createInstance() {
  4562. return (fgui.UIPackage.createObject("game", "UIMain"));
  4563. }
  4564. onConstruct() {
  4565. this.n47 = (this.getChild("n47"));
  4566. this.n10 = (this.getChild("n10"));
  4567. this.secretary = (this.getChild("secretary"));
  4568. this.moneyNode = (this.getChild("moneyNode"));
  4569. this.headNode = (this.getChild("headNode"));
  4570. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4571. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4572. this.classicBtn = (this.getChild("classicBtn"));
  4573. this.globalBtn = (this.getChild("globalBtn"));
  4574. this.n44 = (this.getChild("n44"));
  4575. this.n_dengLu = (this.getChild("n_dengLu"));
  4576. this.settingNode = (this.getChild("settingNode"));
  4577. this.drawBtn = (this.getChild("drawBtn"));
  4578. this.signBtn = (this.getChild("signBtn"));
  4579. this.shopBtn = (this.getChild("shopBtn"));
  4580. this.n45 = (this.getChild("n45"));
  4581. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4582. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4583. this.rankBtn = (this.getChild("rankBtn"));
  4584. this.n46 = (this.getChild("n46"));
  4585. this.liucheng1 = (this.getChild("liucheng1"));
  4586. this.rightBtn = (this.getChild("rightBtn"));
  4587. this.n75 = (this.getChild("n75"));
  4588. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4589. this.liucheng2 = (this.getChild("liucheng2"));
  4590. this.guideBtn = (this.getChild("guideBtn"));
  4591. this.n73 = (this.getChild("n73"));
  4592. this.wordsNode = (this.getChild("wordsNode"));
  4593. this.enterGuide = (this.getChild("enterGuide"));
  4594. this.talkNode = (this.getChild("talkNode"));
  4595. this.n83 = (this.getChild("n83"));
  4596. this.n84 = (this.getChild("n84"));
  4597. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4598. }
  4599. }
  4600. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4601. class ui_UIMoyu extends fgui.GComponent {
  4602. static createInstance() {
  4603. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4604. }
  4605. onConstruct() {
  4606. this.ageTip = (this.getChild("ageTip"));
  4607. this.mainBg = (this.getChild("mainBg"));
  4608. this.xyNode = (this.getChild("xyNode"));
  4609. this.rnNode = (this.getChild("rnNode"));
  4610. this.fcmNode = (this.getChild("fcmNode"));
  4611. this.ageNode = (this.getChild("ageNode"));
  4612. this.tipNode = (this.getChild("tipNode"));
  4613. this.msgNode = (this.getChild("msgNode"));
  4614. }
  4615. }
  4616. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4617. class MoyuMgr {
  4618. static initMoyu() {
  4619. this.moyuView = new MoyuView();
  4620. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4621. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4622. this.moyuView.ui.displayObject.zOrder = 1000;
  4623. this.moyuView.init();
  4624. this.moyuView.showTip(true);
  4625. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4626. window['XApk'] = this;
  4627. }
  4628. static showAge(show) {
  4629. if (this.moyuView)
  4630. this.moyuView.showAge(show);
  4631. }
  4632. static onPlatMsg(idx) {
  4633. if (!MoyuMgr.moyuView)
  4634. return;
  4635. if (idx == '0') {
  4636. MoyuMgr.moyuView.showTip(false);
  4637. }
  4638. }
  4639. static showAgree(call) {
  4640. if (this.moyuView)
  4641. this.moyuView.showAgree(call);
  4642. else
  4643. call && call();
  4644. }
  4645. static showXy(type = 1) {
  4646. if (this.moyuView)
  4647. this.moyuView.showXy(type);
  4648. }
  4649. }
  4650. MoyuMgr.isAdvise = false;
  4651. class MoyuView {
  4652. constructor() {
  4653. this.ysxyNum = 1;
  4654. this.ysJson = null;
  4655. this.ui = ui_UIMoyu.createInstance();
  4656. }
  4657. init() {
  4658. this.ui.mainBg.visible = false;
  4659. this.ui.xyNode.visible = false;
  4660. this.ui.ageNode.visible = false;
  4661. this.ui.tipNode.visible = false;
  4662. this.ui.rnNode.visible = false;
  4663. this.ui.fcmNode.visible = false;
  4664. this.ui.ageTip.visible = false;
  4665. this.ui.msgNode.visible = false;
  4666. this.ui.visible = false;
  4667. this.ui.xyNode.xyList.setVirtual();
  4668. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4669. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4670. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4671. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4672. this.ui.xyNode.btnKnown.visible = false;
  4673. this.ui.xyNode.xy1.visible = false;
  4674. this.ui.xyNode.xy2.visible = false;
  4675. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4676. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4677. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4678. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4679. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4680. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4681. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4682. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4683. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4684. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4685. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4686. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4687. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4688. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4689. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4690. this.ysxyNum = 2;
  4691. }
  4692. }
  4693. onClick(obj) {
  4694. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4695. switch (obj) {
  4696. case this.ui.ageTip:
  4697. if (Moyu.isTTApk) {
  4698. this.ui.ageNode.visible = true;
  4699. this.ui.mainBg.visible = true;
  4700. }
  4701. break;
  4702. case this.ui.tipNode:
  4703. this.showTip(false);
  4704. break;
  4705. case this.ui.ageNode.btnAge:
  4706. this.ui.ageNode.visible = false;
  4707. this.ui.mainBg.visible = false;
  4708. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4709. this.ui.visible = false;
  4710. break;
  4711. case this.ui.xyNode.btnXy3:
  4712. case this.ui.xyNode.btnXy1:
  4713. this.loadXy(1);
  4714. break;
  4715. case this.ui.xyNode.btnXy2:
  4716. this.loadXy(2);
  4717. break;
  4718. case this.ui.xyNode.btnBack:
  4719. this.ui.xyNode.xy1.visible = true;
  4720. this.ui.xyNode.xy2.visible = false;
  4721. break;
  4722. case this.ui.xyNode.btnKnown:
  4723. this.ui.xyNode.visible = false;
  4724. this.ui.mainBg.visible = false;
  4725. this.ui.visible = false;
  4726. break;
  4727. case this.ui.rnNode.btnCheck:
  4728. this.check();
  4729. break;
  4730. case this.ui.rnNode.btnExit:
  4731. case this.ui.xyNode.btnNo:
  4732. this.ysxyNum--;
  4733. if (this.ysxyNum > 0)
  4734. this.showMsg("Refuse to quit the game once again");
  4735. else {
  4736. Moyu.userAgree(false);
  4737. Moyu.exit();
  4738. }
  4739. break;
  4740. case this.ui.xyNode.btnSure:
  4741. case this.ui.xyNode.btnYes:
  4742. DataMgr.userData.isAgree = true;
  4743. DataMgr.saveUserData();
  4744. this.onAgree();
  4745. break;
  4746. case this.ui.rnNode.btnDone:
  4747. this.ui.rnNode.visible = false;
  4748. this.ui.visible = false;
  4749. break;
  4750. case this.ui.fcmNode.btnRn:
  4751. this.showRn();
  4752. break;
  4753. }
  4754. }
  4755. showTip(show) {
  4756. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4757. return;
  4758. if (show) {
  4759. MoyuMgr.isAdvise = true;
  4760. this.ui.visible = true;
  4761. this.ui.tipNode.visible = true;
  4762. this.ui.tipNode.alpha = 1;
  4763. Laya.timer.once(1000, this, this.showTip, [false]);
  4764. }
  4765. else {
  4766. this.ui.tipNode.alpha = 1;
  4767. this.ui.tipNode.visible = true;
  4768. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4769. this.ui.tipNode.visible = false;
  4770. MoyuMgr.isAdvise = false;
  4771. }), 1000);
  4772. }
  4773. }
  4774. showAge(show, px = 0, py = 0) {
  4775. if (Moyu.platType > 10 && !Moyu.isIos) {
  4776. this.ui.ageTip.x = px;
  4777. this.ui.ageTip.y = py;
  4778. this.ui.ageTip.visible = show;
  4779. if (show)
  4780. this.ui.visible = true;
  4781. }
  4782. }
  4783. showAgree(call) {
  4784. this.agreeCall = call;
  4785. this.onAgree();
  4786. return;
  4787. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4788. this.showXy(0);
  4789. }
  4790. else
  4791. this.onAgree();
  4792. }
  4793. onAgree() {
  4794. if (!this.ui.ageNode.visible)
  4795. this.ui.visible = false;
  4796. this.ui.xyNode.visible = false;
  4797. Moyu.userAgree(true);
  4798. this.showAge(false);
  4799. this.agreeCall && this.agreeCall();
  4800. this.showRn();
  4801. }
  4802. showMsg(txt) {
  4803. this.ui.msgNode.txtMsg.text = txt;
  4804. this.ui.msgNode.visible = true;
  4805. this.ui.msgNode.alpha = 1;
  4806. this.ui.visible = true;
  4807. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4808. this.ui.msgNode.visible = false;
  4809. }), 2500, true);
  4810. }
  4811. showRn() {
  4812. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4813. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4814. this.ui.rnNode.rn1.visible = true;
  4815. this.ui.rnNode.rn2.visible = false;
  4816. this.ui.rnNode.rn3.visible = false;
  4817. this.ui.rnNode.rn4.visible = false;
  4818. this.ui.rnNode.visible = true;
  4819. this.ui.mainBg.visible = true;
  4820. this.ui.rnNode.btnDone.visible = false;
  4821. this.ui.rnNode.btnExit.visible = true;
  4822. this.ui.rnNode.btnCheck.visible = true;
  4823. this.ui.fcmNode.visible = false;
  4824. this.ui.visible = true;
  4825. return;
  4826. }
  4827. }
  4828. this.showFcm();
  4829. }
  4830. showFcm() {
  4831. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4832. Moyu.initFCM(true);
  4833. if (Moyu.gameTime < 1)
  4834. this.fcmLoop();
  4835. else if (Moyu.gameTime < 999)
  4836. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4837. }
  4838. }
  4839. fcmLoop() {
  4840. if (Moyu.gameTime < 1) {
  4841. this.ui.rnNode.visible = false;
  4842. this.ui.fcmNode.visible = true;
  4843. this.ui.mainBg.visible = true;
  4844. this.ui.visible = true;
  4845. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4846. Laya.timer.clear(this.ui, this.fcmLoop);
  4847. }
  4848. }
  4849. check() {
  4850. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4851. this.ui.rnNode.rn1.visible = false;
  4852. this.ui.rnNode.rn2.visible = false;
  4853. this.ui.rnNode.rn4.visible = true;
  4854. }
  4855. else if (this.ui.rnNode.rn4.visible) {
  4856. let name = this.ui.rnNode.inputName.text;
  4857. let code = this.ui.rnNode.inputCode.text;
  4858. if (code && code.length == 18) {
  4859. this.ui.rnNode.rn1.visible = false;
  4860. this.ui.rnNode.rn4.visible = false;
  4861. Moyu.authenticate(name, code, (res) => {
  4862. this.ui.rnNode.rn2.visible = !res;
  4863. this.ui.rnNode.rn3.visible = res;
  4864. this.ui.rnNode.btnDone.visible = res;
  4865. this.ui.rnNode.btnExit.visible = !res;
  4866. this.ui.rnNode.btnCheck.visible = !res;
  4867. if (res)
  4868. this.showFcm();
  4869. });
  4870. }
  4871. else
  4872. this.showMsg("信息填写不完整");
  4873. }
  4874. }
  4875. loadXy(type = 0) {
  4876. this.ui.xyNode.xy1.visible = false;
  4877. this.ui.xyNode.xy2.visible = true;
  4878. this.ui.xyNode.xyList.scrollToView(0);
  4879. if (type == 1) {
  4880. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4881. }
  4882. else if (type == 2) {
  4883. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4884. }
  4885. }
  4886. showXy(type = 0) {
  4887. this.xyBtn();
  4888. if (type == 0) {
  4889. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4890. this.ui.xyNode.btnSure.visible = true;
  4891. }
  4892. else {
  4893. this.ui.xyNode.btnYes.visible = true;
  4894. this.ui.xyNode.btnNo.visible = true;
  4895. }
  4896. }
  4897. else {
  4898. this.ui.xyNode.btnKnown.visible = true;
  4899. this.ui.mainBg.visible = true;
  4900. }
  4901. this.ui.xyNode.xy1.visible = true;
  4902. this.ui.xyNode.xy2.visible = false;
  4903. this.ui.xyNode.visible = true;
  4904. this.ui.visible = true;
  4905. }
  4906. xyBtn() {
  4907. this.ui.xyNode.btnSure.visible = false;
  4908. this.ui.xyNode.btnYes.visible = false;
  4909. this.ui.xyNode.btnNo.visible = false;
  4910. this.ui.xyNode.btnKnown.visible = false;
  4911. {
  4912. this.ui.xyNode.btnXy3.visible = false;
  4913. this.ui.xyNode.btnXy2.visible = true;
  4914. this.ui.xyNode.btnXy1.visible = true;
  4915. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4916. }
  4917. }
  4918. createXY(json) {
  4919. this.ysJson = json.content;
  4920. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4921. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4922. this.ui.xyNode.xy2.visible = true;
  4923. }
  4924. renderListItem(idx, cell) {
  4925. let xy = this.ysJson[idx];
  4926. cell.height = xy.line * 30;
  4927. cell.xyItem.text = xy.text;
  4928. }
  4929. onDestroy() {
  4930. this.agreeCall = null;
  4931. }
  4932. }
  4933. class SettingNode {
  4934. constructor(ui) {
  4935. this.showSetting = false;
  4936. this.openSound = true;
  4937. this.openShake = true;
  4938. this.ui = ui;
  4939. this.ui.soundBtn.onClick(this, this.switchSound);
  4940. this.ui.shakeBtn.onClick(this, this.switchShake);
  4941. this.ui.xyBtn.onClick(this, this.onXy);
  4942. this.ui.clickNode.onClick(this, this.changeSetting);
  4943. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4944. this.ui.xyBtn.visible = false;
  4945. this.ui.shakeBtn.visible = false;
  4946. }
  4947. changeSetting() {
  4948. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4949. this.showSetting = !this.showSetting;
  4950. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4951. }
  4952. switchSound() {
  4953. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4954. this.openSound = !this.openSound;
  4955. Moyu.onSetting(this.openSound, this.openShake);
  4956. xGame.soundMgr.onSetting(this.openSound);
  4957. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4958. }
  4959. switchShake() {
  4960. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4961. this.openShake = !this.openShake;
  4962. Moyu.onSetting(this.openSound, this.openShake);
  4963. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4964. }
  4965. onXy() {
  4966. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4967. MoyuMgr.showXy(1);
  4968. }
  4969. }
  4970. class ui_UILevelDisplay extends fgui.GComponent {
  4971. static createInstance() {
  4972. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4973. }
  4974. onConstruct() {
  4975. this.n9 = (this.getChild("n9"));
  4976. this.myNode = (this.getChild("myNode"));
  4977. this.closeNode = (this.getChild("closeNode"));
  4978. }
  4979. }
  4980. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4981. class ui_UILevelProp extends fgui.GComponent {
  4982. static createInstance() {
  4983. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4984. }
  4985. onConstruct() {
  4986. this.n16 = (this.getChild("n16"));
  4987. this.myNode = (this.getChild("myNode"));
  4988. this.closeBtn = (this.getChild("closeBtn"));
  4989. this.moneyNode = (this.getChild("moneyNode"));
  4990. this.t1 = this.getTransition("t1");
  4991. }
  4992. }
  4993. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4994. class ui_ShowItem extends fgui.GComponent {
  4995. static createInstance() {
  4996. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4997. }
  4998. onConstruct() {
  4999. this.myImg = (this.getChild("myImg"));
  5000. }
  5001. }
  5002. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5003. class ShowItem {
  5004. constructor() {
  5005. this.ui = ui_ShowItem.createInstance();
  5006. }
  5007. destroySelf() {
  5008. if (!this.ui.isDisposed) {
  5009. this.ui.removeFromParent();
  5010. this.ui.dispose();
  5011. }
  5012. }
  5013. setParent(parent) {
  5014. parent.addChild(this.ui);
  5015. }
  5016. setPos(x, y) {
  5017. this.ui.x = x;
  5018. this.ui.y = y;
  5019. }
  5020. setUrl(index) {
  5021. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5022. }
  5023. }
  5024. class ui_UIPower extends fgui.GComponent {
  5025. static createInstance() {
  5026. return (fgui.UIPackage.createObject("game", "UIPower"));
  5027. }
  5028. onConstruct() {
  5029. this.n11 = (this.getChild("n11"));
  5030. this.myNode = (this.getChild("myNode"));
  5031. this.t0 = this.getTransition("t0");
  5032. }
  5033. }
  5034. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5035. class UIPower extends UIBase {
  5036. constructor() {
  5037. super();
  5038. }
  5039. onConstructor() {
  5040. this.ui = ui_UIPower.createInstance();
  5041. this.contentPane = this.ui;
  5042. this.isEject = false;
  5043. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5044. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5045. }
  5046. show() {
  5047. super.show();
  5048. this.ui.t0.play();
  5049. this.setGlobalFont(this.ui);
  5050. }
  5051. videoGetPower() {
  5052. console.log('zh:qjff_AD_for_uipower');
  5053. if (Laya.Browser.onAndroid) {
  5054. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5055. if (!boo) {
  5056. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5057. return;
  5058. }
  5059. }
  5060. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5061. }
  5062. else {
  5063. console.log('zh:AD 失败,直接发放奖励');
  5064. this.qjff_AD_for_uipower();
  5065. }
  5066. }
  5067. qjff_AD_for_uipower() {
  5068. DataMgr.setPower(xGame.common.videoPower, true);
  5069. xGame.eventMgr.event(POWER_TIME);
  5070. this.hide();
  5071. }
  5072. }
  5073. UIPower.uiName = "UIPower";
  5074. class UILevelProp extends UIBase {
  5075. constructor() {
  5076. super();
  5077. this.firstPos = 385;
  5078. this.secondPos = 467;
  5079. this.showItemArr = [];
  5080. }
  5081. onConstructor() {
  5082. this.ui = ui_UILevelProp.createInstance();
  5083. this.contentPane = this.ui;
  5084. this.isEject = false;
  5085. this.addUIClick(this.ui.closeBtn, this.hide);
  5086. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5087. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5088. }
  5089. show(level) {
  5090. super.show();
  5091. this.ui.t1.play();
  5092. this.level = level;
  5093. this.data = cfgTable.placeballData[this.level];
  5094. this.updateSelf();
  5095. this.showPreView();
  5096. this.moneyNode.ui.c1.selectedIndex = 2;
  5097. this.moneyNode.checkPowerTime();
  5098. this.moneyNode.powerChange();
  5099. this.setGlobalFont(this.ui);
  5100. }
  5101. showPreView() {
  5102. let item;
  5103. let data;
  5104. for (let index = 0; index < this.showItemArr.length; index++) {
  5105. item = this.showItemArr[index];
  5106. item.destroySelf();
  5107. }
  5108. this.showItemArr = [];
  5109. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5110. for (const key in cfgData) {
  5111. data = cfgData[key];
  5112. item = new ShowItem();
  5113. item.setParent(this.ui.myNode.displayRoot);
  5114. item.setPos(data.x, data.y);
  5115. item.setUrl(data.value);
  5116. this.showItemArr.push(item);
  5117. }
  5118. }
  5119. updateSelf() {
  5120. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5121. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5122. if (this.data.ball == -1) {
  5123. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5124. }
  5125. else {
  5126. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5127. }
  5128. let localData = DataMgr.getPlaceBallLevel(this.level);
  5129. let getAward = localData.getAward;
  5130. let cfg = cfgTable.placeballData[this.level];
  5131. let coin = this.data.award[0];
  5132. let diamond = this.data.award[1];
  5133. if (cfg.type == PlaceBallType.challenge) {
  5134. diamond = 0;
  5135. coin = 100;
  5136. }
  5137. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5138. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5139. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5140. if (cfg.type == PlaceBallType.challenge) {
  5141. this.ui.myNode.coinNode.numTxt.text = "";
  5142. }
  5143. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5144. if (coin > 0 && diamond > 0) {
  5145. this.ui.myNode.diamondNode.x = 385;
  5146. this.ui.myNode.coinNode.x = 467;
  5147. }
  5148. else {
  5149. this.ui.myNode.diamondNode.x = 385;
  5150. this.ui.myNode.coinNode.x = 385;
  5151. }
  5152. if (!getAward) {
  5153. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5154. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5155. }
  5156. else {
  5157. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5158. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5159. }
  5160. }
  5161. startGame() {
  5162. if (DataMgr.powerEnough()) {
  5163. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5164. this.ui.myNode.startBtn.touchable = false;
  5165. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5166. console.log('zh:startGame ');
  5167. this.ui.myNode.startBtn.touchable = true;
  5168. DataMgr.setPower(-1);
  5169. xGame.eventMgr.event(POWER_TIME);
  5170. xGame.common.gameMode = GameMode.placeBall;
  5171. xGame.common.placeBallCurLevel = this.level;
  5172. xGame.uiMgr.Show(UIGame);
  5173. this.logEventForChallenge_level_start(this.level);
  5174. xGame.uiMgr.Hide(UILevelDisplay);
  5175. xGame.uiMgr.Hide(UIMain);
  5176. this.hide();
  5177. }));
  5178. }
  5179. else {
  5180. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5181. xGame.uiMgr.Show(UIPower);
  5182. }
  5183. }
  5184. logEventForChallenge_level_start(level) {
  5185. let keyStr = 'sjmd_challenge_level_start';
  5186. let jsonStr = {
  5187. "count": 1,
  5188. "gold_balance ": DataMgr.getCoin(),
  5189. "level": level,
  5190. "diamond_balance ": DataMgr.getDiamond()
  5191. };
  5192. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5193. const d = LocalStorageManager.getItem(keyStr);
  5194. if (level > d.level) {
  5195. jsonStr.count = d.count + 1;
  5196. LocalStorageManager.setItem(keyStr, jsonStr);
  5197. }
  5198. else {
  5199. }
  5200. }
  5201. else {
  5202. LocalStorageManager.setItem(keyStr, jsonStr);
  5203. }
  5204. const reqStr = JSON.stringify(jsonStr);
  5205. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5206. }
  5207. hide() {
  5208. super.hide();
  5209. }
  5210. }
  5211. UILevelProp.uiName = "UILevelProp";
  5212. class PutBallLevelDisplay {
  5213. constructor(ui, index) {
  5214. this.index = 0;
  5215. this.ui = ui;
  5216. this.index = index;
  5217. this.ui.onClick(this, this.clickSelf);
  5218. this.updateSelf();
  5219. this.ui.levelTxt.text = (this.index + 1) + "";
  5220. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5221. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5222. }
  5223. updateSelf() {
  5224. let level = this.index + 1;
  5225. this.data = DataMgr.getPlaceBallLevel(level);
  5226. this.ui.starNode.c1.selectedIndex = this.data.star;
  5227. let isChallenge = cfgTable.placeballData[level].type;
  5228. if (this.data.isCur) {
  5229. if (isChallenge) {
  5230. this.ui.c1.selectedIndex = 5;
  5231. }
  5232. else {
  5233. this.ui.c1.selectedIndex = 2;
  5234. }
  5235. }
  5236. else {
  5237. if (this.data.play) {
  5238. if (this.data.star == 3) {
  5239. this.ui.c1.selectedIndex = 0;
  5240. }
  5241. else {
  5242. this.ui.c1.selectedIndex = 1;
  5243. }
  5244. }
  5245. else {
  5246. if (isChallenge) {
  5247. this.ui.c1.selectedIndex = 4;
  5248. }
  5249. else {
  5250. this.ui.c1.selectedIndex = 3;
  5251. }
  5252. }
  5253. }
  5254. }
  5255. clickSelf() {
  5256. if (!this.data.play)
  5257. return;
  5258. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5259. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5260. }
  5261. }
  5262. class UILevelDisplay extends UIBase {
  5263. constructor() {
  5264. super();
  5265. }
  5266. onConstructor() {
  5267. this.ui = ui_UILevelDisplay.createInstance();
  5268. this.contentPane = this.ui;
  5269. this.isEject = false;
  5270. this.myList = this.ui.myNode.myList;
  5271. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5272. this.levelItemArr = [];
  5273. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5274. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5275. this.myList.numItems = levelNum;
  5276. }
  5277. levelItemRender(index, target) {
  5278. let item = new PutBallLevelDisplay(target, index);
  5279. this.levelItemArr.push(item);
  5280. }
  5281. show() {
  5282. super.show();
  5283. this.updateLevel();
  5284. this.scrollToPlace();
  5285. this.setGlobalFont(this.ui);
  5286. }
  5287. updateLevel() {
  5288. let temp;
  5289. for (let index = 0; index < this.levelItemArr.length; index++) {
  5290. temp = this.levelItemArr[index];
  5291. temp.updateSelf();
  5292. }
  5293. }
  5294. scrollToPlace() {
  5295. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5296. let passArr = DataMgr.getPlaceBallLevelList();
  5297. let offest = passArr.length;
  5298. if (offest >= maxNum - 1)
  5299. offest = maxNum - 1;
  5300. this.myList.scrollToView(offest, true, true);
  5301. }
  5302. hide() {
  5303. super.hide();
  5304. }
  5305. }
  5306. UILevelDisplay.uiName = "UILevelDisplay";
  5307. class ui_UIMatching extends fgui.GComponent {
  5308. static createInstance() {
  5309. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5310. }
  5311. onConstruct() {
  5312. this.n5 = (this.getChild("n5"));
  5313. this.n49 = (this.getChild("n49"));
  5314. this.n51 = (this.getChild("n51"));
  5315. this.n64 = (this.getChild("n64"));
  5316. this.n2 = (this.getChild("n2"));
  5317. this.n53 = (this.getChild("n53"));
  5318. this.n54 = (this.getChild("n54"));
  5319. this.n56 = (this.getChild("n56"));
  5320. this.n58 = (this.getChild("n58"));
  5321. this.n59 = (this.getChild("n59"));
  5322. this.n57 = (this.getChild("n57"));
  5323. this.n60 = (this.getChild("n60"));
  5324. this.n62 = (this.getChild("n62"));
  5325. this.awardTxt = (this.getChild("awardTxt"));
  5326. this.n61 = (this.getChild("n61"));
  5327. this.selfHead = (this.getChild("selfHead"));
  5328. this.aiHead = (this.getChild("aiHead"));
  5329. this.n82 = (this.getChild("n82"));
  5330. this.n84 = (this.getChild("n84"));
  5331. this.n83 = (this.getChild("n83"));
  5332. this.t1 = this.getTransition("t1");
  5333. this.t2 = this.getTransition("t2");
  5334. this.t3 = this.getTransition("t3");
  5335. this.t4 = this.getTransition("t4");
  5336. }
  5337. }
  5338. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5339. class UIMatching extends UIBase {
  5340. constructor() {
  5341. super();
  5342. }
  5343. onConstructor() {
  5344. this.ui = ui_UIMatching.createInstance();
  5345. this.contentPane = this.ui;
  5346. this.isEject = false;
  5347. }
  5348. show(callback) {
  5349. super.show();
  5350. PlatMgr.showBanner(true);
  5351. this.callback = callback;
  5352. let user = Moyu.getUserInfo();
  5353. if (!this.selfPot) {
  5354. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5355. }
  5356. if (!this.aiPot) {
  5357. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5358. }
  5359. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5360. this.ui.selfHead.nameTxt.text = user.nickName;
  5361. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5362. this.ui.aiHead.nameTxt.text = "???";
  5363. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5364. this.ui.selfHead.c1.selectedIndex = 0;
  5365. this.ui.aiHead.c1.selectedIndex = 0;
  5366. this.ui.selfHead.x = this.selfPot.x;
  5367. this.ui.selfHead.y = this.selfPot.y;
  5368. this.ui.aiHead.x = this.aiPot.x;
  5369. this.ui.aiHead.y = this.aiPot.y;
  5370. switch (xGame.common.gameMode) {
  5371. case GameMode.classic:
  5372. break;
  5373. case GameMode.bigMove:
  5374. this.initSkillData();
  5375. break;
  5376. default:
  5377. break;
  5378. }
  5379. this.ui.t1.play(Laya.Handler.create(this, () => {
  5380. this.ui.t2.play(Laya.Handler.create(this, () => {
  5381. switch (xGame.common.gameMode) {
  5382. case GameMode.classic:
  5383. this.waitingPeople();
  5384. break;
  5385. case GameMode.bigMove:
  5386. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5387. break;
  5388. default:
  5389. break;
  5390. }
  5391. }));
  5392. }));
  5393. this.setGlobalFont(this.ui);
  5394. }
  5395. initSkillData() {
  5396. this.skillSelectData = [];
  5397. let skillUrl = xGame.common.skillIconList;
  5398. let skillName = xGame.common.skillNameList;
  5399. let skillLevel = DataMgr.getBigSkillList();
  5400. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5401. for (let index = 0; index < 5; index++) {
  5402. let obj = {};
  5403. obj.skillImg = skillUrl[index];
  5404. obj.skillName = skillName[index];
  5405. obj.skillType = skillType[index];
  5406. obj.skillLevel = skillLevel[index];
  5407. this.skillSelectData.push(obj);
  5408. }
  5409. }
  5410. getAISkillLevel(myLevel) {
  5411. let video = xGame.common.upSkillLevel;
  5412. let aiLevel;
  5413. let temp;
  5414. if (video) {
  5415. temp = xGame.common.randomNum(-2, -1);
  5416. }
  5417. else {
  5418. if (myLevel <= 5) {
  5419. temp = xGame.common.randomNum(1, 3);
  5420. }
  5421. else if (myLevel <= 9) {
  5422. temp = xGame.common.randomNum(-2, 1);
  5423. }
  5424. else {
  5425. temp = xGame.common.randomNum(-4, 0);
  5426. }
  5427. }
  5428. aiLevel = temp + myLevel;
  5429. if (aiLevel <= 1)
  5430. aiLevel = 1;
  5431. if (aiLevel >= 10)
  5432. aiLevel = 10;
  5433. return aiLevel;
  5434. }
  5435. getAISkillType() {
  5436. return xGame.common.randomNum(1, 4);
  5437. let successTimes = DataMgr.getSkillSuccessTimes();
  5438. let info = cfgTable.aiskillData[successTimes];
  5439. if (!info) {
  5440. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5441. info = cfgTable.aiskillData[max];
  5442. }
  5443. let dataArr = info.skillselect;
  5444. let myCfg = {};
  5445. for (let index = 0; index < dataArr.length; index++) {
  5446. let temp = dataArr[index].split('-');
  5447. myCfg[temp[0]] = {};
  5448. myCfg[temp[0]].id = parseInt(temp[0]);
  5449. myCfg[temp[0]].weight = parseInt(temp[1]);
  5450. }
  5451. let aiCfg = xGame.common.initWeight(myCfg);
  5452. let curData = xGame.common.getRandomWeightData(aiCfg);
  5453. return parseInt(curData.id);
  5454. }
  5455. getAISkillData(index) {
  5456. let myLevel = this.skillSelectData[index].skillLevel;
  5457. let aiLevel = this.getAISkillLevel(myLevel);
  5458. let aiType = this.getAISkillType() - 1;
  5459. return { aiLevel, aiType } = { aiLevel, aiType };
  5460. }
  5461. skillSelectFinish(index) {
  5462. let aiInfo = this.getAISkillData(index);
  5463. xGame.common.gameMgr.selfCurSkill = index;
  5464. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5465. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5466. this.ui.selfHead.c1.selectedIndex = 1;
  5467. this.ui.aiHead.c1.selectedIndex = 1;
  5468. let myData = this.skillSelectData[index];
  5469. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5470. let guide = DataMgr.getSkillGuide();
  5471. if (guide == 0) {
  5472. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5473. }
  5474. else {
  5475. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5476. }
  5477. let aiData = this.skillSelectData[aiInfo.aiType];
  5478. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5479. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5480. this.waitingPeople();
  5481. }
  5482. waitingPeople() {
  5483. let time = xGame.common.randomNum(1000, 3000);
  5484. time += 1000;
  5485. Laya.timer.once(time, this, () => {
  5486. this.matchingSuccess();
  5487. });
  5488. }
  5489. matchingSuccess() {
  5490. let gameUI = xGame.common.gameUI;
  5491. let name = gameUI.ui.topNode.aiNameTxt.text;
  5492. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5493. this.ui.aiHead.nameTxt.text = name;
  5494. this.ui.aiHead.headImg.url = url;
  5495. name = gameUI.ui.topNode.selfNameTxt.text;
  5496. url = gameUI.ui.topNode.selfHeadLoader.url;
  5497. this.ui.selfHead.nameTxt.text = name;
  5498. this.ui.selfHead.headImg.url = url;
  5499. this.ui.t3.play(Laya.Handler.create(this, () => {
  5500. this.callback && this.callback();
  5501. this.ui.t4.play(Laya.Handler.create(this, () => {
  5502. this.destroySelf();
  5503. }));
  5504. }));
  5505. }
  5506. destroySelf() {
  5507. this.callback = null;
  5508. this.skillSelectData = null;
  5509. this.selfPot = null;
  5510. this.aiPot = null;
  5511. if (!this.ui.isDisposed) {
  5512. this.ui.removeFromParent();
  5513. this.ui.dispose();
  5514. }
  5515. xGame.uiMgr.destroyUI(this);
  5516. }
  5517. }
  5518. UIMatching.uiName = "UIMatching";
  5519. class ui_UIRanking extends fgui.GComponent {
  5520. static createInstance() {
  5521. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5522. }
  5523. onConstruct() {
  5524. this.n26 = (this.getChild("n26"));
  5525. this.myNode = (this.getChild("myNode"));
  5526. }
  5527. }
  5528. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5529. class UIRanking extends UIBase {
  5530. constructor() {
  5531. super();
  5532. this.showSelf = true;
  5533. this.rankType = 1;
  5534. this.rankList = [];
  5535. this.topX = 10;
  5536. this.myIndex = this.topX + 1;
  5537. this.myStar = 0;
  5538. }
  5539. onConstructor() {
  5540. this.ui = ui_UIRanking.createInstance();
  5541. this.contentPane = this.ui;
  5542. this.isEject = false;
  5543. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5544. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5545. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5546. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5547. this.ui.myNode.myList.setVirtual();
  5548. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5549. }
  5550. show() {
  5551. super.show();
  5552. this.getPaiHangBangDataFormJosnFile();
  5553. this.updateSelf();
  5554. let self = Moyu.getUserInfo();
  5555. if (!self.isAuth) {
  5556. Moyu.initUser(this, () => {
  5557. DataMgr.upRankData();
  5558. });
  5559. }
  5560. this.setGlobalFont(this.ui);
  5561. }
  5562. getPaiHangBangDataFormJosnFile() {
  5563. const rankingList = cfgTable.paiHangBangData.list;
  5564. this.updateItemData(rankingList);
  5565. }
  5566. updateSelfItem() {
  5567. console.log('zh:Moyu.platType =' + Moyu.platType);
  5568. let self = Moyu.getUserInfo();
  5569. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5570. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5571. if (this.myIndex > this.topX) {
  5572. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5573. }
  5574. else {
  5575. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5576. }
  5577. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5578. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5579. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5580. }
  5581. updateItemData(data) {
  5582. this.myStar = xGame.common.getAllStarNum();
  5583. if (this.rankList.length < 2) {
  5584. this.rankList = data;
  5585. let self = Moyu.getUserInfo();
  5586. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5587. self.headIcon = self.headIcon;
  5588. for (let i = 0; i < data.length; i++) {
  5589. let data = this.rankList[i];
  5590. if (data.userId == self.userId) {
  5591. this.rankList.splice(i, 1);
  5592. break;
  5593. }
  5594. }
  5595. for (let i = 0; i < data.length; i++) {
  5596. let data = this.rankList[i];
  5597. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5598. this.myIndex = i + 1;
  5599. let user = { headIcon: self.headIcon, nickName: "myself" };
  5600. let ud = { user: user, data: {} };
  5601. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5602. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5603. if (Moyu.platType < 11) {
  5604. user.headIcon = self.headIcon;
  5605. user.nickName = self.nickName;
  5606. }
  5607. this.rankList.splice(i, 0, md);
  5608. break;
  5609. }
  5610. }
  5611. }
  5612. this.updateSelfItem();
  5613. this.ui.myNode.myList.numItems = this.rankList.length;
  5614. }
  5615. updateItemUI(index, obj) {
  5616. let data = this.rankList[index];
  5617. let userData = JSON.parse(data.userData).user;
  5618. obj.nameTxt.text = userData.nickName.toString();
  5619. obj.valueTxt.text = data.rankScore;
  5620. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5621. obj.rankTxt.text = index + 1;
  5622. switch (index) {
  5623. case 0:
  5624. this.setImg(obj, 1, 0, 0);
  5625. obj.rankTxt.color = "#FFC047";
  5626. break;
  5627. case 1:
  5628. this.setImg(obj, 0, 1, 0);
  5629. obj.rankTxt.color = "#ACACAC";
  5630. break;
  5631. case 2:
  5632. this.setImg(obj, 0, 0, 1);
  5633. obj.rankTxt.color = "#D09672";
  5634. break;
  5635. default:
  5636. this.setImg(obj, 0, 0, 0);
  5637. obj.rankTxt.color = "#496FAB";
  5638. break;
  5639. }
  5640. }
  5641. setImg(obj, a, b, c) {
  5642. obj.img1.visible = a ? true : false;
  5643. obj.img2.visible = b ? true : false;
  5644. obj.img3.visible = c ? true : false;
  5645. }
  5646. changeList(type) {
  5647. this.rankType = type;
  5648. this.updateSelf();
  5649. }
  5650. changeSelfNode() {
  5651. this.showSelf = !this.showSelf;
  5652. this.updateSelf();
  5653. }
  5654. updateSelf() {
  5655. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5656. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5657. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5658. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5659. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5660. }
  5661. }
  5662. UIRanking.uiName = "UIRanking";
  5663. class ui_UISecretary extends fgui.GComponent {
  5664. static createInstance() {
  5665. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5666. }
  5667. onConstruct() {
  5668. this.n0 = (this.getChild("n0"));
  5669. this.myNode = (this.getChild("myNode"));
  5670. this.closeBtn = (this.getChild("closeBtn"));
  5671. this.t0 = this.getTransition("t0");
  5672. }
  5673. }
  5674. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5675. class UISecretary extends UIBase {
  5676. constructor() {
  5677. super();
  5678. this.curIndex = 1;
  5679. }
  5680. onConstructor() {
  5681. this.ui = ui_UISecretary.createInstance();
  5682. this.contentPane = this.ui;
  5683. this.isEject = false;
  5684. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5685. this.nodeObj = { left: null, right: null, cur: null };
  5686. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5687. }
  5688. show() {
  5689. super.show();
  5690. this.ui.t0.play();
  5691. this.updateData();
  5692. this.setGlobalFont(this.ui);
  5693. }
  5694. addSecretarySpine(node, spineName) {
  5695. if (spineName == "mishu") {
  5696. if (this.secretarySpine1) {
  5697. node.displayObject.destroyChildren();
  5698. this.playWoman(this.secretarySpine1, node.displayObject);
  5699. }
  5700. else {
  5701. let spine1 = new SpineMgr("mishu", () => {
  5702. this.secretarySpine1 = spine1;
  5703. this.playWoman(this.secretarySpine1, node.displayObject);
  5704. });
  5705. }
  5706. }
  5707. else {
  5708. if (this.secretarySpine2) {
  5709. node.displayObject.destroyChildren();
  5710. this.playWoman(this.secretarySpine2, node.displayObject);
  5711. }
  5712. else {
  5713. let spine2 = new SpineMgr("xiaomishu2", () => {
  5714. this.secretarySpine2 = spine2;
  5715. this.playWoman(this.secretarySpine2, node.displayObject);
  5716. });
  5717. }
  5718. }
  5719. }
  5720. playWoman(node, parent) {
  5721. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5722. let yy = this.ui.myNode.gameNode3.secretary.height;
  5723. let scale = 1.5;
  5724. if (node == this.secretarySpine2) {
  5725. scale = 1.2;
  5726. }
  5727. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5728. node.play(data, 0, true, parent);
  5729. }
  5730. turnLeft() {
  5731. this.curIndex--;
  5732. if (this.curIndex < 1) {
  5733. this.curIndex = 2;
  5734. }
  5735. let left = this.nodeObj.left;
  5736. let right = this.nodeObj.right;
  5737. let cur = this.nodeObj.cur;
  5738. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5739. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5740. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5741. this.updateData();
  5742. }));
  5743. this.ui.myNode.setChildIndex(right, 2);
  5744. this.nodeObj.left = cur;
  5745. this.nodeObj.right = left;
  5746. this.nodeObj.cur = right;
  5747. }
  5748. turnRight() {
  5749. this.curIndex++;
  5750. if (this.curIndex > 2) {
  5751. this.curIndex = 1;
  5752. }
  5753. let left = this.nodeObj.left;
  5754. let right = this.nodeObj.right;
  5755. let cur = this.nodeObj.cur;
  5756. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5757. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5758. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5759. this.updateData();
  5760. }));
  5761. this.ui.myNode.setChildIndex(left, 2);
  5762. this.nodeObj.left = right;
  5763. this.nodeObj.right = cur;
  5764. this.nodeObj.cur = left;
  5765. }
  5766. updateData() {
  5767. console.log('zh: updateData FFFFFFFFFF');
  5768. let data = cfgTable.secretaryshopData;
  5769. let children = this.ui.myNode._children;
  5770. let temp;
  5771. let curData;
  5772. for (let index = 0; index < children.length; index++) {
  5773. temp = children[index];
  5774. curData = data[1];
  5775. temp.heightTxt.text = curData.height;
  5776. temp.foodTxt.text = curData.food;
  5777. temp.historyTxt.text = curData.history;
  5778. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5779. this.addSecretarySpine(temp.secretary, curData.spine);
  5780. let womanIndex = curData.id - 1;
  5781. let getWoman = DataMgr.getSecretary(womanIndex);
  5782. let curUse = DataMgr.getCurSecretary();
  5783. if (getWoman) {
  5784. if (curUse == womanIndex) {
  5785. temp.purchaseBtn.c1.selectedIndex = 1;
  5786. }
  5787. else {
  5788. temp.purchaseBtn.c1.selectedIndex = 2;
  5789. }
  5790. }
  5791. else {
  5792. temp.purchaseBtn.c1.selectedIndex = 0;
  5793. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5794. }
  5795. temp.purchaseBtn.visible = false;
  5796. }
  5797. }
  5798. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5799. console.log('zh: 点击了clickSecretary ');
  5800. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5801. if (getWoman) {
  5802. if (curUse != womanIndex) {
  5803. console.log();
  5804. DataMgr.setCurSecretary(womanIndex);
  5805. this.updateData();
  5806. }
  5807. }
  5808. else {
  5809. console.log('zh:点击购买了');
  5810. let need = needDiamond;
  5811. if (DataMgr.diamondEnough(need)) {
  5812. DataMgr.setDiamond(-need);
  5813. DataMgr.setSecretary(womanIndex, 1);
  5814. DataMgr.setCurSecretary(womanIndex);
  5815. this.updateData();
  5816. }
  5817. else {
  5818. xGame.uiMgr.Show(UIAddProp, 1);
  5819. }
  5820. }
  5821. }
  5822. closeSelf() {
  5823. this.hide();
  5824. }
  5825. }
  5826. UISecretary.uiName = "UISecretary";
  5827. class ui_UIShop extends fgui.GComponent {
  5828. static createInstance() {
  5829. return (fgui.UIPackage.createObject("game", "UIShop"));
  5830. }
  5831. onConstruct() {
  5832. this.n48 = (this.getChild("n48"));
  5833. this.n0 = (this.getChild("n0"));
  5834. this.secretary = (this.getChild("secretary"));
  5835. this.talkNode = (this.getChild("talkNode"));
  5836. this.closeNode = (this.getChild("closeNode"));
  5837. this.moneyNode = (this.getChild("moneyNode"));
  5838. this.myNode = (this.getChild("myNode"));
  5839. }
  5840. }
  5841. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5842. class ui_UIMsg extends fgui.GComponent {
  5843. static createInstance() {
  5844. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5845. }
  5846. onConstruct() {
  5847. this.tipsNode = (this.getChild("tipsNode"));
  5848. }
  5849. }
  5850. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5851. class UIMsg extends UIBase {
  5852. constructor() {
  5853. super();
  5854. }
  5855. onConstructor() {
  5856. this.ui = ui_UIMsg.createInstance();
  5857. this.contentPane = this.ui;
  5858. this.isEject = false;
  5859. this.isMuti = true;
  5860. }
  5861. show(msg, callback) {
  5862. super.show();
  5863. this.ui.tipsNode.msgTxt.text = msg;
  5864. this.ui.alpha = 1;
  5865. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5866. this.hide();
  5867. callback && callback();
  5868. }), 1000);
  5869. this.setGlobalFont(this.ui);
  5870. }
  5871. }
  5872. UIMsg.uiName = "UIMsg";
  5873. class BallRodDisplay {
  5874. constructor(ui, index) {
  5875. this.index = 0;
  5876. this.uiIndex = 0;
  5877. this.ui = ui;
  5878. this.index = index;
  5879. this.initData();
  5880. }
  5881. initData() {
  5882. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5883. let data = cfgTable.ballrodData[this.index + 1];
  5884. this.ui.nameTxt.text = data.name;
  5885. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5886. this.ui.levelNode.c1.selectedIndex = data.quality;
  5887. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5888. if (data.spine) {
  5889. this.mySpine = new SpineMgr(data.spine, () => {
  5890. let xx = 150;
  5891. let yy = 70;
  5892. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5893. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5894. });
  5895. }
  5896. }
  5897. updateSelf() {
  5898. let get = DataMgr.getBallRod(this.index);
  5899. if (get == null)
  5900. get = 1;
  5901. let curUse = DataMgr.getCurBallRod();
  5902. if (get) {
  5903. if (curUse == this.index) {
  5904. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5905. }
  5906. else {
  5907. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5908. }
  5909. }
  5910. else {
  5911. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5912. }
  5913. }
  5914. buyBallRod() {
  5915. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5916. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5917. switch (selectedIndex) {
  5918. case 0:
  5919. break;
  5920. case 1:
  5921. console.log('zh:点击了 USE THIS');
  5922. DataMgr.setCurBallRod(this.index);
  5923. let curUse = DataMgr.getCurBallRod();
  5924. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5925. let ui = xGame.uiMgr.getUI(UIShop);
  5926. ui.updateBallRod();
  5927. break;
  5928. case 2:
  5929. let data = cfgTable.ballrodData[this.index + 1];
  5930. let need = data.price;
  5931. if (DataMgr.diamondEnough(need)) {
  5932. this.buyQiuGan(data);
  5933. DataMgr.setDiamond(-need);
  5934. DataMgr.setBallRod(this.index, 1);
  5935. DataMgr.setCurBallRod(this.index);
  5936. let ui = xGame.uiMgr.getUI(UIShop);
  5937. ui.updateBallRod();
  5938. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5939. }
  5940. else {
  5941. xGame.uiMgr.Show(UIAddProp, 1);
  5942. }
  5943. break;
  5944. default:
  5945. break;
  5946. }
  5947. }
  5948. buyQiuGan(qgItem) {
  5949. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5950. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5951. if (userInfo == null) {
  5952. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5953. return;
  5954. }
  5955. let reqData = xGame.httpMgr.getReqData();
  5956. let pd = JSON.parse(reqData);
  5957. pd.qiuGanData = qgItem;
  5958. reqData = JSON.stringify(pd);
  5959. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5960. try {
  5961. console.log('zh:buySp res = ' + JSON.stringify(res));
  5962. let code = res.code;
  5963. let msg = res.msg;
  5964. if (code == 401) {
  5965. Laya.LocalStorage.removeItem(keyForLoginInfo);
  5966. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  5967. return;
  5968. }
  5969. if (code == 200) {
  5970. xGame.uiMgr.Show(UIMsg, msg);
  5971. DataMgr.getUserZiChanInfo(false);
  5972. }
  5973. else {
  5974. xGame.uiMgr.Show(UIMsg, msg);
  5975. }
  5976. }
  5977. catch (error) {
  5978. console.log('error=' + error);
  5979. alert(error);
  5980. }
  5981. finally {
  5982. }
  5983. });
  5984. }
  5985. logEventForGouMaiGan(qiuGanName) {
  5986. const ev = {
  5987. value: qiuGanName
  5988. };
  5989. const jsonStr = JSON.stringify(ev);
  5990. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5991. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5992. }
  5993. }
  5994. class DaoJuDisplay {
  5995. constructor(ui, index) {
  5996. this.index = 0;
  5997. this.uiIndex = 0;
  5998. this.ggSpid = "";
  5999. this.spid = 0;
  6000. this.ui = ui;
  6001. this.index = index;
  6002. this.initData();
  6003. }
  6004. initData() {
  6005. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6006. let data = cfgTable.daoJuData[this.index + 1];
  6007. this.ui.nameTxt.text = data.spbt;
  6008. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6009. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6010. this.ggSpid = data.ggSpid;
  6011. this.spid = data.spid;
  6012. let baseUrl = "asset/sound/ogg/";
  6013. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6014. }
  6015. gotoBuy() {
  6016. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6017. if (userInfo != null) {
  6018. let token = userInfo.token;
  6019. let ggSpid = this.ggSpid;
  6020. let spid = this.spid;
  6021. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6022. console.log('zh:gotoBuy1 spid =' + spid);
  6023. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6024. return;
  6025. }
  6026. else {
  6027. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6028. }
  6029. }
  6030. gotoBuy1() {
  6031. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6032. let djItem = cfgTable.daoJuData[this.index + 1];
  6033. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6034. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6035. if (userInfo == null) {
  6036. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6037. return;
  6038. }
  6039. let reqData = xGame.httpMgr.getReqData();
  6040. let pd = JSON.parse(reqData);
  6041. pd.spItem = djItem;
  6042. reqData = JSON.stringify(pd);
  6043. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6044. try {
  6045. console.log('zh:buySp res = ' + JSON.stringify(res));
  6046. let code = res.code;
  6047. let msg = res.msg;
  6048. if (code == 401) {
  6049. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6050. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6051. return;
  6052. }
  6053. if (code == 200) {
  6054. xGame.uiMgr.Show(UIMsg, msg);
  6055. DataMgr.getUserZiChanInfo(false);
  6056. }
  6057. else {
  6058. xGame.uiMgr.Show(UIMsg, msg);
  6059. }
  6060. }
  6061. catch (error) {
  6062. console.log('error=' + error);
  6063. alert(error);
  6064. }
  6065. finally {
  6066. }
  6067. });
  6068. }
  6069. }
  6070. class UIShop extends UIBase {
  6071. constructor() {
  6072. super();
  6073. this.itemNums = 0;
  6074. this.itemNumsForDj = 0;
  6075. this.curType = "";
  6076. }
  6077. onConstructor() {
  6078. this.ui = ui_UIShop.createInstance();
  6079. this.contentPane = this.ui;
  6080. this.isEject = false;
  6081. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6082. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6083. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6084. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6085. this.addUIClick(this.ui, this.interuptSecretary);
  6086. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6087. this.ballRodArr = [];
  6088. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6089. this.ui.myNode.myList.numItems = this.itemNums;
  6090. this.loadDjdata_old();
  6091. }
  6092. loadDjdata_old() {
  6093. let fff = cfgTable.daoJuData;
  6094. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6095. this.daoJuArr = [];
  6096. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6097. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6098. }
  6099. getProductList() {
  6100. let reqData = xGame.httpMgr.getReqData();
  6101. let pd = JSON.parse(reqData);
  6102. pd.splx = "Consumable";
  6103. reqData = JSON.stringify(pd);
  6104. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6105. try {
  6106. let code = res.code;
  6107. let msg = res.msg;
  6108. if (code == 401) {
  6109. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6110. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6111. return;
  6112. }
  6113. if (code == 200) {
  6114. let data = res.data;
  6115. for (let index = 0; index < data.length; index++) {
  6116. let element = data[index];
  6117. cfgTable.daoJuData[element.spid] = element;
  6118. }
  6119. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6120. }
  6121. else {
  6122. xGame.uiMgr.Show(UIMsg, msg);
  6123. }
  6124. }
  6125. catch (error) {
  6126. console.log('error=' + error);
  6127. alert(error);
  6128. }
  6129. finally {
  6130. }
  6131. });
  6132. }
  6133. show(type) {
  6134. super.show();
  6135. this.curType = type == 0 ? "qiugan" : "daoju";
  6136. this.switchBtn("");
  6137. this.playSecretaryIdle();
  6138. this.updateBallRod();
  6139. this.setGlobalFont(this.ui);
  6140. }
  6141. test123() {
  6142. console.log('zh:test123 ');
  6143. }
  6144. switchBtn(type) {
  6145. console.log('zh:1111切換 sel type=' + type);
  6146. if (type == "") {
  6147. type = this.curType;
  6148. }
  6149. else {
  6150. if (this.curType == type) {
  6151. return;
  6152. }
  6153. else {
  6154. this.curType = type;
  6155. }
  6156. }
  6157. if (type == "qiugan") {
  6158. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6159. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6160. this.ui.myNode.c1.selectedIndex = 0;
  6161. this.ui.myNode.myList.visible = true;
  6162. this.ui.myNode.djList.visible = false;
  6163. }
  6164. else {
  6165. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6166. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6167. this.ui.myNode.c1.selectedIndex = 1;
  6168. this.ui.myNode.myList.visible = false;
  6169. this.ui.myNode.djList.visible = true;
  6170. }
  6171. }
  6172. updateBallRod() {
  6173. for (let index = 0; index < this.ballRodArr.length; index++) {
  6174. this.ballRodArr[index].updateSelf();
  6175. }
  6176. }
  6177. renderBallRod(sort, obj) {
  6178. let index = this.getIndexBySort(sort + 1) - 1;
  6179. let ballRod = new BallRodDisplay(obj, index);
  6180. this.ballRodArr.push(ballRod);
  6181. }
  6182. renderDaoJu(idx, obj) {
  6183. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6184. let b = new DaoJuDisplay(obj, index);
  6185. this.daoJuArr.push(b);
  6186. }
  6187. getIndexBySort(sort) {
  6188. let object = cfgTable.ballrodData;
  6189. for (const key in object) {
  6190. if (object[key].sort == sort) {
  6191. return parseInt(key);
  6192. }
  6193. }
  6194. }
  6195. getIndexBySortForDj(idx) {
  6196. let object = cfgTable.daoJuData;
  6197. for (const key in object) {
  6198. if (object[key].idx == idx) {
  6199. return parseInt(key);
  6200. }
  6201. }
  6202. }
  6203. playSecretaryIdle() {
  6204. let parent = this.ui.secretary.displayObject;
  6205. parent.destroyChildren();
  6206. let xx = this.ui.secretary.width / 2;
  6207. let yy = this.ui.secretary.height;
  6208. let scale = xGame.common.getSecretaryScale();
  6209. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6210. xGame.common.secretary.play(data, 0, true, parent);
  6211. }
  6212. interuptSecretary() {
  6213. Laya.timer.clearAll(this);
  6214. this.playSecretaryRandomSound();
  6215. }
  6216. playSecretaryRandomSound() {
  6217. if (this.isHide)
  6218. return;
  6219. let time = xGame.common.randomNum(45000, 60000);
  6220. Laya.timer.once(time, this, () => {
  6221. if (this.isHide)
  6222. return;
  6223. let index = xGame.common.randomNum(4, 7);
  6224. xGame.soundMgr.playSound("s_main0" + index);
  6225. let words = 1;
  6226. switch (index) {
  6227. case 4:
  6228. words = 5;
  6229. break;
  6230. case 5:
  6231. words = 3;
  6232. break;
  6233. case 6:
  6234. words = 6;
  6235. break;
  6236. case 7:
  6237. words = 7;
  6238. break;
  6239. default:
  6240. break;
  6241. }
  6242. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6243. this.playSecretaryRandomSound();
  6244. });
  6245. }
  6246. closeSelf() {
  6247. this.hide();
  6248. }
  6249. }
  6250. UIShop.uiName = "UIShop";
  6251. class ui_UISign extends fgui.GComponent {
  6252. static createInstance() {
  6253. return (fgui.UIPackage.createObject("game", "UISign"));
  6254. }
  6255. onConstruct() {
  6256. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6257. this.n6 = (this.getChild("n6"));
  6258. this.closeNode = (this.getChild("closeNode"));
  6259. this.myNode = (this.getChild("myNode"));
  6260. this.moneyNode = (this.getChild("moneyNode"));
  6261. this.secretary = (this.getChild("secretary"));
  6262. this.talkNode = (this.getChild("talkNode"));
  6263. this.tripleBtn = (this.getChild("tripleBtn"));
  6264. this.normalBtn = (this.getChild("normalBtn"));
  6265. this.tipsNode = (this.getChild("tipsNode"));
  6266. this.againBtn = (this.getChild("againBtn"));
  6267. this.t0 = this.getTransition("t0");
  6268. }
  6269. }
  6270. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6271. class SignMax {
  6272. constructor(ui) {
  6273. this.ui = ui;
  6274. }
  6275. updateSelf(index, sameDay, curDayIndex) {
  6276. let data = cfgTable.signData[index + 1];
  6277. this.ui.titleTxt.text = data.title;
  6278. let arr1 = data.award[0].split('-');
  6279. let arr2 = data.award[1].split('-');
  6280. let num1 = parseInt(arr1[1]);
  6281. let num2 = parseInt(arr2[1]);
  6282. this.ui.numTxt1.text = num1 + "";
  6283. this.ui.numTxt2.text = num2 + "";
  6284. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6285. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6286. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6287. this.ui.numTxt1.visible = false;
  6288. }
  6289. else {
  6290. this.ui.numTxt1.visible = true;
  6291. }
  6292. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6293. this.ui.numTxt2.visible = false;
  6294. }
  6295. else {
  6296. this.ui.numTxt2.visible = true;
  6297. }
  6298. if (index < curDayIndex) {
  6299. this.ui.c1.selectedIndex = 1;
  6300. }
  6301. else if (index == curDayIndex) {
  6302. if (sameDay) {
  6303. this.ui.c1.selectedIndex = 2;
  6304. }
  6305. else {
  6306. this.ui.c1.selectedIndex = 2;
  6307. }
  6308. }
  6309. else {
  6310. this.ui.c1.selectedIndex = 0;
  6311. }
  6312. }
  6313. }
  6314. class SignNormal {
  6315. constructor(ui) {
  6316. this.ui = ui;
  6317. }
  6318. updateSelf(index, sameDay, curDayIndex) {
  6319. let data = cfgTable.signData[index + 1];
  6320. this.ui.titleTxt.text = data.title;
  6321. let arr = data.award[0].split('-');
  6322. let type = parseInt(arr[0]);
  6323. let num = parseInt(arr[1]);
  6324. this.ui.numTxt.text = num + "";
  6325. if (type > 2) {
  6326. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6327. this.ui.myIcon.rotation = 0;
  6328. }
  6329. else {
  6330. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6331. this.ui.myIcon.rotation = 0;
  6332. }
  6333. if (xGame.common.signAwardContainsRod(data.award)) {
  6334. this.ui.numTxt.visible = false;
  6335. }
  6336. else {
  6337. this.ui.numTxt.visible = true;
  6338. }
  6339. if (index < curDayIndex) {
  6340. this.ui.c1.selectedIndex = 1;
  6341. }
  6342. else if (index == curDayIndex) {
  6343. if (sameDay) {
  6344. this.ui.c1.selectedIndex = 2;
  6345. }
  6346. else {
  6347. this.ui.c1.selectedIndex = 2;
  6348. }
  6349. }
  6350. else {
  6351. this.ui.c1.selectedIndex = 0;
  6352. }
  6353. }
  6354. }
  6355. class UISign extends UIBase {
  6356. constructor() {
  6357. super();
  6358. this.curDayIndex = 0;
  6359. this.starX = 0;
  6360. }
  6361. onConstructor() {
  6362. this.ui = ui_UISign.createInstance();
  6363. this.contentPane = this.ui;
  6364. this.isEject = false;
  6365. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6366. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6367. this.initSignItem();
  6368. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6369. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6370. }
  6371. show() {
  6372. super.show();
  6373. this.ui.t0.play();
  6374. this.playSecretaryIdle();
  6375. this.updateSign();
  6376. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6377. this.setGlobalFont(this.ui);
  6378. }
  6379. initSignItem() {
  6380. this.signArr = [];
  6381. for (let index = 0; index < 6; index++) {
  6382. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6383. this.signArr.push(temp);
  6384. }
  6385. this.signMax = new SignMax(this.ui.myNode.day7);
  6386. if (Moyu.isKs)
  6387. this.ui.closeNode.closeBtn.x += 100;
  6388. }
  6389. updateSign() {
  6390. let sameDay = xGame.common.judgeSameDay();
  6391. let max = 7;
  6392. this.curDayIndex = DataMgr.getSignData();
  6393. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6394. this.curDayIndex = 0;
  6395. if (!sameDay) {
  6396. this.ui.normalBtn.visible = true;
  6397. this.ui.tipsNode.visible = false;
  6398. this.ui.againBtn.visible = false;
  6399. }
  6400. else {
  6401. this.ui.normalBtn.visible = false;
  6402. let again = DataMgr.getExtraSign();
  6403. let isCurrency = false;
  6404. let index = this.curDayIndex;
  6405. if (index == 0)
  6406. index = 7;
  6407. let award = cfgTable.signData[index].award;
  6408. let num = award[0].split("-")[0];
  6409. if (num == "1" || num == "2")
  6410. isCurrency = true;
  6411. let showAgain = again == 0 && isCurrency;
  6412. this.ui.againBtn.visible = showAgain;
  6413. this.ui.tipsNode.visible = !showAgain;
  6414. }
  6415. for (let index = 0; index < this.signArr.length; index++) {
  6416. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6417. }
  6418. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6419. }
  6420. playSecretaryIdle() {
  6421. let parent = this.ui.secretary.displayObject;
  6422. parent.destroyChildren();
  6423. let xx = this.ui.secretary.width / 2;
  6424. let yy = this.ui.secretary.height;
  6425. let scale = xGame.common.getSecretaryScale();
  6426. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6427. xGame.common.secretary.play(data, 0, true, parent);
  6428. }
  6429. closeSelf() {
  6430. this.hide();
  6431. }
  6432. normalGetAward() {
  6433. let sameDay = xGame.common.judgeSameDay();
  6434. if (!sameDay) {
  6435. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6436. let temp;
  6437. let type;
  6438. let num;
  6439. let arr = [];
  6440. for (let index = 0; index < award.length; index++) {
  6441. temp = award[index].split("-");
  6442. type = parseInt(temp[0]);
  6443. num = parseInt(temp[1]);
  6444. let awardType = new AwardType();
  6445. awardType.num = num;
  6446. awardType.type = type;
  6447. arr.push(awardType);
  6448. }
  6449. xGame.common.getAward(arr, (watchVideo) => {
  6450. this.curDayIndex++;
  6451. if (this.curDayIndex > 7)
  6452. this.curDayIndex = 0;
  6453. DataMgr.setSignData(this.curDayIndex);
  6454. this.updateSignData2Server(this.curDayIndex);
  6455. DataMgr.setSignTime(new Date().getTime());
  6456. if (watchVideo) {
  6457. DataMgr.setExtraSign(1);
  6458. Moyu.sendDataEvent("signIn1");
  6459. }
  6460. this.updateSign();
  6461. });
  6462. }
  6463. }
  6464. againGetAward() {
  6465. Moyu.sendDataEvent("signIn2");
  6466. console.log('zh:qjff_AD_for_uisign');
  6467. if (Laya.Browser.onAndroid) {
  6468. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6469. if (!boo) {
  6470. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6471. return;
  6472. }
  6473. }
  6474. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6475. }
  6476. else {
  6477. console.log('zh:AD 失败,直接发放奖励');
  6478. this.qjff_AD_for_uisign();
  6479. }
  6480. }
  6481. qjff_AD_for_uisign() {
  6482. let index = this.curDayIndex;
  6483. if (index == 0)
  6484. index = 7;
  6485. let award = cfgTable.signData[index].award;
  6486. let temp;
  6487. let type;
  6488. let num;
  6489. for (let index = 0; index < award.length; index++) {
  6490. temp = award[index].split("-");
  6491. type = parseInt(temp[0]);
  6492. num = parseInt(temp[1]) * 3;
  6493. xGame.common.playObjFlyAnim(num, type);
  6494. }
  6495. DataMgr.setExtraSign(1);
  6496. this.updateSign();
  6497. }
  6498. updateSignData2Server(day) {
  6499. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6500. if (userInfo == null) {
  6501. return;
  6502. }
  6503. let reqData = xGame.httpMgr.getReqData();
  6504. let pd = JSON.parse(reqData);
  6505. pd.signData = day;
  6506. reqData = JSON.stringify(pd);
  6507. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6508. try {
  6509. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6510. let code = res.code;
  6511. let msg = res.msg;
  6512. if (code == 401) {
  6513. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6514. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6515. return;
  6516. }
  6517. if (code == 200) {
  6518. let data = res.data;
  6519. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6520. }
  6521. else {
  6522. xGame.uiMgr.Show(UIMsg, msg);
  6523. }
  6524. }
  6525. catch (error) {
  6526. console.log('error=' + error);
  6527. alert(error);
  6528. }
  6529. finally {
  6530. }
  6531. });
  6532. }
  6533. }
  6534. UISign.uiName = "UISign";
  6535. class ui_UISkill extends fgui.GComponent {
  6536. static createInstance() {
  6537. return (fgui.UIPackage.createObject("game", "UISkill"));
  6538. }
  6539. onConstruct() {
  6540. this.n48 = (this.getChild("n48"));
  6541. this.n0 = (this.getChild("n0"));
  6542. this.secretary = (this.getChild("secretary"));
  6543. this.talkNode = (this.getChild("talkNode"));
  6544. this.closeNode = (this.getChild("closeNode"));
  6545. this.moneyNode = (this.getChild("moneyNode"));
  6546. this.skillNode = (this.getChild("skillNode"));
  6547. this.guideNode = (this.getChild("guideNode"));
  6548. }
  6549. }
  6550. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6551. class SkillDisplay {
  6552. constructor(ui, data, uiIndex) {
  6553. this.starX = 0;
  6554. this.starY = 0;
  6555. this.index = 0;
  6556. this.ui = ui;
  6557. this.data = data;
  6558. this.index = uiIndex;
  6559. this.initSelf();
  6560. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6561. }
  6562. initSelf() {
  6563. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6564. this.ui.nameTxt.text = this.data.name;
  6565. this.ui.describeTxt.text = this.data.describe;
  6566. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6567. this.ui.startBtn.onClick(this, this.startGame);
  6568. this.updateSelf();
  6569. }
  6570. updateSelf() {
  6571. this.checkTry();
  6572. let level = DataMgr.getBigSkillByIndex(this.index);
  6573. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6574. }
  6575. checkTry() {
  6576. let index = this.index;
  6577. let level = DataMgr.getBigSkillByIndex(index);
  6578. if (level == null) {
  6579. DataMgr.setBigSkill(index, 1, false);
  6580. level = 1;
  6581. }
  6582. this.ui.levelTxt.text = "LV." + level;
  6583. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6584. this.ui.tryNode.visible = true;
  6585. else
  6586. this.ui.tryNode.visible = false;
  6587. }
  6588. clickAddLevel() {
  6589. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6590. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6591. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6592. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6593. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6594. }
  6595. else {
  6596. console.log('zh:AD 失败,直接发放奖励');
  6597. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6598. }
  6599. }
  6600. qjff_AD_for_skilldisplay_clickAddLevel() {
  6601. DataMgr.setBigSkill(this.data.index, 1);
  6602. this.updateSelf();
  6603. xGame.common.upSkillLevel = true;
  6604. }
  6605. startGame() {
  6606. console.log('zh:rod skill startgame');
  6607. if (this.data.index == 3) {
  6608. alert('Coming soon!');
  6609. return;
  6610. }
  6611. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6612. let needCoin = xGame.common.bigMoveNeedCoin;
  6613. xGame.common.passAwardCoin = 2000;
  6614. let guide = DataMgr.getSkillGuide();
  6615. console.log('zh:startGame guide=' + guide);
  6616. xGame.common.temSelfLevel = 0;
  6617. if (guide == 0) {
  6618. needCoin = 0;
  6619. xGame.common.temSelfLevel = 100;
  6620. }
  6621. if (DataMgr.coinEnough(needCoin)) {
  6622. DataMgr.setCoin(-needCoin);
  6623. xGame.common.curPlayerSkillType = this.index;
  6624. if (guide == 0)
  6625. xGame.common.curPlayerSkillType = 0;
  6626. console.log('zh: skilldisplay 1');
  6627. xGame.uiMgr.Show(UIGame);
  6628. xGame.uiMgr.Hide(UIMain);
  6629. xGame.uiMgr.Show(UIMatching, () => {
  6630. xGame.common.gameUI.ui.alpha = 1;
  6631. xGame.common.gameUI.startGame();
  6632. xGame.uiMgr.Hide(UISkill);
  6633. });
  6634. this.logEventForRod_start();
  6635. }
  6636. else {
  6637. console.log('zh: skilldisplay 2');
  6638. xGame.uiMgr.Show(UIAddProp, 0);
  6639. Moyu.sendDataEvent("AddCoinVideo");
  6640. }
  6641. }
  6642. logEventForRod_start() {
  6643. let gfmsIdx = xGame.common.curPlayerSkillType;
  6644. console.log('zh:选择的技能=' + gfmsIdx);
  6645. let gfmc = 'Skyfall Shot';
  6646. if (gfmsIdx == 0) {
  6647. gfmc = 'Skyfall Shot';
  6648. }
  6649. if (gfmsIdx == 1) {
  6650. gfmc = 'Surging break';
  6651. }
  6652. if (gfmsIdx == 2) {
  6653. gfmc = 'Frost Lock';
  6654. }
  6655. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6656. let jsonStr = {
  6657. "count": 0,
  6658. "name": gfmc
  6659. };
  6660. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6661. const d = LocalStorageManager.getItem(keyStr);
  6662. jsonStr.count = d.count + 1;
  6663. LocalStorageManager.setItem(keyStr, jsonStr);
  6664. }
  6665. else {
  6666. LocalStorageManager.setItem(keyStr, jsonStr);
  6667. }
  6668. const reqStr = JSON.stringify(jsonStr);
  6669. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6670. }
  6671. }
  6672. class UISkill extends UIBase {
  6673. constructor() {
  6674. super();
  6675. this.skillData = [];
  6676. }
  6677. onConstructor() {
  6678. this.ui = ui_UISkill.createInstance();
  6679. this.contentPane = this.ui;
  6680. this.isEject = false;
  6681. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6682. this.initSkillData();
  6683. console.log('zh:aaaaaa1111111111');
  6684. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6685. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6686. console.log('zh:aaaaaa22222222');
  6687. this.displayList = [];
  6688. this.ui.skillNode.skillList.numItems = 3;
  6689. this.addUIClick(this.ui, this.interuptSecretary);
  6690. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6691. this.ui.talkNode.visible = false;
  6692. if (Moyu.isKs)
  6693. this.ui.closeNode.closeBtn.x += 100;
  6694. }
  6695. show() {
  6696. super.show();
  6697. this.playSecretaryIdle();
  6698. this.moneyNode.ui.c1.selectedIndex = 1;
  6699. Laya.timer.clearAll(this);
  6700. xGame.soundMgr.playSound("s_start");
  6701. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6702. let guide = DataMgr.getSkillGuide();
  6703. this.ui.guideNode.visible = guide == 0;
  6704. let item = this.getSkillItemByUIIndex(0);
  6705. if (guide == 0) {
  6706. item.ui.c1.selectedIndex = 1;
  6707. }
  6708. else {
  6709. item.ui.c1.selectedIndex = 0;
  6710. }
  6711. this.ui.guideNode.guideBtn.visible = guide == 0;
  6712. for (let index = 0; index < this.displayList.length; index++) {
  6713. this.displayList[index].checkTry();
  6714. }
  6715. this.setGlobalFont(this.ui);
  6716. }
  6717. getSkillItemByUIIndex(cur) {
  6718. for (let index = 0; index < this.displayList.length; index++) {
  6719. if (this.displayList[index].index == cur) {
  6720. return this.displayList[index];
  6721. }
  6722. }
  6723. }
  6724. enterGuideLevel() {
  6725. let item = this.getSkillItemByUIIndex(0);
  6726. item.startGame();
  6727. if (DataMgr.getNewUser())
  6728. Moyu.sendDataEvent("gameStart1");
  6729. }
  6730. initSkillData() {
  6731. this.skillData = [];
  6732. let nameList = xGame.common.skillNameList;
  6733. let iconList = xGame.common.skillIconList;
  6734. let describeList = [
  6735. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6736. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6737. "The power of frost descends—freezing the flow and taking full control of the game!"
  6738. ];
  6739. console.log('zh:initSkillData 111111111');
  6740. let data;
  6741. for (let index = 0; index < nameList.length; index++) {
  6742. data = {};
  6743. data.name = nameList[index];
  6744. data.icon = iconList[index];
  6745. data.describe = describeList[index];
  6746. data.index = index;
  6747. this.skillData.push(data);
  6748. }
  6749. }
  6750. updateSkillItem(index, target) {
  6751. if (this.displayList[index] == null) {
  6752. let uiIndex;
  6753. switch (index) {
  6754. case 0:
  6755. uiIndex = 1;
  6756. break;
  6757. case 1:
  6758. uiIndex = 0;
  6759. break;
  6760. case 2:
  6761. uiIndex = 2;
  6762. break;
  6763. case 3:
  6764. uiIndex = 3;
  6765. break;
  6766. default:
  6767. break;
  6768. }
  6769. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6770. this.displayList.push(temp);
  6771. }
  6772. }
  6773. playSecretaryIdle() {
  6774. let parent = this.ui.secretary.displayObject;
  6775. parent.destroyChildren();
  6776. let xx = this.ui.secretary.width / 2;
  6777. let yy = this.ui.secretary.height;
  6778. let scale = xGame.common.getSecretaryScale();
  6779. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6780. xGame.common.secretary.play(data, 0, true, parent);
  6781. }
  6782. returnUIMain() {
  6783. this.hide();
  6784. xGame.common.stopGirlPop(this.ui.talkNode);
  6785. xGame.uiMgr.Show(UIMain);
  6786. }
  6787. interuptSecretary() {
  6788. Laya.timer.clearAll(this);
  6789. this.playSecretaryRandomSound();
  6790. }
  6791. playSecretaryRandomSound() {
  6792. if (this.isHide)
  6793. return;
  6794. let time = xGame.common.randomNum(45000, 60000);
  6795. Laya.timer.once(time, this, () => {
  6796. if (this.isHide)
  6797. return;
  6798. let index = xGame.common.randomNum(4, 7);
  6799. xGame.soundMgr.playSound("s_main0" + index);
  6800. let words = 1;
  6801. switch (index) {
  6802. case 4:
  6803. words = 5;
  6804. break;
  6805. case 5:
  6806. words = 3;
  6807. break;
  6808. case 6:
  6809. words = 6;
  6810. break;
  6811. case 7:
  6812. words = 7;
  6813. break;
  6814. default:
  6815. break;
  6816. }
  6817. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6818. this.playSecretaryRandomSound();
  6819. });
  6820. }
  6821. }
  6822. UISkill.uiName = "UISkill";
  6823. class ui_UIModeSelection extends fgui.GComponent {
  6824. static createInstance() {
  6825. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6826. }
  6827. onConstruct() {
  6828. this.n19 = (this.getChild("n19"));
  6829. this.closeBtn = (this.getChild("closeBtn"));
  6830. this.myNode = (this.getChild("myNode"));
  6831. this.t0 = this.getTransition("t0");
  6832. }
  6833. }
  6834. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6835. class UIModeSelection extends UIBase {
  6836. constructor() {
  6837. super();
  6838. }
  6839. onConstructor() {
  6840. this.ui = ui_UIModeSelection.createInstance();
  6841. this.contentPane = this.ui;
  6842. this.isEject = false;
  6843. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6844. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6845. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6846. this.addUIClick(this.ui.closeBtn, this.hide);
  6847. this.peopleArr = [65, 990, 580];
  6848. this.peopleOffest = [5, 10, 10];
  6849. }
  6850. show(callback) {
  6851. this.updateSelf();
  6852. super.show();
  6853. this.ui.t0.play();
  6854. this.callback = callback;
  6855. this.setGlobalFont(this.ui);
  6856. }
  6857. updateSelf() {
  6858. let cfg = cfgTable.modeselectData;
  6859. for (let index = 1; index <= 3; index++) {
  6860. let node = this.ui.myNode["type" + index];
  6861. node.need.text = cfg[index].need;
  6862. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6863. node.peopleTxt.text = this.getRandPeople(index - 1);
  6864. }
  6865. }
  6866. enterGame(type) {
  6867. console.log('zh: 进入经典模式 type: ' + type);
  6868. xGame.common.classicRoomType = type;
  6869. let cfg = cfgTable.modeselectData[type];
  6870. let need = cfg.need;
  6871. xGame.common.passAwardCoin = cfg.award;
  6872. if (DataMgr.coinEnough(need)) {
  6873. DataMgr.setCoin(-need);
  6874. this.ui.myNode["type" + type].t0.play();
  6875. Laya.timer.once(200, this, () => {
  6876. this.callback && this.callback();
  6877. });
  6878. this.logEventForClassic_start();
  6879. }
  6880. else {
  6881. Moyu.sendDataEvent("AddCoinVideo");
  6882. xGame.uiMgr.Show(UIAddProp, 0);
  6883. }
  6884. }
  6885. getRandPeople(index) {
  6886. let rand = this.peopleOffest[index];
  6887. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6888. }
  6889. logEventForClassic_start() {
  6890. let rtype = xGame.common.classicRoomType;
  6891. let msmc = '';
  6892. if (rtype == 1) {
  6893. msmc = 'beginner';
  6894. }
  6895. if (rtype == 2) {
  6896. msmc = 'expert';
  6897. }
  6898. if (rtype == 3) {
  6899. msmc = 'master';
  6900. }
  6901. let keyStr = 'sjmd_classic_start_' + rtype;
  6902. let jsonStr = {
  6903. "difficulty": msmc,
  6904. "classic_count": 1,
  6905. "difficulty_count": 1
  6906. };
  6907. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6908. const d = LocalStorageManager.getItem(keyStr);
  6909. jsonStr.classic_count = d.classic_count + 1;
  6910. jsonStr.difficulty_count = d.difficulty_count + 1;
  6911. LocalStorageManager.setItem(keyStr, jsonStr);
  6912. }
  6913. else {
  6914. LocalStorageManager.setItem(keyStr, jsonStr);
  6915. }
  6916. const reqStr = JSON.stringify(jsonStr);
  6917. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6918. }
  6919. }
  6920. UIModeSelection.uiName = "UIModeSelection";
  6921. class ui_UIReg extends fgui.GComponent {
  6922. static createInstance() {
  6923. return (fgui.UIPackage.createObject("game", "UIReg"));
  6924. }
  6925. onConstruct() {
  6926. this.n38 = (this.getChild("n38"));
  6927. this.n51 = (this.getChild("n51"));
  6928. this.closeBtn = (this.getChild("closeBtn"));
  6929. this.lab_tip = (this.getChild("lab_tip"));
  6930. this.txt_ua = (this.getChild("txt_ua"));
  6931. this.txt_up1 = (this.getChild("txt_up1"));
  6932. this.txt_up2 = (this.getChild("txt_up2"));
  6933. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6934. this.btn_reg = (this.getChild("btn_reg"));
  6935. }
  6936. }
  6937. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6938. class ui_UILogin extends fgui.GComponent {
  6939. static createInstance() {
  6940. return (fgui.UIPackage.createObject("game", "UILogin"));
  6941. }
  6942. onConstruct() {
  6943. this.c1 = this.getController("c1");
  6944. this.n18 = (this.getChild("n18"));
  6945. this.n19 = (this.getChild("n19"));
  6946. }
  6947. }
  6948. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6949. class UILogin extends UIBase {
  6950. constructor() {
  6951. super();
  6952. this.fontStr = 'big-john-woff2-2';
  6953. try {
  6954. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  6955. console.log("zh: constructor加载arial字体成功");
  6956. }
  6957. catch (error) {
  6958. console.log("zh: constructor加载arial字体失败");
  6959. }
  6960. }
  6961. onFontLoaded() {
  6962. try {
  6963. Laya.Text.defaultFont = this.fontStr;
  6964. this.ui.n19.txt_ua.font = this.fontStr;
  6965. this.ui.n19.txt_up.font = this.fontStr;
  6966. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  6967. }
  6968. catch (error) {
  6969. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  6970. }
  6971. }
  6972. onConstructor() {
  6973. this.ui = ui_UILogin.createInstance();
  6974. this.contentPane = this.ui;
  6975. this.isEject = false;
  6976. this.addUIClick(this.ui.n19.closeBtn, this.closeSelf);
  6977. this.addUIClick(this.ui.n19.btn_gotoReg, this.gotoRegPage);
  6978. this.addUIClick(this.ui.n19.btn_login, this.userLogin);
  6979. }
  6980. show() {
  6981. super.show();
  6982. this.x = (Laya.stage.width - this.width) / 2;
  6983. this.y = (Laya.stage.height - this.height) / 2;
  6984. this.onFontLoaded();
  6985. }
  6986. closeSelf() {
  6987. this.hide();
  6988. }
  6989. userLogin() {
  6990. let ua = this.ui.n19.txt_ua.text;
  6991. let up = this.ui.n19.txt_up.text;
  6992. console.log('zh:ua font' + this.ui.n19.txt_ua.font);
  6993. if (ua && up) {
  6994. let reqData = JSON.stringify({
  6995. username: ua.trim(),
  6996. password: up.trim(),
  6997. fromMark: 'app_game'
  6998. });
  6999. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7000. try {
  7001. console.log('zh:res = ' + JSON.stringify(res));
  7002. let code = res.code;
  7003. let msg = res.msg;
  7004. if (code == 200) {
  7005. let keyStr = keyForLoginInfo;
  7006. let jsonStr = {
  7007. "username": res.username,
  7008. "token": res.token,
  7009. "buySpids": { 1: false, 7: false }
  7010. };
  7011. LocalStorageManager.setItem(keyStr, jsonStr);
  7012. let myu = Moyu.getUserInfo();
  7013. console.log('zh:myu = ' + JSON.stringify(myu));
  7014. DataMgr.updateUserNickName(res.username);
  7015. Moyu.updateUserInfo(res.username);
  7016. xGame.uiMgr.Show(UIMsg, msg);
  7017. DataMgr.loadUserSpOrderForAd();
  7018. DataMgr.getUserZiChanInfo(false);
  7019. xGame.eventMgr.event(LOGIN_IN);
  7020. this.closeSelf();
  7021. }
  7022. else {
  7023. xGame.uiMgr.Show(UIMsg, msg);
  7024. }
  7025. }
  7026. catch (error) {
  7027. console.log('error=' + error);
  7028. alert(error);
  7029. }
  7030. finally {
  7031. }
  7032. });
  7033. }
  7034. else {
  7035. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7036. }
  7037. }
  7038. gotoRegPage() {
  7039. this.closeSelf();
  7040. xGame.uiMgr.Show(UIReg);
  7041. }
  7042. }
  7043. UILogin.uiName = "UILogin";
  7044. class UIReg extends UIBase {
  7045. constructor() {
  7046. super();
  7047. this.fontStr = 'big-john-woff2-2';
  7048. try {
  7049. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7050. console.log("zh: constructor加载arial字体成功");
  7051. }
  7052. catch (error) {
  7053. console.log("zh: constructor加载arial字体失败");
  7054. }
  7055. }
  7056. onFontLoaded() {
  7057. try {
  7058. Laya.Text.defaultFont = this.fontStr;
  7059. this.ui.txt_ua.font = this.fontStr;
  7060. this.ui.txt_up1.font = this.fontStr;
  7061. this.ui.txt_up2.font = this.fontStr;
  7062. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7063. }
  7064. catch (error) {
  7065. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7066. }
  7067. }
  7068. onConstructor() {
  7069. this.ui = ui_UIReg.createInstance();
  7070. this.contentPane = this.ui;
  7071. this.isEject = false;
  7072. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7073. this.addUIClick(this.ui.btn_reg, this.regUser);
  7074. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7075. }
  7076. show() {
  7077. super.show();
  7078. this.x = (Laya.stage.width - this.width) / 2;
  7079. this.y = (Laya.stage.height - this.height) / 2;
  7080. this.onFontLoaded();
  7081. }
  7082. closeSelf() {
  7083. this.hide();
  7084. }
  7085. regUser() {
  7086. this.ui.lab_tip.visible = false;
  7087. let ua = this.ui.txt_ua.text;
  7088. let up1 = this.ui.txt_up1.text;
  7089. let up2 = this.ui.txt_up2.text;
  7090. if (ua && up1 && up2 && up1 == up2) {
  7091. let reqData = JSON.stringify({
  7092. username: ua.trim(),
  7093. password: up1.trim(),
  7094. fromMark: 'app_game'
  7095. });
  7096. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7097. try {
  7098. console.log('zh:res = ' + JSON.stringify(res));
  7099. let code = res.code;
  7100. let msg = res.msg;
  7101. xGame.uiMgr.Show(UIMsg, msg);
  7102. if (code == 200) {
  7103. this.ui.lab_tip.color = "#FFFFFF";
  7104. xGame.uiMgr.Show(UIMsg, msg);
  7105. this.closeSelf();
  7106. }
  7107. else {
  7108. this.ui.lab_tip.color = "#FF0000";
  7109. xGame.uiMgr.Show(UIMsg, msg);
  7110. }
  7111. }
  7112. catch (error) {
  7113. console.log('error=' + error);
  7114. alert(error);
  7115. }
  7116. finally {
  7117. }
  7118. });
  7119. }
  7120. else {
  7121. if (up1 != up2) {
  7122. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7123. }
  7124. else {
  7125. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7126. }
  7127. }
  7128. }
  7129. gotoLogin() {
  7130. this.closeSelf();
  7131. xGame.uiMgr.Show(UILogin);
  7132. }
  7133. }
  7134. UIReg.uiName = "UIReg";
  7135. class ui_UIFuli1 extends fgui.GComponent {
  7136. static createInstance() {
  7137. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7138. }
  7139. onConstruct() {
  7140. this.n1 = (this.getChild("n1"));
  7141. this.n2 = (this.getChild("n2"));
  7142. }
  7143. }
  7144. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7145. class UIFuli1 extends UIBase {
  7146. constructor() {
  7147. super();
  7148. this.jiage = 4.99;
  7149. }
  7150. onConstructor() {
  7151. this.ui = ui_UIFuli1.createInstance();
  7152. this.contentPane = this.ui;
  7153. this.isEject = false;
  7154. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7155. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7156. }
  7157. show() {
  7158. super.show();
  7159. this.x = (Laya.stage.width - this.width) / 2;
  7160. this.y = (Laya.stage.height - this.height) / 2;
  7161. this.ui.n2.txt_price.text = "$" + this.jiage;
  7162. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  7163. this.setGlobalFont(this.ui);
  7164. }
  7165. closeSelf() {
  7166. DataMgr.loadUserSpOrderForAd();
  7167. this.hide();
  7168. }
  7169. gotoBuy() {
  7170. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7171. if (userInfo != null) {
  7172. let token = userInfo.token;
  7173. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7174. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7175. DataMgr.loadUserSpOrderForAd();
  7176. return;
  7177. }
  7178. else {
  7179. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7180. }
  7181. }
  7182. gotoBuy2() {
  7183. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7184. if (userInfo == null) {
  7185. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7186. return;
  7187. }
  7188. let reqData = xGame.httpMgr.getReqData();
  7189. let pd = JSON.parse(reqData);
  7190. pd.productId = 1;
  7191. reqData = JSON.stringify(pd);
  7192. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7193. try {
  7194. console.log('zh:buySp res = ' + JSON.stringify(res));
  7195. let code = res.code;
  7196. let msg = res.msg;
  7197. if (code == 401) {
  7198. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7199. alert(TIP_MSG_key.loginTimeOut);
  7200. xGame.uiMgr.Show(UIMsg, msg);
  7201. return;
  7202. }
  7203. if (code == 200) {
  7204. xGame.uiMgr.Show(UIMsg, msg);
  7205. DataMgr.loadUserSpOrderForAd();
  7206. DataMgr.getUserZiChanInfo(false);
  7207. this.closeSelf();
  7208. }
  7209. else {
  7210. xGame.uiMgr.Show(UIMsg, msg);
  7211. }
  7212. }
  7213. catch (error) {
  7214. console.log('error=' + error);
  7215. alert(error);
  7216. }
  7217. finally {
  7218. }
  7219. });
  7220. }
  7221. }
  7222. UIFuli1.uiName = "UIFuli1";
  7223. class ui_UIFuli2 extends fgui.GComponent {
  7224. static createInstance() {
  7225. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7226. }
  7227. onConstruct() {
  7228. this.n1 = (this.getChild("n1"));
  7229. this.n2 = (this.getChild("n2"));
  7230. }
  7231. }
  7232. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7233. class UIFuli2 extends UIBase {
  7234. constructor() {
  7235. super();
  7236. this.jiage = 14.99;
  7237. }
  7238. onConstructor() {
  7239. this.ui = ui_UIFuli2.createInstance();
  7240. this.contentPane = this.ui;
  7241. this.isEject = false;
  7242. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7243. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7244. }
  7245. show() {
  7246. super.show();
  7247. this.x = (Laya.stage.width - this.width) / 2;
  7248. this.y = (Laya.stage.height - this.height) / 2;
  7249. this.ui.n2.txt_price.text = "$" + this.jiage;
  7250. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  7251. this.setGlobalFont(this.ui);
  7252. }
  7253. closeSelf() {
  7254. DataMgr.loadUserSpOrderForAd();
  7255. this.hide();
  7256. }
  7257. gotoBuy() {
  7258. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7259. if (userInfo != null) {
  7260. let token = userInfo.token;
  7261. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7262. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7263. DataMgr.loadUserSpOrderForAd();
  7264. return;
  7265. }
  7266. else {
  7267. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7268. }
  7269. }
  7270. gotoBuy1() {
  7271. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7272. if (userInfo == null) {
  7273. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7274. return;
  7275. }
  7276. let reqData = xGame.httpMgr.getReqData();
  7277. let pd = JSON.parse(reqData);
  7278. pd.productId = 2;
  7279. reqData = JSON.stringify(pd);
  7280. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7281. try {
  7282. console.log('zh:buySp res = ' + JSON.stringify(res));
  7283. let code = res.code;
  7284. let msg = res.msg;
  7285. if (code == 401) {
  7286. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7287. alert(TIP_MSG_key.loginTimeOut);
  7288. xGame.uiMgr.Show(UIMsg, msg);
  7289. return;
  7290. }
  7291. if (code == 200) {
  7292. xGame.uiMgr.Show(UIMsg, msg);
  7293. DataMgr.loadUserSpOrderForAd();
  7294. DataMgr.getUserZiChanInfo(false);
  7295. this.closeSelf();
  7296. }
  7297. else {
  7298. xGame.uiMgr.Show(UIMsg, msg);
  7299. }
  7300. }
  7301. catch (error) {
  7302. console.log('error=' + error);
  7303. alert(error);
  7304. }
  7305. finally {
  7306. }
  7307. });
  7308. }
  7309. }
  7310. UIFuli2.uiName = "UIFuli2";
  7311. class ui_UIGetAward extends fgui.GComponent {
  7312. static createInstance() {
  7313. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7314. }
  7315. onConstruct() {
  7316. this.n4 = (this.getChild("n4"));
  7317. this.n0 = (this.getChild("n0"));
  7318. this.myList = (this.getChild("myList"));
  7319. this.n1 = (this.getChild("n1"));
  7320. this.eftNode = (this.getChild("eftNode"));
  7321. this.btnNode = (this.getChild("btnNode"));
  7322. this.t0 = this.getTransition("t0");
  7323. }
  7324. }
  7325. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7326. class UIGetAward extends UIBase {
  7327. constructor() {
  7328. super();
  7329. this.showTriple = true;
  7330. }
  7331. onConstructor() {
  7332. this.ui = ui_UIGetAward.createInstance();
  7333. this.contentPane = this.ui;
  7334. this.isEject = false;
  7335. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7336. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7337. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7338. }
  7339. show(arr, showTriple, callback) {
  7340. super.show();
  7341. this.ui.t0.play();
  7342. this.ui.eftNode.visible = true;
  7343. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7344. this.ui.eftNode.visible = false;
  7345. }), 1, 0, 0, 0.9);
  7346. this.awardArr = arr;
  7347. this.showTriple = showTriple;
  7348. this.callback = callback;
  7349. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7350. this.ui.myList.numItems = arr.length;
  7351. xGame.soundMgr.playSound("getaward");
  7352. this.setGlobalFont(this.ui);
  7353. }
  7354. updateSelf(index, obj) {
  7355. let temp = this.awardArr[index];
  7356. let icon = this.getIcon(temp.type);
  7357. let str = icon;
  7358. if (temp.type > 2) {
  7359. str = "s" + icon;
  7360. }
  7361. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7362. obj.myIcon.rotation = 0;
  7363. obj.numTxt.text = temp.num + "";
  7364. obj.numTxt.visible = temp.type > 2 ? false : true;
  7365. obj.nameTxt.text = this.getNameStr(temp.type);
  7366. }
  7367. renderItem(index, obj) {
  7368. this.updateSelf(index, obj);
  7369. }
  7370. tripleGetAward() {
  7371. console.log('zh:qjff_AD_for_uigetAward');
  7372. if (Laya.Browser.onAndroid) {
  7373. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7374. if (!boo) {
  7375. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7376. return;
  7377. }
  7378. }
  7379. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7380. }
  7381. else {
  7382. console.log('zh:AD 失败,直接发放奖励');
  7383. this.qjff_AD_for_uigetAward();
  7384. }
  7385. }
  7386. qjff_AD_for_uigetAward() {
  7387. this.getAward(3);
  7388. }
  7389. normalGetAward() {
  7390. if (PlatMgr.isMisVideo())
  7391. this.tripleGetAward();
  7392. else
  7393. this.getAward();
  7394. }
  7395. getAward(times = 1) {
  7396. this.hide();
  7397. for (let index = 0; index < this.awardArr.length; index++) {
  7398. this.awardArr[index].num *= times;
  7399. }
  7400. this.callback && this.callback(times != 1);
  7401. }
  7402. getIcon(type) {
  7403. switch (type) {
  7404. case Prop.diamond:
  7405. return "ty_zs";
  7406. case Prop.coin:
  7407. return "ty_jb";
  7408. case Prop.gan1:
  7409. return "qg1";
  7410. case Prop.gan2:
  7411. return "qg2";
  7412. case Prop.gan3:
  7413. return "qg3";
  7414. case Prop.gan4:
  7415. return "qg4";
  7416. default:
  7417. break;
  7418. }
  7419. }
  7420. getNameStr(type) {
  7421. switch (type) {
  7422. case Prop.diamond:
  7423. return "Diamond";
  7424. case Prop.coin:
  7425. return "Coins";
  7426. case Prop.gan1:
  7427. case Prop.gan2:
  7428. case Prop.gan3:
  7429. case Prop.gan4:
  7430. return cfgTable.ballrodData[type - 1].name;
  7431. default:
  7432. break;
  7433. }
  7434. }
  7435. }
  7436. UIGetAward.uiName = "UIGetAward";
  7437. class ui_UIRepentProp extends fgui.GComponent {
  7438. static createInstance() {
  7439. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7440. }
  7441. onConstruct() {
  7442. this.c1 = this.getController("c1");
  7443. this.n11 = (this.getChild("n11"));
  7444. this.regretNode = (this.getChild("regretNode"));
  7445. this.helpLineNode = (this.getChild("helpLineNode"));
  7446. this.t0 = this.getTransition("t0");
  7447. }
  7448. }
  7449. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7450. class UIRepentProp extends UIBase {
  7451. constructor() {
  7452. super();
  7453. this.viewType = 0;
  7454. this.regretType = 0;
  7455. }
  7456. onConstructor() {
  7457. this.ui = ui_UIRepentProp.createInstance();
  7458. this.contentPane = this.ui;
  7459. this.isEject = false;
  7460. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7461. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7462. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7463. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7464. }
  7465. show(viewType, regretType, callback) {
  7466. PlatMgr.showInsert(true);
  7467. this.viewType = viewType;
  7468. this.regretType = regretType;
  7469. this.callback = callback;
  7470. super.show();
  7471. this.ui.t0.play();
  7472. this.ui.c1.selectedIndex = this.viewType;
  7473. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7474. if (this.viewType == 0) {
  7475. let guide = DataMgr.getGuideHelpLine();
  7476. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7477. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7478. }
  7479. xGame.common.gameMgr.gamePause = true;
  7480. this.setGlobalFont(this.ui);
  7481. }
  7482. hideSelf() {
  7483. xGame.common.gameMgr.gamePause = false;
  7484. this.callback && this.callback(false);
  7485. this.hide();
  7486. }
  7487. videoRegret() {
  7488. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7489. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7490. }
  7491. else {
  7492. console.log('zh:AD 失败,直接发放奖励');
  7493. this.qjff_AD_for_UIrepentProp_videoRegret();
  7494. }
  7495. }
  7496. qjff_AD_for_UIrepentProp_videoRegret() {
  7497. this.callback && this.callback(true);
  7498. this.hideSelf();
  7499. }
  7500. videoAddHelpLine() {
  7501. let guide = DataMgr.getGuideHelpLine();
  7502. if (guide == 0) {
  7503. this.callback && this.callback(true);
  7504. this.hideSelf();
  7505. DataMgr.setGuideHelpLine();
  7506. xGame.common.gameUI.ui.guideNode.visible = false;
  7507. }
  7508. else {
  7509. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7510. if (Laya.Browser.onAndroid) {
  7511. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7512. if (!boo) {
  7513. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7514. return;
  7515. }
  7516. }
  7517. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7518. }
  7519. else {
  7520. console.log('zh:AD 失败,直接发放奖励');
  7521. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7522. }
  7523. }
  7524. }
  7525. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7526. this.callback && this.callback(true);
  7527. this.hideSelf();
  7528. }
  7529. }
  7530. UIRepentProp.uiName = "UIRepentProp";
  7531. class UIMain extends UIBase {
  7532. constructor() {
  7533. super();
  7534. this.firstEnter = true;
  7535. }
  7536. nativeCallJs(msg) {
  7537. let t = msg;
  7538. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7539. switch (t) {
  7540. case 'qjff_chouJiang':
  7541. let dui = xGame.uiMgr.getUI(UIDraw);
  7542. dui.qjff_chouJiang();
  7543. break;
  7544. case 'qjff_AD_for_uisign':
  7545. let dui2 = xGame.uiMgr.getUI(UISign);
  7546. dui2.qjff_AD_for_uisign();
  7547. break;
  7548. case 'qjff_AD_for_uitry':
  7549. let dui3 = xGame.uiMgr.getUI(UITry);
  7550. dui3.qjff_AD_for_uitry();
  7551. break;
  7552. case 'qjff_AD_for_uipower':
  7553. let dui4 = xGame.uiMgr.getUI(UIPower);
  7554. dui4.qjff_AD_for_uipower();
  7555. break;
  7556. case 'qjff_AD_for_uigetAward':
  7557. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7558. dui5.qjff_AD_for_uigetAward();
  7559. break;
  7560. case 'qjff_AD_for_uiGameEnd':
  7561. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7562. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7563. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7564. break;
  7565. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7566. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7567. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7568. break;
  7569. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7570. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7571. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7572. break;
  7573. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7574. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7575. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7576. break;
  7577. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7578. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7579. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7580. break;
  7581. case 'qjff_AD_for_UIBOX_onOpenBox':
  7582. let dui11 = xGame.uiMgr.getUI(UIBox);
  7583. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7584. break;
  7585. case 'qjff_AD_for_UIAddCoin':
  7586. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7587. dui12.qjff_AD_for_UIAddCoin();
  7588. break;
  7589. case 'app_sign_for_buyProduct_onSuccess':
  7590. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7591. DataMgr.getUserZiChanInfo(false);
  7592. break;
  7593. case '222axxxxxx':
  7594. let dui15 = xGame.uiMgr.getUI(UISign);
  7595. dui15.qjff_AD_for_uisign();
  7596. break;
  7597. case '333axsxxxxxx':
  7598. let dui16 = xGame.uiMgr.getUI(UISign);
  7599. dui16.qjff_AD_for_uisign();
  7600. break;
  7601. default:
  7602. console.log('zh:未知的方法名字' + t);
  7603. break;
  7604. }
  7605. }
  7606. onConstructor() {
  7607. console.log('zh: UIMain onConstructor');
  7608. this.ui = ui_UIMain.createInstance();
  7609. this.contentPane = this.ui;
  7610. this.isEject = false;
  7611. this.addEvent();
  7612. this.addClickSpine();
  7613. this.settingNode = new SettingNode(this.ui.settingNode);
  7614. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7615. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7616. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7617. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7618. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7619. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7620. let curUse = DataMgr.getCurSecretary();
  7621. this.changeSecretary(curUse);
  7622. this.ui.talkNode.visible = false;
  7623. let guide = DataMgr.getSkillGuide();
  7624. if (xGame.common.isNewDay && guide == 1) {
  7625. xGame.common.isNewDay = false;
  7626. xGame.soundMgr.playSound("s_main01");
  7627. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7628. console.log("zh:播放小秘书每天语音");
  7629. }
  7630. this.onGetUserInfo();
  7631. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7632. DataMgr.getUserZiChanInfo(false);
  7633. }
  7634. this.ui.n83.visible = false;
  7635. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7636. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7637. let ua = d.username;
  7638. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7639. }
  7640. this.c_btn_for_user();
  7641. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7642. }
  7643. Logout() {
  7644. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7645. LocalStorageManager.removeItem(keyForLoginInfo);
  7646. this.freshUser();
  7647. }
  7648. JSBridgeUtils.instance.loginOutForApp();
  7649. this.setUserDefaultNickname();
  7650. DataMgr.setCoin2(4000);
  7651. DataMgr.setDiamond2(0);
  7652. this.setDefaultQiuGanInfo();
  7653. DataMgr.setPlaceBallLevelList("");
  7654. DataMgr.setChallengeMode_overLev(1);
  7655. this.setDefaultSignData();
  7656. }
  7657. setDefaultSignData() {
  7658. DataMgr.setSignData(1);
  7659. DataMgr.setSignTime(new Date().getTime());
  7660. }
  7661. setDefaultQiuGanInfo() {
  7662. DataMgr.setBallRod(0, 1);
  7663. DataMgr.setBallRod(1, 0);
  7664. DataMgr.setBallRod(2, 0);
  7665. DataMgr.setBallRod(3, 0);
  7666. DataMgr.setBallRod(4, 0);
  7667. DataMgr.setBallRod(5, 1);
  7668. }
  7669. setUserDefaultNickname() {
  7670. let defUsername = "player";
  7671. this.ui.headNode.nameTxt.text = defUsername;
  7672. DataMgr.updateUserNickName(defUsername);
  7673. Moyu.updateUserInfo(defUsername);
  7674. }
  7675. gotoLogin() {
  7676. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7677. xGame.uiMgr.Show(UILogin);
  7678. }
  7679. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7680. this.Logout();
  7681. }
  7682. }
  7683. gotoRegUser() {
  7684. xGame.uiMgr.Show(UIReg);
  7685. }
  7686. showFuLiSp1() {
  7687. console.log('zh:福利1');
  7688. this.checkForShowFuLi17(1);
  7689. }
  7690. showFuLiSp7() {
  7691. console.log('zh:福利7');
  7692. this.checkForShowFuLi17(7);
  7693. }
  7694. checkForShowFuLi17(spid) {
  7695. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7696. if (userInfo == null) {
  7697. if (spid === 1) {
  7698. xGame.uiMgr.Show(UIFuli1);
  7699. }
  7700. if (spid === 7) {
  7701. xGame.uiMgr.Show(UIFuli2);
  7702. }
  7703. return;
  7704. }
  7705. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7706. let reqData = xGame.httpMgr.getReqData();
  7707. let pd = JSON.parse(reqData);
  7708. pd.productId = spid;
  7709. reqData = JSON.stringify(pd);
  7710. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7711. try {
  7712. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7713. let code = res.code;
  7714. let msg = res.msg;
  7715. if (code == 401) {
  7716. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7717. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7718. return;
  7719. }
  7720. if (code == 200) {
  7721. let isBuyOk = res.data;
  7722. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7723. if (isBuyOk === false) {
  7724. if (spid === 1) {
  7725. xGame.uiMgr.Show(UIFuli1);
  7726. }
  7727. if (spid === 7) {
  7728. xGame.uiMgr.Show(UIFuli2);
  7729. }
  7730. }
  7731. else {
  7732. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7733. }
  7734. }
  7735. else {
  7736. xGame.uiMgr.Show(UIMsg, msg);
  7737. }
  7738. }
  7739. catch (error) {
  7740. console.log('error=' + error);
  7741. alert(error);
  7742. }
  7743. finally {
  7744. }
  7745. });
  7746. }
  7747. c_btn_for_user() {
  7748. this.ui.n_dengLu.c1.selectedIndex = 0;
  7749. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7750. this.ui.n_dengLu.c1.selectedIndex = 1;
  7751. }
  7752. else {
  7753. this.ui.n_dengLu.c1.selectedIndex = 0;
  7754. }
  7755. }
  7756. changeSecretary(curUse) {
  7757. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7758. xGame.common.secretary && xGame.common.secretary.dispose();
  7759. this.addSecretarySpine(name);
  7760. }
  7761. addSecretarySpine(name) {
  7762. let spine = new SpineMgr(name, () => {
  7763. this.playSecretaryIdle();
  7764. });
  7765. xGame.common.secretary = spine;
  7766. }
  7767. addClickSpine() {
  7768. let clickSpine = new SpineMgr("dianji", () => {
  7769. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7770. let parent = Laya.stage;
  7771. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7772. clickSpine.play(data, 0, false, parent, (spine) => {
  7773. spine.destroy(true);
  7774. });
  7775. });
  7776. });
  7777. }
  7778. addEvent() {
  7779. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7780. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7781. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7782. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7783. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7784. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7785. this.addUIClick(this.ui, this.interuptSecretary);
  7786. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7787. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7788. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7789. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7790. this.addUIClick(this.ui.signBtn, this.openSignView);
  7791. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7792. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7793. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7794. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7795. }
  7796. show(showFailWords) {
  7797. super.show();
  7798. DataMgr.loadUserSpOrderForAd();
  7799. this.moneyNode.ui.c1.selectedIndex = 1;
  7800. this.playSecretaryIdle();
  7801. xGame.soundMgr.playMusic("caromhall01", 0);
  7802. Laya.timer.clearAll(this);
  7803. this.playSecretaryRandomSound();
  7804. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7805. if (showFailWords) {
  7806. console.log('zh:uimain.ts ');
  7807. setTimeout(() => {
  7808. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7809. let words = -1;
  7810. if (str == "s_main02") {
  7811. words = 2;
  7812. }
  7813. else {
  7814. words = 3;
  7815. }
  7816. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7817. xGame.soundMgr.playSound(str);
  7818. }, 300);
  7819. }
  7820. this.showGuide();
  7821. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7822. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7823. let guide = DataMgr.getSkillGuide();
  7824. if (guide == 1) {
  7825. let randTime = xGame.common.randomNum(300, 800);
  7826. if (this.firstEnter) {
  7827. console.log("zh: firstEnter");
  7828. this.firstEnter = false;
  7829. randTime += 900;
  7830. }
  7831. else {
  7832. console.log("zh: no firstEnter");
  7833. }
  7834. Laya.timer.once(randTime, this, () => {
  7835. });
  7836. Laya.timer.once(1000, this, () => {
  7837. console.log('zh: 1秒后 showFuLiSp1');
  7838. this.showFuLiSp1();
  7839. });
  7840. Laya.timer.once(10000, this, () => {
  7841. console.log('zh: 10秒后 showFuLiSp1');
  7842. this.showFuLiSp7();
  7843. });
  7844. }
  7845. this.setGlobalFont(this.ui);
  7846. }
  7847. checkActive(show) {
  7848. }
  7849. showGuide() {
  7850. let guide = DataMgr.getSkillGuide();
  7851. this.ui.guideBtn.visible = guide == 0;
  7852. this.ui.enterGuide.visible = false;
  7853. this.ui.secretaryGuide.visible = guide == 0;
  7854. if (guide == 0) {
  7855. console.log("zh:显示引导");
  7856. xGame.soundMgr.playSound("s_guide");
  7857. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7858. }
  7859. else {
  7860. console.log("zh:不需要显示引导");
  7861. }
  7862. }
  7863. ensureSecretary() {
  7864. console.log('zh: ensureSecretary ');
  7865. this.ui.secretaryGuide.visible = false;
  7866. this.ui.enterGuide.visible = true;
  7867. this.ui.wordsNode.t0.play();
  7868. if (DataMgr.getNewUser())
  7869. Moyu.sendDataEvent("gameReady");
  7870. }
  7871. playSecretaryIdle() {
  7872. let parent = this.ui.secretary.displayObject;
  7873. parent.destroyChildren();
  7874. let xx = this.ui.secretary.width / 2;
  7875. let yy = this.ui.secretary.height;
  7876. let scale = xGame.common.getSecretaryScale();
  7877. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7878. xGame.common.secretary.play(data, 0, true, parent);
  7879. }
  7880. startGame(type) {
  7881. if (!this.isReadyForLoadNetSource()) {
  7882. return;
  7883. }
  7884. xGame.common.gameMode = type;
  7885. Moyu.sendDataEvent("PlayGame", { type: type });
  7886. let gm = xGame.common.gameMode;
  7887. console.log('zh:进入游戏gameMode =' + gm);
  7888. switch (gm) {
  7889. case GameMode.classic:
  7890. console.log('zh:进入经典模式111111111');
  7891. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7892. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7893. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7894. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7895. console.log('zh:判断是否可以玩该模式classic =NO');
  7896. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7897. xGame.uiMgr.Show(UIMsg, tipStr);
  7898. return;
  7899. }
  7900. else {
  7901. console.log('zh:可以玩该模式classic');
  7902. this.beginGame();
  7903. }
  7904. }
  7905. else {
  7906. console.log('zh:不需要判断是否可以玩该classic');
  7907. let challengeTimes = DataMgr.getChallengeTimes();
  7908. if (challengeTimes == 0) {
  7909. xGame.uiMgr.Show(UIInvitation);
  7910. }
  7911. else {
  7912. this.beginGame();
  7913. }
  7914. }
  7915. break;
  7916. case GameMode.bigMove:
  7917. console.info('zh:bigMove check 大招');
  7918. let guide = DataMgr.getSkillGuide();
  7919. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7920. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7921. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7922. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7923. console.log('zh:提示不可以玩');
  7924. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7925. xGame.uiMgr.Show(UIMsg, tipStr);
  7926. return;
  7927. }
  7928. else {
  7929. console.log('zh:可以玩该模式 bigMove');
  7930. this.beginGame();
  7931. if (DataMgr.getNewUser())
  7932. Moyu.sendDataEvent("gameStart0");
  7933. }
  7934. }
  7935. else {
  7936. this.beginGame();
  7937. if (DataMgr.getNewUser())
  7938. Moyu.sendDataEvent("gameStart0");
  7939. }
  7940. break;
  7941. default:
  7942. console.error('zh:未知错误!!!!');
  7943. break;
  7944. }
  7945. }
  7946. beginGame(isNice = false) {
  7947. console.log('zh:beginGame ');
  7948. let guide = DataMgr.getSkillGuide();
  7949. if (guide == 1) {
  7950. console.log('zh:非新手引导,showInternAd ');
  7951. JSBridgeUtils.instance.showInternAd('beginGame');
  7952. }
  7953. else {
  7954. console.log('zh:新手引导,不显示AD ');
  7955. }
  7956. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7957. console.log('zh:beginGame 1');
  7958. if (xGame.common.gameMode == GameMode.classic) {
  7959. console.log('zh:beginGame 2');
  7960. if (isNice) {
  7961. console.log('zh:进入巅峰赛');
  7962. this.enterClassic();
  7963. }
  7964. else {
  7965. console.log('zh:beginGame 3-1');
  7966. xGame.uiMgr.Show(UIModeSelection, () => {
  7967. console.log('zh:beginGame 3-2');
  7968. this.enterClassic();
  7969. });
  7970. }
  7971. }
  7972. else if (xGame.common.gameMode == GameMode.bigMove) {
  7973. console.log('zh:beginGame 5');
  7974. this.ui.enterGuide.visible = false;
  7975. xGame.uiMgr.Show(UISkill);
  7976. }
  7977. }
  7978. enterClassic() {
  7979. console.log('zh:beginGame 7');
  7980. xGame.uiMgr.Show(UIGame);
  7981. xGame.uiMgr.Show(UIMatching, () => {
  7982. if (!this.isHide)
  7983. this.hide();
  7984. xGame.common.gameUI.ui.alpha = 1;
  7985. console.log('zh:beginGame 8');
  7986. xGame.common.gameUI.startGame();
  7987. xGame.uiMgr.Hide(UIGameEnd);
  7988. });
  7989. }
  7990. start_debug_for_moni_payOk() {
  7991. console.log('zh:start_debug_for_moni_payOk');
  7992. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7993. if (userInfo != null) {
  7994. let token = userInfo.token;
  7995. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7996. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7997. alert('模拟支付OK');
  7998. return;
  7999. }
  8000. else {
  8001. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8002. }
  8003. }
  8004. startGlobal() {
  8005. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  8006. }
  8007. startWeekly() {
  8008. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  8009. }
  8010. zhouSaiMonth() {
  8011. console.log('zh: zhouSaiMonth 被调用');
  8012. }
  8013. isReadyForLoadNetSource() {
  8014. let reqCount = xGame.cfgMgr.httpReqCount;
  8015. let ok = xGame.cfgMgr.httpReqOkCount;
  8016. if (reqCount > ok) {
  8017. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  8018. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  8019. Laya.timer.once(5000, this, () => {
  8020. let retryCount = 0;
  8021. const maxRetries = 3;
  8022. const tryFetchConfig = () => {
  8023. try {
  8024. xGame.cfgMgr.getConfigFromServer();
  8025. }
  8026. catch (error) {
  8027. if (retryCount < maxRetries) {
  8028. retryCount++;
  8029. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8030. Laya.timer.once(5000, this, tryFetchConfig);
  8031. }
  8032. else {
  8033. console.error("❌ 达到最大重试次数,配置获取失败");
  8034. }
  8035. }
  8036. };
  8037. tryFetchConfig();
  8038. });
  8039. return false;
  8040. }
  8041. return true;
  8042. }
  8043. startPlaceBall() {
  8044. if (!this.isReadyForLoadNetSource()) {
  8045. return;
  8046. }
  8047. xGame.uiMgr.Show(UILevelDisplay);
  8048. }
  8049. hide() {
  8050. console.log('zh:uimain hide ...');
  8051. super.hide();
  8052. xGame.common.stopGirlPop(this.ui.talkNode);
  8053. }
  8054. onGetUserInfo(force = false) {
  8055. if (Moyu.isWx) {
  8056. let info = Moyu.getSystemInfo();
  8057. if (info)
  8058. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8059. }
  8060. else {
  8061. Moyu.initUser(this, this.freshUser, force);
  8062. }
  8063. this.freshUser();
  8064. console.log('zh:5秒后更新用户信息');
  8065. setTimeout(() => {
  8066. DataMgr.getUserZiChanInfo(true);
  8067. }, 5000);
  8068. }
  8069. event_login_in() {
  8070. console.log("zh:event_login_in被触发");
  8071. this.freshUser();
  8072. }
  8073. freshUser() {
  8074. let user = Moyu.getUserInfo();
  8075. if (!user.isAuth) {
  8076. user.headIcon = 'res/ty_touxiang.png';
  8077. }
  8078. else {
  8079. DataMgr.upRankData();
  8080. }
  8081. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8082. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8083. let keyStr = keyForLoginInfo;
  8084. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8085. const d = LocalStorageManager.getItem(keyStr);
  8086. let ua = d.username;
  8087. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8088. }
  8089. else {
  8090. }
  8091. this.c_btn_for_user();
  8092. }
  8093. interuptSecretary() {
  8094. Laya.timer.clearAll(this);
  8095. this.playSecretaryRandomSound();
  8096. }
  8097. playSecretaryRandomSound() {
  8098. if (this.isHide)
  8099. return;
  8100. let time = xGame.common.randomNum(45000, 60000);
  8101. Laya.timer.once(time, this, () => {
  8102. if (this.isHide)
  8103. return;
  8104. let index = xGame.common.randomNum(4, 7);
  8105. xGame.soundMgr.playSound("s_main0" + index);
  8106. let words = 1;
  8107. switch (index) {
  8108. case 4:
  8109. words = 5;
  8110. break;
  8111. case 5:
  8112. words = 3;
  8113. break;
  8114. case 6:
  8115. words = 6;
  8116. break;
  8117. case 7:
  8118. words = 7;
  8119. break;
  8120. default:
  8121. break;
  8122. }
  8123. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8124. this.playSecretaryRandomSound();
  8125. });
  8126. }
  8127. openSecretaryView() {
  8128. xGame.uiMgr.Show(UISecretary);
  8129. Moyu.sendDataEvent("secretary");
  8130. }
  8131. openShopView() {
  8132. xGame.uiMgr.Show(UIShop, 1);
  8133. }
  8134. openShopView0() {
  8135. xGame.uiMgr.Show(UIShop, 0);
  8136. }
  8137. openSignView() {
  8138. xGame.uiMgr.Show(UISign);
  8139. }
  8140. openDrawView() {
  8141. xGame.uiMgr.Show(UIDraw);
  8142. }
  8143. openRanking() {
  8144. console.log('zh:phb openRanking');
  8145. xGame.uiMgr.Show(UIRanking);
  8146. Moyu.sendDataEvent("rankingList");
  8147. }
  8148. }
  8149. UIMain.uiName = "UIMain";
  8150. class UIGameEnd extends UIBase {
  8151. constructor() {
  8152. super();
  8153. this.success = false;
  8154. this.awardCoinNum = 1000;
  8155. this.awardDiamondNum = 10;
  8156. }
  8157. onConstructor() {
  8158. this.ui = ui_UIGameEnd.createInstance();
  8159. this.contentPane = this.ui;
  8160. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8161. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8162. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8163. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8164. this.ui.talkNode.visible = false;
  8165. if (Moyu.isKs)
  8166. this.ui.closeNode.closeBtn.x += 100;
  8167. }
  8168. updateType() {
  8169. switch (xGame.common.gameMode) {
  8170. case GameMode.classic:
  8171. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8172. this.ui.coinNode.visible = this.success;
  8173. if (!this.success) {
  8174. Laya.timer.once(500, this, () => {
  8175. xGame.uiMgr.Show(UIAddCoin);
  8176. });
  8177. }
  8178. else {
  8179. this.logEventForClassic_win();
  8180. }
  8181. this.logEventForClassic_complete();
  8182. this.ui.isGetAward.visible = false;
  8183. this.ui.leftBtn.c1.selectedIndex = 3;
  8184. this.ui.rightBtn.c1.selectedIndex = 0;
  8185. this.moneyNode.ui.c1.selectedIndex = 1;
  8186. break;
  8187. case GameMode.bigMove:
  8188. console.log('zh:招法模式 aaaaaa bigMove');
  8189. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8190. this.ui.coinNode.visible = this.success;
  8191. if (xGame.common.gameMode == GameMode.bigMove) {
  8192. if (this.success) {
  8193. DataMgr.setSkillSuccessTimes(1, true);
  8194. DataMgr.setSkillAccTimes(1);
  8195. }
  8196. else {
  8197. DataMgr.setSkillSuccessTimes(0, false);
  8198. }
  8199. }
  8200. this.logEventForRod_complete_N();
  8201. if (!this.success) {
  8202. Laya.timer.once(500, this, () => {
  8203. xGame.uiMgr.Show(UIAddCoin);
  8204. });
  8205. }
  8206. else {
  8207. this.logEventForRod_win();
  8208. }
  8209. this.ui.isGetAward.visible = false;
  8210. this.ui.leftBtn.c1.selectedIndex = 3;
  8211. this.ui.rightBtn.c1.selectedIndex = 0;
  8212. this.moneyNode.ui.c1.selectedIndex = 1;
  8213. break;
  8214. case GameMode.placeBall:
  8215. this.ui.coinNode.visible = false;
  8216. if (this.success) {
  8217. if (xGame.common.placeBallStarNum == 3) {
  8218. this.ui.c1.selectedIndex = 2;
  8219. }
  8220. else {
  8221. this.ui.c1.selectedIndex = 3;
  8222. }
  8223. let level = xGame.common.placeBallCurLevel;
  8224. if (level > 59) {
  8225. this.logEventForChallenge_level_complete(level);
  8226. }
  8227. else {
  8228. this.logEventForChallenge_level_N(level);
  8229. }
  8230. }
  8231. else {
  8232. this.ui.c1.selectedIndex = 4;
  8233. }
  8234. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8235. if (cfg.type == PlaceBallType.challenge) {
  8236. this.ui.c1.selectedIndex = 2;
  8237. }
  8238. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8239. this.updatePlaceBallBtn();
  8240. this.updatePlaceBallStarNum();
  8241. this.updatePlaceBallAwardState();
  8242. this.moneyNode.ui.c1.selectedIndex = 2;
  8243. this.moneyNode.checkPowerTime();
  8244. this.moneyNode.powerChange();
  8245. DataMgr.upRankData();
  8246. break;
  8247. default:
  8248. break;
  8249. }
  8250. }
  8251. logEventForRod_complete_N() {
  8252. let gfmsIdx = xGame.common.curPlayerSkillType;
  8253. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8254. let gfmc = 'Skyfall Shot';
  8255. if (gfmsIdx == 0) {
  8256. gfmc = 'Skyfall Shot';
  8257. }
  8258. if (gfmsIdx == 1) {
  8259. gfmc = 'Surging break';
  8260. }
  8261. if (gfmsIdx == 2) {
  8262. gfmc = 'Frost Lock';
  8263. }
  8264. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8265. console.log('zh:logEventForRod_complete_N level = ' + level);
  8266. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8267. let jsonStr = {
  8268. "count": 0,
  8269. "name": gfmc
  8270. };
  8271. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8272. const d = LocalStorageManager.getItem(keyStr);
  8273. jsonStr.count = d.count + 1;
  8274. LocalStorageManager.setItem(keyStr, jsonStr);
  8275. }
  8276. else {
  8277. LocalStorageManager.setItem(keyStr, jsonStr);
  8278. }
  8279. const d2 = LocalStorageManager.getItem(keyStr);
  8280. let count = d2.count;
  8281. console.log('zh:logEventForRod_complete_N count = ' + count);
  8282. if (count % 5 == 0) {
  8283. const reqStr = JSON.stringify(jsonStr);
  8284. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8285. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8286. }
  8287. }
  8288. logEventForRod_win() {
  8289. console.log('zh:logEventForRod_win,胜利');
  8290. let gfmsIdx = xGame.common.curPlayerSkillType;
  8291. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8292. let gfmc = 'Skyfall Shot';
  8293. if (gfmsIdx == 0) {
  8294. gfmc = 'Skyfall Shot';
  8295. }
  8296. if (gfmsIdx == 1) {
  8297. gfmc = 'Surging break';
  8298. }
  8299. if (gfmsIdx == 2) {
  8300. gfmc = 'Frost Lock';
  8301. }
  8302. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8303. console.log('zh:logEventForRod_win level = ' + level);
  8304. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8305. let jsonStr = {
  8306. "count": 1,
  8307. "name": gfmc + ' Lev' + level
  8308. };
  8309. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8310. const d = LocalStorageManager.getItem(keyStr);
  8311. jsonStr.count = d.count + 1;
  8312. LocalStorageManager.setItem(keyStr, jsonStr);
  8313. }
  8314. else {
  8315. LocalStorageManager.setItem(keyStr, jsonStr);
  8316. }
  8317. const reqStr = JSON.stringify(jsonStr);
  8318. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8319. }
  8320. logEventForClassic_win() {
  8321. console.log('zh:logEventForClassic_win,胜利');
  8322. let rtype = xGame.common.classicRoomType;
  8323. let msmc = '';
  8324. if (rtype == 1) {
  8325. msmc = 'beginner';
  8326. }
  8327. if (rtype == 2) {
  8328. msmc = 'expert';
  8329. }
  8330. if (rtype == 3) {
  8331. msmc = 'master';
  8332. }
  8333. let keyStr = 'sjmd_classic_win_' + rtype;
  8334. let jsonStr = {
  8335. "difficulty": msmc,
  8336. "classic_count": 1,
  8337. "difficulty_count": 1
  8338. };
  8339. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8340. const d = LocalStorageManager.getItem(keyStr);
  8341. jsonStr.classic_count = d.classic_count + 1;
  8342. jsonStr.difficulty_count = d.difficulty_count + 1;
  8343. LocalStorageManager.setItem(keyStr, jsonStr);
  8344. }
  8345. else {
  8346. LocalStorageManager.setItem(keyStr, jsonStr);
  8347. }
  8348. const reqStr = JSON.stringify(jsonStr);
  8349. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8350. }
  8351. logEventForClassic_complete() {
  8352. console.log('zh:logEventForClassic_complete,胜利');
  8353. let rtype = xGame.common.classicRoomType;
  8354. let msmc = '';
  8355. if (rtype == 1) {
  8356. msmc = 'beginner';
  8357. }
  8358. if (rtype == 2) {
  8359. msmc = 'expert';
  8360. }
  8361. if (rtype == 3) {
  8362. msmc = 'master';
  8363. }
  8364. let keyStr = 'sjmd_classic_complete_' + rtype;
  8365. let jsonStr = {
  8366. "msmc": msmc,
  8367. "count": 0
  8368. };
  8369. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8370. const d = LocalStorageManager.getItem(keyStr);
  8371. jsonStr.count = d.count + 1;
  8372. LocalStorageManager.setItem(keyStr, jsonStr);
  8373. }
  8374. else {
  8375. LocalStorageManager.setItem(keyStr, jsonStr);
  8376. }
  8377. if (jsonStr.count % 5 == 0) {
  8378. const reqStr = JSON.stringify(jsonStr);
  8379. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8380. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8381. }
  8382. }
  8383. updatePlaceBallBtn() {
  8384. this.ui.leftBtn.c1.selectedIndex = 5;
  8385. if (this.success) {
  8386. this.ui.rightBtn.c1.selectedIndex = 14;
  8387. }
  8388. else {
  8389. if (xGame.common.placeBallStarNum == 3) {
  8390. this.ui.rightBtn.c1.selectedIndex = 14;
  8391. }
  8392. else {
  8393. this.ui.rightBtn.c1.selectedIndex = 1;
  8394. }
  8395. }
  8396. }
  8397. updatePlaceBallStarNum() {
  8398. let starNum = xGame.common.placeBallStarNum;
  8399. if (starNum == 0)
  8400. this.ui.starNumNode.c1.selectedIndex = 3;
  8401. else {
  8402. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8403. }
  8404. }
  8405. updatePlaceBallAwardState() {
  8406. let level = xGame.common.placeBallCurLevel;
  8407. let starNum = xGame.common.placeBallStarNum;
  8408. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8409. let data = cfgTable.placeballData[level].award;
  8410. let cfg = cfgTable.placeballData[level];
  8411. this.awardDiamondNum = data[1];
  8412. this.awardCoinNum = data[0];
  8413. if (cfg.type == PlaceBallType.challenge) {
  8414. this.awardDiamondNum = 0;
  8415. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8416. }
  8417. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8418. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8419. if (cfg.type == PlaceBallType.challenge) {
  8420. this.ui.awardNode.coinNode.visible = true;
  8421. }
  8422. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8423. this.ui.awardNode.diamondNode.x = 265;
  8424. this.ui.awardNode.coinNode.x = 354;
  8425. }
  8426. else {
  8427. this.ui.awardNode.diamondNode.x = 291;
  8428. this.ui.awardNode.coinNode.x = 291;
  8429. }
  8430. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8431. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8432. if (this.awardCoinNum == 0) {
  8433. this.ui.awardNode.coinNode.numTxt.text = "";
  8434. }
  8435. if (getAward) {
  8436. this.ui.isGetAward.visible = true;
  8437. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8438. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8439. }
  8440. else {
  8441. this.ui.isGetAward.visible = false;
  8442. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8443. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8444. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8445. }
  8446. else {
  8447. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8448. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8449. }
  8450. }
  8451. }
  8452. show(success) {
  8453. super.show();
  8454. xGame.eventMgr.event(RESET_GAME);
  8455. this.success = success;
  8456. Laya.timer.clearAll(this);
  8457. this.playSecretaryAni();
  8458. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8459. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8460. offsetTime = Math.floor(offsetTime / 1000);
  8461. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8462. this.updateType();
  8463. Laya.timer.once(200, this, () => {
  8464. this.addAward(() => {
  8465. this.updateType();
  8466. Laya.timer.once(500, this, () => {
  8467. this.showChallengeLevel();
  8468. });
  8469. });
  8470. });
  8471. if (this.success) {
  8472. JSBridgeUtils.instance.showInternAd('gameend_success');
  8473. console.log('zh:game end 成功');
  8474. xGame.soundMgr.playSound('slots_roll01');
  8475. xGame.soundMgr.playSound("s_win");
  8476. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8477. this.diyGameDataUtilForGameWin();
  8478. this.updateGamePlaceBallData2Server();
  8479. }
  8480. else {
  8481. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8482. console.log('zh:game end失败');
  8483. xGame.soundMgr.playSound('matchwin01');
  8484. xGame.soundMgr.playSound("s_lose");
  8485. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8486. }
  8487. let challengeNum = DataMgr.getChallengeTimes();
  8488. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8489. DataMgr.setChallengeTimes(1);
  8490. }
  8491. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8492. DataMgr.setClassicTimes();
  8493. }
  8494. this.setGlobalFont(this.ui);
  8495. }
  8496. diyGameDataUtilForGameWin() {
  8497. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8498. switch (xGame.common.gameMode) {
  8499. case GameMode.classic:
  8500. console.log('zh:DiyGameDataUtilForGameWin 111');
  8501. case GameMode.bigMove:
  8502. console.log('zh:DiyGameDataUtilForGameWin 222');
  8503. this.restartGame();
  8504. break;
  8505. case GameMode.placeBall:
  8506. console.log('zh:DiyGameDataUtilForGameWin 333');
  8507. var level = xGame.common.placeBallCurLevel;
  8508. console.log('zh:练习模式 联系了多少LEV=' + level);
  8509. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8510. if (level > db_over_lev) {
  8511. DataMgr.setChallengeMode_overLev(level);
  8512. }
  8513. break;
  8514. default:
  8515. console.log('zh:DiyGameDataUtilForGameWin 444');
  8516. break;
  8517. }
  8518. }
  8519. updateGamePlaceBallData2Server() {
  8520. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8521. if (userInfo == null) {
  8522. return;
  8523. }
  8524. let pbdObj = DataMgr.getPlaceBallLevelList();
  8525. let reqData = xGame.httpMgr.getReqData();
  8526. let pd = JSON.parse(reqData);
  8527. pd.placeBallData = JSON.stringify(pbdObj);
  8528. reqData = JSON.stringify(pd);
  8529. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8530. try {
  8531. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8532. let code = res.code;
  8533. let msg = res.msg;
  8534. if (code == 401) {
  8535. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8536. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8537. return;
  8538. }
  8539. if (code == 200) {
  8540. let data = res.data;
  8541. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8542. }
  8543. else {
  8544. xGame.uiMgr.Show(UIMsg, msg);
  8545. }
  8546. }
  8547. catch (error) {
  8548. console.log('error=' + error);
  8549. alert(error);
  8550. }
  8551. finally {
  8552. }
  8553. });
  8554. }
  8555. showChallengeLevel() {
  8556. if (DataMgr.getChallengeTimes() != 0)
  8557. return;
  8558. let skill = DataMgr.getSkillAccTimes();
  8559. let put = DataMgr.getPlaceBallLevelList().length;
  8560. if (skill >= 3 || put >= 5) {
  8561. xGame.uiMgr.Show(UIInvitation);
  8562. this.hide();
  8563. }
  8564. }
  8565. addAward(callback) {
  8566. if (!this.success) {
  8567. callback && callback();
  8568. return;
  8569. }
  8570. switch (xGame.common.gameMode) {
  8571. case GameMode.classic:
  8572. this.awardCoinNum = xGame.common.passAwardCoin;
  8573. this.awardDiamondNum = 0;
  8574. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8575. break;
  8576. case GameMode.bigMove:
  8577. this.awardCoinNum = xGame.common.passAwardCoin;
  8578. this.awardDiamondNum = 0;
  8579. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8580. callback && callback();
  8581. break;
  8582. case GameMode.placeBall:
  8583. let level = xGame.common.placeBallCurLevel;
  8584. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8585. if (xGame.common.placeBallStarNum != 3) {
  8586. callback && callback();
  8587. return;
  8588. }
  8589. else {
  8590. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8591. if (getAward) {
  8592. callback && callback();
  8593. return;
  8594. }
  8595. }
  8596. let cfg = cfgTable.placeballData[level];
  8597. let data = cfgTable.placeballData[level].award;
  8598. this.awardCoinNum = data[0];
  8599. this.awardDiamondNum = data[1];
  8600. if (cfg.type == PlaceBallType.challenge) {
  8601. this.awardDiamondNum = 0;
  8602. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8603. }
  8604. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8605. let diamondAward;
  8606. if (this.awardDiamondNum > 0) {
  8607. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8608. xGame.common.getAward([diamondAward, coinAward], callback);
  8609. }
  8610. else {
  8611. xGame.common.getAward([coinAward], callback);
  8612. }
  8613. if (cfg.type == PlaceBallType.normal) {
  8614. DataMgr.setPlaceBallAward(level);
  8615. }
  8616. break;
  8617. default:
  8618. break;
  8619. }
  8620. }
  8621. playSecretaryAni_old() {
  8622. let parent = this.ui.secretary.displayObject;
  8623. parent.destroyChildren();
  8624. let xx = this.ui.secretary.width / 2;
  8625. let yy = this.ui.secretary.height;
  8626. let scale = xGame.common.getSecretaryScale();
  8627. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8628. if (this.success) {
  8629. let rand = Math.random() <= 0.5 ? 2 : 3;
  8630. xGame.common.secretary.play(data, rand, false, parent, () => {
  8631. xGame.common.secretary.play(data, 1, true, parent);
  8632. });
  8633. }
  8634. else {
  8635. xGame.common.secretary.play(data, 0, true, parent);
  8636. }
  8637. }
  8638. playSecretaryAni() {
  8639. let parent = this.ui.secretary.displayObject;
  8640. parent.destroyChildren();
  8641. let xx = this.ui.secretary.width / 2;
  8642. let yy = this.ui.secretary.height;
  8643. let scale = xGame.common.getSecretaryScale();
  8644. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8645. if (this.success) {
  8646. let rand = 0;
  8647. xGame.common.secretary.play(data, 0, true, parent);
  8648. }
  8649. else {
  8650. xGame.common.secretary.play(data, 0, true, parent);
  8651. }
  8652. }
  8653. restartGame() {
  8654. switch (xGame.common.gameMode) {
  8655. case GameMode.classic:
  8656. xGame.eventMgr.event(RESTART_GAME);
  8657. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8658. break;
  8659. case GameMode.bigMove:
  8660. this.hide();
  8661. xGame.eventMgr.event(RESTART_GAME);
  8662. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8663. break;
  8664. default:
  8665. break;
  8666. }
  8667. }
  8668. hide() {
  8669. super.hide();
  8670. xGame.common.stopGirlPop(this.ui.talkNode);
  8671. PlatMgr.showBanner(false);
  8672. }
  8673. returnHome() {
  8674. this.hide();
  8675. let showFailWords = !this.success;
  8676. xGame.uiMgr.Show(UIMain, showFailWords);
  8677. }
  8678. clickLeftBtn() {
  8679. switch (xGame.common.gameMode) {
  8680. case GameMode.classic:
  8681. case GameMode.bigMove:
  8682. this.returnHome();
  8683. break;
  8684. case GameMode.placeBall:
  8685. let level = xGame.common.placeBallCurLevel;
  8686. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8687. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8688. break;
  8689. default:
  8690. break;
  8691. }
  8692. }
  8693. powerStartPlaceBallLevel(level, btn) {
  8694. if (DataMgr.powerEnough()) {
  8695. btn.touchable = false;
  8696. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8697. btn.touchable = true;
  8698. DataMgr.setPower(-1);
  8699. xGame.eventMgr.event(POWER_TIME);
  8700. this.startPlaceBallLevel(level);
  8701. this.logEventForChallenge_level_start(level);
  8702. }));
  8703. }
  8704. else {
  8705. xGame.uiMgr.Show(UIPower, 0);
  8706. }
  8707. }
  8708. clickRightBtn() {
  8709. switch (xGame.common.gameMode) {
  8710. case GameMode.classic:
  8711. console.log('zh:clickRightBtn 111');
  8712. case GameMode.bigMove:
  8713. console.log('zh:clickRightBtn 222');
  8714. this.restartGame();
  8715. break;
  8716. case GameMode.placeBall:
  8717. console.log('zh:clickRightBtn 333');
  8718. let level = xGame.common.placeBallCurLevel;
  8719. let data = DataMgr.getPlaceBallLevel(level);
  8720. let curPss = data.play && !data.isCur;
  8721. if (curPss) {
  8722. console.log('zh:clickRightBtn 333-111');
  8723. console.log('zh:当前LV=' + level);
  8724. if (level == 60) {
  8725. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8726. Laya.timer.once(3000, this, () => {
  8727. this.returnHome();
  8728. });
  8729. }
  8730. else {
  8731. let lev = level + 1;
  8732. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8733. }
  8734. }
  8735. else {
  8736. console.log('zh:clickRightBtn 333-000');
  8737. Moyu.sendDataEvent("placeBallNextLevel");
  8738. console.log('zh:qjff_AD_for_uiGameEnd');
  8739. if (Laya.Browser.onAndroid) {
  8740. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8741. if (!boo) {
  8742. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8743. return;
  8744. }
  8745. }
  8746. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8747. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8748. }
  8749. else {
  8750. console.log('zh:AD 失败,直接发放奖励');
  8751. this.qjff_AD_for_uiGameEnd(level);
  8752. }
  8753. }
  8754. break;
  8755. default:
  8756. console.log('zh:clickRightBtn 444');
  8757. break;
  8758. }
  8759. }
  8760. logEventForChallenge_level_start(level) {
  8761. let keyStr = 'sjmd_challenge_level_start';
  8762. let jsonStr = {
  8763. "count": 0,
  8764. "gold_balance ": DataMgr.getCoin(),
  8765. "level": level,
  8766. "diamond_balance ": DataMgr.getDiamond()
  8767. };
  8768. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8769. const d = LocalStorageManager.getItem(keyStr);
  8770. if (level > d.level) {
  8771. jsonStr.count = d.count + 1;
  8772. LocalStorageManager.setItem(keyStr, jsonStr);
  8773. }
  8774. else {
  8775. }
  8776. }
  8777. else {
  8778. LocalStorageManager.setItem(keyStr, jsonStr);
  8779. }
  8780. const reqStr = JSON.stringify(jsonStr);
  8781. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8782. }
  8783. qjff_AD_for_uiGameEnd(level) {
  8784. DataMgr.setPlaceBallLevel(level, 1);
  8785. this.startPlaceBallLevel(level + 1);
  8786. }
  8787. startPlaceBallLevel(level) {
  8788. xGame.common.gameMode = GameMode.placeBall;
  8789. xGame.common.placeBallCurLevel = level;
  8790. xGame.uiMgr.Show(UIGame);
  8791. this.hide();
  8792. }
  8793. logEventForChallenge_level_complete(level) {
  8794. let keyStr = 'sjmd_challenge_level_complete';
  8795. let jsonStr = {
  8796. "count": 1,
  8797. "gold_balance ": DataMgr.getCoin(),
  8798. "level": level,
  8799. "diamond_balance ": DataMgr.getDiamond()
  8800. };
  8801. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8802. const d = LocalStorageManager.getItem(keyStr);
  8803. jsonStr.count = d.count + 1;
  8804. LocalStorageManager.setItem(keyStr, jsonStr);
  8805. }
  8806. else {
  8807. LocalStorageManager.setItem(keyStr, jsonStr);
  8808. }
  8809. const reqStr = JSON.stringify(jsonStr);
  8810. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8811. }
  8812. logEventForChallenge_level_N(level) {
  8813. console.log('zh:logEventForChallenge_level_N ' + level);
  8814. let keyStr = 'sjmd_challenge_level_N';
  8815. if (LocalStorageManager.hasKey(keyStr)) {
  8816. let lev = LocalStorageManager.getItem(keyStr);
  8817. if (level > lev) {
  8818. LocalStorageManager.setItem(keyStr, level);
  8819. }
  8820. if ((level) % 5 == 0) {
  8821. console.log('zh:每5关上报1次');
  8822. let sjmc = 'challenge_level_' + level;
  8823. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8824. let sjmcForFirebase = 'challenge_level_' + level;
  8825. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8826. }
  8827. else {
  8828. console.log('zh:5 no 上报');
  8829. }
  8830. }
  8831. else {
  8832. LocalStorageManager.setItem(keyStr, level);
  8833. }
  8834. }
  8835. }
  8836. UIGameEnd.uiName = "UIGameEnd";
  8837. class ui_UIVideoShare extends fgui.GComponent {
  8838. static createInstance() {
  8839. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8840. }
  8841. onConstruct() {
  8842. this.n10 = (this.getChild("n10"));
  8843. this.myNode = (this.getChild("myNode"));
  8844. this.t0 = this.getTransition("t0");
  8845. }
  8846. }
  8847. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8848. class UIVideoShare extends UIBase {
  8849. constructor() {
  8850. super();
  8851. this.success = false;
  8852. this.awardNum = 0;
  8853. this.isShared = true;
  8854. }
  8855. onConstructor() {
  8856. this.ui = ui_UIVideoShare.createInstance();
  8857. this.contentPane = this.ui;
  8858. this.isEject = false;
  8859. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8860. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8861. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8862. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8863. }
  8864. show(success) {
  8865. super.show();
  8866. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8867. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8868. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8869. this.success = success;
  8870. let time = xGame.common.randomNum(600, 1500);
  8871. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8872. if (success)
  8873. xGame.soundMgr.playSound("applause");
  8874. this.ui.t0.play();
  8875. this.checkShareState();
  8876. let times = DataMgr.getDailyVideoShareTimes();
  8877. this.awardNum = times == 0 ? 2000 : 200;
  8878. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8879. this.setGlobalFont(this.ui);
  8880. }
  8881. checkShareState() {
  8882. if (PlatMgr.forceShare == 0) {
  8883. this.ui.myNode.closeBtn.visible = true;
  8884. this.ui.myNode.tipsNode.visible = false;
  8885. this.ui.myNode.closeBtn.x = 90;
  8886. this.ui.myNode.shareBtn.x = 342;
  8887. }
  8888. else if (PlatMgr.forceShare == 1) {
  8889. this.ui.myNode.closeBtn.visible = false;
  8890. this.ui.myNode.tipsNode.visible = true;
  8891. this.ui.myNode.shareBtn.x = 218;
  8892. this.isShared = true;
  8893. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8894. }
  8895. }
  8896. checkForceShare() {
  8897. this.isShared = !this.isShared;
  8898. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8899. }
  8900. videoShare() {
  8901. if (PlatMgr.forceShare == 1) {
  8902. if (this.isShared) {
  8903. this.shareGame();
  8904. }
  8905. else {
  8906. this.hideSelf();
  8907. }
  8908. }
  8909. else {
  8910. this.shareGame();
  8911. }
  8912. }
  8913. shareGame() {
  8914. Moyu.sendDataEvent("VideoShare");
  8915. if (Moyu.canShare() > 100) {
  8916. Moyu.shareGame((success) => {
  8917. if (success) {
  8918. DataMgr.setDailyVideoShareTimes(1);
  8919. DataMgr.setCoin(this.awardNum);
  8920. }
  8921. this.hideSelf();
  8922. }, this);
  8923. }
  8924. else {
  8925. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8926. this.hideSelf();
  8927. }
  8928. }
  8929. hideSelf() {
  8930. this.hide();
  8931. xGame.uiMgr.Show(UIGameEnd, this.success);
  8932. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8933. xGame.common.screenImg.destroy();
  8934. xGame.common.screenImg = null;
  8935. }
  8936. }
  8937. }
  8938. UIVideoShare.uiName = "UIVideoShare";
  8939. class ui_UITips extends fgui.GComponent {
  8940. static createInstance() {
  8941. return (fgui.UIPackage.createObject("game", "UITips"));
  8942. }
  8943. onConstruct() {
  8944. this.n0 = (this.getChild("n0"));
  8945. this.myNode = (this.getChild("myNode"));
  8946. this.t0 = this.getTransition("t0");
  8947. }
  8948. }
  8949. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8950. class UITips extends UIBase {
  8951. constructor() {
  8952. super();
  8953. this.type = 0;
  8954. }
  8955. onConstructor() {
  8956. this.ui = ui_UITips.createInstance();
  8957. this.contentPane = this.ui;
  8958. this.isEject = false;
  8959. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8960. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8961. }
  8962. show(tipsTxt, womanTxt, type) {
  8963. super.show();
  8964. this.ui.t0.play();
  8965. this.ui.myNode.tipsTxt.text = tipsTxt;
  8966. this.ui.myNode.womanTxt.text = womanTxt;
  8967. PlatMgr.showInsert(true);
  8968. this.ui.myNode.c1.selectedIndex = type;
  8969. this.type = type;
  8970. switch (this.type) {
  8971. case TipsType.exitGame:
  8972. xGame.common.gameMgr.gamePause = true;
  8973. break;
  8974. case TipsType.foul:
  8975. Laya.timer.once(200, this, () => {
  8976. xGame.common.gameMgr.gamePause = true;
  8977. });
  8978. break;
  8979. default:
  8980. break;
  8981. }
  8982. this.setGlobalFont(this.ui);
  8983. }
  8984. clickLeftBtn() {
  8985. this.hide();
  8986. xGame.common.gameMgr.gamePause = false;
  8987. switch (this.type) {
  8988. case TipsType.exitGame:
  8989. break;
  8990. case TipsType.foul:
  8991. break;
  8992. default:
  8993. break;
  8994. }
  8995. }
  8996. clickRightBtn() {
  8997. this.hide();
  8998. switch (this.type) {
  8999. case TipsType.exitGame:
  9000. xGame.eventMgr.event(RESET_GAME);
  9001. xGame.uiMgr.Show(UIMain);
  9002. Moyu.recordEnd(this, null);
  9003. xGame.common.longHelpLine = false;
  9004. break;
  9005. case TipsType.foul:
  9006. xGame.common.gameMgr.gamePause = false;
  9007. Laya.timer.clearAll(this);
  9008. break;
  9009. default:
  9010. break;
  9011. }
  9012. }
  9013. }
  9014. UITips.uiName = "UITips";
  9015. class GameMgr {
  9016. constructor() {
  9017. this.selfCamp = "";
  9018. this.selfFoulNum = 0;
  9019. this.selfBallArr = [];
  9020. this.selfTimer = 0;
  9021. this.selfScore = 0;
  9022. this.aiCamp = "";
  9023. this.aiFoulNum = 0;
  9024. this.aiBallArr = [];
  9025. this.aiTimer = 0;
  9026. this.aiScore = 0;
  9027. this.aiSkillLevelNum = 1;
  9028. this.targertScore = 0;
  9029. this.setTime = 30;
  9030. this.selfTurnRate = 0.5;
  9031. this.accTime = 0;
  9032. this.curFoul = "";
  9033. this.maxFoulTimes = 3;
  9034. this.isFirstInGame = true;
  9035. this.firstColliObj = null;
  9036. this.inHoleBalls = [];
  9037. this.blackNum = 8;
  9038. this.success = false;
  9039. this.holePosList = [];
  9040. this.posObj = {};
  9041. this._selfTurn = false;
  9042. this.lastRootBallPos = new Laya.Vector2(311, 430);
  9043. this.ensureBallType = false;
  9044. this.isOpenBall = true;
  9045. this.finishOneShoot = true;
  9046. this.isEnd = false;
  9047. this.isChangeTurn = false;
  9048. this.isInterrupt = false;
  9049. this.aiPlayedBreakArmy = false;
  9050. this.isTouchedBall = false;
  9051. this.finishBalls = 0;
  9052. this.needBalls = 0;
  9053. this.allBallNum = 0;
  9054. this.placeBallPosData = {};
  9055. this.curHP = 0;
  9056. this.showLongView = false;
  9057. this.firstShoot = true;
  9058. this._gamePause = false;
  9059. this.trunCount = 0;
  9060. this.isBlackInHole = false;
  9061. this.isEnter = true;
  9062. xGame.eventMgr.offAll(ALL_BALL_STOP);
  9063. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  9064. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  9065. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  9066. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  9067. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  9068. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9069. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9070. }
  9071. get gamePause() {
  9072. return this._gamePause;
  9073. }
  9074. set gamePause(v) {
  9075. if (v) {
  9076. Laya.physicsTimer.pause();
  9077. }
  9078. else {
  9079. Laya.physicsTimer.resume();
  9080. }
  9081. this._gamePause = v;
  9082. }
  9083. get selfTurn() {
  9084. return this._selfTurn;
  9085. }
  9086. set selfTurn(val) {
  9087. this.trunCount++;
  9088. this._selfTurn = val;
  9089. if (val) {
  9090. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9091. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9092. }
  9093. else {
  9094. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9095. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9096. if (this.trunCount > 1)
  9097. PlatMgr.openBox();
  9098. }
  9099. }
  9100. resetGame() {
  9101. this.inHoleBalls = [];
  9102. this.isFirstInGame = true;
  9103. this.firstColliObj = null;
  9104. this.aiCamp = "";
  9105. this.selfCamp = "";
  9106. this.aiFoulNum = 0;
  9107. this.selfFoulNum = 0;
  9108. this.selfBallArr = [];
  9109. this.aiBallArr = [];
  9110. this.gamePause = false;
  9111. this.ensureBallType = false;
  9112. this.isInterrupt = false;
  9113. this.updateLeftBall();
  9114. this.clearTime();
  9115. this.aiPlayedBreakArmy = false;
  9116. this.isBlackInHole = false;
  9117. this.placeBallPosData = {};
  9118. if (xGame.common.d3World.knifeRoot) {
  9119. xGame.common.d3World.knifeRoot.destroyChildren();
  9120. }
  9121. }
  9122. gameReady() {
  9123. this.trunCount = 0;
  9124. this.firstColliObj = null;
  9125. this.isFirstInGame = true;
  9126. this.selfTurn = Math.random() <= this.selfTurnRate;
  9127. let challengeNum = DataMgr.getChallengeTimes();
  9128. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9129. this.selfTurn = true;
  9130. }
  9131. if (xGame.common.gameMode == GameMode.placeBall)
  9132. this.selfTurn = true;
  9133. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9134. this.selfTurn = true;
  9135. }
  9136. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9137. this.checkGuide();
  9138. if (xGame.common.uiRodMethod)
  9139. xGame.common.uiRodMethod.resetRod();
  9140. xGame.common.d2World.getHelpLine();
  9141. this.isOpenBall = true;
  9142. this.isTouchedBall = false;
  9143. xGame.common.aiPlayer.stopRun();
  9144. this.setTime = 30;
  9145. let ui = xGame.common.gameUI.ui;
  9146. switch (xGame.common.gameMode) {
  9147. case GameMode.classic:
  9148. xGame.common.aiPlayer.init();
  9149. this.blackNum = 8;
  9150. this.placeRootBall();
  9151. this.peoplePlay(9, 10);
  9152. ui.wordsBtn.visible = true;
  9153. ui.aiWordsBtn.visible = true;
  9154. xGame.common.talkMgr.changeAIState(true);
  9155. DataMgr.gameData.gameCount++;
  9156. DataMgr.saveGameData();
  9157. break;
  9158. case GameMode.bigMove:
  9159. this.blackNum = -1;
  9160. this.selfScore = 0;
  9161. this.aiScore = 0;
  9162. xGame.common.aiPlayer.init();
  9163. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9164. this.updateSelfScore();
  9165. this.updateAIScore();
  9166. this.updateTargetSroce();
  9167. this.placeRootBall();
  9168. this.peoplePlay(9, 10);
  9169. ui.wordsBtn.visible = true;
  9170. ui.aiWordsBtn.visible = true;
  9171. xGame.common.talkMgr.changeAIState(true);
  9172. if (DataMgr.getSkillGuide() < 1)
  9173. DataMgr.gameData.gameCount = 0;
  9174. else {
  9175. DataMgr.gameData.gameCount++;
  9176. DataMgr.saveGameData();
  9177. PlatMgr.openTry();
  9178. }
  9179. if (xGame.common.d3World.knifeRoot) {
  9180. xGame.common.d3World.knifeRoot.destroyChildren();
  9181. }
  9182. break;
  9183. case GameMode.placeBall:
  9184. this.blackNum = -1;
  9185. this.selfTurn = true;
  9186. this.setTime = 10000;
  9187. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9188. this.curHP = this.placeBallData.hp;
  9189. if (this.placeBallData.ball == -1)
  9190. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9191. else
  9192. this.needBalls = this.placeBallData.ball;
  9193. console.log("需要的进球数目", this.needBalls);
  9194. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9195. this.finishBalls = 0;
  9196. this.placeBallPosData = {};
  9197. this.updatePlaceBallPos();
  9198. this.updatePlaceBallState();
  9199. this.finishOneShoot = true;
  9200. xGame.common.gameUI.ui.moveNode.visible = false;
  9201. this.isOpenBall = false;
  9202. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9203. ui.wordsBtn.visible = false;
  9204. ui.aiWordsBtn.visible = false;
  9205. xGame.common.talkMgr.changeAIState(false);
  9206. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9207. PlatMgr.openBox();
  9208. });
  9209. break;
  9210. default:
  9211. break;
  9212. }
  9213. this.showLongView = false;
  9214. xGame.common.wordsMgr.comboTimes = 1;
  9215. let guide = DataMgr.getSkillGuide();
  9216. if (guide)
  9217. xGame.eventMgr.event(WAIT_SHOOT);
  9218. xGame.common.upSkillLevel = false;
  9219. xGame.common.gameStartTime = new Date().getTime();
  9220. this.firstShoot = true;
  9221. }
  9222. checkGuide() {
  9223. let guide = DataMgr.getSkillGuide();
  9224. let gameUI = xGame.common.gameUI.ui;
  9225. gameUI.guide1.visible = false;
  9226. gameUI.guide2.visible = false;
  9227. gameUI.guide3.visible = false;
  9228. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9229. this.selfTurn = true;
  9230. }
  9231. else {
  9232. return;
  9233. }
  9234. let oneBall = this.getOneBall();
  9235. gameUI.guide1.visible = true;
  9236. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9237. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9238. }
  9239. getOneBall() {
  9240. let arr = xGame.common.d2World.ballArr;
  9241. for (let index = 0; index < arr.length; index++) {
  9242. if (arr[index].number == 0)
  9243. continue;
  9244. return arr[index];
  9245. }
  9246. }
  9247. updateSelfScore() {
  9248. let ui = xGame.common.gameUI.ui.topNode;
  9249. ui.selfScoreTxt.text = this.selfScore + "";
  9250. }
  9251. updateAIScore() {
  9252. let ui = xGame.common.gameUI.ui.topNode;
  9253. ui.aiScoreTxt.text = this.aiScore + "";
  9254. }
  9255. updateTargetSroce() {
  9256. let ui = xGame.common.gameUI.ui.topNode;
  9257. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9258. }
  9259. updateLeftBall() {
  9260. let topUI = xGame.common.gameUI.ui.topNode;
  9261. topUI.selfBallList.numItems = this.selfBallArr.length;
  9262. topUI.aiBallList.numItems = this.aiBallArr.length;
  9263. }
  9264. ballShoot() {
  9265. this.clearTime();
  9266. this.finishOneShoot = false;
  9267. xGame.common.gameUI.ui.moveNode.visible = false;
  9268. if (xGame.common.gameUI.ui.guideNode.visible) {
  9269. xGame.common.gameUI.ui.guideNode.visible = false;
  9270. }
  9271. if (this.firstShoot) {
  9272. this.firstShoot = false;
  9273. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9274. }
  9275. }
  9276. ensureCamp(number) {
  9277. this.ensureBallType = true;
  9278. this.isOpenBall = false;
  9279. if (xGame.common.gameMode != GameMode.classic)
  9280. return;
  9281. let full = [1, 2, 3, 4, 5, 6, 7];
  9282. let flower = [9, 10, 11, 12, 13, 14, 15];
  9283. let sayWords = "";
  9284. if (this.selfTurn) {
  9285. if (number <= 7) {
  9286. this.selfCamp = ballCamp.full;
  9287. this.selfBallArr = full;
  9288. this.aiCamp = ballCamp.flower;
  9289. this.aiBallArr = flower;
  9290. sayWords = cfgTable.wordsData[3].msg;
  9291. }
  9292. else {
  9293. this.selfCamp = ballCamp.flower;
  9294. this.selfBallArr = flower;
  9295. this.aiCamp = ballCamp.full;
  9296. this.aiBallArr = full;
  9297. sayWords = cfgTable.wordsData[4].msg;
  9298. }
  9299. }
  9300. else {
  9301. if (number <= 7) {
  9302. this.selfCamp = ballCamp.flower;
  9303. this.selfBallArr = flower;
  9304. this.aiCamp = ballCamp.full;
  9305. this.aiBallArr = full;
  9306. sayWords = cfgTable.wordsData[2].msg;
  9307. }
  9308. else {
  9309. this.selfCamp = ballCamp.full;
  9310. this.selfBallArr = full;
  9311. this.aiCamp = ballCamp.flower;
  9312. this.aiBallArr = flower;
  9313. sayWords = cfgTable.wordsData[1].msg;
  9314. }
  9315. }
  9316. this.updateLeftBall();
  9317. xGame.uiMgr.Show(UIMsg, sayWords);
  9318. }
  9319. updatePlaceBallState() {
  9320. let ui = xGame.common.gameUI.ui;
  9321. switch (this.placeBallData.type) {
  9322. case PlaceBallType.normal:
  9323. let normal = ui.placeNormalNode;
  9324. normal.hpTxt.text = this.curHP + "";
  9325. this.updatePlaceBallStar(normal);
  9326. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9327. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9328. break;
  9329. case PlaceBallType.challenge:
  9330. let challenge = ui.placeChallengeNode;
  9331. challenge.hpTxt.text = "Shots:" + this.curHP;
  9332. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9333. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9334. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9335. break;
  9336. default:
  9337. break;
  9338. }
  9339. }
  9340. playSubHpAni() {
  9341. let ui = xGame.common.gameUI.ui;
  9342. switch (this.placeBallData.type) {
  9343. case PlaceBallType.normal:
  9344. let normal = ui.placeNormalNode;
  9345. normal.hpTxt.visible = false;
  9346. normal.starAni.c1.selectedIndex = 1;
  9347. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9348. normal.hpTxt.visible = true;
  9349. normal.starAni.c1.selectedIndex = 0;
  9350. }));
  9351. break;
  9352. default:
  9353. break;
  9354. }
  9355. }
  9356. getEndStarNum() {
  9357. let num;
  9358. let level = xGame.common.placeBallCurLevel;
  9359. if (this.curHP == this.placeBallData.hp) {
  9360. num = 3;
  9361. }
  9362. else if (this.curHP <= 1) {
  9363. num = 1;
  9364. }
  9365. else {
  9366. num = 2;
  9367. }
  9368. if (!this.success) {
  9369. num = 0;
  9370. }
  9371. else {
  9372. DataMgr.setPlaceBallLevel(level, num);
  9373. }
  9374. let myType = cfgTable.placeballData[level].type;
  9375. if (this.success && myType == 1) {
  9376. num = 3;
  9377. }
  9378. xGame.common.placeBallStarNum = num;
  9379. }
  9380. updatePlaceBallStar(node) {
  9381. let star = 0;
  9382. if (this.curHP == this.placeBallData.hp) {
  9383. star = 3;
  9384. }
  9385. else if (this.curHP >= 2) {
  9386. star = 2;
  9387. }
  9388. else if (this.curHP == 1) {
  9389. star = 1;
  9390. }
  9391. else {
  9392. star = 0;
  9393. }
  9394. let temp;
  9395. for (let index = 1; index <= 3; index++) {
  9396. temp = node["star" + index];
  9397. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9398. }
  9399. node.myProgress.value = (star / 3) * 100;
  9400. }
  9401. openRegretView(isFoul, GoalNum, challenge = false) {
  9402. let regretType = -1;
  9403. if (isFoul) {
  9404. regretType = 1;
  9405. }
  9406. else {
  9407. if (GoalNum <= 0) {
  9408. regretType = 0;
  9409. }
  9410. }
  9411. if (challenge) {
  9412. regretType = 1;
  9413. }
  9414. if (regretType != -1) {
  9415. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9416. if (success) {
  9417. this.curHP++;
  9418. this.updatePlaceBallState();
  9419. this.setPlaceBallAllPos();
  9420. xGame.common.gameUI.ui.moveNode.visible = false;
  9421. }
  9422. else {
  9423. if (this.curHP <= 0) {
  9424. this.success = false;
  9425. this.gameEnd();
  9426. }
  9427. this.playSubHpAni();
  9428. }
  9429. this.updatePlaceBallState();
  9430. this.updatePlaceBallPos();
  9431. });
  9432. }
  9433. }
  9434. setPlaceBallAllPos() {
  9435. let allBall = xGame.common.d2World.ballArr;
  9436. let cfgArr = this.placeBallPosData;
  9437. let temp;
  9438. let obj;
  9439. for (let index = 0; index < allBall.length; index++) {
  9440. temp = allBall[index];
  9441. if (temp.destroyed)
  9442. continue;
  9443. obj = cfgArr[temp.myUNID];
  9444. if (obj && obj.src && !obj.src.destroyed) {
  9445. temp.gameObj.x = obj.posX;
  9446. temp.gameObj.y = obj.posY;
  9447. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9448. }
  9449. }
  9450. xGame.common.d2World.getHelpLine();
  9451. }
  9452. updatePlaceBallPos() {
  9453. let arr = xGame.common.d2World.ballArr;
  9454. let temp;
  9455. for (let index = 0; index < arr.length; index++) {
  9456. temp = arr[index];
  9457. if (!this.placeBallPosData[temp.myUNID]) {
  9458. this.placeBallPosData[temp.myUNID] = {
  9459. src: temp,
  9460. posX: temp.gameObj.x,
  9461. posY: temp.gameObj.y
  9462. };
  9463. }
  9464. else {
  9465. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9466. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9467. }
  9468. }
  9469. let check;
  9470. for (const key in this.placeBallPosData) {
  9471. check = this.placeBallPosData[key];
  9472. if (check.src.destroyed) {
  9473. delete this.placeBallPosData[key];
  9474. }
  9475. }
  9476. }
  9477. gameRun(type) {
  9478. if (this.gamePause)
  9479. return;
  9480. this.curFoul = this.getFoulType();
  9481. if (type) {
  9482. xGame.common.d2World.d2Gan.shoot();
  9483. xGame.common.gameUI.forceCancel();
  9484. this.curFoul = type;
  9485. }
  9486. this.isEnd = false;
  9487. this.isChangeTurn = true;
  9488. if (xGame.common.gameMode == GameMode.classic) {
  9489. this.judgeClassic(this.curFoul);
  9490. this.checkClassicWords(() => {
  9491. xGame.common.destroyClassicEmotion();
  9492. if (this.isEnd) {
  9493. if (this.isBlackInHole) {
  9494. xGame.common.gameUI.ui.blackAni.visible = true;
  9495. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9496. xGame.common.gameUI.ui.blackAni.visible = false;
  9497. this.gameEnd();
  9498. }));
  9499. }
  9500. else {
  9501. this.gameEnd();
  9502. }
  9503. }
  9504. else {
  9505. this.waitShoot();
  9506. xGame.eventMgr.event(WAIT_SHOOT);
  9507. }
  9508. });
  9509. }
  9510. else if (xGame.common.gameMode == GameMode.bigMove) {
  9511. xGame.common.aiPlayer.stopRun();
  9512. let scoreArr = this.getScore(this.curFoul);
  9513. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9514. this.isEnd = true;
  9515. }
  9516. this.checkBigSkillWords(() => {
  9517. if (this.isEnd) {
  9518. this.gameEnd();
  9519. }
  9520. else {
  9521. this.waitShoot();
  9522. xGame.eventMgr.event(WAIT_SHOOT);
  9523. }
  9524. });
  9525. }
  9526. else if (xGame.common.gameMode == GameMode.placeBall) {
  9527. xGame.common.destroyAwardSpine();
  9528. let isFoul = this.curFoul == FoulType.rootHole;
  9529. let GoalNum = this.inHoleBalls.length;
  9530. if (this.inHoleBalls.indexOf(0) > -1)
  9531. GoalNum -= 1;
  9532. if (isFoul) {
  9533. this.placeRootBall();
  9534. }
  9535. console.log("neeballs", this.needBalls);
  9536. console.log("当前完成的goalNum", GoalNum);
  9537. this.finishBalls += GoalNum;
  9538. console.log("当前完成的finishballs", this.finishBalls);
  9539. let need = this.needBalls;
  9540. if (this.placeBallData.type == PlaceBallType.challenge) {
  9541. need += 100;
  9542. }
  9543. if (this.finishBalls >= need) {
  9544. this.success = true;
  9545. this.gameEnd();
  9546. }
  9547. else {
  9548. switch (this.placeBallData.type) {
  9549. case PlaceBallType.normal:
  9550. if (!isFoul && GoalNum > 0) {
  9551. this.updatePlaceBallPos();
  9552. this.updatePlaceBallState();
  9553. }
  9554. else {
  9555. this.curHP--;
  9556. this.openRegretView(isFoul, GoalNum);
  9557. }
  9558. this.waitShoot();
  9559. xGame.eventMgr.event(WAIT_SHOOT);
  9560. break;
  9561. case PlaceBallType.challenge:
  9562. this.curHP--;
  9563. this.updatePlaceBallState();
  9564. if (isFoul) {
  9565. this.openRegretView(isFoul, GoalNum, true);
  9566. }
  9567. else {
  9568. this.updatePlaceBallPos();
  9569. if (this.curHP <= 0) {
  9570. this.success = true;
  9571. this.gameEnd();
  9572. }
  9573. }
  9574. this.waitShoot();
  9575. xGame.eventMgr.event(WAIT_SHOOT);
  9576. break;
  9577. default:
  9578. break;
  9579. }
  9580. }
  9581. }
  9582. }
  9583. checkClassicWords(callback) {
  9584. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9585. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9586. let type = this.getClassicWordsType();
  9587. if (condition && type != -1) {
  9588. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9589. xGame.soundMgr.playSound(str);
  9590. xGame.common.wordsMgr.playClassicWords(type, callback);
  9591. }
  9592. else {
  9593. Laya.timer.once(300, this, () => {
  9594. callback && callback();
  9595. });
  9596. }
  9597. }
  9598. getClassicWordsType() {
  9599. let d2world = xGame.common.d2World;
  9600. let type = -1;
  9601. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9602. type = ClassicWordsType.perfectShow;
  9603. return type;
  9604. }
  9605. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9606. type = ClassicWordsType.directShoot;
  9607. return type;
  9608. }
  9609. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9610. type = ClassicWordsType.anotherShoot;
  9611. return type;
  9612. }
  9613. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9614. type = ClassicWordsType.bigPower;
  9615. return type;
  9616. }
  9617. let minSpeed = 1;
  9618. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9619. type = ClassicWordsType.hardShoot;
  9620. return type;
  9621. }
  9622. if (this.inHoleBalls.length > 0) {
  9623. type = ClassicWordsType.directShoot;
  9624. return type;
  9625. }
  9626. return type;
  9627. }
  9628. checkBigSkillWords(callback) {
  9629. if (this.curFoul == FoulType.timeOut) {
  9630. callback && callback();
  9631. }
  9632. else {
  9633. let playSkill = false;
  9634. if (this.selfTurn) {
  9635. playSkill = true;
  9636. }
  9637. else {
  9638. if (!this.aiPlayedBreakArmy) {
  9639. this.aiPlayedBreakArmy = true;
  9640. playSkill = true;
  9641. }
  9642. if (this.aiCurSkill != SkillType.breakArmy) {
  9643. playSkill = true;
  9644. }
  9645. }
  9646. if (xGame.common.skillMgr.playedLastSkill) {
  9647. xGame.common.skillMgr.playedLastSkill = false;
  9648. playSkill = false;
  9649. }
  9650. if (playSkill) {
  9651. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9652. let selfExtra = 0;
  9653. let aiExtra = 0;
  9654. if (this.selfTurn)
  9655. selfExtra += extraScore;
  9656. else
  9657. aiExtra += extraScore;
  9658. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9659. this.isEnd = true;
  9660. }
  9661. this.playBigSkillTimes(callback);
  9662. });
  9663. }
  9664. else {
  9665. this.playBigSkillTimes(callback);
  9666. }
  9667. }
  9668. }
  9669. playBigSkillTimes(callback) {
  9670. let length = this.inHoleBalls.length;
  9671. if (this.inHoleBalls.indexOf(0) > -1) {
  9672. length = this.inHoleBalls.length - 1;
  9673. }
  9674. if (length <= 0) {
  9675. callback && callback();
  9676. return;
  9677. }
  9678. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9679. callback && callback();
  9680. });
  9681. }
  9682. playSkillTips() {
  9683. let levelNum = 0;
  9684. let curType;
  9685. if (this.selfTurn) {
  9686. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9687. curType = this.selfCurSkill;
  9688. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9689. levelNum += 5;
  9690. }
  9691. }
  9692. else {
  9693. levelNum = this.aiSkillLevelNum;
  9694. curType = this.aiCurSkill;
  9695. }
  9696. let str = ``;
  9697. switch (curType) {
  9698. case SkillType.highSpace:
  9699. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9700. break;
  9701. case SkillType.breakArmy:
  9702. str = `You pocketed ${levelNum} extra balls`;
  9703. break;
  9704. case SkillType.ice:
  9705. str = `${levelNum * 2} extra balls were frozen`;
  9706. break;
  9707. case SkillType.fireworks:
  9708. str = `${levelNum} extra balls exploded `;
  9709. break;
  9710. case SkillType.GuanYu:
  9711. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9712. break;
  9713. default:
  9714. break;
  9715. }
  9716. xGame.uiMgr.Show(UIMsg, str);
  9717. }
  9718. getFoulType() {
  9719. let foulType = "";
  9720. if (this.firstColliObj == null) {
  9721. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9722. return FoulType.rootHole;
  9723. }
  9724. return FoulType.notTouch;
  9725. }
  9726. else {
  9727. if (this.selfTurn) {
  9728. if (this.selfBallArr.length > 0) {
  9729. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9730. foulType = FoulType.wrongTouch;
  9731. }
  9732. }
  9733. else {
  9734. if (this.ensureBallType) {
  9735. }
  9736. else {
  9737. if (this.firstColliObj == this.blackNum) {
  9738. foulType = FoulType.wrongTouch;
  9739. }
  9740. }
  9741. }
  9742. }
  9743. else {
  9744. if (this.aiBallArr.length > 0) {
  9745. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9746. foulType = FoulType.wrongTouch;
  9747. }
  9748. }
  9749. else {
  9750. if (this.ensureBallType) {
  9751. }
  9752. else {
  9753. if (this.firstColliObj == this.blackNum) {
  9754. foulType = FoulType.wrongTouch;
  9755. }
  9756. }
  9757. }
  9758. }
  9759. if (this.inHoleBalls.length <= 0) {
  9760. return foulType;
  9761. }
  9762. let temp;
  9763. if (this.inHoleBalls.indexOf(0) > -1) {
  9764. foulType = FoulType.rootHole;
  9765. }
  9766. else {
  9767. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9768. temp = this.inHoleBalls[index];
  9769. if (this.selfTurn) {
  9770. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9771. foulType = FoulType.wrongHole;
  9772. break;
  9773. }
  9774. }
  9775. else {
  9776. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9777. foulType = FoulType.wrongHole;
  9778. break;
  9779. }
  9780. }
  9781. }
  9782. }
  9783. let foo;
  9784. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9785. temp = this.inHoleBalls[index];
  9786. foo = this.selfBallArr.indexOf(temp);
  9787. if (foo > -1) {
  9788. this.selfBallArr.splice(foo, 1);
  9789. }
  9790. foo = this.aiBallArr.indexOf(temp);
  9791. if (foo > -1) {
  9792. this.aiBallArr.splice(foo, 1);
  9793. }
  9794. }
  9795. this.updateLeftBall();
  9796. }
  9797. return foulType;
  9798. }
  9799. judgeGameEndByBlack(arr) {
  9800. if (this.selfTurn) {
  9801. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9802. this.selfFoulNum = this.maxFoulTimes;
  9803. return true;
  9804. }
  9805. }
  9806. else {
  9807. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9808. this.aiFoulNum = this.maxFoulTimes;
  9809. return true;
  9810. }
  9811. }
  9812. }
  9813. judgeClassic(type) {
  9814. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9815. xGame.common.aiPlayer.stopRun();
  9816. if (this.judgeNormalSuccess()) {
  9817. this.isEnd = true;
  9818. return;
  9819. }
  9820. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9821. if (this.selfTurn) {
  9822. if (isFoul) {
  9823. this.selfFoulNum++;
  9824. }
  9825. if (this.selfFoulNum >= this.maxFoulTimes) {
  9826. this.success = false;
  9827. this.isEnd = true;
  9828. return;
  9829. }
  9830. }
  9831. else {
  9832. if (isFoul)
  9833. this.aiFoulNum++;
  9834. if (this.aiFoulNum >= this.maxFoulTimes) {
  9835. this.success = true;
  9836. this.isEnd = true;
  9837. return;
  9838. }
  9839. }
  9840. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9841. this.isChangeTurn = false;
  9842. }
  9843. else {
  9844. this.isInterrupt = true;
  9845. }
  9846. }
  9847. waitShoot() {
  9848. if (xGame.common.gameMode == GameMode.classic) {
  9849. switch (this.curFoul) {
  9850. case FoulType.timeOut:
  9851. case FoulType.rootHole:
  9852. this.selfTurn = !this.selfTurn;
  9853. this.peoplePlay(5, 6, true);
  9854. break;
  9855. case FoulType.notTouch:
  9856. this.selfTurn = !this.selfTurn;
  9857. this.peoplePlay(7, 7);
  9858. break;
  9859. case FoulType.wrongHole:
  9860. this.selfTurn = !this.selfTurn;
  9861. this.peoplePlay(11, 11);
  9862. break;
  9863. default:
  9864. if (this.inHoleBalls.length > 0) {
  9865. this.peoplePlay(0, 0, false, false);
  9866. }
  9867. else {
  9868. this.selfTurn = !this.selfTurn;
  9869. this.peoplePlay(7, 7);
  9870. }
  9871. break;
  9872. }
  9873. }
  9874. else if (xGame.common.gameMode == GameMode.bigMove) {
  9875. if (this.curFoul == FoulType.timeOut) {
  9876. this.selfTurn = !this.selfTurn;
  9877. this.peoplePlay(14, 15);
  9878. this.placeRootBall();
  9879. }
  9880. else {
  9881. this.selfTurn = !this.selfTurn;
  9882. if (this.curFoul == FoulType.rootHole) {
  9883. this.peoplePlay(12, 13);
  9884. this.placeRootBall();
  9885. }
  9886. else {
  9887. this.peoplePlay(0, 0, false, false);
  9888. }
  9889. }
  9890. }
  9891. else if (xGame.common.gameMode == GameMode.placeBall) {
  9892. this.finishOneShoot = true;
  9893. }
  9894. this.gameResult();
  9895. }
  9896. gameResult() {
  9897. this.firstColliObj = null;
  9898. this.inHoleBalls = [];
  9899. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9900. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9901. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9902. if (xGame.common.uiRodMethod)
  9903. xGame.common.uiRodMethod.resetRod();
  9904. xGame.common.d2World.rootBall.showSelf();
  9905. this.clearIceSkill();
  9906. if (this.selfTurn) {
  9907. PlatMgr.gameInsert();
  9908. }
  9909. xGame.common.d3World.knifeRoot.destroyChildren();
  9910. if (this.selfTurn) {
  9911. xGame.common.gameUI.showHelpLineGuide();
  9912. xGame.common.gameUI.setTurnAlpha(true);
  9913. }
  9914. else {
  9915. xGame.common.gameUI.setTurnAlpha(false);
  9916. }
  9917. }
  9918. getScore(type) {
  9919. let selfAdd = 0;
  9920. let aiAdd = 0;
  9921. if (type == FoulType.timeOut) {
  9922. if (this.selfTurn)
  9923. aiAdd += 3;
  9924. else
  9925. selfAdd += 3;
  9926. }
  9927. else {
  9928. if (this.inHoleBalls.length > 0) {
  9929. if (this.selfTurn) {
  9930. if (type == FoulType.rootHole) {
  9931. aiAdd += 3;
  9932. if (this.inHoleBalls.length - 1 > 0) {
  9933. selfAdd += this.inHoleBalls.length - 1;
  9934. }
  9935. }
  9936. else {
  9937. selfAdd += this.inHoleBalls.length;
  9938. }
  9939. }
  9940. else {
  9941. if (type == FoulType.rootHole) {
  9942. selfAdd += 3;
  9943. if (this.inHoleBalls.length - 1 > 0) {
  9944. aiAdd += this.inHoleBalls.length - 1;
  9945. }
  9946. }
  9947. else {
  9948. aiAdd += this.inHoleBalls.length;
  9949. }
  9950. }
  9951. }
  9952. }
  9953. return [selfAdd, aiAdd];
  9954. }
  9955. judgeScoreEnd(selfAdd, aiAdd) {
  9956. this.selfScore += selfAdd;
  9957. this.aiScore += aiAdd;
  9958. this.updateAIScore();
  9959. this.updateSelfScore();
  9960. if (this.selfScore >= this.targertScore) {
  9961. this.success = true;
  9962. return true;
  9963. }
  9964. if (this.aiScore >= this.targertScore) {
  9965. this.success = false;
  9966. return true;
  9967. }
  9968. let ballArr = xGame.common.d2World.ballArr;
  9969. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9970. if (this.selfScore > this.aiScore) {
  9971. this.success = true;
  9972. return true;
  9973. }
  9974. else if (this.selfScore < this.aiScore) {
  9975. this.success = false;
  9976. return true;
  9977. }
  9978. else {
  9979. if (this.selfTurn) {
  9980. this.success = false;
  9981. }
  9982. else {
  9983. this.success = true;
  9984. }
  9985. return true;
  9986. }
  9987. }
  9988. }
  9989. clearIceSkill() {
  9990. let arr = xGame.common.d2World.ballArr;
  9991. let temp;
  9992. if (this.selfTurn) {
  9993. if (this.selfCurSkill == SkillType.ice) {
  9994. for (let index = 0; index < arr.length; index++) {
  9995. temp = arr[index];
  9996. if (temp.ballFunc == "ice") {
  9997. temp.setBallFunc("normal", "self");
  9998. }
  9999. }
  10000. }
  10001. }
  10002. else {
  10003. if (this.aiCurSkill == SkillType.ice) {
  10004. for (let index = 0; index < arr.length; index++) {
  10005. temp = arr[index];
  10006. if (temp.ballFunc == "ice") {
  10007. temp.setBallFunc("normal", "ai");
  10008. }
  10009. }
  10010. }
  10011. }
  10012. }
  10013. judgeNormalSuccess() {
  10014. if (this.selfTurn) {
  10015. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  10016. this.success = true;
  10017. return true;
  10018. }
  10019. }
  10020. else {
  10021. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  10022. this.success = false;
  10023. return true;
  10024. }
  10025. }
  10026. }
  10027. gameEnd() {
  10028. if (Moyu.isTT) {
  10029. xGame.common.screenImg = getScreenImg();
  10030. }
  10031. console.log("游戏结束", this.success);
  10032. xGame.common.aiPlayer.stopRun();
  10033. if (xGame.common.gameMode == GameMode.placeBall) {
  10034. this.getEndStarNum();
  10035. this.updatePlaceBallState();
  10036. }
  10037. this.isEnter = false;
  10038. Moyu.recordEnd(this, () => {
  10039. if (this.isEnter)
  10040. return;
  10041. this.isEnter = true;
  10042. console.log("进入录结束回调");
  10043. this.enterNext();
  10044. });
  10045. Laya.timer.once(1000, this, () => {
  10046. if (this.isEnter)
  10047. return;
  10048. this.isEnter = true;
  10049. this.enterNext();
  10050. });
  10051. xGame.common.longHelpLine = false;
  10052. }
  10053. enterNext() {
  10054. Laya.timer.clearAll(this);
  10055. if (Moyu.canShare() > 100 || Moyu.isKs) {
  10056. xGame.uiMgr.Show(UIVideoShare, this.success);
  10057. }
  10058. else {
  10059. xGame.uiMgr.Show(UIGameEnd, this.success);
  10060. }
  10061. }
  10062. aiLeave() {
  10063. let ui = xGame.common.gameUI.ui;
  10064. ui.topNode.aiNameTxt.text = "offline";
  10065. }
  10066. aiGameEnd(suc) {
  10067. this.success = suc;
  10068. xGame.common.aiPlayer.stopRun();
  10069. if (this.success) {
  10070. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10071. Laya.timer.once(1000, this, () => {
  10072. this.clearTime();
  10073. this.gameEnd();
  10074. });
  10075. }
  10076. }
  10077. openTimer() {
  10078. let src = xGame.common.gameUI;
  10079. if (this.selfTurn) {
  10080. src.ui.topNode.selfProgress.visible = true;
  10081. src.ui.topNode.aiProgress.visible = false;
  10082. this.curTimer = src.ui.topNode.selfProgress;
  10083. }
  10084. else {
  10085. src.ui.topNode.selfProgress.visible = false;
  10086. src.ui.topNode.aiProgress.visible = true;
  10087. this.curTimer = src.ui.topNode.aiProgress;
  10088. }
  10089. this.accTime = 0;
  10090. Laya.timer.clearAll(this);
  10091. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10092. this.curTimer.value = 100;
  10093. }
  10094. updateTime(dt) {
  10095. if (this.gamePause)
  10096. return;
  10097. this.accTime += dt;
  10098. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10099. if (this.accTime >= this.setTime) {
  10100. this.clearTime();
  10101. console.log("时钟进入了gameRun");
  10102. this.gameRun(FoulType.timeOut);
  10103. }
  10104. }
  10105. clearTime() {
  10106. let src = xGame.common.gameUI;
  10107. src.ui.topNode.selfProgress.visible = false;
  10108. src.ui.topNode.aiProgress.visible = false;
  10109. Laya.timer.clearAll(this);
  10110. }
  10111. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10112. let ui = xGame.common.gameUI.ui;
  10113. let selfMsg, aiMsg;
  10114. if (sayWords) {
  10115. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10116. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10117. if (Foul) {
  10118. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10119. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10120. this.placeRootBall();
  10121. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10122. if (this.curFoul == FoulType.rootHole) {
  10123. if (!DataMgr.getRootBallFoul()) {
  10124. DataMgr.setRootBallFoul();
  10125. aiMsg = "";
  10126. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10127. let woman = "Boss, pay attention next time~";
  10128. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10129. }
  10130. }
  10131. else if (this.curFoul == FoulType.timeOut) {
  10132. if (!DataMgr.getTimeoutFoul()) {
  10133. DataMgr.setTimeoutFoul();
  10134. aiMsg = "";
  10135. let tips = "Game timeout, 3 fouls, this game failed.";
  10136. let woman = "Boss, pay attention to the timeline~";
  10137. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10138. }
  10139. }
  10140. }
  10141. }
  10142. }
  10143. if (this.selfTurn) {
  10144. if (sayWords) {
  10145. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10146. ui.selfTurn.visible = true;
  10147. ui.aiTurn.visible = false;
  10148. ui.selfTurn.t0.play();
  10149. Moyu.vibration();
  10150. });
  10151. }
  10152. }
  10153. else {
  10154. let aiNum = xGame.tools.random(1, 11);
  10155. let challengeNum = DataMgr.getChallengeTimes();
  10156. let delay = false;
  10157. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10158. aiNum = 9;
  10159. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10160. aiNum = 3;
  10161. if (challengeNum == 3) {
  10162. if (!this.showLongView) {
  10163. this.showLongView = true;
  10164. delay = true;
  10165. }
  10166. }
  10167. }
  10168. }
  10169. if (delay) {
  10170. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10171. if (success) {
  10172. xGame.common.longHelpLine = true;
  10173. xGame.common.d2World.getHelpLine();
  10174. }
  10175. else {
  10176. aiNum = 10;
  10177. }
  10178. xGame.common.aiPlayer.setAiLevel(aiNum);
  10179. if (sayWords) {
  10180. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10181. xGame.common.aiPlayer.runAI();
  10182. ui.selfTurn.visible = false;
  10183. ui.aiTurn.visible = true;
  10184. ui.aiTurn.t0.play();
  10185. });
  10186. }
  10187. else {
  10188. xGame.common.aiPlayer.runAI();
  10189. }
  10190. this.openTimer();
  10191. this.finishOneShoot = true;
  10192. if (this.selfTurn) {
  10193. ui.topNode.selfKuang.visible = true;
  10194. ui.topNode.aiKuang.visible = false;
  10195. ui.topNode.selfTips.visible = true;
  10196. ui.topNode.aiTips.visible = false;
  10197. }
  10198. else {
  10199. ui.topNode.selfKuang.visible = false;
  10200. ui.topNode.aiKuang.visible = true;
  10201. ui.topNode.selfTips.visible = false;
  10202. ui.topNode.aiTips.visible = true;
  10203. }
  10204. });
  10205. return;
  10206. }
  10207. if (xGame.common.gameMode == GameMode.classic) {
  10208. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10209. if (cfg) {
  10210. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10211. aiNum = aiLevel;
  10212. }
  10213. }
  10214. xGame.common.aiPlayer.setAiLevel(aiNum);
  10215. if (sayWords) {
  10216. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10217. xGame.common.aiPlayer.runAI();
  10218. ui.selfTurn.visible = false;
  10219. ui.aiTurn.visible = true;
  10220. ui.aiTurn.t0.play();
  10221. });
  10222. }
  10223. else {
  10224. xGame.common.aiPlayer.runAI();
  10225. }
  10226. }
  10227. this.openTimer();
  10228. this.finishOneShoot = true;
  10229. if (this.selfTurn) {
  10230. ui.topNode.selfKuang.visible = true;
  10231. ui.topNode.aiKuang.visible = false;
  10232. ui.topNode.selfTips.visible = true;
  10233. ui.topNode.aiTips.visible = false;
  10234. }
  10235. else {
  10236. ui.topNode.selfKuang.visible = false;
  10237. ui.topNode.aiKuang.visible = true;
  10238. ui.topNode.selfTips.visible = false;
  10239. ui.topNode.aiTips.visible = true;
  10240. }
  10241. }
  10242. placeRootBall() {
  10243. let rootBall = xGame.common.d2World.rootBall;
  10244. if (!rootBall)
  10245. return;
  10246. rootBall.gameObj.x = this.lastRootBallPos.x;
  10247. rootBall.gameObj.y = this.lastRootBallPos.y;
  10248. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10249. let moveNode = xGame.common.gameUI.ui.moveNode;
  10250. moveNode.visible = true;
  10251. moveNode.x = this.lastRootBallPos.x;
  10252. moveNode.y = this.lastRootBallPos.y;
  10253. if (!this.selfTurn) {
  10254. xGame.common.aiPlayer.resetRoot();
  10255. }
  10256. }
  10257. }
  10258. class ui_guanyuAni extends fgui.GComponent {
  10259. static createInstance() {
  10260. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10261. }
  10262. onConstruct() {
  10263. this.n0 = (this.getChild("n0"));
  10264. }
  10265. }
  10266. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10267. class UIFireworks extends UIBase {
  10268. constructor() {
  10269. super();
  10270. }
  10271. onConstructor() {
  10272. this.isEject = false;
  10273. }
  10274. show(callback) {
  10275. super.show();
  10276. }
  10277. }
  10278. UIFireworks.uiName = "UIFireworks";
  10279. class ui_UIGuanYu extends fgui.GComponent {
  10280. static createInstance() {
  10281. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10282. }
  10283. onConstruct() {
  10284. this.n2 = (this.getChild("n2"));
  10285. this.n1 = (this.getChild("n1"));
  10286. this.n3 = (this.getChild("n3"));
  10287. this.n4 = (this.getChild("n4"));
  10288. this.n5 = (this.getChild("n5"));
  10289. this.n6 = (this.getChild("n6"));
  10290. this.n8 = (this.getChild("n8"));
  10291. this.n7 = (this.getChild("n7"));
  10292. this.t0 = this.getTransition("t0");
  10293. }
  10294. }
  10295. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10296. class UIGuanYu extends UIBase {
  10297. constructor() {
  10298. super();
  10299. }
  10300. onConstructor() {
  10301. this.ui = ui_UIGuanYu.createInstance();
  10302. this.contentPane = this.ui;
  10303. this.isEject = false;
  10304. }
  10305. show(callback) {
  10306. super.show();
  10307. this.ui.t0.play(Laya.Handler.create(this, () => {
  10308. callback && callback();
  10309. this.hide();
  10310. }));
  10311. this.setGlobalFont(this.ui);
  10312. }
  10313. }
  10314. UIGuanYu.uiName = "UIGuanYu";
  10315. class SkillMgr {
  10316. constructor() {
  10317. this.leveNum = 0;
  10318. this.extraScore = 0;
  10319. this.selfTurn = false;
  10320. this.playedLastSkill = false;
  10321. this.tweenArr = [];
  10322. this._finishNum = 0;
  10323. this._curFinish = 0;
  10324. this._rootX = 0;
  10325. this._rootY = 0;
  10326. this.knifeTimes = 0;
  10327. this.knifeV2 = new Laya.Vector2();
  10328. this.knifeV3 = new Laya.Vector3();
  10329. this.rtStarX = 0;
  10330. this.rtStarY = 0;
  10331. this.addBigSkillSpine();
  10332. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10333. }
  10334. addBigSkillSpine() {
  10335. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10336. console.log("extra2 success");
  10337. });
  10338. }
  10339. runBigSkill(callback) {
  10340. this.tweenArr = [];
  10341. this.callback = callback;
  10342. this.judgeSkill();
  10343. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10344. let guide = DataMgr.getSkillGuide();
  10345. if (!xGame.common.gameMgr.selfTurn) {
  10346. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10347. }
  10348. else {
  10349. if (xGame.common.temSelfLevel != 0) {
  10350. this.leveNum = xGame.common.temSelfLevel;
  10351. }
  10352. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10353. this.leveNum += 5;
  10354. }
  10355. }
  10356. if (guide == 0) {
  10357. DataMgr.setSkillGuide(1);
  10358. if (DataMgr.getNewUser()) {
  10359. Moyu.sendDataEvent("gameFirstPlay");
  10360. DataMgr.setNewUser();
  10361. }
  10362. }
  10363. this.playSpineAni(() => {
  10364. switch (this.curSkill) {
  10365. case SkillType.highSpace:
  10366. this.runHighSpace();
  10367. break;
  10368. case SkillType.breakArmy:
  10369. this.runBreakArmy();
  10370. break;
  10371. case SkillType.ice:
  10372. this.runIce();
  10373. break;
  10374. case SkillType.fireworks:
  10375. this.runFireworks();
  10376. break;
  10377. case SkillType.GuanYu:
  10378. this.runGuanYu();
  10379. break;
  10380. default:
  10381. break;
  10382. }
  10383. });
  10384. }
  10385. judgeSkill() {
  10386. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10387. let gameMgr = xGame.common.gameMgr;
  10388. let type;
  10389. for (let index = 0; index < typeArr.length; index++) {
  10390. type = typeArr[index];
  10391. if (gameMgr.selfTurn) {
  10392. if (gameMgr.selfCurSkill == type) {
  10393. this.selfTurn = true;
  10394. this.curSkill = type;
  10395. return;
  10396. }
  10397. }
  10398. else {
  10399. if (gameMgr.aiCurSkill == type) {
  10400. this.selfTurn = false;
  10401. this.curSkill = type;
  10402. return;
  10403. }
  10404. }
  10405. }
  10406. }
  10407. playSpineAni(callback) {
  10408. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10409. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10410. parent.destroyChildren();
  10411. let aniIndex = 0;
  10412. let skillSpine;
  10413. switch (this.curSkill) {
  10414. case SkillType.highSpace:
  10415. aniIndex = 1;
  10416. xGame.soundMgr.playSound("skill01");
  10417. skillSpine = this.skillSpine2;
  10418. data.scaleX = 0.5;
  10419. data.scaleY = 0.5;
  10420. skillSpine.play(data, 1, false, parent, () => {
  10421. callback && callback();
  10422. });
  10423. break;
  10424. case SkillType.breakArmy:
  10425. aniIndex = 2;
  10426. xGame.soundMgr.playSound("skill02");
  10427. skillSpine = this.skillSpine2;
  10428. data.scaleX = 0.5;
  10429. data.scaleY = 0.5;
  10430. skillSpine.play(data, 2, false, parent, () => {
  10431. callback && callback();
  10432. });
  10433. break;
  10434. case SkillType.ice:
  10435. aniIndex = 0;
  10436. xGame.soundMgr.playSound("skill03");
  10437. skillSpine = this.skillSpine2;
  10438. data.scaleX = 0.5;
  10439. data.scaleY = 0.5;
  10440. skillSpine.play(data, 0, false, parent, () => {
  10441. callback && callback();
  10442. });
  10443. break;
  10444. case SkillType.fireworks:
  10445. xGame.soundMgr.playSound("skill_04_01");
  10446. xGame.soundMgr.playSound("skill04");
  10447. xGame.uiMgr.Show(UIFireworks, callback);
  10448. break;
  10449. case SkillType.GuanYu:
  10450. xGame.soundMgr.playSound("skill05_1");
  10451. xGame.soundMgr.playSound("skill05");
  10452. xGame.uiMgr.Show(UIGuanYu, callback);
  10453. break;
  10454. default:
  10455. break;
  10456. }
  10457. }
  10458. getAllBallArr() {
  10459. let arr = xGame.common.d2World.ballArr;
  10460. let outArr = [];
  10461. for (let index = 0; index < arr.length; index++) {
  10462. if (arr[index] instanceof D2RootBallSrc)
  10463. continue;
  10464. if (arr[index].ballFunc == "ice")
  10465. continue;
  10466. if (arr[index].destroyed)
  10467. continue;
  10468. outArr.push(arr[index]);
  10469. }
  10470. return outArr;
  10471. }
  10472. getOneArr(deletObj) {
  10473. let allArr = this.getAllBallArr();
  10474. let temp;
  10475. for (let index = 0; index < allArr.length; index++) {
  10476. temp = allArr[index];
  10477. if (temp.id == deletObj.id) {
  10478. allArr.splice(index, 1);
  10479. break;
  10480. }
  10481. }
  10482. return allArr;
  10483. }
  10484. getNearBallBag(ball) {
  10485. let ui = xGame.common.gameUI.ui;
  10486. let circleArr = [];
  10487. for (let index = 1; index <= 6; index++) {
  10488. circleArr.push(ui.border["circle" + index]);
  10489. }
  10490. let outIndex = 0;
  10491. let temp;
  10492. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10493. ;
  10494. let dis = 0;
  10495. for (let index = 1; index < circleArr.length; index++) {
  10496. temp = circleArr[index];
  10497. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10498. if (dis < min) {
  10499. min = dis;
  10500. outIndex = index;
  10501. }
  10502. }
  10503. return [circleArr[outIndex], outIndex];
  10504. }
  10505. ballFlyToBag(ballArr, time = 300) {
  10506. let temp;
  10507. let hole;
  10508. this._finishNum = ballArr.length;
  10509. this._curFinish = 0;
  10510. let holeObj = {};
  10511. let holeCfg = {
  10512. "1": 0,
  10513. "2": 0,
  10514. "3": 0,
  10515. "4": 0,
  10516. "5": 0,
  10517. "6": 0
  10518. };
  10519. for (let index = 0; index < ballArr.length; index++) {
  10520. temp = ballArr[index];
  10521. temp.outColli.isSensor = true;
  10522. temp.innerColli.isSensor = true;
  10523. temp.isRunSkillAni = true;
  10524. let holeArr = this.getNearBallBag(temp);
  10525. hole = holeArr[0];
  10526. holeObj[index] = holeArr[1];
  10527. temp.d3BallSrc.scaleXYZ = 0.5;
  10528. this.tweenArr.push(temp.d3BallSrc, temp);
  10529. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10530. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10531. }));
  10532. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10533. let mIndex = holeObj[this._curFinish];
  10534. let isDone = holeCfg[mIndex];
  10535. if (isDone) {
  10536. ballArr[this._curFinish].checkWrongBall(false);
  10537. }
  10538. else {
  10539. holeCfg[mIndex] = 1;
  10540. ballArr[this._curFinish].checkWrongBall();
  10541. }
  10542. this._curFinish++;
  10543. if (this._curFinish >= this._finishNum) {
  10544. if (this.curSkill == SkillType.highSpace) {
  10545. }
  10546. else if (this.curSkill == SkillType.breakArmy) {
  10547. let rootBall = xGame.common.d2World.rootBall;
  10548. rootBall.gameObj.x = this._rootX;
  10549. rootBall.gameObj.y = this._rootY;
  10550. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10551. xGame.common.d2World.d2Gan.ui.visible = true;
  10552. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10553. xGame.common.d2World.getHelpLine();
  10554. this.callback && this.callback(this.extraScore);
  10555. }
  10556. }
  10557. }));
  10558. }
  10559. }
  10560. runHighSpace() {
  10561. let rootBall = xGame.common.d2World.rootBall;
  10562. rootBall.showSelf();
  10563. let d3Src = rootBall.d3BallSrc;
  10564. let allArr = this.getAllBallArr();
  10565. if (allArr.length <= 0) {
  10566. this.callback && this.callback(0);
  10567. return;
  10568. }
  10569. let selectBall = xGame.common.d2World.targetBall;
  10570. let wrong = selectBall && selectBall.destroyed;
  10571. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10572. selectBall = xGame.common.getRandArrEle(allArr);
  10573. }
  10574. let targetD3Src = selectBall.d3BallSrc;
  10575. xGame.common.d2World.d2Gan.ui.visible = false;
  10576. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10577. d3Src.scaleXYZ = 0.5;
  10578. this.tweenArr.push(d3Src);
  10579. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10580. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10581. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10582. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10583. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10584. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10585. let outArr = [selectBall];
  10586. let other = this.leveNum - 1;
  10587. if (other > 0) {
  10588. let nearArr = this.getOneArr(selectBall);
  10589. if (nearArr.length > 0) {
  10590. xGame.common.botherArr(nearArr);
  10591. if (other >= nearArr.length)
  10592. other = nearArr.length;
  10593. for (let index = 0; index < other; index++) {
  10594. outArr.push(nearArr[index]);
  10595. }
  10596. }
  10597. }
  10598. xGame.common.extraMoveNum = other + 1;
  10599. this.extraScore = other + 1;
  10600. this._rootX = selectBall.gameObj.x;
  10601. this._rootY = selectBall.gameObj.y;
  10602. rootBall.gameObj.x = this._rootX;
  10603. rootBall.gameObj.y = this._rootY;
  10604. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10605. Laya.Tween.clearAll(d3Src);
  10606. this.addRandomForce(outArr);
  10607. }));
  10608. }));
  10609. }
  10610. addRandomForce(outArr) {
  10611. if (outArr.length > 0) {
  10612. xGame.common.d2World.openCheckStill = true;
  10613. this.playedLastSkill = true;
  10614. }
  10615. let temp;
  10616. for (let index = 0; index < outArr.length; index++) {
  10617. let angle = xGame.common.randomNum(0, 360);
  10618. let linearPercent = xGame.common.randomNum(65, 100);
  10619. temp = outArr[index];
  10620. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10621. }
  10622. }
  10623. setLinearSpeed(angle, rigy, linearPercent) {
  10624. let sin = Math.sin(angle * Math.PI / 180);
  10625. let cos = Math.cos(angle * Math.PI / 180);
  10626. let maxSpeed = 4;
  10627. let speed = new Laya.Vector2();
  10628. speed.x = maxSpeed * linearPercent * sin;
  10629. speed.y = -maxSpeed * linearPercent * cos;
  10630. rigy.applyLinearImpulseToCenter(speed);
  10631. }
  10632. runBreakArmy() {
  10633. xGame.common.d2World.d2Gan.ui.visible = false;
  10634. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10635. let gameUI = xGame.common.gameUI.ui;
  10636. gameUI.skillRod.visible = true;
  10637. gameUI.skillRod.rotation = 110;
  10638. let outArr = this.getAllBallArr();
  10639. if (outArr.length <= 0) {
  10640. gameUI.skillRod.visible = false;
  10641. this.callback && this.callback(0);
  10642. return;
  10643. }
  10644. xGame.common.botherArr(outArr);
  10645. if (this.leveNum >= outArr.length)
  10646. this.leveNum = outArr.length;
  10647. let deleteNum = outArr.length - this.leveNum;
  10648. outArr.splice(0, deleteNum);
  10649. this.extraScore = this.leveNum;
  10650. let potX = gameUI.skillRod.x;
  10651. let potY = gameUI.skillRod.y;
  10652. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10653. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10654. let disArr = [];
  10655. for (let index = 0; index < outArr.length; index++) {
  10656. let obj = outArr[index];
  10657. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10658. dis = Math.pow(dis, 0.5);
  10659. disArr.push(dis);
  10660. }
  10661. this.tweenArr.push(gameUI.skillRod);
  10662. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10663. })).update = Laya.Handler.create(this, (e, t, c) => {
  10664. let angle = gameUI.skillRod.rotation;
  10665. let xx;
  10666. let yy;
  10667. let temp;
  10668. for (let index = 0; index < outArr.length; index++) {
  10669. temp = outArr[index];
  10670. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10671. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10672. yy -= 20;
  10673. temp.gameObj.x = xx;
  10674. temp.gameObj.y = yy;
  10675. temp.d3BallSrc.setTransPos(xx, yy);
  10676. }
  10677. if (angle <= 60) {
  10678. Laya.Tween.clearAll(gameUI.skillRod);
  10679. this.ballFlyToBag(outArr, 150);
  10680. gameUI.skillRod.visible = false;
  10681. }
  10682. }, null, false);
  10683. }
  10684. runIce() {
  10685. let ballArr = xGame.common.d2World.ballArr;
  10686. this.leveNum *= 2;
  10687. if (this.leveNum >= ballArr.length - 1)
  10688. this.leveNum = ballArr.length - 1;
  10689. let tempArr = [];
  10690. let outArr = [];
  10691. for (let index = 0; index < ballArr.length; index++) {
  10692. if (ballArr[index] instanceof D2RootBallSrc)
  10693. continue;
  10694. tempArr.push(ballArr[index]);
  10695. }
  10696. if (tempArr.length <= 0) {
  10697. this.callback && this.callback(0);
  10698. return;
  10699. }
  10700. xGame.common.botherArr(tempArr);
  10701. for (let index = 0; index < this.leveNum; index++) {
  10702. outArr.push(tempArr[index]);
  10703. }
  10704. this.extraScore = this.leveNum;
  10705. let temp;
  10706. for (let index = 0; index < outArr.length; index++) {
  10707. temp = outArr[index];
  10708. temp.d3BallSrc.playIceEft();
  10709. }
  10710. Laya.timer.once(2000, this, () => {
  10711. for (let index = 0; index < outArr.length; index++) {
  10712. temp = outArr[index];
  10713. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10714. temp.setBallFunc("ice", str);
  10715. }
  10716. this.callback && this.callback(0);
  10717. });
  10718. }
  10719. runFireworks() {
  10720. let allArr = this.getAllBallArr();
  10721. if (allArr.length <= 0) {
  10722. this.callback && this.callback(0);
  10723. return;
  10724. }
  10725. xGame.common.d2World.d2Gan.ui.visible = false;
  10726. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10727. let outArr = [];
  10728. let other = this.leveNum;
  10729. if (other > 0) {
  10730. if (allArr.length > 0) {
  10731. xGame.common.botherArr(allArr);
  10732. if (other >= allArr.length)
  10733. other = allArr.length;
  10734. for (let index = 0; index < other; index++) {
  10735. outArr.push(allArr[index]);
  10736. }
  10737. }
  10738. }
  10739. xGame.common.extraMoveNum = other;
  10740. this.extraScore = other;
  10741. this.addRandmomFireworks(outArr);
  10742. }
  10743. addRandmomFireworks(outArr) {
  10744. Laya.timer.once(1100, this, () => {
  10745. if (outArr.length > 0) {
  10746. xGame.common.d2World.openCheckStill = true;
  10747. this.playedLastSkill = true;
  10748. }
  10749. });
  10750. xGame.soundMgr.playSound("skill_04_02");
  10751. let temp;
  10752. let delay = -200;
  10753. for (let index = 0; index < outArr.length; index++) {
  10754. temp = outArr[index];
  10755. delay += 200;
  10756. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10757. let angle = xGame.common.randomNum(0, 360);
  10758. angle = this.getFireworksAngle(obj);
  10759. let linearPercent = xGame.common.randomNum(45, 80);
  10760. if (!obj.destroyed)
  10761. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10762. });
  10763. }
  10764. }
  10765. getFireworksAngle(obj) {
  10766. let rootBall = xGame.common.d2World.rootBall;
  10767. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10768. }
  10769. resetGame() {
  10770. Laya.timer.clearAll(this);
  10771. if (this.tweenArr) {
  10772. for (let index = 0; index < this.tweenArr.length; index++) {
  10773. Laya.Tween.clearAll(this.tweenArr[index]);
  10774. }
  10775. }
  10776. this.tweenArr = null;
  10777. }
  10778. runGuanYu() {
  10779. xGame.common.d2World.d2Gan.ui.visible = false;
  10780. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10781. let rootBall = xGame.common.d2World.rootBall;
  10782. if (rootBall.isInHole) {
  10783. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10784. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10785. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10786. rootBall.showSelf();
  10787. }
  10788. this.rtStarX = rootBall.gameObj.x;
  10789. this.rtStarY = rootBall.gameObj.y;
  10790. this.knifeTimes = 0;
  10791. this.playedLastSkill = true;
  10792. rootBall.forceRun = true;
  10793. rootBall.rigy.type = "static";
  10794. xGame.common.d2World.openCheckStill = true;
  10795. this.guanyuRandomKnife();
  10796. }
  10797. guanyuRandomKnife() {
  10798. let rootBall = xGame.common.d2World.rootBall;
  10799. let dir = this.getRandDir();
  10800. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10801. console.log("当前angle", angle);
  10802. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10803. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10804. let dis = 324;
  10805. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10806. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10807. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10808. this.rtStarX = rootBall.gameObj.x;
  10809. this.rtStarY = rootBall.gameObj.y;
  10810. this.knifeTimes++;
  10811. let skillLevel;
  10812. if (xGame.common.gameMgr.selfTurn) {
  10813. skillLevel = DataMgr.getBigSkillByIndex(4);
  10814. }
  10815. else {
  10816. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10817. }
  10818. if (!skillLevel)
  10819. skillLevel = 1;
  10820. skillLevel += 2;
  10821. if (this.knifeTimes < skillLevel) {
  10822. Laya.timer.once(400, this, () => {
  10823. this.guanyuRandomKnife();
  10824. });
  10825. }
  10826. else {
  10827. rootBall.forceRun = false;
  10828. rootBall.rigy.type = "dynamic";
  10829. xGame.common.extraMoveNum = skillLevel;
  10830. }
  10831. }));
  10832. }
  10833. getRandDir() {
  10834. let rootBall = xGame.common.d2World.rootBall;
  10835. let allBall = this.getAllBallArr();
  10836. let target = xGame.common.getRandArrEle(allBall);
  10837. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10838. return this.knifeV2;
  10839. }
  10840. cloneKnife(x, y, rotation) {
  10841. let parent = xGame.common.d3World.knifeRoot;
  10842. let prefab = xGame.common.d3World.knife;
  10843. let clone = prefab.clone();
  10844. parent.addChild(clone);
  10845. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10846. clone.transform.localPositionX = this.knifeV3.x;
  10847. clone.transform.localPositionY = 0;
  10848. clone.transform.localPositionZ = this.knifeV3.z;
  10849. clone.transform.localRotationEulerX = 0;
  10850. clone.transform.localRotationEulerY = rotation;
  10851. clone.transform.localRotationEulerZ = 0;
  10852. clone.active = true;
  10853. return clone;
  10854. }
  10855. cloneGuanYuEft(x, y, angle) {
  10856. return;
  10857. let parent = xGame.common.gameUI.ui.guanyuNode;
  10858. let eft = new ui_guanyuAni();
  10859. eft.parent = parent;
  10860. eft.x = x;
  10861. eft.y = y;
  10862. eft.rotation = angle;
  10863. }
  10864. }
  10865. class ui_UIWordsList extends fgui.GComponent {
  10866. static createInstance() {
  10867. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10868. }
  10869. onConstruct() {
  10870. this.c1 = this.getController("c1");
  10871. this.n74 = (this.getChild("n74"));
  10872. this.clickNode = (this.getChild("clickNode"));
  10873. this.myNode = (this.getChild("myNode"));
  10874. this.n68 = (this.getChild("n68"));
  10875. this.n66 = (this.getChild("n66"));
  10876. this.n55 = (this.getChild("n55"));
  10877. this.wordsBtn = (this.getChild("wordsBtn"));
  10878. this.emotionBtn = (this.getChild("emotionBtn"));
  10879. this.mybggg = (this.getChild("mybggg"));
  10880. this.wordsList = (this.getChild("wordsList"));
  10881. this.emotionList = (this.getChild("emotionList"));
  10882. this.myRoot = (this.getChild("myRoot"));
  10883. }
  10884. }
  10885. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10886. class EmotionDisplay {
  10887. constructor(index, ui) {
  10888. this.ui = ui;
  10889. this.index = index;
  10890. this.ui.onClick(this, this.clickSelf);
  10891. this.updateSelf();
  10892. }
  10893. updateSelf() {
  10894. let data = cfgTable.emotionData[this.index + 1];
  10895. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10896. }
  10897. clickSelf() {
  10898. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10899. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10900. xGame.common.talkMgr.closeTalkView();
  10901. }
  10902. }
  10903. class WordsDisplay {
  10904. constructor(index, ui) {
  10905. this.ui = ui;
  10906. this.index = index;
  10907. this.ui.onClick(this, this.clickSelf);
  10908. this.updateSelf();
  10909. }
  10910. updateSelf() {
  10911. let data = cfgTable.talkwordsData[this.index + 1];
  10912. this.ui.txt.text = data.msg;
  10913. }
  10914. clickSelf() {
  10915. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10916. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10917. xGame.common.talkMgr.closeTalkView();
  10918. }
  10919. }
  10920. class UIWordsList extends UIBase {
  10921. constructor() {
  10922. super();
  10923. }
  10924. onConstructor() {
  10925. this.ui = ui_UIWordsList.createInstance();
  10926. this.contentPane = this.ui;
  10927. this.isEject = false;
  10928. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10929. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10930. this.addUIClick(this.ui.clickNode, this.hide);
  10931. this.initTalkList();
  10932. this.initEmotionList();
  10933. }
  10934. show() {
  10935. super.show();
  10936. this.setGlobalFont(this.ui);
  10937. }
  10938. initTalkList() {
  10939. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10940. let data = cfgTable.talkwordsData;
  10941. let length = Object.keys(data).length;
  10942. this.ui.wordsList.numItems = length;
  10943. }
  10944. initEmotionList() {
  10945. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10946. let data = cfgTable.emotionData;
  10947. let length = Object.keys(data).length;
  10948. this.ui.emotionList.numItems = length;
  10949. }
  10950. renderTalkItem(index, obj) {
  10951. let temp = new WordsDisplay(index, obj);
  10952. }
  10953. renderEmotionItem(index, obj) {
  10954. let temp = new EmotionDisplay(index, obj);
  10955. }
  10956. openTalkList() {
  10957. this.ui.c1.selectedIndex = 0;
  10958. }
  10959. openEmotionList() {
  10960. this.ui.c1.selectedIndex = 1;
  10961. }
  10962. }
  10963. UIWordsList.uiName = "UIWordsList";
  10964. class TalkMgr {
  10965. constructor() {
  10966. this.aiSpeak = true;
  10967. this.emotionList = [];
  10968. this.talkList = [];
  10969. this.addEvent();
  10970. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10971. this.emotionList = [];
  10972. this.talkList = [];
  10973. for (let k in cfgTable.emotionData) {
  10974. this.emotionList.push(cfgTable.emotionData[k].id);
  10975. }
  10976. for (let k in cfgTable.talkwordsData) {
  10977. this.talkList.push(cfgTable.talkwordsData[k].id);
  10978. }
  10979. }
  10980. addEvent() {
  10981. let ui = xGame.common.gameUI.ui;
  10982. ui.wordsBtn.visible = true;
  10983. ui.wordsBtn.onClick(this, this.openTalkView);
  10984. ui.aiWordsBtn.visible = true;
  10985. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10986. }
  10987. openTalkView() {
  10988. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10989. xGame.uiMgr.Show(UIWordsList);
  10990. }
  10991. closeTalkView() {
  10992. xGame.uiMgr.Hide(UIWordsList);
  10993. }
  10994. clickAIState() {
  10995. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10996. this.aiSpeak = !this.aiSpeak;
  10997. this.changeAIState(this.aiSpeak);
  10998. }
  10999. changeAIState(speak) {
  11000. this.aiSpeak = speak;
  11001. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  11002. if (speak) {
  11003. btn.c1.selectedIndex = 0;
  11004. }
  11005. else {
  11006. btn.c1.selectedIndex = 1;
  11007. }
  11008. }
  11009. showSelfTalk(wordsId) {
  11010. let ui = xGame.common.gameUI.ui;
  11011. ui.selfTalk.visible = true;
  11012. ui.selfTalk.myNode.c1.selectedIndex = 1;
  11013. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11014. ui.selfTalk.t0.play();
  11015. }
  11016. showSelfEmotion(emotionId) {
  11017. let ui = xGame.common.gameUI.ui;
  11018. ui.selfTalk.visible = true;
  11019. ui.selfTalk.myNode.c1.selectedIndex = 0;
  11020. this.selfSpine && this.selfSpine.dispose();
  11021. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11022. let spineData = cfgTable.emotionData[emotionId].spine;
  11023. this.selfSpine = new SpineMgr(spineData, () => {
  11024. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  11025. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  11026. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11027. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  11028. });
  11029. ui.selfTalk.t0.play();
  11030. }
  11031. showAITalk(wordsId) {
  11032. if (!this.aiSpeak)
  11033. return;
  11034. if (DataMgr.gameData.gameCount < 2)
  11035. return;
  11036. if (wordsId < 1)
  11037. wordsId = this.getRandTalk();
  11038. let ui = xGame.common.gameUI.ui;
  11039. ui.aiTalk.visible = true;
  11040. ui.aiTalk.myNode.c1.selectedIndex = 1;
  11041. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11042. ui.aiTalk.t0.play();
  11043. }
  11044. getRandTalk() {
  11045. let rand = xGame.tools.random(0, this.talkList.length);
  11046. return this.emotionList[rand];
  11047. }
  11048. getRandEmotion() {
  11049. let rand = xGame.tools.random(0, this.emotionList.length);
  11050. return this.emotionList[rand];
  11051. }
  11052. showAIEmotion(emotionId) {
  11053. if (!this.aiSpeak)
  11054. return;
  11055. if (DataMgr.gameData.gameCount < 2)
  11056. return;
  11057. if (emotionId < 1)
  11058. emotionId = this.getRandEmotion();
  11059. let ui = xGame.common.gameUI.ui;
  11060. ui.aiTalk.visible = true;
  11061. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11062. this.aiSpine && this.aiSpine.dispose();
  11063. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11064. let spineData = cfgTable.emotionData[emotionId].spine;
  11065. this.aiSpine = new SpineMgr(spineData, () => {
  11066. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11067. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11068. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11069. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11070. });
  11071. ui.aiTalk.t0.play();
  11072. }
  11073. resetGame() {
  11074. let ui = xGame.common.gameUI.ui;
  11075. ui.aiTalk.visible = false;
  11076. ui.selfTalk.visible = false;
  11077. this.aiSpine && this.aiSpine.dispose();
  11078. this.selfSpine && this.selfSpine.dispose();
  11079. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11080. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11081. this.closeTalkView();
  11082. }
  11083. }
  11084. class WordsMgr {
  11085. constructor() {
  11086. this.comboTimes = 1;
  11087. this.skillTimes = 0;
  11088. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11089. this.comboSpine = new SpineMgr("yxz_liangan");
  11090. this.skillSpine = new SpineMgr("yiganxqiu");
  11091. this.scoreSpine = new SpineMgr("defen");
  11092. }
  11093. setClassicCombo(isInterrupt) {
  11094. if (isInterrupt) {
  11095. this.comboTimes = 0;
  11096. }
  11097. }
  11098. playClassicWords(type, callback) {
  11099. this.callback = callback;
  11100. let aniIndex = type;
  11101. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11102. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11103. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11104. mySpine.destroy(true);
  11105. this.playClassicTimes();
  11106. });
  11107. }
  11108. playClassicTimes() {
  11109. this.comboTimes++;
  11110. if (this.comboTimes <= 1) {
  11111. this.callback && this.callback();
  11112. }
  11113. else {
  11114. let aniIndex = this.comboTimes - 1;
  11115. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11116. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11117. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11118. mySpine.destroy(true);
  11119. this.callback && this.callback();
  11120. });
  11121. }
  11122. }
  11123. playBigSkillTimes(times, callback) {
  11124. if (times <= 0) {
  11125. callback && callback();
  11126. return;
  11127. }
  11128. this.callback = callback;
  11129. let pre = "sz_0";
  11130. let aniIndex = 0;
  11131. this.getWordsImg(times, pre, () => {
  11132. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11133. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11134. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11135. let r1 = ``;
  11136. let r2 = ``;
  11137. if (times <= 9) {
  11138. r1 = `res/d2Res/${pre}${times}.png`;
  11139. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11140. aniIndex = 0;
  11141. }
  11142. else {
  11143. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11144. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11145. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11146. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11147. aniIndex = 1;
  11148. }
  11149. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11150. mySpine.destroy(true);
  11151. xGame.common.gameMgr.playSkillTips();
  11152. this.playScore(times);
  11153. xGame.common.playRandomMutiBallBigSkillSound();
  11154. }, mySpine);
  11155. });
  11156. }
  11157. playScore(score) {
  11158. let pre = "sz_";
  11159. let aniIndex = 0;
  11160. this.getWordsImg(score, pre, () => {
  11161. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11162. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11163. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11164. let r1 = ``;
  11165. let r2 = ``;
  11166. if (score <= 9) {
  11167. r1 = `res/d2Res/${pre}${score}.png`;
  11168. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11169. aniIndex = 0;
  11170. }
  11171. else {
  11172. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11173. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11174. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11175. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11176. aniIndex = 1;
  11177. }
  11178. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11179. mySpine.destroy(true);
  11180. this.callback && this.callback();
  11181. }, mySpine);
  11182. });
  11183. }
  11184. getWordsImg(number, pre = "", callback) {
  11185. let arr = [];
  11186. if (number <= 9) {
  11187. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11188. }
  11189. else {
  11190. arr.push({ url: `res/d2Res/${pre}${number % 10}.png`, type: Laya.Loader.IMAGE }, { url: `res/d2Res/${pre}${Math.floor(number / 10)}.png`, type: Laya.Loader.IMAGE });
  11191. }
  11192. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11193. callback && callback();
  11194. }));
  11195. }
  11196. }
  11197. class ui_UIRodMethod extends fgui.GComponent {
  11198. static createInstance() {
  11199. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11200. }
  11201. onConstruct() {
  11202. this.n24 = (this.getChild("n24"));
  11203. this.white = (this.getChild("white"));
  11204. this.dot = (this.getChild("dot"));
  11205. this.sureBtn = (this.getChild("sureBtn"));
  11206. this.n20 = (this.getChild("n20"));
  11207. this.n21 = (this.getChild("n21"));
  11208. this.n22 = (this.getChild("n22"));
  11209. this.n23 = (this.getChild("n23"));
  11210. this.n5 = (this.getChild("n5"));
  11211. this.n14 = (this.getChild("n14"));
  11212. this.t0 = this.getTransition("t0");
  11213. }
  11214. }
  11215. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11216. class UIRodMethod extends UIBase {
  11217. constructor() {
  11218. super();
  11219. this.isPressd = false;
  11220. }
  11221. onConstructor() {
  11222. this.ui = ui_UIRodMethod.createInstance();
  11223. this.contentPane = this.ui;
  11224. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11225. this.moveDir = new Laya.Vector2();
  11226. this.moveDest = new Laya.Vector2();
  11227. this.centerPos = new Laya.Vector2();
  11228. xGame.common.uiRodMethod = this;
  11229. }
  11230. show() {
  11231. super.show();
  11232. xGame.common.gameMgr.gamePause = true;
  11233. this.openPressDotEvent();
  11234. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11235. this.centerPos.x = this.ui.white.x;
  11236. this.centerPos.y = this.ui.white.y;
  11237. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11238. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11239. this.setDot();
  11240. this.setGlobalFont(this.ui);
  11241. }
  11242. setDot() {
  11243. this.ui.dot.x = this.moveDest.x;
  11244. this.ui.dot.y = this.moveDest.y;
  11245. }
  11246. closeSelf() {
  11247. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11248. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11249. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11250. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11251. xGame.common.gameMgr.gamePause = false;
  11252. this.hide();
  11253. }
  11254. openPressDotEvent() {
  11255. this.closePressDotEvent();
  11256. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11257. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11258. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11259. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11260. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11261. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11262. }
  11263. closePressDotEvent() {
  11264. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11265. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11266. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11267. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11268. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11269. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11270. }
  11271. onDown(e) {
  11272. if (e.type == Laya.Event.MOUSE_DOWN)
  11273. this.isPressd = true;
  11274. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11275. this.isPressd = false;
  11276. if (!this.isPressd)
  11277. return;
  11278. this.moveDest.x = e.stageX;
  11279. this.moveDest.y = e.stageY;
  11280. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11281. if (dis > 6724) {
  11282. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11283. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11284. }
  11285. this.setDot();
  11286. }
  11287. resetRod() {
  11288. this.ui.dot.x = this.ui.white.x;
  11289. this.ui.dot.y = this.ui.white.y;
  11290. this.gameRod.dot.x = this.gameRod.bg.x;
  11291. this.gameRod.dot.y = this.gameRod.bg.y;
  11292. xGame.common.rodOffest.x = 0;
  11293. xGame.common.rodOffest.y = 0;
  11294. }
  11295. }
  11296. UIRodMethod.uiName = "UIRodMethod";
  11297. class UIGame extends UIBase {
  11298. constructor() {
  11299. super();
  11300. this.powerNum = 0;
  11301. this.isD3Inited = false;
  11302. this.isPrePlay = false;
  11303. this.isMoveRod = false;
  11304. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11305. this.rulerDis = 20;
  11306. this.rulerOffset = 0;
  11307. }
  11308. onConstructor() {
  11309. this.ui = ui_UIGame.createInstance();
  11310. this.contentPane = this.ui;
  11311. this.ui.x += xGame.common.sysOffestNum;
  11312. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11313. this.isEject = false;
  11314. xGame.common.gameUI = this;
  11315. this.initSelf();
  11316. }
  11317. isTurnSelf() {
  11318. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11319. return true;
  11320. }
  11321. }
  11322. initSelf() {
  11323. let topUI = this.ui.topNode;
  11324. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11325. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11326. this.barInfo = {};
  11327. this.barInfo.curY = 0;
  11328. this.barInfo.height = this.ui.powerNode.height;
  11329. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11330. this.barInfo.powerStartY = this.ui.powerNode.y;
  11331. xGame.common.aiPlayer = new AIPlayer();
  11332. xGame.common.gameMgr = new GameMgr();
  11333. xGame.common.skillMgr = new SkillMgr();
  11334. xGame.common.wordsMgr = new WordsMgr();
  11335. xGame.common.talkMgr = new TalkMgr();
  11336. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11337. });
  11338. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11339. });
  11340. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11341. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11342. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11343. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11344. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11345. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11346. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11347. }
  11348. getGanZiImg() {
  11349. let index = DataMgr.getCurBallRod();
  11350. let data = cfgTable.ballrodData[index + 1];
  11351. let gan_url = xGame.common.getGameIconUrl(data.img);
  11352. this.ui.powerNode.showImg.url = gan_url;
  11353. }
  11354. returnHome() {
  11355. let tips = "Are you sure to exit the game?";
  11356. let woman = "Boss, why don't you play for a while longer?";
  11357. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11358. }
  11359. addRodMethodClick() {
  11360. if (this.isTurnSelf()) {
  11361. xGame.uiMgr.Show(UIRodMethod);
  11362. }
  11363. }
  11364. clickHelpLineBtn(force = false) {
  11365. if (!this.isTurnSelf())
  11366. return;
  11367. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11368. if (success) {
  11369. xGame.common.longHelpLine = true;
  11370. xGame.common.d2World.getHelpLine();
  11371. Moyu.sendDataEvent("guideNum");
  11372. }
  11373. else {
  11374. }
  11375. });
  11376. }
  11377. renderSelfDisplayBalls(index, target) {
  11378. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11379. target.myImg.url = xGame.common.getGameIconUrl(str);
  11380. }
  11381. renderAIDisplayBalls(index, target) {
  11382. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11383. target.myImg.url = xGame.common.getGameIconUrl(str);
  11384. ;
  11385. }
  11386. updateMode() {
  11387. if (xGame.common.gameMode == GameMode.classic) {
  11388. this.ui.topNode.scoreNode.visible = false;
  11389. }
  11390. else if (xGame.common.gameMode == GameMode.bigMove) {
  11391. this.ui.topNode.scoreNode.visible = true;
  11392. }
  11393. }
  11394. show() {
  11395. super.show();
  11396. this.ui.alpha = 0;
  11397. this.updateSelf();
  11398. xGame.common.gameMgr.gamePause = false;
  11399. xGame.common.gameUI.ui.blackAni.visible = false;
  11400. xGame.common.gameUI.ui.whiteAni.visible = false;
  11401. this.ui.powerEft.visible = false;
  11402. this.ui.colorNode.visible = false;
  11403. this.updateHead();
  11404. let curUse = DataMgr.getCurBallRod();
  11405. this.getGanZiImg();
  11406. this.setGlobalFont(this.ui);
  11407. }
  11408. updateSelf() {
  11409. if (xGame.common.gameMode == GameMode.classic) {
  11410. this.ui.c1.selectedIndex = 0;
  11411. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11412. this.ui.topNode.middleNode.visible = true;
  11413. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11414. }
  11415. else if (xGame.common.gameMode == GameMode.bigMove) {
  11416. this.ui.c1.selectedIndex = 0;
  11417. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11418. this.ui.topNode.middleNode.visible = false;
  11419. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11420. let rand = xGame.common.randomNum(1, max);
  11421. let guide = DataMgr.getSkillGuide();
  11422. if (guide == 0)
  11423. rand = 1;
  11424. xGame.common.bigMoveLevelIndex = rand;
  11425. }
  11426. else if (xGame.common.gameMode == GameMode.placeBall) {
  11427. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11428. this.ui.c1.selectedIndex = 1 + data.type;
  11429. this.ui.alpha = 1;
  11430. this.startGame();
  11431. }
  11432. this.updateMode();
  11433. this.initD3world();
  11434. this.initD2world();
  11435. }
  11436. startGame() {
  11437. this.ui.snowNode.visible = Math.random() <= 0.1;
  11438. this.ui.d2Node.visible = false;
  11439. xGame.common.d3World.d3Hand.gameObj.active = false;
  11440. xGame.common.d3World.tableSrc.init();
  11441. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11442. this.cameraViewChange(() => {
  11443. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11444. switch (xGame.common.gameMode) {
  11445. case GameMode.classic:
  11446. xGame.common.d3World.d3Hand.gameObj.active = true;
  11447. this.playPutBallD3Ani();
  11448. break;
  11449. case GameMode.bigMove:
  11450. this.enterGame();
  11451. Laya.timer.once(500, this, () => {
  11452. this.ui.topNode.middleNode.visible = true;
  11453. this.ui.topNode.middleNode.t0.play();
  11454. });
  11455. break;
  11456. case GameMode.placeBall:
  11457. this.enterGame();
  11458. break;
  11459. default:
  11460. break;
  11461. }
  11462. });
  11463. PlatMgr.showBanner(false);
  11464. }
  11465. enterGame() {
  11466. this.ui.d2Node.visible = true;
  11467. xGame.common.d3World.d3Hand.gameObj.active = false;
  11468. xGame.common.showOneCamera("mainCamera");
  11469. Moyu.recordGame(30, true);
  11470. if (!this.isPrePlay) {
  11471. this.isPrePlay = true;
  11472. xGame.common.d3World.prePlayEft();
  11473. }
  11474. xGame.common.gameMgr.gameReady();
  11475. this.openAllEvent();
  11476. this.ui.snowNode.visible = false;
  11477. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11478. this.ui.helpBtn.visible = condition;
  11479. }
  11480. showHelpLineGuide() {
  11481. let longGuide = DataMgr.getGuideHelpLine();
  11482. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11483. this.ui.helpBtn.visible = true;
  11484. this.ui.guideNode.visible = true;
  11485. }
  11486. }
  11487. setTurnAlpha(alpha) {
  11488. this.ui.keduNode.alpha = alpha;
  11489. this.ui.ganNode.alpha = alpha;
  11490. this.ui.rodMethodNode.alpha = alpha;
  11491. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11492. }
  11493. cameraViewChange(callback) {
  11494. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11495. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11496. xGame.common.showOneCamera("visitAngle");
  11497. cameraSrc.localRotationEulerY = 180;
  11498. cameraSrc.localRotationEulerZ = 0;
  11499. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11500. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11501. callback && callback();
  11502. }));
  11503. }));
  11504. }
  11505. playPutBallD3Ani() {
  11506. xGame.common.showOneCamera("mainCamera");
  11507. let handSrc = xGame.common.d3World.d3Hand;
  11508. handSrc.gameObj.active = true;
  11509. handSrc.transform.localPositionZ = 3;
  11510. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11511. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11512. handSrc.gameObj.active = false;
  11513. this.enterGame();
  11514. }), 400);
  11515. }));
  11516. }
  11517. updateHead() {
  11518. let user = Moyu.getUserInfo();
  11519. this.ui.topNode.selfNameTxt.text = user.nickName;
  11520. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11521. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11522. if (DataMgr.getSkillGuide() < 1) {
  11523. this.ui.topNode.aiNameTxt.text = 'billiards';
  11524. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11525. }
  11526. else {
  11527. this.ui.topNode.aiNameTxt.text = aiData.name;
  11528. let randNo = Math.floor(Math.random() * 10) + 1;
  11529. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11530. }
  11531. }
  11532. initD2world() {
  11533. let node = this.ui.d2Root.displayObject;
  11534. let src = node.getComponent(D2World);
  11535. if (!src) {
  11536. xGame.common.d2World = node.addComponent(D2World);
  11537. }
  11538. xGame.common.d2World.initSelf();
  11539. }
  11540. initD3world() {
  11541. if (this.isD3Inited)
  11542. return;
  11543. this.isD3Inited = true;
  11544. let scene3D = xGame.common.d3Scene;
  11545. this.ui.d3Root.displayObject.addChild(scene3D);
  11546. scene3D.active = true;
  11547. xGame.common.d3World.tableSrc.setBorderPos();
  11548. }
  11549. onRootMove(e) {
  11550. let rootBall = xGame.common.d2World.rootBall;
  11551. this.ui.moveNode.x = e.x;
  11552. this.ui.moveNode.y = e.y;
  11553. rootBall.gameObj.x = e.x;
  11554. rootBall.gameObj.y = e.y;
  11555. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11556. }
  11557. aiRootMove(move) {
  11558. if (move)
  11559. this.hideBallUI();
  11560. else {
  11561. this.showBallUI();
  11562. xGame.common.d2World.getHelpLine();
  11563. }
  11564. }
  11565. aiForce(type, force = 0) {
  11566. this.pressTarget = PressType.powerNode;
  11567. if (type == 1)
  11568. this.onEventUp({ force: true });
  11569. else if (type == 2)
  11570. this.onEventMove({ stageY: force, force: true });
  11571. }
  11572. onEventPress(e) {
  11573. if (e.stopPropagation)
  11574. e.stopPropagation();
  11575. if (!this.isTurnSelf())
  11576. return;
  11577. let target = e.target;
  11578. switch (target) {
  11579. case this.ui.myPowerNode.displayObject:
  11580. this.pressTarget = PressType.powerNode;
  11581. this.barInfo.curY = e.stageY;
  11582. this.updateBarInfo();
  11583. break;
  11584. case this.ui.moveNode.displayObject:
  11585. this.pressTarget = PressType.moveNode;
  11586. this.hideBallUI();
  11587. this.eventObj.curX = this.ui.moveNode.x;
  11588. this.eventObj.curY = this.ui.moveNode.y;
  11589. this.ui.moveNode.finger.visible = false;
  11590. this.eventObj.lastX = e.stageX;
  11591. this.eventObj.lastY = e.stageY;
  11592. break;
  11593. case this.ui.rulerClickNode.displayObject:
  11594. this.pressTarget = PressType.rulerNode;
  11595. this.eventObj.lastY = e.stageY;
  11596. break;
  11597. case this.ui.d2Root.displayObject:
  11598. this.pressTarget = PressType.d2Root;
  11599. this.eventObj.lastX = e.stageX;
  11600. this.eventObj.lastY = e.stageY;
  11601. this.eventObj.starX = e.stageX;
  11602. this.eventObj.starY = e.stageY;
  11603. this.eventObj.curX = 0;
  11604. this.eventObj.curY = 0;
  11605. xGame.common.d2World.d2Gan.setGanLastInfo();
  11606. this.rulerOffset = 0;
  11607. break;
  11608. default:
  11609. break;
  11610. }
  11611. }
  11612. onEventMove(e) {
  11613. if (e.stopPropagation)
  11614. e.stopPropagation();
  11615. if (e && e.force) {
  11616. }
  11617. else {
  11618. if (!this.isTurnSelf())
  11619. return;
  11620. }
  11621. switch (this.pressTarget) {
  11622. case PressType.powerNode:
  11623. this.barInfo.curY = e.stageY;
  11624. this.updateBarInfo();
  11625. this.isMoveRod = true;
  11626. break;
  11627. case PressType.moveNode:
  11628. let rootBall = xGame.common.d2World.rootBall;
  11629. let radius = rootBall.gameObj.width / 2;
  11630. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11631. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11632. let border = xGame.common.d2World.borderRect;
  11633. if (curX <= border.x + radius)
  11634. curX = border.x + radius;
  11635. else if (curX >= border.x + border.width - radius)
  11636. curX = border.x + border.width - radius;
  11637. if (curY <= border.y + radius)
  11638. curY = border.y + radius;
  11639. else if (curY >= border.y + border.height - radius)
  11640. curY = border.y + border.height - radius;
  11641. if (xGame.common.gameMgr.isOpenBall) {
  11642. if (curX >= border.x + border.openBallW - radius)
  11643. curX = border.x + border.openBallW - radius;
  11644. }
  11645. this.ui.moveNode.x = curX;
  11646. this.ui.moveNode.y = curY;
  11647. rootBall.gameObj.x = curX;
  11648. rootBall.gameObj.y = curY;
  11649. rootBall.d3BallSrc.setTransPos(curX, curY);
  11650. this.isMoveRod = true;
  11651. break;
  11652. case PressType.rulerNode:
  11653. let yy = e.stageY - this.eventObj.lastY;
  11654. this.eventObj.lastY = e.stageY;
  11655. let ruler1 = this.ui.rulerNode.img1;
  11656. let ruler2 = this.ui.rulerNode.img2;
  11657. ruler1.y += yy;
  11658. ruler2.y += yy;
  11659. this.rulerOffset += yy;
  11660. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11661. this.rulerOffset = 0;
  11662. xGame.soundMgr.playSound("inch", 1, 10);
  11663. }
  11664. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11665. let h = ruler1.height;
  11666. this.checkGuide();
  11667. this.isMoveRod = true;
  11668. if (ruler1.y >= h) {
  11669. ruler1.y = -h;
  11670. ruler2.y = 0;
  11671. return;
  11672. }
  11673. else if (ruler1.y <= -h) {
  11674. ruler1.y = h;
  11675. ruler2.y = 0;
  11676. return;
  11677. }
  11678. if (ruler2.y >= h) {
  11679. ruler2.y = -h;
  11680. ruler1.y = 0;
  11681. return;
  11682. }
  11683. else if (ruler2.y <= -h) {
  11684. ruler2.y = h;
  11685. ruler1.y = 0;
  11686. return;
  11687. }
  11688. break;
  11689. case PressType.d2Root:
  11690. this.eventObj.curX = e.stageX;
  11691. this.eventObj.curY = e.stageY;
  11692. let offset = this.checkRodMoveDir();
  11693. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11694. this.eventObj.lastX = e.stageX;
  11695. this.eventObj.lastY = e.stageY;
  11696. break;
  11697. default:
  11698. break;
  11699. }
  11700. }
  11701. onEventUp(e) {
  11702. if (e.stopPropagation)
  11703. e.stopPropagation();
  11704. if (e && e.force) {
  11705. }
  11706. else {
  11707. if (!this.isTurnSelf())
  11708. return;
  11709. }
  11710. switch (this.pressTarget) {
  11711. case PressType.powerNode:
  11712. this.ui.powerNode.value = 0;
  11713. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11714. this.ui.powerTxt.text = "";
  11715. if (this.powerNum > 0) {
  11716. xGame.eventMgr.event(BALL_SHOOT);
  11717. xGame.common.d2World.shoot(this.powerNum);
  11718. xGame.common.d2World.d2Gan.shoot();
  11719. xGame.common.d2World.d2HelpLine.shoot();
  11720. this.finishGuide();
  11721. this.ui.powerEft.visible = false;
  11722. this.ui.colorNode.visible = false;
  11723. let ganStr = "";
  11724. if (this.powerNum <= 30) {
  11725. ganStr = "gan_30";
  11726. }
  11727. else if (this.powerNum <= 60) {
  11728. ganStr = "gan_50";
  11729. }
  11730. else {
  11731. ganStr = "gan_80";
  11732. }
  11733. xGame.soundMgr.playSound(ganStr);
  11734. }
  11735. break;
  11736. case PressType.moveNode:
  11737. let rootBall = xGame.common.d2World.rootBall;
  11738. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11739. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11740. let isIntersect = this.judgeBallIntersect();
  11741. if (isIntersect) {
  11742. this.ui.moveNode.x = lastX;
  11743. this.ui.moveNode.y = lastY;
  11744. rootBall.gameObj.x = lastX;
  11745. rootBall.gameObj.y = lastY;
  11746. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11747. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11748. }
  11749. else {
  11750. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11751. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11752. }
  11753. this.showBallUI();
  11754. this.ui.moveNode.finger.visible = true;
  11755. xGame.common.d2World.getHelpLine();
  11756. break;
  11757. case PressType.rulerNode:
  11758. break;
  11759. case PressType.d2Root:
  11760. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11761. if (dis <= 25) {
  11762. this.moveToClickDot(e);
  11763. }
  11764. break;
  11765. default:
  11766. break;
  11767. }
  11768. this.pressTarget = -1;
  11769. }
  11770. checkGuide() {
  11771. let guide = DataMgr.getSkillGuide();
  11772. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11773. xGame.common.guideStep++;
  11774. xGame.common.gameUI.ui.guide2.visible = false;
  11775. xGame.common.gameUI.ui.guide3.visible = true;
  11776. }
  11777. }
  11778. finishGuide() {
  11779. let guide = DataMgr.getSkillGuide();
  11780. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11781. xGame.common.guideStep = 10;
  11782. this.closeAllGuide();
  11783. console.log('zh: 新手引导完毕');
  11784. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11785. }
  11786. }
  11787. closeAllGuide() {
  11788. xGame.common.gameUI.ui.guide1.visible = false;
  11789. xGame.common.gameUI.ui.guide2.visible = false;
  11790. xGame.common.gameUI.ui.guide3.visible = false;
  11791. }
  11792. updateBarInfo() {
  11793. let star = this.ui.powerNode.y;
  11794. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11795. if (rate >= 1)
  11796. rate = 1;
  11797. if (rate <= 0)
  11798. rate = 0;
  11799. this.powerNum = Math.ceil(rate * 100);
  11800. this.ui.powerNode.value = this.powerNum;
  11801. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11802. this.ui.colorNode.value = this.powerNum;
  11803. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11804. this.ui.powerEft.visible = this.powerNum != 0;
  11805. this.ui.colorNode.visible = this.powerNum != 0;
  11806. this.ui.powerTxt.text = this.powerNum + "";
  11807. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11808. }
  11809. forceCancel() {
  11810. this.ui.powerNode.value = 0;
  11811. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11812. this.ui.powerTxt.text = "";
  11813. }
  11814. checkRodMoveDir() {
  11815. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11816. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11817. if (tempX >= 0 && tempY <= 0) {
  11818. return this.checkDir();
  11819. }
  11820. else if (tempX < 0 && tempY < 0) {
  11821. return this.checkDir(1, -1);
  11822. }
  11823. else if (tempX < 0 && tempY > 0) {
  11824. return this.checkDir(-1, -1);
  11825. }
  11826. else {
  11827. return this.checkDir(-1, 1);
  11828. }
  11829. }
  11830. checkDir(flagX = 1, flagY = 1) {
  11831. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11832. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11833. if (offsetY == 0) {
  11834. return offsetX * flagX;
  11835. }
  11836. if (offsetX == 0) {
  11837. return offsetY * flagY;
  11838. }
  11839. let angle = offsetY / offsetX;
  11840. if (Math.abs(angle) >= 1) {
  11841. return offsetY * flagY;
  11842. }
  11843. else {
  11844. return offsetX * flagX;
  11845. }
  11846. }
  11847. judgeBallIntersect() {
  11848. let rootBall = xGame.common.d2World.rootBall;
  11849. let ballArr = xGame.common.d2World.ballArr;
  11850. let radius = rootBall.gameObj.width / 2;
  11851. let temp;
  11852. let isIntersect = false;
  11853. for (let index = 0; index < ballArr.length; index++) {
  11854. temp = ballArr[index];
  11855. if (temp.number == rootBall.number)
  11856. continue;
  11857. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11858. if (isIntersect) {
  11859. break;
  11860. }
  11861. }
  11862. return isIntersect;
  11863. }
  11864. hideBallUI() {
  11865. let d2Gan = xGame.common.d2World.d2Gan;
  11866. if (!d2Gan.ui.isDisposed)
  11867. d2Gan.ui.visible = false;
  11868. let d2Help = xGame.common.d2World.d2HelpLine;
  11869. if (!d2Help.ui.isDisposed)
  11870. d2Help.ui.visible = false;
  11871. let rootBall = xGame.common.d2World.rootBall;
  11872. if (!rootBall.destroyed) {
  11873. rootBall.gameObj.active = false;
  11874. }
  11875. }
  11876. showBallUI() {
  11877. let d2Gan = xGame.common.d2World.d2Gan;
  11878. if (!d2Gan.ui.isDisposed)
  11879. d2Gan.ui.visible = true;
  11880. let d2Help = xGame.common.d2World.d2HelpLine;
  11881. if (!d2Help.ui.isDisposed)
  11882. d2Help.ui.visible = true;
  11883. let rootBall = xGame.common.d2World.rootBall;
  11884. if (!rootBall.destroyed) {
  11885. rootBall.gameObj.active = true;
  11886. }
  11887. }
  11888. moveToClickDot(e) {
  11889. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11890. let root = xGame.common.d2World.rootBall.gameObj;
  11891. let xx = e.stageX - xGame.common.sysOffestNum;
  11892. let yy = e.stageY;
  11893. let x = xx - root.x;
  11894. let y = yy - root.y;
  11895. let angle = xGame.common.getfguiRotation(x, y);
  11896. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11897. xGame.common.d2World.getHelpLine();
  11898. }
  11899. this.isMoveRod = false;
  11900. xGame.common.clickedBall = false;
  11901. }
  11902. openAllEvent() {
  11903. this.closeAllEvent();
  11904. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11905. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11906. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11907. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11908. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11909. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11910. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11911. }
  11912. closeAllEvent() {
  11913. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11914. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11915. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11916. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11917. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11918. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11919. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11920. }
  11921. resetGame() {
  11922. this.closeAllEvent();
  11923. this.hideBallUI();
  11924. xGame.common.gameMgr.gamePause = true;
  11925. }
  11926. }
  11927. UIGame.uiName = "UIGame";
  11928. class UIAddProp extends UIBase {
  11929. constructor() {
  11930. super();
  11931. this.curType = "";
  11932. }
  11933. onConstructor() {
  11934. this.ui = ui_UIAddProp.createInstance();
  11935. this.contentPane = this.ui;
  11936. this.isEject = false;
  11937. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11938. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11939. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11940. this.updateUI();
  11941. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11942. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11943. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11944. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11945. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11946. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11947. }
  11948. show(type) {
  11949. super.show();
  11950. this.curType = type == 0 ? "coin" : "diamond";
  11951. this.switchBtn("");
  11952. this.ui.t0.play();
  11953. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11954. PlatMgr.showInsert(true);
  11955. this.setGlobalFont(this.ui);
  11956. }
  11957. closeSelf() {
  11958. this.hide();
  11959. }
  11960. updateUI() {
  11961. let data = cfgTable.moneyData;
  11962. let temp;
  11963. let obj;
  11964. for (const key in data) {
  11965. temp = data[key];
  11966. obj = this.ui.myNode["node" + key];
  11967. if (parseInt(key) <= 2) {
  11968. obj.diamondTxt.text = "+" + temp.num;
  11969. }
  11970. else {
  11971. obj.coinTxt.text = temp.num;
  11972. obj.diamondTxt.text = temp.get.split('_')[1];
  11973. }
  11974. }
  11975. this.updateDiamondShare();
  11976. }
  11977. updateDiamondShare() {
  11978. let data = DataMgr.getShareDiamondTimes();
  11979. if (data >= xGame.common.maxShareDiamondTimes) {
  11980. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11981. this.ui.myNode.node1.touchable = false;
  11982. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11983. }
  11984. else {
  11985. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11986. this.ui.myNode.node1.touchable = true;
  11987. }
  11988. }
  11989. switchBtn(type) {
  11990. if (type == "")
  11991. type = this.curType;
  11992. else {
  11993. if (this.curType == type) {
  11994. return;
  11995. }
  11996. else {
  11997. this.curType = type;
  11998. }
  11999. }
  12000. if (type == "coin") {
  12001. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  12002. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  12003. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  12004. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  12005. this.ui.myNode.c1.selectedIndex = 0;
  12006. }
  12007. else {
  12008. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  12009. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  12010. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  12011. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  12012. this.ui.myNode.c1.selectedIndex = 1;
  12013. }
  12014. }
  12015. convertCoin(index) {
  12016. let data = cfgTable.moneyData[index];
  12017. let coinNum = data.num;
  12018. let str = data.get.split('_')[1];
  12019. let needDiamond = parseInt(str);
  12020. if (DataMgr.diamondEnough(needDiamond)) {
  12021. DataMgr.setDiamond(-needDiamond);
  12022. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  12023. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12024. }
  12025. else {
  12026. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12027. this.switchBtn("diamond");
  12028. }
  12029. }
  12030. videoGetDiamond() {
  12031. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12032. if (Laya.Browser.onAndroid) {
  12033. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12034. if (!boo) {
  12035. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12036. return;
  12037. }
  12038. }
  12039. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12040. }
  12041. else {
  12042. console.log('zh:AD 失败,直接发放奖励');
  12043. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12044. }
  12045. }
  12046. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12047. let num = cfgTable.moneyData[2].num;
  12048. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12049. this.closeSelf();
  12050. }
  12051. videoGetCoin() {
  12052. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12053. if (Laya.Browser.onAndroid) {
  12054. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12055. if (!boo) {
  12056. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12057. return;
  12058. }
  12059. }
  12060. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12061. }
  12062. else {
  12063. console.log('zh:AD 失败,直接发放奖励');
  12064. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12065. }
  12066. }
  12067. qjff_AD_for_uiAddProp_videoGetCoin() {
  12068. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12069. this.closeSelf();
  12070. }
  12071. shareGetDiamond() {
  12072. let times = DataMgr.getShareDiamondTimes();
  12073. if (times >= xGame.common.maxShareDiamondTimes) {
  12074. console.log('zh: 233333333333 maxShareDiamondTimes');
  12075. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12076. }
  12077. else {
  12078. console.log('zh:33333333333333ad');
  12079. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12080. if (Laya.Browser.onAndroid) {
  12081. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12082. if (!boo) {
  12083. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12084. return;
  12085. }
  12086. }
  12087. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12088. }
  12089. else {
  12090. console.log('zh:AD 失败,直接发放奖励');
  12091. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12092. }
  12093. }
  12094. }
  12095. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12096. let diamond = xGame.common.randomNum(50, 100);
  12097. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12098. DataMgr.setShareDiamondTimes(1);
  12099. this.updateDiamondShare();
  12100. }
  12101. openPutBallView() {
  12102. let end = xGame.uiMgr.getUI(UIGameEnd);
  12103. let skill = xGame.uiMgr.getUI(UISkill);
  12104. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12105. let uigame = xGame.uiMgr.getUI(UIGame);
  12106. if (end && !end.isHide) {
  12107. xGame.uiMgr.Hide(UIGameEnd);
  12108. xGame.uiMgr.Show(UIMain);
  12109. }
  12110. if (skill && !skill.isHide)
  12111. xGame.uiMgr.Hide(UISkill);
  12112. if (uigame && !uigame.isHide)
  12113. xGame.uiMgr.Hide(UIGame);
  12114. if (level && !level.isHide) {
  12115. }
  12116. else {
  12117. xGame.uiMgr.Show(UILevelDisplay);
  12118. }
  12119. this.closeSelf();
  12120. }
  12121. }
  12122. UIAddProp.uiName = "UIAddProp";
  12123. class MoneyNode {
  12124. constructor(ui) {
  12125. this.leftTime = 0;
  12126. this.ui = ui;
  12127. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12128. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12129. this.ui.addPowerBtn.onClick(this, this.addPower);
  12130. this.ui.c1.selectedIndex = 1;
  12131. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12132. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12133. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12134. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12135. this.coinChange();
  12136. this.diamondChange();
  12137. this.powerChange();
  12138. }
  12139. addPower() {
  12140. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12141. xGame.uiMgr.Show(UIPower);
  12142. }
  12143. powerChange() {
  12144. let powerNum = DataMgr.getPower();
  12145. this.ui.powerTxt.text = powerNum + "";
  12146. }
  12147. checkPowerTime() {
  12148. let cur = new Date().getTime();
  12149. let last = DataMgr.getPowerTime();
  12150. if (last == 0) {
  12151. last = cur;
  12152. DataMgr.setPowerTime(cur);
  12153. }
  12154. let power = DataMgr.getPower();
  12155. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12156. Laya.timer.clearAll(this);
  12157. if (power >= xGame.common.natureMaxPower) {
  12158. this.ui.powerTimeTxt.text = "";
  12159. DataMgr.setPowerTime(cur);
  12160. return;
  12161. }
  12162. if (power + offset >= xGame.common.natureMaxPower) {
  12163. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12164. this.ui.powerTimeTxt.text = "";
  12165. DataMgr.setPowerTime(cur);
  12166. }
  12167. else {
  12168. if (offset > 0) {
  12169. DataMgr.setPower(offset);
  12170. DataMgr.setPowerTime(cur);
  12171. }
  12172. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12173. this.leftTime = xGame.common.powerRecoverNum - time;
  12174. if (this.leftTime <= 0)
  12175. this.leftTime = 0;
  12176. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12177. Laya.timer.loop(1000, this, this.updatePowerTime);
  12178. }
  12179. }
  12180. updatePowerTime() {
  12181. this.leftTime -= 1;
  12182. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12183. if (this.leftTime <= 0) {
  12184. this.checkPowerTime();
  12185. }
  12186. }
  12187. coinChange() {
  12188. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12189. }
  12190. diamondChange() {
  12191. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12192. }
  12193. addCoin() {
  12194. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12195. Moyu.sendDataEvent("AddCoinBtn");
  12196. xGame.uiMgr.Show(UIAddProp, 0);
  12197. }
  12198. addDiamond() {
  12199. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12200. Moyu.sendDataEvent("AddDiamondBtn");
  12201. xGame.uiMgr.Show(UIAddProp, 1);
  12202. }
  12203. }
  12204. class UIDraw extends UIBase {
  12205. constructor() {
  12206. super();
  12207. this.curKey = 0;
  12208. }
  12209. onConstructor() {
  12210. this.ui = ui_UIDraw.createInstance();
  12211. this.contentPane = this.ui;
  12212. this.isEject = false;
  12213. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12214. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12215. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12216. this.initDraw();
  12217. this.initUI();
  12218. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12219. }
  12220. show() {
  12221. super.show();
  12222. this.ui.t0.play();
  12223. this.playSecretaryIdle();
  12224. this.updateDraw();
  12225. this.checkFree();
  12226. if (PlatMgr.bannerDelay > 0) {
  12227. this.ui.closeNode.closeBtn.visible = false;
  12228. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12229. this.ui.closeNode.closeBtn.visible = true;
  12230. });
  12231. }
  12232. PlatMgr.showRateBanner();
  12233. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12234. this.setGlobalFont(this.ui);
  12235. }
  12236. hide() {
  12237. Laya.timer.clearAll(this);
  12238. super.hide();
  12239. }
  12240. checkFree() {
  12241. let isFree = DataMgr.getDailyfreeDrawTimes();
  12242. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12243. }
  12244. initDraw() {
  12245. this.drawObj = [];
  12246. let data = cfgTable.drawData;
  12247. let temp;
  12248. let weight = 0;
  12249. for (const key in data) {
  12250. temp = data[key];
  12251. weight += temp.weight;
  12252. this.drawObj.push(weight);
  12253. }
  12254. this.allWeight = weight;
  12255. }
  12256. initUI() {
  12257. let data = cfgTable.drawData;
  12258. let temp;
  12259. let img;
  12260. let txt;
  12261. for (const key in data) {
  12262. temp = data[key];
  12263. img = this.ui.myNode.rotNode["img" + key];
  12264. txt = this.ui.myNode.rotNode["txt" + key];
  12265. img.url = xGame.common.getGameIconUrl(temp.icon);
  12266. txt.visible = true;
  12267. if (temp.award > 2) {
  12268. img.rotation = 0;
  12269. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12270. }
  12271. else {
  12272. img.rotation = temp.rotation;
  12273. txt.text = temp.num;
  12274. }
  12275. }
  12276. }
  12277. getCurkey() {
  12278. let rand = Math.random() * this.allWeight;
  12279. let temp;
  12280. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12281. temp = this.drawObj[index];
  12282. if (index == 0) {
  12283. if (rand < temp) {
  12284. return index + 1;
  12285. }
  12286. }
  12287. else {
  12288. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12289. return index + 1;
  12290. }
  12291. }
  12292. }
  12293. return 2;
  12294. }
  12295. startDraw() {
  12296. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12297. if (freeTimes > 0) {
  12298. this.beginDraw();
  12299. DataMgr.setDailyfreeDrawTimes(0);
  12300. this.checkFree();
  12301. }
  12302. else {
  12303. if (Laya.Browser.onAndroid) {
  12304. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12305. if (!boo) {
  12306. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12307. return;
  12308. }
  12309. }
  12310. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12311. }
  12312. else {
  12313. console.log('zh:AD 失败,直接发放奖励');
  12314. this.qjff_chouJiang();
  12315. }
  12316. }
  12317. }
  12318. qjff_chouJiang() {
  12319. this.beginDraw();
  12320. }
  12321. beginDraw() {
  12322. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12323. this.ui.drawBtn.touchable = false;
  12324. this.curKey = this.getCurkey();
  12325. console.log("当前key", this.curKey);
  12326. let cell = 60;
  12327. let lap = 3;
  12328. let angle = cell * (this.curKey - 1) + lap * 360;
  12329. let target = this.ui.myNode.rotNode;
  12330. target.rotation = 0;
  12331. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12332. console.log("旋转完成");
  12333. this.ui.drawBtn.touchable = true;
  12334. this.getAward();
  12335. }));
  12336. }
  12337. getAward() {
  12338. let data = cfgTable.drawData[this.curKey];
  12339. let temp = new AwardType();
  12340. temp.type = data.award;
  12341. temp.num = data.num;
  12342. xGame.common.getAward([temp], () => {
  12343. DataMgr.setDrawTimes(1);
  12344. this.updateDraw();
  12345. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12346. });
  12347. }
  12348. updateDraw() {
  12349. let drawTimes = DataMgr.getDrawTimes();
  12350. let awardTimes = DataMgr.getDrawAwardTimes();
  12351. if (Math.floor(drawTimes / 3) > awardTimes) {
  12352. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12353. this.ui.extraNode.boxBtn.touchable = true;
  12354. this.ui.extraNode.tipsTxt.text = "3/3";
  12355. this.ui.extraNode.barNode.width = 265;
  12356. this.getExtraAward();
  12357. }
  12358. else {
  12359. this.ui.extraNode.boxBtn.t0.stop();
  12360. this.ui.extraNode.boxBtn.touchable = false;
  12361. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12362. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12363. }
  12364. let data = cfgTable.drawData[1];
  12365. if (awardTimes == 0) {
  12366. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12367. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12368. this.ui.myNode.rotNode.img1.rotation = 0;
  12369. }
  12370. else {
  12371. let award = data.nextid;
  12372. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12373. this.ui.myNode.rotNode.txt1.text = award[1];
  12374. this.ui.myNode.rotNode.img1.rotation = 0;
  12375. }
  12376. }
  12377. getExtraAward() {
  12378. let drawTimes = DataMgr.getDrawTimes();
  12379. let awardTimes = DataMgr.getDrawAwardTimes();
  12380. let data = cfgTable.drawData[1];
  12381. let award = new AwardType();
  12382. if (awardTimes == 0) {
  12383. award.num = data.num;
  12384. award.type = data.award;
  12385. xGame.common.getAward([award], () => {
  12386. let all = Math.floor(drawTimes / 3);
  12387. DataMgr.setDrawAwardTimes(all);
  12388. this.updateDraw();
  12389. });
  12390. }
  12391. else {
  12392. award.num = parseInt(data.nextid[1]);
  12393. award.type = parseInt(data.nextid[0]);
  12394. xGame.common.getAward([award], () => {
  12395. let all = Math.floor(drawTimes / 3);
  12396. DataMgr.setDrawAwardTimes(all);
  12397. this.updateDraw();
  12398. });
  12399. }
  12400. }
  12401. closeSelf() {
  12402. this.hide();
  12403. }
  12404. playSecretaryIdle() {
  12405. let parent = this.ui.secretary.displayObject;
  12406. parent.destroyChildren();
  12407. let xx = this.ui.secretary.width / 2;
  12408. let yy = this.ui.secretary.height;
  12409. let scale = xGame.common.getSecretaryScale();
  12410. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12411. xGame.common.secretary.play(data, 0, true, parent);
  12412. }
  12413. }
  12414. UIDraw.uiName = "UIDraw";
  12415. class ui_UIFlyEft extends fgui.GComponent {
  12416. static createInstance() {
  12417. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12418. }
  12419. onConstruct() {
  12420. this.n0 = (this.getChild("n0"));
  12421. this.n1 = (this.getChild("n1"));
  12422. this.n2 = (this.getChild("n2"));
  12423. this.n3 = (this.getChild("n3"));
  12424. this.n4 = (this.getChild("n4"));
  12425. this.n5 = (this.getChild("n5"));
  12426. this.n6 = (this.getChild("n6"));
  12427. this.n7 = (this.getChild("n7"));
  12428. this.iconNode = (this.getChild("iconNode"));
  12429. this.txt = (this.getChild("txt"));
  12430. this.txtNode = (this.getChild("txtNode"));
  12431. }
  12432. }
  12433. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12434. class UIFlyEft extends UIBase {
  12435. constructor() {
  12436. super();
  12437. this.max = 8;
  12438. this.delay = 0;
  12439. }
  12440. onConstructor() {
  12441. this.ui = ui_UIFlyEft.createInstance();
  12442. this.contentPane = this.ui;
  12443. this.isEject = false;
  12444. this.isMuti = true;
  12445. this.ui.x += xGame.common.sysOffestNum;
  12446. }
  12447. getArrPos() {
  12448. if (this.iconPos && this.iconPos.length > 0)
  12449. return;
  12450. this.iconPos = [];
  12451. let temp;
  12452. for (let index = 0; index < this.max; index++) {
  12453. temp = this.ui["n" + index];
  12454. this.iconPos.push([temp.x, temp.y]);
  12455. }
  12456. }
  12457. show(stPos, edPos, num, type, callback) {
  12458. super.show();
  12459. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12460. this.getArrPos();
  12461. this.updateUI(type);
  12462. this.updatePos();
  12463. this.runFly(edPos, callback);
  12464. this.runWorlds(stPos, num);
  12465. this.setGlobalFont(this.ui);
  12466. }
  12467. updateUI(type) {
  12468. let temp;
  12469. let str;
  12470. for (let index = 0; index < this.max; index++) {
  12471. temp = this.ui["n" + index];
  12472. str = this.getIconStr(type);
  12473. temp.url = xGame.common.getGameIconUrl(str);
  12474. }
  12475. }
  12476. getIconStr(type) {
  12477. switch (type) {
  12478. case Prop.diamond:
  12479. return "ty_zs";
  12480. case Prop.coin:
  12481. return "ty_jb";
  12482. default:
  12483. break;
  12484. }
  12485. }
  12486. updatePos() {
  12487. let temp;
  12488. for (let index = 0; index < this.max; index++) {
  12489. temp = this.ui["n" + index];
  12490. temp.x = this.iconPos[index][0];
  12491. temp.y = this.iconPos[index][1];
  12492. }
  12493. }
  12494. runFly(endPos, callback) {
  12495. let all = 0;
  12496. let temp;
  12497. for (let index = 0; index < this.max; index++) {
  12498. temp = this.ui["n" + index];
  12499. temp.visible = true;
  12500. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12501. temp.visible = false;
  12502. all++;
  12503. if (all >= this.max) {
  12504. callback && callback();
  12505. }
  12506. }), 20 * index);
  12507. }
  12508. }
  12509. runWorlds(stPos, num) {
  12510. let str = "+" + num;
  12511. this.ui.txt.text = str;
  12512. let starX = stPos.x;
  12513. let starY = stPos.y + 50;
  12514. this.ui.txt.x = starX;
  12515. this.ui.txt.y = starY;
  12516. this.ui.txt.visible = true;
  12517. this.ui.txt.alpha = 1;
  12518. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12519. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12520. this.ui.txt.visible = false;
  12521. this.hide();
  12522. }));
  12523. }));
  12524. }
  12525. }
  12526. UIFlyEft.uiName = "UIFlyEft";
  12527. class Common {
  12528. constructor() {
  12529. this.convertNum = 0.025;
  12530. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12531. this.scaleV3One = new Laya.Vector3();
  12532. this.scaleV3Two = new Laya.Vector3();
  12533. this.posV4 = new Laya.Vector4();
  12534. this.showDebug = false;
  12535. this.openGuide = true;
  12536. this.rodOffest = new Laya.Vector2(0, 0);
  12537. this.rodAngle = 0;
  12538. this.gameMode = GameMode.classic;
  12539. this.bigMoveLevelIndex = 1;
  12540. this.bigMoveNeedCoin = 1000;
  12541. this.classicNiceNeddCoin = 1000;
  12542. this.passAwardCoin = 2000;
  12543. this.classicRoomType = 1;
  12544. this.maxPower = 20;
  12545. this.natureMaxPower = 5;
  12546. this.videoPower = 2;
  12547. this.powerRecoverNum = 900;
  12548. this.curPlayerSkillType = 0;
  12549. this.isNewDay = false;
  12550. this.clickedBall = false;
  12551. this.placeBallCurLevel = 0;
  12552. this.placeBallStarNum = 0;
  12553. this.longHelpLine = false;
  12554. this.maxShareDiamondTimes = 3;
  12555. this.guideStep = 0;
  12556. this.temSelfLevel = 0;
  12557. this.extraMoveNum = 0;
  12558. this.curRankID = 0;
  12559. this.rankID = {
  12560. normalStar: 12000,
  12561. wxStar: 12001
  12562. };
  12563. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12564. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12565. this.btnClickStr = "buttonclick";
  12566. this.maxSkillLevel = 10;
  12567. this.upSkillLevel = false;
  12568. this.gameStartTime = 0;
  12569. this._sysOffestNum = 0;
  12570. this.angleV2 = new Laya.Vector2();
  12571. this.rootV = new Laya.Vector2(0, 1);
  12572. this.tempDir1 = new Laya.Vector2();
  12573. this.tempDir2 = new Laya.Vector2();
  12574. this.ballSize = 33;
  12575. this.stPos = new Laya.Point();
  12576. this.edPos = new Laya.Point();
  12577. Common._instance = this;
  12578. window["common"] = this;
  12579. }
  12580. static getInstance() {
  12581. if (!this._instance) {
  12582. this._instance = new Common();
  12583. }
  12584. return this._instance;
  12585. }
  12586. get sysOffestNum() {
  12587. if (this._sysOffestNum == 0) {
  12588. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12589. }
  12590. return this._sysOffestNum;
  12591. }
  12592. testShader() {
  12593. let test = new LightShader();
  12594. test.texture = "res/d3Res/ballTexture/ball1.png";
  12595. Laya.stage.addChild(test);
  12596. }
  12597. playScale(node) {
  12598. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12599. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12600. }));
  12601. }));
  12602. }
  12603. setGroup(colli, ...group) {
  12604. let out = 0;
  12605. for (let index = 0; index < group.length; index++) {
  12606. if (index == 0) {
  12607. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12608. }
  12609. else {
  12610. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12611. }
  12612. }
  12613. colli.collisionGroup = out;
  12614. }
  12615. setCanGroupWith(colli, ...group) {
  12616. let out = 0;
  12617. for (let index = 0; index < group.length; index++) {
  12618. if (index == 0) {
  12619. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12620. }
  12621. else {
  12622. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12623. }
  12624. }
  12625. colli.canCollideWith = out;
  12626. }
  12627. loadPrefab(name, callback) {
  12628. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12629. let prefab = new Laya.Prefab();
  12630. prefab.json = obj;
  12631. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12632. callback && callback(img);
  12633. }));
  12634. }
  12635. pos2to3Convert(x, y, d3Pos) {
  12636. x = x + this.sysOffestNum;
  12637. d3Pos.setValue(x, y, 0);
  12638. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12639. if (success) {
  12640. }
  12641. else {
  12642. console.error("转换出错了。。。。。。。。");
  12643. }
  12644. }
  12645. scale2to3Convert(num) {
  12646. this.scaleV3One.setValue(0, 0, 0);
  12647. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12648. this.scaleV3Two.setValue(0, num, 0);
  12649. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12650. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12651. return outNum;
  12652. }
  12653. pos3to2Convert(d3Pos) {
  12654. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12655. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12656. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12657. d3Pos.x -= this.sysOffestNum;
  12658. }
  12659. scale3to2Convert(num) {
  12660. let scale = this.scale2to3Convert(1);
  12661. let d2Out = num / scale;
  12662. return d2Out;
  12663. }
  12664. getCollider(type, restitution = 0.9, density = 10) {
  12665. let colli;
  12666. if (type == "box")
  12667. colli = new Laya.BoxCollider();
  12668. else
  12669. colli = new Laya.CircleCollider();
  12670. colli.friction = 0;
  12671. colli.restitution = restitution;
  12672. colli.density = density;
  12673. return colli;
  12674. }
  12675. getRigbody() {
  12676. let rigy = new Laya.RigidBody();
  12677. rigy.bullet = true;
  12678. rigy.allowRotation = false;
  12679. rigy.allowSleep = false;
  12680. rigy.gravityScale = 0;
  12681. return rigy;
  12682. }
  12683. getfguiRotation(x, y) {
  12684. this.angleV2.setValue(x, y);
  12685. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12686. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12687. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12688. angle = -angle;
  12689. }
  12690. return 180 + angle;
  12691. }
  12692. getAngle(x, y) {
  12693. this.angleV2.setValue(x, y);
  12694. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12695. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12696. return angle;
  12697. }
  12698. randomNum(a, b) {
  12699. return a + Math.floor((b - a + 1) * Math.random());
  12700. }
  12701. getRandArrEle(arr) {
  12702. return arr[Math.floor(arr.length * Math.random())];
  12703. }
  12704. getSign(val) {
  12705. return val >= 0 ? 1 : -1;
  12706. }
  12707. botherArr(arr) {
  12708. let times = arr.length + 2;
  12709. let length = arr.length;
  12710. let a;
  12711. let b;
  12712. let temp;
  12713. for (let index = 0; index < times; index++) {
  12714. a = Math.floor(Math.random() * length);
  12715. b = Math.floor(Math.random() * length);
  12716. temp = arr[a];
  12717. arr[a] = arr[b];
  12718. arr[b] = temp;
  12719. }
  12720. }
  12721. getGameIconUrl(id) {
  12722. return "ui://game/" + id;
  12723. }
  12724. getComponentUrl(id) {
  12725. return "ui://game/" + id;
  12726. }
  12727. getAnimation() {
  12728. }
  12729. judgeSkillType(type = SkillType.highSpace) {
  12730. if (this.gameMode == GameMode.classic)
  12731. return;
  12732. let gameMgr = this.gameMgr;
  12733. if (gameMgr.selfTurn) {
  12734. if (gameMgr.selfCurSkill == type) {
  12735. return true;
  12736. }
  12737. }
  12738. else {
  12739. if (gameMgr.aiCurSkill == type) {
  12740. return true;
  12741. }
  12742. }
  12743. }
  12744. ballColliHole(collider) {
  12745. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12746. xGame.common.gameMgr.isFirstInGame = false;
  12747. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12748. }
  12749. collider.owner.mySrc.checkWrongBall();
  12750. }
  12751. getArrMaxEle(arr) {
  12752. let max = -Infinity;
  12753. for (let index = 0; index < arr.length; index++) {
  12754. max = Math.max(arr[index], max);
  12755. }
  12756. return max;
  12757. }
  12758. getArrMinEle(arr) {
  12759. let min = Infinity;
  12760. for (let index = 0; index < arr.length; index++) {
  12761. min = Math.min(arr[index], min);
  12762. }
  12763. return min;
  12764. }
  12765. playRandomMutiBallBigSkillSound() {
  12766. if (Math.random() <= 0.5)
  12767. return;
  12768. let rand = this.randomNum(1, 6);
  12769. let str = "ganfa0" + rand;
  12770. xGame.soundMgr.playSound(str);
  12771. }
  12772. showOneCamera(type) {
  12773. let object = xGame.common.d3World.cameraObj;
  12774. for (const key in object) {
  12775. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12776. object[key].init();
  12777. object[key].owner.active = key == type;
  12778. }
  12779. }
  12780. }
  12781. checkBallOverBorder(x, y) {
  12782. let radius = 17;
  12783. let condition = this._checkBorder(x + radius, y) ||
  12784. this._checkBorder(x - radius, y) ||
  12785. this._checkBorder(x, y + radius) ||
  12786. this._checkBorder(x, y - radius);
  12787. if (condition) {
  12788. return true;
  12789. }
  12790. }
  12791. _checkBorder(x, y) {
  12792. let borderRect = this.d2World.borderRect;
  12793. let xOffest = 20;
  12794. let yOffest = 20;
  12795. if (y <= borderRect.y - yOffest) {
  12796. return true;
  12797. }
  12798. if (y >= borderRect.y + borderRect.height + yOffest) {
  12799. return true;
  12800. }
  12801. if (x <= borderRect.x - xOffest) {
  12802. return true;
  12803. }
  12804. if (x >= borderRect.x + borderRect.width + xOffest) {
  12805. return true;
  12806. }
  12807. }
  12808. initWeight(cfg) {
  12809. let allCfgData = { data: {}, allWeightNum: 0 };
  12810. let weightCfg = allCfgData.data;
  12811. let weight = 0;
  12812. for (const key in cfg) {
  12813. weightCfg[key] = {};
  12814. weightCfg[key].id = cfg[key].id;
  12815. weightCfg[key].minWeight = weight;
  12816. weight += cfg[key].weight;
  12817. weightCfg[key].maxWeight = weight;
  12818. }
  12819. allCfgData.allWeightNum = weight;
  12820. return allCfgData;
  12821. }
  12822. getRandomWeightData(cfg) {
  12823. let weightCfg = cfg.data;
  12824. let allWeightNum = cfg.allWeightNum;
  12825. let rand = Math.floor(Math.random() * allWeightNum);
  12826. for (const key in weightCfg) {
  12827. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12828. return weightCfg[key];
  12829. }
  12830. }
  12831. return weightCfg[1];
  12832. }
  12833. showGirlTalkPop(wordsIndex, node, msgNode) {
  12834. node.visible = true;
  12835. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12836. node.t0.play(Laya.Handler.create(this, () => {
  12837. node.visible = false;
  12838. }));
  12839. }
  12840. stopGirlPop(node) {
  12841. node.t0.stop();
  12842. node.visible = false;
  12843. }
  12844. createHead(loader, url, size = 107) {
  12845. if (Laya.Browser.name == "Browser") {
  12846. loader.url = url;
  12847. return;
  12848. }
  12849. else {
  12850. console.log('zh:url=', url);
  12851. loader.url = url;
  12852. }
  12853. }
  12854. addTestCoin(num) {
  12855. DataMgr.setCoin(num);
  12856. }
  12857. addTestDiamond(num) {
  12858. DataMgr.setDiamond(num);
  12859. }
  12860. addTestSkill() {
  12861. DataMgr.setBigSkill(0, 99);
  12862. DataMgr.setBigSkill(1, 99);
  12863. DataMgr.setBigSkill(2, 99);
  12864. }
  12865. playClassicEmotion(number, x, y) {
  12866. if (this.gameMode == GameMode.bigMove)
  12867. return;
  12868. let randIndex = this.randomNum(0, 2);
  12869. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12870. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12871. if (this.gameMgr.selfTurn) {
  12872. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12873. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12874. }
  12875. else {
  12876. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12877. }
  12878. else {
  12879. if (number == this.gameMgr.blackNum) {
  12880. if (this.gameMgr.selfBallArr.length == 0) {
  12881. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12882. }
  12883. else {
  12884. }
  12885. }
  12886. else {
  12887. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12888. }
  12889. }
  12890. }
  12891. }
  12892. else {
  12893. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12894. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12895. }
  12896. else {
  12897. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12898. }
  12899. else {
  12900. if (number == this.gameMgr.blackNum) {
  12901. if (this.gameMgr.aiBallArr.length == 0) {
  12902. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12903. }
  12904. else {
  12905. }
  12906. }
  12907. else {
  12908. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12909. }
  12910. }
  12911. }
  12912. }
  12913. }
  12914. playHappySound(number) {
  12915. if (this.gameMode != GameMode.classic)
  12916. return;
  12917. if (number == 8)
  12918. return;
  12919. let play = false;
  12920. if (this.gameMgr.selfTurn) {
  12921. if (this.gameMgr.ensureBallType) {
  12922. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12923. play = true;
  12924. }
  12925. }
  12926. else {
  12927. play = true;
  12928. }
  12929. }
  12930. else {
  12931. if (this.gameMgr.ensureBallType) {
  12932. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12933. play = true;
  12934. }
  12935. }
  12936. else {
  12937. play = true;
  12938. }
  12939. }
  12940. if (play)
  12941. xGame.soundMgr.playSound("applause");
  12942. }
  12943. destroyClassicEmotion() {
  12944. if (this.gameMode == GameMode.bigMove)
  12945. return;
  12946. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12947. parent.destroyChildren();
  12948. }
  12949. playAwardSpine(x, y) {
  12950. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12951. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12952. this.awardSpine.play(data, 0, false, parent);
  12953. }
  12954. destroyAwardSpine() {
  12955. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12956. parent.destroyChildren();
  12957. }
  12958. isBlock(bx, by, hx, hy, except = null) {
  12959. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12960. let balls = xGame.common.d2World.ballArr;
  12961. let outArr = [];
  12962. for (let index = 0; index < balls.length; index++) {
  12963. let obj = balls[index];
  12964. if (obj.number == 0)
  12965. continue;
  12966. if (obj == except)
  12967. continue;
  12968. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12969. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12970. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12971. if (num >= 1)
  12972. num = 1;
  12973. if (num < 0)
  12974. continue;
  12975. let gap = Math.sin(Math.acos(num)) * dis;
  12976. if (gap < this.ballSize) {
  12977. outArr.push({
  12978. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12979. disHon: Math.cos(Math.acos(num)) * dis,
  12980. disVer: Math.sin(Math.acos(num)) * dis,
  12981. src: balls[index],
  12982. dir: this.tempDir1
  12983. });
  12984. }
  12985. }
  12986. if (outArr.length > 0) {
  12987. outArr.sort((a, b) => { return a.dis - b.dis; });
  12988. return outArr[0];
  12989. }
  12990. }
  12991. AngleBetween(vector1, vector2) {
  12992. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12993. return rad * (180 / Math.PI);
  12994. }
  12995. getSecretaryScale() {
  12996. if (this.secretary.spineName == "mishu") {
  12997. return 1.28;
  12998. }
  12999. else {
  13000. return 1.024;
  13001. }
  13002. }
  13003. signAwardContainsRod(arr) {
  13004. let temp;
  13005. for (let index = 0; index < arr.length; index++) {
  13006. temp = arr[index].split('-')[0];
  13007. if (parseInt(temp) > 2) {
  13008. return true;
  13009. }
  13010. }
  13011. }
  13012. judgeSameDay() {
  13013. let lastTime = DataMgr.getSignTime();
  13014. let curTime = new Date().getTime();
  13015. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  13016. return true;
  13017. }
  13018. return false;
  13019. }
  13020. getAward(arr, callback) {
  13021. let showTriple = arr[0].type <= 2;
  13022. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  13023. let temp;
  13024. for (let index = 0; index < arr.length; index++) {
  13025. temp = arr[index];
  13026. switch (temp.type) {
  13027. case 1:
  13028. this.playObjFlyAnim(temp.num, temp.type);
  13029. break;
  13030. case 2:
  13031. this.playObjFlyAnim(temp.num, temp.type);
  13032. break;
  13033. case 3:
  13034. case 4:
  13035. case 5:
  13036. case 6:
  13037. DataMgr.setBallRod(temp.type - 2, 1);
  13038. DataMgr.setCurBallRod(temp.type - 2);
  13039. break;
  13040. default:
  13041. break;
  13042. }
  13043. }
  13044. callback && callback(watchVideo);
  13045. });
  13046. }
  13047. getMoneyNode() {
  13048. let moneyNode;
  13049. let sign = xGame.uiMgr.getUI(UISign);
  13050. let draw = xGame.uiMgr.getUI(UIDraw);
  13051. let end = xGame.uiMgr.getUI(UIGameEnd);
  13052. let skill = xGame.uiMgr.getUI(UISkill);
  13053. if (sign && !sign.isHide)
  13054. moneyNode = sign.ui.moneyNode;
  13055. if (draw && !draw.isHide)
  13056. moneyNode = draw.ui.moneyNode;
  13057. if (end && !end.isHide)
  13058. moneyNode = end.ui.moneyNode;
  13059. if (skill && !skill.isHide)
  13060. moneyNode = skill.ui.moneyNode;
  13061. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13062. let main = xGame.uiMgr.getUI(UIMain);
  13063. if (condition1 && main && !main.isHide) {
  13064. moneyNode = main.ui.moneyNode;
  13065. }
  13066. return moneyNode;
  13067. }
  13068. playObjFlyAnim(num, type, callback = null) {
  13069. this.stPos.x = Laya.stage.width / 2;
  13070. this.stPos.y = Laya.stage.height / 2;
  13071. let moneyNode = this.getMoneyNode();
  13072. switch (type) {
  13073. case Prop.diamond:
  13074. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13075. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13076. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13077. this.edPos.x /= 2;
  13078. this.edPos.y /= 2;
  13079. break;
  13080. case Prop.coin:
  13081. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13082. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13083. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13084. this.edPos.x /= 2;
  13085. this.edPos.y /= 2;
  13086. break;
  13087. default:
  13088. break;
  13089. }
  13090. xGame.soundMgr.playSound("coinbag");
  13091. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13092. switch (type) {
  13093. case Prop.diamond:
  13094. DataMgr.setDiamond(num);
  13095. break;
  13096. case Prop.coin:
  13097. DataMgr.setCoin(num);
  13098. break;
  13099. default:
  13100. break;
  13101. }
  13102. callback && callback();
  13103. });
  13104. }
  13105. autoPopUIView() {
  13106. let arr = [];
  13107. let sign = this.judgeSameDay() ? false : true;
  13108. if (sign)
  13109. arr.push("sign");
  13110. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13111. if (draw)
  13112. arr.push("draw");
  13113. if (arr.length <= 0)
  13114. return;
  13115. let str = this.getRandArrEle(arr);
  13116. switch (str) {
  13117. case "sign":
  13118. xGame.uiMgr.Show(UISign);
  13119. break;
  13120. case "draw":
  13121. xGame.uiMgr.Show(UIDraw);
  13122. break;
  13123. default:
  13124. break;
  13125. }
  13126. }
  13127. getMSTime(time) {
  13128. let min = Math.floor(time / 60);
  13129. let sec = Math.floor((time - min * 60));
  13130. if (sec < 10)
  13131. sec = "0" + sec;
  13132. if (min < 10)
  13133. min = "0" + min;
  13134. return `${min}:${sec}`;
  13135. }
  13136. testPower() {
  13137. DataMgr.setPower(0, false);
  13138. }
  13139. getAllStarNum() {
  13140. let data = DataMgr.getPlaceBallLevelList();
  13141. let out = 0;
  13142. for (let index = 0; index < data.length; index++) {
  13143. out += data[index].star;
  13144. }
  13145. return out;
  13146. }
  13147. recoverCameraView() {
  13148. Laya.timer.once(900, this, () => {
  13149. xGame.common.showOneCamera("mainCamera");
  13150. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13151. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13152. xGame.common.gameUI.ui.border.alpha = 0;
  13153. if (Laya.physicsTimer.scale < 1) {
  13154. Laya.physicsTimer.scale = 1;
  13155. }
  13156. }
  13157. });
  13158. }
  13159. getClassicLevel() {
  13160. let successTimes = DataMgr.getClassicTimes();
  13161. let needKey = "";
  13162. let lastKey = "";
  13163. let cfg = cfgTable.classictimesData;
  13164. let data;
  13165. for (const key in cfg) {
  13166. data = cfg[key];
  13167. if (successTimes <= data.times) {
  13168. needKey = key;
  13169. }
  13170. lastKey = key;
  13171. }
  13172. if (needKey == "")
  13173. needKey = lastKey;
  13174. return cfg[needKey];
  13175. }
  13176. }
  13177. Common._instance = null;
  13178. class ui_Component92 extends fgui.GComponent {
  13179. static createInstance() {
  13180. return (fgui.UIPackage.createObject("game", "Component92"));
  13181. }
  13182. onConstruct() {
  13183. this.n0 = (this.getChild("n0"));
  13184. }
  13185. }
  13186. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13187. class ui_Component129 extends fgui.GProgressBar {
  13188. static createInstance() {
  13189. return (fgui.UIPackage.createObject("game", "Component129"));
  13190. }
  13191. onConstruct() {
  13192. this.bar_v = (this.getChild("bar_v"));
  13193. this.n84 = (this.getChild("n84"));
  13194. }
  13195. }
  13196. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13197. class ui_Component130 extends fgui.GComponent {
  13198. static createInstance() {
  13199. return (fgui.UIPackage.createObject("game", "Component130"));
  13200. }
  13201. onConstruct() {
  13202. this.ani = (this.getChild("ani"));
  13203. this.t0 = this.getTransition("t0");
  13204. }
  13205. }
  13206. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13207. class ui_powerEft extends fgui.GComponent {
  13208. static createInstance() {
  13209. return (fgui.UIPackage.createObject("game", "powerEft"));
  13210. }
  13211. onConstruct() {
  13212. this.ani = (this.getChild("ani"));
  13213. this.n88 = (this.getChild("n88"));
  13214. this.n89 = (this.getChild("n89"));
  13215. }
  13216. }
  13217. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13218. class ui_Component1305_logo extends fgui.GComponent {
  13219. static createInstance() {
  13220. return (fgui.UIPackage.createObject("game", "Component1305_logo"));
  13221. }
  13222. onConstruct() {
  13223. this.n7 = (this.getChild("n7"));
  13224. this.closeBtn = (this.getChild("closeBtn"));
  13225. this.txt_ua = (this.getChild("txt_ua"));
  13226. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  13227. this.btn_login = (this.getChild("btn_login"));
  13228. this.txt_up = (this.getChild("txt_up"));
  13229. }
  13230. }
  13231. ui_Component1305_logo.URL = "ui://isxx5ak7a1zav5ao";
  13232. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13235. }
  13236. onConstruct() {
  13237. this.c1 = this.getController("c1");
  13238. this.n2 = (this.getChild("n2"));
  13239. this.n22 = (this.getChild("n22"));
  13240. this.n23 = (this.getChild("n23"));
  13241. this.n15 = (this.getChild("n15"));
  13242. this.challenge = (this.getChild("challenge"));
  13243. this.n17 = (this.getChild("n17"));
  13244. this.n3 = (this.getChild("n3"));
  13245. this.starNode = (this.getChild("starNode"));
  13246. this.levelTxt = (this.getChild("levelTxt"));
  13247. this.n14 = (this.getChild("n14"));
  13248. this.n19 = (this.getChild("n19"));
  13249. this.n20 = (this.getChild("n20"));
  13250. this.n21 = (this.getChild("n21"));
  13251. this.special = (this.getChild("special"));
  13252. }
  13253. }
  13254. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13255. class ui_Component79 extends fgui.GComponent {
  13256. static createInstance() {
  13257. return (fgui.UIPackage.createObject("game", "Component79"));
  13258. }
  13259. onConstruct() {
  13260. this.c1 = this.getController("c1");
  13261. this.n7 = (this.getChild("n7"));
  13262. this.n8 = (this.getChild("n8"));
  13263. this.n9 = (this.getChild("n9"));
  13264. this.n10 = (this.getChild("n10"));
  13265. this.n11 = (this.getChild("n11"));
  13266. this.n12 = (this.getChild("n12"));
  13267. }
  13268. }
  13269. ui_Component79.URL = "ui://isxx5ak7avag477";
  13270. class ui_Component80 extends fgui.GComponent {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "Component80"));
  13273. }
  13274. onConstruct() {
  13275. this.n0 = (this.getChild("n0"));
  13276. this.n1 = (this.getChild("n1"));
  13277. this.myList = (this.getChild("myList"));
  13278. this.t0 = this.getTransition("t0");
  13279. }
  13280. }
  13281. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13282. class ui_SignNormal extends fgui.GComponent {
  13283. static createInstance() {
  13284. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13285. }
  13286. onConstruct() {
  13287. this.c1 = this.getController("c1");
  13288. this.n7 = (this.getChild("n7"));
  13289. this.n15 = (this.getChild("n15"));
  13290. this.titleTxt = (this.getChild("titleTxt"));
  13291. this.n8 = (this.getChild("n8"));
  13292. this.myIcon = (this.getChild("myIcon"));
  13293. this.numTxt = (this.getChild("numTxt"));
  13294. this.n12 = (this.getChild("n12"));
  13295. this.n13 = (this.getChild("n13"));
  13296. this.n17 = (this.getChild("n17"));
  13297. this.n14 = (this.getChild("n14"));
  13298. }
  13299. }
  13300. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13301. class ui_Button_reg extends fgui.GButton {
  13302. static createInstance() {
  13303. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13304. }
  13305. onConstruct() {
  13306. this.button = this.getController("button");
  13307. this.n6 = (this.getChild("n6"));
  13308. }
  13309. }
  13310. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13311. class ui_screenNode extends fgui.GComponent {
  13312. static createInstance() {
  13313. return (fgui.UIPackage.createObject("game", "screenNode"));
  13314. }
  13315. onConstruct() {
  13316. this.n9 = (this.getChild("n9"));
  13317. this.screenImg = (this.getChild("screenImg"));
  13318. }
  13319. }
  13320. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13321. class ui_GetAwrad_com1 extends fgui.GComponent {
  13322. static createInstance() {
  13323. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13324. }
  13325. onConstruct() {
  13326. this.n38 = (this.getChild("n38"));
  13327. this.n39 = (this.getChild("n39"));
  13328. this.n40 = (this.getChild("n40"));
  13329. this.t0 = this.getTransition("t0");
  13330. this.t1 = this.getTransition("t1");
  13331. }
  13332. }
  13333. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13334. class ui_GetAwrad_com2 extends fgui.GComponent {
  13335. static createInstance() {
  13336. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13337. }
  13338. onConstruct() {
  13339. this.n39 = (this.getChild("n39"));
  13340. this.n40 = (this.getChild("n40"));
  13341. this.t0 = this.getTransition("t0");
  13342. }
  13343. }
  13344. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13345. class ui_Component128 extends fgui.GComponent {
  13346. static createInstance() {
  13347. return (fgui.UIPackage.createObject("game", "Component128"));
  13348. }
  13349. onConstruct() {
  13350. this.n38 = (this.getChild("n38"));
  13351. this.n40 = (this.getChild("n40"));
  13352. }
  13353. }
  13354. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13355. class ui_Component100_1 extends fgui.GComponent {
  13356. static createInstance() {
  13357. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13358. }
  13359. onConstruct() {
  13360. this.myNode = (this.getChild("myNode"));
  13361. this.t0 = this.getTransition("t0");
  13362. }
  13363. }
  13364. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13365. class ui_Component142 extends fgui.GComponent {
  13366. static createInstance() {
  13367. return (fgui.UIPackage.createObject("game", "Component142"));
  13368. }
  13369. onConstruct() {
  13370. this.n41 = (this.getChild("n41"));
  13371. this.n42 = (this.getChild("n42"));
  13372. }
  13373. }
  13374. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13375. class ui_main_guang extends fgui.GComponent {
  13376. static createInstance() {
  13377. return (fgui.UIPackage.createObject("game", "main_guang"));
  13378. }
  13379. onConstruct() {
  13380. this.n1 = (this.getChild("n1"));
  13381. this.n2 = (this.getChild("n2"));
  13382. this.n3 = (this.getChild("n3"));
  13383. this.n4 = (this.getChild("n4"));
  13384. this.n5 = (this.getChild("n5"));
  13385. this.n6 = (this.getChild("n6"));
  13386. this.n8 = (this.getChild("n8"));
  13387. this.t0 = this.getTransition("t0");
  13388. }
  13389. }
  13390. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13391. class ui_try_com1 extends fgui.GComponent {
  13392. static createInstance() {
  13393. return (fgui.UIPackage.createObject("game", "try_com1"));
  13394. }
  13395. onConstruct() {
  13396. this.c1 = this.getController("c1");
  13397. this.n0 = (this.getChild("n0"));
  13398. this.n2 = (this.getChild("n2"));
  13399. this.cancelBtn = (this.getChild("cancelBtn"));
  13400. this.videoBtn = (this.getChild("videoBtn"));
  13401. this.n9 = (this.getChild("n9"));
  13402. this.n24 = (this.getChild("n24"));
  13403. this.titleTxt = (this.getChild("titleTxt"));
  13404. this.n32 = (this.getChild("n32"));
  13405. this.n29 = (this.getChild("n29"));
  13406. this.n36 = (this.getChild("n36"));
  13407. this.txtTime = (this.getChild("txtTime"));
  13408. this.t0 = this.getTransition("t0");
  13409. }
  13410. }
  13411. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13412. class ui_try_com2 extends fgui.GComponent {
  13413. static createInstance() {
  13414. return (fgui.UIPackage.createObject("game", "try_com2"));
  13415. }
  13416. onConstruct() {
  13417. this.skillicon = (this.getChild("skillicon"));
  13418. this.n35 = (this.getChild("n35"));
  13419. this.n31 = (this.getChild("n31"));
  13420. this.n32 = (this.getChild("n32"));
  13421. this.n33 = (this.getChild("n33"));
  13422. this.n34 = (this.getChild("n34"));
  13423. }
  13424. }
  13425. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13426. class ui_try_com3 extends fgui.GComponent {
  13427. static createInstance() {
  13428. return (fgui.UIPackage.createObject("game", "try_com3"));
  13429. }
  13430. onConstruct() {
  13431. this.n33 = (this.getChild("n33"));
  13432. this.n34 = (this.getChild("n34"));
  13433. this.n35 = (this.getChild("n35"));
  13434. this.t0 = this.getTransition("t0");
  13435. }
  13436. }
  13437. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13438. class ui_huihe1 extends fgui.GComponent {
  13439. static createInstance() {
  13440. return (fgui.UIPackage.createObject("game", "huihe1"));
  13441. }
  13442. onConstruct() {
  13443. this.n0 = (this.getChild("n0"));
  13444. this.n1 = (this.getChild("n1"));
  13445. this.t0 = this.getTransition("t0");
  13446. }
  13447. }
  13448. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13449. class ui_huihe2 extends fgui.GComponent {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "huihe2"));
  13452. }
  13453. onConstruct() {
  13454. this.n0 = (this.getChild("n0"));
  13455. this.n1 = (this.getChild("n1"));
  13456. this.t0 = this.getTransition("t0");
  13457. }
  13458. }
  13459. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13460. class ui_Component143 extends fgui.GComponent {
  13461. static createInstance() {
  13462. return (fgui.UIPackage.createObject("game", "Component143"));
  13463. }
  13464. onConstruct() {
  13465. this.n3 = (this.getChild("n3"));
  13466. this.n4 = (this.getChild("n4"));
  13467. this.n5 = (this.getChild("n5"));
  13468. this.n6 = (this.getChild("n6"));
  13469. this.n7 = (this.getChild("n7"));
  13470. this.n8 = (this.getChild("n8"));
  13471. this.n9 = (this.getChild("n9"));
  13472. this.n10 = (this.getChild("n10"));
  13473. this.t0 = this.getTransition("t0");
  13474. }
  13475. }
  13476. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13477. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13478. static createInstance() {
  13479. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13480. }
  13481. onConstruct() {
  13482. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13483. }
  13484. }
  13485. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13486. class ui_dh_jingbi2 extends fgui.GComponent {
  13487. static createInstance() {
  13488. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13489. }
  13490. onConstruct() {
  13491. this.n0 = (this.getChild("n0"));
  13492. this.n1 = (this.getChild("n1"));
  13493. this.n2 = (this.getChild("n2"));
  13494. this.n3 = (this.getChild("n3"));
  13495. this.n4 = (this.getChild("n4"));
  13496. this.n5 = (this.getChild("n5"));
  13497. this.n6 = (this.getChild("n6"));
  13498. this.n8 = (this.getChild("n8"));
  13499. this.n10 = (this.getChild("n10"));
  13500. this.t0 = this.getTransition("t0");
  13501. }
  13502. }
  13503. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13504. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13505. static createInstance() {
  13506. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13507. }
  13508. onConstruct() {
  13509. this.n1 = (this.getChild("n1"));
  13510. this.n4 = (this.getChild("n4"));
  13511. this.t0 = this.getTransition("t0");
  13512. }
  13513. }
  13514. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13515. class ui_dh_jingbi3 extends fgui.GComponent {
  13516. static createInstance() {
  13517. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13518. }
  13519. onConstruct() {
  13520. this.n0 = (this.getChild("n0"));
  13521. this.n1 = (this.getChild("n1"));
  13522. this.n2 = (this.getChild("n2"));
  13523. this.n3 = (this.getChild("n3"));
  13524. this.n4 = (this.getChild("n4"));
  13525. this.n5 = (this.getChild("n5"));
  13526. this.n6 = (this.getChild("n6"));
  13527. this.n8 = (this.getChild("n8"));
  13528. this.n10 = (this.getChild("n10"));
  13529. this.t0 = this.getTransition("t0");
  13530. }
  13531. }
  13532. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13533. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13534. static createInstance() {
  13535. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13536. }
  13537. onConstruct() {
  13538. this.n3 = (this.getChild("n3"));
  13539. this.n1 = (this.getChild("n1"));
  13540. this.t0 = this.getTransition("t0");
  13541. }
  13542. }
  13543. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13544. class ui_hb_jinbi1 extends fgui.GButton {
  13545. static createInstance() {
  13546. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13547. }
  13548. onConstruct() {
  13549. this.n20 = (this.getChild("n20"));
  13550. this.n25 = (this.getChild("n25"));
  13551. this.coinTxt = (this.getChild("coinTxt"));
  13552. this.n28 = (this.getChild("n28"));
  13553. this.n32 = (this.getChild("n32"));
  13554. this.n38 = (this.getChild("n38"));
  13555. this.n45 = (this.getChild("n45"));
  13556. this.getTips = (this.getChild("getTips"));
  13557. this.n39 = (this.getChild("n39"));
  13558. this.diamondTxt = (this.getChild("diamondTxt"));
  13559. this.n41 = (this.getChild("n41"));
  13560. this.n42 = (this.getChild("n42"));
  13561. this.n46 = (this.getChild("n46"));
  13562. this.n47 = (this.getChild("n47"));
  13563. this.n48 = (this.getChild("n48"));
  13564. this.t0 = this.getTransition("t0");
  13565. }
  13566. }
  13567. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13568. class ui_hb_jinbi2 extends fgui.GButton {
  13569. static createInstance() {
  13570. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13571. }
  13572. onConstruct() {
  13573. this.n20 = (this.getChild("n20"));
  13574. this.n25 = (this.getChild("n25"));
  13575. this.coinTxt = (this.getChild("coinTxt"));
  13576. this.n28 = (this.getChild("n28"));
  13577. this.n32 = (this.getChild("n32"));
  13578. this.n38 = (this.getChild("n38"));
  13579. this.n39 = (this.getChild("n39"));
  13580. this.diamondTxt = (this.getChild("diamondTxt"));
  13581. this.n41 = (this.getChild("n41"));
  13582. this.n42 = (this.getChild("n42"));
  13583. this.n43 = (this.getChild("n43"));
  13584. this.n44 = (this.getChild("n44"));
  13585. this.n45 = (this.getChild("n45"));
  13586. this.t0 = this.getTransition("t0");
  13587. }
  13588. }
  13589. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13590. class ui_hb_jinbi3 extends fgui.GButton {
  13591. static createInstance() {
  13592. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13593. }
  13594. onConstruct() {
  13595. this.n20 = (this.getChild("n20"));
  13596. this.n25 = (this.getChild("n25"));
  13597. this.coinTxt = (this.getChild("coinTxt"));
  13598. this.n28 = (this.getChild("n28"));
  13599. this.n32 = (this.getChild("n32"));
  13600. this.n38 = (this.getChild("n38"));
  13601. this.n39 = (this.getChild("n39"));
  13602. this.diamondTxt = (this.getChild("diamondTxt"));
  13603. this.n41 = (this.getChild("n41"));
  13604. this.n42 = (this.getChild("n42"));
  13605. this.n43 = (this.getChild("n43"));
  13606. this.n44 = (this.getChild("n44"));
  13607. this.n45 = (this.getChild("n45"));
  13608. this.t0 = this.getTransition("t0");
  13609. }
  13610. }
  13611. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13612. class ui_Component104 extends fgui.GComponent {
  13613. static createInstance() {
  13614. return (fgui.UIPackage.createObject("game", "Component104"));
  13615. }
  13616. onConstruct() {
  13617. this.c1 = this.getController("c1");
  13618. this.n12 = (this.getChild("n12"));
  13619. this.coinBtn = (this.getChild("coinBtn"));
  13620. this.diamondBtn = (this.getChild("diamondBtn"));
  13621. this.node3 = (this.getChild("node3"));
  13622. this.node4 = (this.getChild("node4"));
  13623. this.node5 = (this.getChild("node5"));
  13624. this.node1 = (this.getChild("node1"));
  13625. this.node2 = (this.getChild("node2"));
  13626. this.node6 = (this.getChild("node6"));
  13627. this.t0 = this.getTransition("t0");
  13628. }
  13629. }
  13630. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13631. class ui_Component105 extends fgui.GButton {
  13632. static createInstance() {
  13633. return (fgui.UIPackage.createObject("game", "Component105"));
  13634. }
  13635. onConstruct() {
  13636. this.c1 = this.getController("c1");
  13637. this.n49 = (this.getChild("n49"));
  13638. this.n18 = (this.getChild("n18"));
  13639. this.n46 = (this.getChild("n46"));
  13640. this.n48 = (this.getChild("n48"));
  13641. }
  13642. }
  13643. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13644. class ui_Component106 extends fgui.GButton {
  13645. static createInstance() {
  13646. return (fgui.UIPackage.createObject("game", "Component106"));
  13647. }
  13648. onConstruct() {
  13649. this.c1 = this.getController("c1");
  13650. this.n49 = (this.getChild("n49"));
  13651. this.n18 = (this.getChild("n18"));
  13652. this.n46 = (this.getChild("n46"));
  13653. this.n48 = (this.getChild("n48"));
  13654. }
  13655. }
  13656. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13657. class ui_hb_zs1 extends fgui.GButton {
  13658. static createInstance() {
  13659. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13660. }
  13661. onConstruct() {
  13662. this.c1 = this.getController("c1");
  13663. this.n20 = (this.getChild("n20"));
  13664. this.n21 = (this.getChild("n21"));
  13665. this.n26 = (this.getChild("n26"));
  13666. this.n27 = (this.getChild("n27"));
  13667. this.shareTxt = (this.getChild("shareTxt"));
  13668. this.n32 = (this.getChild("n32"));
  13669. this.n38 = (this.getChild("n38"));
  13670. this.n39 = (this.getChild("n39"));
  13671. this.n44 = (this.getChild("n44"));
  13672. this.diamondTxt = (this.getChild("diamondTxt"));
  13673. this.n41 = (this.getChild("n41"));
  13674. this.n45 = (this.getChild("n45"));
  13675. this.n47 = (this.getChild("n47"));
  13676. this.n48 = (this.getChild("n48"));
  13677. this.randTxt = (this.getChild("randTxt"));
  13678. this.n50 = (this.getChild("n50"));
  13679. this.t0 = this.getTransition("t0");
  13680. }
  13681. }
  13682. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13683. class ui_dh_zs1 extends fgui.GComponent {
  13684. static createInstance() {
  13685. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13686. }
  13687. onConstruct() {
  13688. this.n10 = (this.getChild("n10"));
  13689. this.n9 = (this.getChild("n9"));
  13690. this.n1 = (this.getChild("n1"));
  13691. this.n2 = (this.getChild("n2"));
  13692. this.n3 = (this.getChild("n3"));
  13693. this.n4 = (this.getChild("n4"));
  13694. this.n5 = (this.getChild("n5"));
  13695. this.n6 = (this.getChild("n6"));
  13696. this.n8 = (this.getChild("n8"));
  13697. this.n11 = (this.getChild("n11"));
  13698. this.t0 = this.getTransition("t0");
  13699. }
  13700. }
  13701. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13702. class ui_dh_zs1_1 extends fgui.GComponent {
  13703. static createInstance() {
  13704. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13705. }
  13706. onConstruct() {
  13707. this.n3 = (this.getChild("n3"));
  13708. this.n1 = (this.getChild("n1"));
  13709. this.t0 = this.getTransition("t0");
  13710. }
  13711. }
  13712. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13713. class ui_hb_zs2 extends fgui.GButton {
  13714. static createInstance() {
  13715. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13716. }
  13717. onConstruct() {
  13718. this.n20 = (this.getChild("n20"));
  13719. this.n21 = (this.getChild("n21"));
  13720. this.n26 = (this.getChild("n26"));
  13721. this.n27 = (this.getChild("n27"));
  13722. this.n32 = (this.getChild("n32"));
  13723. this.n38 = (this.getChild("n38"));
  13724. this.n39 = (this.getChild("n39"));
  13725. this.n44 = (this.getChild("n44"));
  13726. this.diamondTxt = (this.getChild("diamondTxt"));
  13727. this.n41 = (this.getChild("n41"));
  13728. this.n45 = (this.getChild("n45"));
  13729. this.t0 = this.getTransition("t0");
  13730. }
  13731. }
  13732. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13733. class ui_hb_zs3 extends fgui.GButton {
  13734. static createInstance() {
  13735. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13736. }
  13737. onConstruct() {
  13738. this.n20 = (this.getChild("n20"));
  13739. this.n21 = (this.getChild("n21"));
  13740. this.n26 = (this.getChild("n26"));
  13741. this.n27 = (this.getChild("n27"));
  13742. this.n32 = (this.getChild("n32"));
  13743. this.n38 = (this.getChild("n38"));
  13744. this.n47 = (this.getChild("n47"));
  13745. this.t0 = this.getTransition("t0");
  13746. }
  13747. }
  13748. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13749. class ui_dh_zs2 extends fgui.GComponent {
  13750. static createInstance() {
  13751. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13752. }
  13753. onConstruct() {
  13754. this.n10 = (this.getChild("n10"));
  13755. this.n9 = (this.getChild("n9"));
  13756. this.n1 = (this.getChild("n1"));
  13757. this.n2 = (this.getChild("n2"));
  13758. this.n3 = (this.getChild("n3"));
  13759. this.n4 = (this.getChild("n4"));
  13760. this.n5 = (this.getChild("n5"));
  13761. this.n6 = (this.getChild("n6"));
  13762. this.n8 = (this.getChild("n8"));
  13763. this.n11 = (this.getChild("n11"));
  13764. this.t0 = this.getTransition("t0");
  13765. }
  13766. }
  13767. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13768. class ui_dh_zs2_1 extends fgui.GComponent {
  13769. static createInstance() {
  13770. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13771. }
  13772. onConstruct() {
  13773. this.n3 = (this.getChild("n3"));
  13774. this.n1 = (this.getChild("n1"));
  13775. this.t0 = this.getTransition("t0");
  13776. }
  13777. }
  13778. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13779. class ui_dh_zs3 extends fgui.GComponent {
  13780. static createInstance() {
  13781. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13782. }
  13783. onConstruct() {
  13784. this.n10 = (this.getChild("n10"));
  13785. this.n9 = (this.getChild("n9"));
  13786. this.n1 = (this.getChild("n1"));
  13787. this.n2 = (this.getChild("n2"));
  13788. this.n3 = (this.getChild("n3"));
  13789. this.n4 = (this.getChild("n4"));
  13790. this.n5 = (this.getChild("n5"));
  13791. this.n6 = (this.getChild("n6"));
  13792. this.n8 = (this.getChild("n8"));
  13793. this.n11 = (this.getChild("n11"));
  13794. this.t0 = this.getTransition("t0");
  13795. }
  13796. }
  13797. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13798. class ui_dh_zs3_1 extends fgui.GComponent {
  13799. static createInstance() {
  13800. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13801. }
  13802. onConstruct() {
  13803. this.n3 = (this.getChild("n3"));
  13804. this.n1 = (this.getChild("n1"));
  13805. this.t0 = this.getTransition("t0");
  13806. }
  13807. }
  13808. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13809. class ui_Component107 extends fgui.GComponent {
  13810. static createInstance() {
  13811. return (fgui.UIPackage.createObject("game", "Component107"));
  13812. }
  13813. onConstruct() {
  13814. this.n18 = (this.getChild("n18"));
  13815. this.n19 = (this.getChild("n19"));
  13816. this.n20 = (this.getChild("n20"));
  13817. this.n21 = (this.getChild("n21"));
  13818. this.n22 = (this.getChild("n22"));
  13819. this.levelTxt = (this.getChild("levelTxt"));
  13820. this.t0 = this.getTransition("t0");
  13821. }
  13822. }
  13823. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13824. class ui_box_com1 extends fgui.GComponent {
  13825. static createInstance() {
  13826. return (fgui.UIPackage.createObject("game", "box_com1"));
  13827. }
  13828. onConstruct() {
  13829. this.n14 = (this.getChild("n14"));
  13830. this.n6 = (this.getChild("n6"));
  13831. this.t0 = this.getTransition("t0");
  13832. }
  13833. }
  13834. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13835. class ui_box_com2 extends fgui.GProgressBar {
  13836. static createInstance() {
  13837. return (fgui.UIPackage.createObject("game", "box_com2"));
  13838. }
  13839. onConstruct() {
  13840. this.bg0 = (this.getChild("bg0"));
  13841. this.bg = (this.getChild("bg"));
  13842. this.bar = (this.getChild("bar"));
  13843. this.n7 = (this.getChild("n7"));
  13844. this.n8 = (this.getChild("n8"));
  13845. this.n10 = (this.getChild("n10"));
  13846. this.n11 = (this.getChild("n11"));
  13847. this.n12 = (this.getChild("n12"));
  13848. }
  13849. }
  13850. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13851. class ui_box_com4 extends fgui.GComponent {
  13852. static createInstance() {
  13853. return (fgui.UIPackage.createObject("game", "box_com4"));
  13854. }
  13855. onConstruct() {
  13856. this.n8 = (this.getChild("n8"));
  13857. this.t0 = this.getTransition("t0");
  13858. }
  13859. }
  13860. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13861. class ui_box_com3 extends fgui.GComponent {
  13862. static createInstance() {
  13863. return (fgui.UIPackage.createObject("game", "box_com3"));
  13864. }
  13865. onConstruct() {
  13866. this.n2 = (this.getChild("n2"));
  13867. this.n3 = (this.getChild("n3"));
  13868. this.n4 = (this.getChild("n4"));
  13869. this.n5 = (this.getChild("n5"));
  13870. this.t0 = this.getTransition("t0");
  13871. this.t1 = this.getTransition("t1");
  13872. }
  13873. }
  13874. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13875. class ui_Component97 extends fgui.GComponent {
  13876. static createInstance() {
  13877. return (fgui.UIPackage.createObject("game", "Component97"));
  13878. }
  13879. onConstruct() {
  13880. this.c1 = this.getController("c1");
  13881. this.n46 = (this.getChild("n46"));
  13882. this.diamondNode = (this.getChild("diamondNode"));
  13883. this.coinNode = (this.getChild("coinNode"));
  13884. this.t0 = this.getTransition("t0");
  13885. }
  13886. }
  13887. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13888. class ui_Component98 extends fgui.GButton {
  13889. static createInstance() {
  13890. return (fgui.UIPackage.createObject("game", "Component98"));
  13891. }
  13892. onConstruct() {
  13893. this.n8 = (this.getChild("n8"));
  13894. this.n40 = (this.getChild("n40"));
  13895. }
  13896. }
  13897. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13898. class ui_Component28_11 extends fgui.GButton {
  13899. static createInstance() {
  13900. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13901. }
  13902. onConstruct() {
  13903. this.c1 = this.getController("c1");
  13904. this.n12 = (this.getChild("n12"));
  13905. this.n17 = (this.getChild("n17"));
  13906. this.n13 = (this.getChild("n13"));
  13907. this.diamondTxt = (this.getChild("diamondTxt"));
  13908. this.n15 = (this.getChild("n15"));
  13909. this.n16 = (this.getChild("n16"));
  13910. }
  13911. }
  13912. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13913. class ui_Component58_11 extends fgui.GComponent {
  13914. static createInstance() {
  13915. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13916. }
  13917. onConstruct() {
  13918. this.c1 = this.getController("c1");
  13919. this.n23 = (this.getChild("n23"));
  13920. this.n41 = (this.getChild("n41"));
  13921. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13922. this.n_daoju = (this.getChild("n_daoju"));
  13923. this.myList = (this.getChild("myList"));
  13924. this.djList = (this.getChild("djList"));
  13925. this.t0 = this.getTransition("t0");
  13926. }
  13927. }
  13928. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13929. class ui_Component100 extends fgui.GComponent {
  13930. static createInstance() {
  13931. return (fgui.UIPackage.createObject("game", "Component100"));
  13932. }
  13933. onConstruct() {
  13934. this.c1 = this.getController("c1");
  13935. this.n75 = (this.getChild("n75"));
  13936. this.n76 = (this.getChild("n76"));
  13937. this.n80 = (this.getChild("n80"));
  13938. this.txt = (this.getChild("txt"));
  13939. this.spineRoot = (this.getChild("spineRoot"));
  13940. }
  13941. }
  13942. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13943. class ui_Component101 extends fgui.GComponent {
  13944. static createInstance() {
  13945. return (fgui.UIPackage.createObject("game", "Component101"));
  13946. }
  13947. onConstruct() {
  13948. this.c1 = this.getController("c1");
  13949. this.n36 = (this.getChild("n36"));
  13950. this.n35 = (this.getChild("n35"));
  13951. this.n33 = (this.getChild("n33"));
  13952. this.n34 = (this.getChild("n34"));
  13953. }
  13954. }
  13955. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13956. class ui_Component53 extends fgui.GComponent {
  13957. static createInstance() {
  13958. return (fgui.UIPackage.createObject("game", "Component53"));
  13959. }
  13960. onConstruct() {
  13961. this.n0 = (this.getChild("n0"));
  13962. this.n1 = (this.getChild("n1"));
  13963. this.n2 = (this.getChild("n2"));
  13964. this.n3 = (this.getChild("n3"));
  13965. this.n4 = (this.getChild("n4"));
  13966. this.n5 = (this.getChild("n5"));
  13967. this.n6 = (this.getChild("n6"));
  13968. this.n7 = (this.getChild("n7"));
  13969. this.n8 = (this.getChild("n8"));
  13970. this.n9 = (this.getChild("n9"));
  13971. this.n10 = (this.getChild("n10"));
  13972. this.n11 = (this.getChild("n11"));
  13973. this.n12 = (this.getChild("n12"));
  13974. this.n13 = (this.getChild("n13"));
  13975. this.n14 = (this.getChild("n14"));
  13976. this.n15 = (this.getChild("n15"));
  13977. this.n16 = (this.getChild("n16"));
  13978. this.n19 = (this.getChild("n19"));
  13979. this.n20 = (this.getChild("n20"));
  13980. this.n21 = (this.getChild("n21"));
  13981. this.n22 = (this.getChild("n22"));
  13982. this.n23 = (this.getChild("n23"));
  13983. this.n24 = (this.getChild("n24"));
  13984. this.n25 = (this.getChild("n25"));
  13985. this.n26 = (this.getChild("n26"));
  13986. this.n27 = (this.getChild("n27"));
  13987. this.n28 = (this.getChild("n28"));
  13988. this.n29 = (this.getChild("n29"));
  13989. this.n30 = (this.getChild("n30"));
  13990. this.n31 = (this.getChild("n31"));
  13991. this.n32 = (this.getChild("n32"));
  13992. this.n33 = (this.getChild("n33"));
  13993. this.n34 = (this.getChild("n34"));
  13994. this.n35 = (this.getChild("n35"));
  13995. this.t0 = this.getTransition("t0");
  13996. }
  13997. }
  13998. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13999. class ui_Component58 extends fgui.GComponent {
  14000. static createInstance() {
  14001. return (fgui.UIPackage.createObject("game", "Component58"));
  14002. }
  14003. onConstruct() {
  14004. this.n23 = (this.getChild("n23"));
  14005. this.n41 = (this.getChild("n41"));
  14006. this.n8 = (this.getChild("n8"));
  14007. this.skillList = (this.getChild("skillList"));
  14008. this.t0 = this.getTransition("t0");
  14009. }
  14010. }
  14011. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  14012. class ui_Component59 extends fgui.GComponent {
  14013. static createInstance() {
  14014. return (fgui.UIPackage.createObject("game", "Component59"));
  14015. }
  14016. onConstruct() {
  14017. this.n3 = (this.getChild("n3"));
  14018. this.msgTxt = (this.getChild("msgTxt"));
  14019. this.t0 = this.getTransition("t0");
  14020. }
  14021. }
  14022. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  14023. class ui_RulerNode extends fgui.GComponent {
  14024. static createInstance() {
  14025. return (fgui.UIPackage.createObject("game", "RulerNode"));
  14026. }
  14027. onConstruct() {
  14028. this.n6 = (this.getChild("n6"));
  14029. this.n4 = (this.getChild("n4"));
  14030. this.img1 = (this.getChild("img1"));
  14031. this.img2 = (this.getChild("img2"));
  14032. }
  14033. }
  14034. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  14035. class ui_Component108 extends fgui.GComponent {
  14036. static createInstance() {
  14037. return (fgui.UIPackage.createObject("game", "Component108"));
  14038. }
  14039. onConstruct() {
  14040. this.n19 = (this.getChild("n19"));
  14041. this.t0 = this.getTransition("t0");
  14042. }
  14043. }
  14044. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14045. class ui_Component63 extends fgui.GComponent {
  14046. static createInstance() {
  14047. return (fgui.UIPackage.createObject("game", "Component63"));
  14048. }
  14049. onConstruct() {
  14050. this.n66 = (this.getChild("n66"));
  14051. this.n56 = (this.getChild("n56"));
  14052. this.n63 = (this.getChild("n63"));
  14053. this.n65 = (this.getChild("n65"));
  14054. this.t0 = this.getTransition("t0");
  14055. }
  14056. }
  14057. ui_Component63.URL = "ui://isxx5ak7h657452";
  14058. class ui_topNode extends fgui.GComponent {
  14059. static createInstance() {
  14060. return (fgui.UIPackage.createObject("game", "topNode"));
  14061. }
  14062. onConstruct() {
  14063. this.selfProgress = (this.getChild("selfProgress"));
  14064. this.aiProgress = (this.getChild("aiProgress"));
  14065. this.selfKuang = (this.getChild("selfKuang"));
  14066. this.aiKuang = (this.getChild("aiKuang"));
  14067. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14068. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14069. this.n33 = (this.getChild("n33"));
  14070. this.n34 = (this.getChild("n34"));
  14071. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14072. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14073. this.selfBallList = (this.getChild("selfBallList"));
  14074. this.aiBallList = (this.getChild("aiBallList"));
  14075. this.middleNode = (this.getChild("middleNode"));
  14076. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14077. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14078. this.scoreNode = (this.getChild("scoreNode"));
  14079. this.selfTips = (this.getChild("selfTips"));
  14080. this.aiTips = (this.getChild("aiTips"));
  14081. }
  14082. }
  14083. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14084. class ui_selfProgress extends fgui.GProgressBar {
  14085. static createInstance() {
  14086. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14087. }
  14088. onConstruct() {
  14089. this.n3 = (this.getChild("n3"));
  14090. this.bar = (this.getChild("bar"));
  14091. }
  14092. }
  14093. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14094. class ui_aiProgress extends fgui.GProgressBar {
  14095. static createInstance() {
  14096. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14097. }
  14098. onConstruct() {
  14099. this.n3 = (this.getChild("n3"));
  14100. this.bar = (this.getChild("bar"));
  14101. }
  14102. }
  14103. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14104. class ui_ballDisplay extends fgui.GComponent {
  14105. static createInstance() {
  14106. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14107. }
  14108. onConstruct() {
  14109. this.myImg = (this.getChild("myImg"));
  14110. }
  14111. }
  14112. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14113. class ui_moveNode extends fgui.GComponent {
  14114. static createInstance() {
  14115. return (fgui.UIPackage.createObject("game", "moveNode"));
  14116. }
  14117. onConstruct() {
  14118. this.n8 = (this.getChild("n8"));
  14119. this.finger = (this.getChild("finger"));
  14120. }
  14121. }
  14122. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14123. class ui_cancelBtn extends fgui.GButton {
  14124. static createInstance() {
  14125. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14126. }
  14127. onConstruct() {
  14128. this.c1 = this.getController("c1");
  14129. this.n0 = (this.getChild("n0"));
  14130. this.n1 = (this.getChild("n1"));
  14131. }
  14132. }
  14133. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14134. class ui_shareBtn extends fgui.GButton {
  14135. static createInstance() {
  14136. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14137. }
  14138. onConstruct() {
  14139. this.c1 = this.getController("c1");
  14140. this.n2 = (this.getChild("n2"));
  14141. this.n1 = (this.getChild("n1"));
  14142. this.n3 = (this.getChild("n3"));
  14143. this.n4 = (this.getChild("n4"));
  14144. this.n5 = (this.getChild("n5"));
  14145. this.n6 = (this.getChild("n6"));
  14146. }
  14147. }
  14148. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14149. class ui_share2Btn extends fgui.GButton {
  14150. static createInstance() {
  14151. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14152. }
  14153. onConstruct() {
  14154. this.n3 = (this.getChild("n3"));
  14155. }
  14156. }
  14157. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14158. class ui_rodMethodNode extends fgui.GComponent {
  14159. static createInstance() {
  14160. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14161. }
  14162. onConstruct() {
  14163. this.bg = (this.getChild("bg"));
  14164. this.dot = (this.getChild("dot"));
  14165. }
  14166. }
  14167. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14168. class ui_sureBtn extends fgui.GButton {
  14169. static createInstance() {
  14170. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14171. }
  14172. onConstruct() {
  14173. this.n2 = (this.getChild("n2"));
  14174. this.n1 = (this.getChild("n1"));
  14175. }
  14176. }
  14177. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14178. class ui_Component18 extends fgui.GComponent {
  14179. static createInstance() {
  14180. return (fgui.UIPackage.createObject("game", "Component18"));
  14181. }
  14182. onConstruct() {
  14183. this.c1 = this.getController("c1");
  14184. this.nameTxt = (this.getChild("nameTxt"));
  14185. this.headImg = (this.getChild("headImg"));
  14186. this.n24 = (this.getChild("n24"));
  14187. this.skillImg = (this.getChild("skillImg"));
  14188. this.skillTxt = (this.getChild("skillTxt"));
  14189. }
  14190. }
  14191. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14192. class ui_Component45 extends fgui.GComponent {
  14193. static createInstance() {
  14194. return (fgui.UIPackage.createObject("game", "Component45"));
  14195. }
  14196. onConstruct() {
  14197. this.c1 = this.getController("c1");
  14198. this.n40 = (this.getChild("n40"));
  14199. this.n41 = (this.getChild("n41"));
  14200. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14201. this.n42 = (this.getChild("n42"));
  14202. this.awardTxt = (this.getChild("awardTxt"));
  14203. this.n44 = (this.getChild("n44"));
  14204. this.t0 = this.getTransition("t0");
  14205. }
  14206. }
  14207. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14208. class ui_emotionDisplay extends fgui.GButton {
  14209. static createInstance() {
  14210. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14211. }
  14212. onConstruct() {
  14213. this.myIcon = (this.getChild("myIcon"));
  14214. }
  14215. }
  14216. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14217. class ui_Component49 extends fgui.GButton {
  14218. static createInstance() {
  14219. return (fgui.UIPackage.createObject("game", "Component49"));
  14220. }
  14221. onConstruct() {
  14222. this.n69 = (this.getChild("n69"));
  14223. this.n56 = (this.getChild("n56"));
  14224. }
  14225. }
  14226. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14227. class ui_Component50 extends fgui.GButton {
  14228. static createInstance() {
  14229. return (fgui.UIPackage.createObject("game", "Component50"));
  14230. }
  14231. onConstruct() {
  14232. this.n54 = (this.getChild("n54"));
  14233. this.n65 = (this.getChild("n65"));
  14234. }
  14235. }
  14236. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14237. class ui_Component51 extends fgui.GButton {
  14238. static createInstance() {
  14239. return (fgui.UIPackage.createObject("game", "Component51"));
  14240. }
  14241. onConstruct() {
  14242. this.c1 = this.getController("c1");
  14243. this.n51 = (this.getChild("n51"));
  14244. this.n54 = (this.getChild("n54"));
  14245. }
  14246. }
  14247. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14248. class ui_Button5 extends fgui.GButton {
  14249. static createInstance() {
  14250. return (fgui.UIPackage.createObject("game", "Button5"));
  14251. }
  14252. onConstruct() {
  14253. this.c1 = this.getController("c1");
  14254. this.n0 = (this.getChild("n0"));
  14255. this.n2 = (this.getChild("n2"));
  14256. }
  14257. }
  14258. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14259. class ui_Component124 extends fgui.GComponent {
  14260. static createInstance() {
  14261. return (fgui.UIPackage.createObject("game", "Component124"));
  14262. }
  14263. onConstruct() {
  14264. this.n22 = (this.getChild("n22"));
  14265. this.shareNode = (this.getChild("shareNode"));
  14266. }
  14267. }
  14268. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14269. class ui_Component125 extends fgui.GComponent {
  14270. static createInstance() {
  14271. return (fgui.UIPackage.createObject("game", "Component125"));
  14272. }
  14273. onConstruct() {
  14274. this.n29 = (this.getChild("n29"));
  14275. this.coinTxt = (this.getChild("coinTxt"));
  14276. }
  14277. }
  14278. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14279. class ui_Component52 extends fgui.GButton {
  14280. static createInstance() {
  14281. return (fgui.UIPackage.createObject("game", "Component52"));
  14282. }
  14283. onConstruct() {
  14284. this.n35 = (this.getChild("n35"));
  14285. this.n36 = (this.getChild("n36"));
  14286. }
  14287. }
  14288. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14289. class ui_Component_denglu extends fgui.GComponent {
  14290. static createInstance() {
  14291. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14292. }
  14293. onConstruct() {
  14294. this.c1 = this.getController("c1");
  14295. this.n102 = (this.getChild("n102"));
  14296. this.n103 = (this.getChild("n103"));
  14297. }
  14298. }
  14299. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14300. class ui_Component_fl_1 extends fgui.GComponent {
  14301. static createInstance() {
  14302. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14303. }
  14304. onConstruct() {
  14305. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14306. this.txt_price = (this.getChild("txt_price"));
  14307. this.n_no = (this.getChild("n_no"));
  14308. this.n_buy = (this.getChild("n_buy"));
  14309. }
  14310. }
  14311. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14312. class ui_Component_fl_2 extends fgui.GComponent {
  14313. static createInstance() {
  14314. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14315. }
  14316. onConstruct() {
  14317. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14318. this.txt_price = (this.getChild("txt_price"));
  14319. this.n_no = (this.getChild("n_no"));
  14320. this.n_buy = (this.getChild("n_buy"));
  14321. }
  14322. }
  14323. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14324. class ui_drawBtn extends fgui.GButton {
  14325. static createInstance() {
  14326. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14327. }
  14328. onConstruct() {
  14329. this.c1 = this.getController("c1");
  14330. this.n2 = (this.getChild("n2"));
  14331. this.n1 = (this.getChild("n1"));
  14332. this.n5 = (this.getChild("n5"));
  14333. }
  14334. }
  14335. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14336. class ui_Component43 extends fgui.GButton {
  14337. static createInstance() {
  14338. return (fgui.UIPackage.createObject("game", "Component43"));
  14339. }
  14340. onConstruct() {
  14341. this.n49 = (this.getChild("n49"));
  14342. }
  14343. }
  14344. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14345. class ui_wordsDisplay extends fgui.GComponent {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14348. }
  14349. onConstruct() {
  14350. this.txt = (this.getChild("txt"));
  14351. this.n63 = (this.getChild("n63"));
  14352. }
  14353. }
  14354. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14355. class ui_Component_phb extends fgui.GComponent {
  14356. static createInstance() {
  14357. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14358. }
  14359. onConstruct() {
  14360. this.n3 = (this.getChild("n3"));
  14361. this.n4 = (this.getChild("n4"));
  14362. }
  14363. }
  14364. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14365. class ui_Component3 extends fgui.GComponent {
  14366. static createInstance() {
  14367. return (fgui.UIPackage.createObject("game", "Component3"));
  14368. }
  14369. onConstruct() {
  14370. this.n26 = (this.getChild("n26"));
  14371. this.n24 = (this.getChild("n24"));
  14372. this.nameTxt = (this.getChild("nameTxt"));
  14373. this.headRoot = (this.getChild("headRoot"));
  14374. }
  14375. }
  14376. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14377. class ui_Component4 extends fgui.GComponent {
  14378. static createInstance() {
  14379. return (fgui.UIPackage.createObject("game", "Component4"));
  14380. }
  14381. onConstruct() {
  14382. this.headImg = (this.getChild("headImg"));
  14383. }
  14384. }
  14385. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14386. class ui_Component7 extends fgui.GButton {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "Component7"));
  14389. }
  14390. onConstruct() {
  14391. this.n17 = (this.getChild("n17"));
  14392. }
  14393. }
  14394. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14395. class ui_Component8 extends fgui.GButton {
  14396. static createInstance() {
  14397. return (fgui.UIPackage.createObject("game", "Component8"));
  14398. }
  14399. onConstruct() {
  14400. this.n19 = (this.getChild("n19"));
  14401. }
  14402. }
  14403. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14404. class ui_Component10 extends fgui.GButton {
  14405. static createInstance() {
  14406. return (fgui.UIPackage.createObject("game", "Component10"));
  14407. }
  14408. onConstruct() {
  14409. this.c1 = this.getController("c1");
  14410. this.n40 = (this.getChild("n40"));
  14411. }
  14412. }
  14413. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14414. class ui_Component11 extends fgui.GButton {
  14415. static createInstance() {
  14416. return (fgui.UIPackage.createObject("game", "Component11"));
  14417. }
  14418. onConstruct() {
  14419. this.n34 = (this.getChild("n34"));
  14420. }
  14421. }
  14422. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14423. class ui_Component12 extends fgui.GButton {
  14424. static createInstance() {
  14425. return (fgui.UIPackage.createObject("game", "Component12"));
  14426. }
  14427. onConstruct() {
  14428. this.n35 = (this.getChild("n35"));
  14429. }
  14430. }
  14431. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14432. class ui_Component13 extends fgui.GButton {
  14433. static createInstance() {
  14434. return (fgui.UIPackage.createObject("game", "Component13"));
  14435. }
  14436. onConstruct() {
  14437. this.n27 = (this.getChild("n27"));
  14438. this.n36 = (this.getChild("n36"));
  14439. }
  14440. }
  14441. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14442. class ui_dh_js_tuowei extends fgui.GComponent {
  14443. static createInstance() {
  14444. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14445. }
  14446. onConstruct() {
  14447. this.n19 = (this.getChild("n19"));
  14448. this.n18 = (this.getChild("n18"));
  14449. this.n0 = (this.getChild("n0"));
  14450. this.n3 = (this.getChild("n3"));
  14451. this.n4 = (this.getChild("n4"));
  14452. this.n5 = (this.getChild("n5"));
  14453. this.n6 = (this.getChild("n6"));
  14454. this.n8 = (this.getChild("n8"));
  14455. this.n9 = (this.getChild("n9"));
  14456. this.n10 = (this.getChild("n10"));
  14457. this.n11 = (this.getChild("n11"));
  14458. this.n12 = (this.getChild("n12"));
  14459. this.n13 = (this.getChild("n13"));
  14460. this.n14 = (this.getChild("n14"));
  14461. this.n15 = (this.getChild("n15"));
  14462. this.n20 = (this.getChild("n20"));
  14463. this.t0 = this.getTransition("t0");
  14464. this.t1 = this.getTransition("t1");
  14465. }
  14466. }
  14467. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14468. class ui_dh_js_tw_g extends fgui.GComponent {
  14469. static createInstance() {
  14470. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14471. }
  14472. onConstruct() {
  14473. this.n0 = (this.getChild("n0"));
  14474. this.n1 = (this.getChild("n1"));
  14475. this.t0 = this.getTransition("t0");
  14476. }
  14477. }
  14478. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14479. class ui_dh_js_xingxing extends fgui.GComponent {
  14480. static createInstance() {
  14481. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14482. }
  14483. onConstruct() {
  14484. this.n1 = (this.getChild("n1"));
  14485. this.n2 = (this.getChild("n2"));
  14486. this.n3 = (this.getChild("n3"));
  14487. this.n4 = (this.getChild("n4"));
  14488. this.n0 = (this.getChild("n0"));
  14489. this.t2 = this.getTransition("t2");
  14490. this.t1 = this.getTransition("t1");
  14491. }
  14492. }
  14493. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14494. class ui_dh_zy_jiazai extends fgui.GComponent {
  14495. static createInstance() {
  14496. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14497. }
  14498. onConstruct() {
  14499. this.c1 = this.getController("c1");
  14500. this.n0 = (this.getChild("n0"));
  14501. this.n1 = (this.getChild("n1"));
  14502. this.n2 = (this.getChild("n2"));
  14503. this.n4 = (this.getChild("n4"));
  14504. this.n5 = (this.getChild("n5"));
  14505. this.n6 = (this.getChild("n6"));
  14506. this.n8 = (this.getChild("n8"));
  14507. this.n7 = (this.getChild("n7"));
  14508. this.t0 = this.getTransition("t0");
  14509. }
  14510. }
  14511. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14512. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14513. static createInstance() {
  14514. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14515. }
  14516. onConstruct() {
  14517. this.c1 = this.getController("c1");
  14518. this.n3 = (this.getChild("n3"));
  14519. this.n5 = (this.getChild("n5"));
  14520. this.n4 = (this.getChild("n4"));
  14521. this.n0 = (this.getChild("n0"));
  14522. this.n1 = (this.getChild("n1"));
  14523. this.n2 = (this.getChild("n2"));
  14524. }
  14525. }
  14526. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14527. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14528. static createInstance() {
  14529. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14530. }
  14531. onConstruct() {
  14532. this.n19 = (this.getChild("n19"));
  14533. this.n21 = (this.getChild("n21"));
  14534. this.n0 = (this.getChild("n0"));
  14535. this.n3 = (this.getChild("n3"));
  14536. this.n4 = (this.getChild("n4"));
  14537. this.n5 = (this.getChild("n5"));
  14538. this.n6 = (this.getChild("n6"));
  14539. this.n8 = (this.getChild("n8"));
  14540. this.n9 = (this.getChild("n9"));
  14541. this.n10 = (this.getChild("n10"));
  14542. this.n11 = (this.getChild("n11"));
  14543. this.n12 = (this.getChild("n12"));
  14544. this.n13 = (this.getChild("n13"));
  14545. this.n14 = (this.getChild("n14"));
  14546. this.n15 = (this.getChild("n15"));
  14547. this.n23 = (this.getChild("n23"));
  14548. this.t0 = this.getTransition("t0");
  14549. this.t1 = this.getTransition("t1");
  14550. }
  14551. }
  14552. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14553. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14554. static createInstance() {
  14555. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14556. }
  14557. onConstruct() {
  14558. this.n1 = (this.getChild("n1"));
  14559. this.n2 = (this.getChild("n2"));
  14560. this.t0 = this.getTransition("t0");
  14561. }
  14562. }
  14563. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14564. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14565. static createInstance() {
  14566. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14567. }
  14568. onConstruct() {
  14569. this.n4 = (this.getChild("n4"));
  14570. this.n2 = (this.getChild("n2"));
  14571. this.n3 = (this.getChild("n3"));
  14572. this.idle = this.getTransition("idle");
  14573. this.attack = this.getTransition("attack");
  14574. }
  14575. }
  14576. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14577. class ui_special extends fgui.GComponent {
  14578. static createInstance() {
  14579. return (fgui.UIPackage.createObject("game", "special"));
  14580. }
  14581. onConstruct() {
  14582. this.n18 = (this.getChild("n18"));
  14583. this.n19 = (this.getChild("n19"));
  14584. this.n20 = (this.getChild("n20"));
  14585. this.n21 = (this.getChild("n21"));
  14586. this.n22 = (this.getChild("n22"));
  14587. this.levelTxt = (this.getChild("levelTxt"));
  14588. this.n24 = (this.getChild("n24"));
  14589. this.n25 = (this.getChild("n25"));
  14590. this.t0 = this.getTransition("t0");
  14591. }
  14592. }
  14593. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14594. class ui_Component145 extends fgui.GComponent {
  14595. static createInstance() {
  14596. return (fgui.UIPackage.createObject("game", "Component145"));
  14597. }
  14598. onConstruct() {
  14599. this.guanyuNode = (this.getChild("guanyuNode"));
  14600. }
  14601. }
  14602. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14603. class ui_longBtn extends fgui.GButton {
  14604. static createInstance() {
  14605. return (fgui.UIPackage.createObject("game", "longBtn"));
  14606. }
  14607. onConstruct() {
  14608. this.c1 = this.getController("c1");
  14609. this.n2 = (this.getChild("n2"));
  14610. this.n1 = (this.getChild("n1"));
  14611. this.n4 = (this.getChild("n4"));
  14612. }
  14613. }
  14614. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14615. class ui_Component146 extends fgui.GComponent {
  14616. static createInstance() {
  14617. return (fgui.UIPackage.createObject("game", "Component146"));
  14618. }
  14619. onConstruct() {
  14620. this.n89 = (this.getChild("n89"));
  14621. this.n90 = (this.getChild("n90"));
  14622. this.guideBtn = (this.getChild("guideBtn"));
  14623. }
  14624. }
  14625. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14626. class ui_Component146_11 extends fgui.GComponent {
  14627. static createInstance() {
  14628. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14629. }
  14630. onConstruct() {
  14631. this.n89 = (this.getChild("n89"));
  14632. this.n90 = (this.getChild("n90"));
  14633. this.guideBtn = (this.getChild("guideBtn"));
  14634. }
  14635. }
  14636. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14637. class ui_Component111_1 extends fgui.GComponent {
  14638. static createInstance() {
  14639. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14640. }
  14641. onConstruct() {
  14642. this.n68 = (this.getChild("n68"));
  14643. this.myMask = (this.getChild("myMask"));
  14644. }
  14645. }
  14646. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14647. class ui_Component64_1 extends fgui.GComponent {
  14648. static createInstance() {
  14649. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14650. }
  14651. onConstruct() {
  14652. this.n57 = (this.getChild("n57"));
  14653. this.n54 = (this.getChild("n54"));
  14654. this.n55 = (this.getChild("n55"));
  14655. this.n56 = (this.getChild("n56"));
  14656. this.t1 = this.getTransition("t1");
  14657. }
  14658. }
  14659. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14660. class ui_ModeSelection_com123 extends fgui.GComponent {
  14661. static createInstance() {
  14662. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14663. }
  14664. onConstruct() {
  14665. this.type1 = (this.getChild("type1"));
  14666. this.type2 = (this.getChild("type2"));
  14667. this.type3 = (this.getChild("type3"));
  14668. this.n38 = (this.getChild("n38"));
  14669. this.t0 = this.getTransition("t0");
  14670. }
  14671. }
  14672. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14673. class ui_Component132_2 extends fgui.GComponent {
  14674. static createInstance() {
  14675. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14676. }
  14677. onConstruct() {
  14678. this.n25 = (this.getChild("n25"));
  14679. this.n26 = (this.getChild("n26"));
  14680. this.n27 = (this.getChild("n27"));
  14681. this.t0 = this.getTransition("t0");
  14682. }
  14683. }
  14684. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14685. class ui_UIPower$1 extends fgui.GComponent {
  14686. static createInstance() {
  14687. return (fgui.UIPackage.createObject("game", "UIPower"));
  14688. }
  14689. onConstruct() {
  14690. this.n11 = (this.getChild("n11"));
  14691. this.myNode = (this.getChild("myNode"));
  14692. this.t0 = this.getTransition("t0");
  14693. }
  14694. }
  14695. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14696. class ui_Component133 extends fgui.GComponent {
  14697. static createInstance() {
  14698. return (fgui.UIPackage.createObject("game", "Component133"));
  14699. }
  14700. onConstruct() {
  14701. this.n29 = (this.getChild("n29"));
  14702. this.n30 = (this.getChild("n30"));
  14703. }
  14704. }
  14705. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14706. class ui_Component134 extends fgui.GComponent {
  14707. static createInstance() {
  14708. return (fgui.UIPackage.createObject("game", "Component134"));
  14709. }
  14710. onConstruct() {
  14711. this.n30 = (this.getChild("n30"));
  14712. this.n31 = (this.getChild("n31"));
  14713. this.t0 = this.getTransition("t0");
  14714. }
  14715. }
  14716. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14717. class ui_Component135 extends fgui.GComponent {
  14718. static createInstance() {
  14719. return (fgui.UIPackage.createObject("game", "Component135"));
  14720. }
  14721. onConstruct() {
  14722. this.n30 = (this.getChild("n30"));
  14723. this.t0 = this.getTransition("t0");
  14724. }
  14725. }
  14726. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14727. class ui_Component137 extends fgui.GComponent {
  14728. static createInstance() {
  14729. return (fgui.UIPackage.createObject("game", "Component137"));
  14730. }
  14731. onConstruct() {
  14732. this.n28 = (this.getChild("n28"));
  14733. this.n29 = (this.getChild("n29"));
  14734. this.n30 = (this.getChild("n30"));
  14735. this.n32 = (this.getChild("n32"));
  14736. }
  14737. }
  14738. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14739. class ui_dh_zuanshi extends fgui.GButton {
  14740. static createInstance() {
  14741. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14742. }
  14743. onConstruct() {
  14744. this.n1 = (this.getChild("n1"));
  14745. this.n2 = (this.getChild("n2"));
  14746. this.n0 = (this.getChild("n0"));
  14747. this.n3 = (this.getChild("n3"));
  14748. this.n4 = (this.getChild("n4"));
  14749. }
  14750. }
  14751. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14752. class ui_Component138 extends fgui.GComponent {
  14753. static createInstance() {
  14754. return (fgui.UIPackage.createObject("game", "Component138"));
  14755. }
  14756. onConstruct() {
  14757. this.n1 = (this.getChild("n1"));
  14758. this.n2 = (this.getChild("n2"));
  14759. this.t0 = this.getTransition("t0");
  14760. }
  14761. }
  14762. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14763. class ui_Component139 extends fgui.GComponent {
  14764. static createInstance() {
  14765. return (fgui.UIPackage.createObject("game", "Component139"));
  14766. }
  14767. onConstruct() {
  14768. this.n0 = (this.getChild("n0"));
  14769. this.t0 = this.getTransition("t0");
  14770. }
  14771. }
  14772. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14773. class ui_Component140 extends fgui.GComponent {
  14774. static createInstance() {
  14775. return (fgui.UIPackage.createObject("game", "Component140"));
  14776. }
  14777. onConstruct() {
  14778. this.n2 = (this.getChild("n2"));
  14779. this.n3 = (this.getChild("n3"));
  14780. this.t0 = this.getTransition("t0");
  14781. }
  14782. }
  14783. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14784. class ui_Component141 extends fgui.GComponent {
  14785. static createInstance() {
  14786. return (fgui.UIPackage.createObject("game", "Component141"));
  14787. }
  14788. onConstruct() {
  14789. this.n0 = (this.getChild("n0"));
  14790. this.t0 = this.getTransition("t0");
  14791. }
  14792. }
  14793. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14794. class ui_powerNode extends fgui.GProgressBar {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "powerNode"));
  14797. }
  14798. onConstruct() {
  14799. this.n2 = (this.getChild("n2"));
  14800. this.bar_v = (this.getChild("bar_v"));
  14801. this.showImg = (this.getChild("showImg"));
  14802. this.n12 = (this.getChild("n12"));
  14803. }
  14804. }
  14805. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14806. class ui_dh_jingbi1 extends fgui.GComponent {
  14807. static createInstance() {
  14808. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14809. }
  14810. onConstruct() {
  14811. this.n0 = (this.getChild("n0"));
  14812. this.n1 = (this.getChild("n1"));
  14813. this.n2 = (this.getChild("n2"));
  14814. this.n3 = (this.getChild("n3"));
  14815. this.n4 = (this.getChild("n4"));
  14816. this.n5 = (this.getChild("n5"));
  14817. this.n6 = (this.getChild("n6"));
  14818. this.n8 = (this.getChild("n8"));
  14819. this.t0 = this.getTransition("t0");
  14820. }
  14821. }
  14822. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14823. class ui_Component94 extends fgui.GButton {
  14824. static createInstance() {
  14825. return (fgui.UIPackage.createObject("game", "Component94"));
  14826. }
  14827. onConstruct() {
  14828. this.n77 = (this.getChild("n77"));
  14829. }
  14830. }
  14831. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14832. class ui_Component95 extends fgui.GButton {
  14833. static createInstance() {
  14834. return (fgui.UIPackage.createObject("game", "Component95"));
  14835. }
  14836. onConstruct() {
  14837. this.n77 = (this.getChild("n77"));
  14838. }
  14839. }
  14840. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14841. class ui_Component126 extends fgui.GComponent {
  14842. static createInstance() {
  14843. return (fgui.UIPackage.createObject("game", "Component126"));
  14844. }
  14845. onConstruct() {
  14846. this.c1 = this.getController("c1");
  14847. this.normalBtn = (this.getChild("normalBtn"));
  14848. this.tripleBtn = (this.getChild("tripleBtn"));
  14849. }
  14850. }
  14851. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14852. class ui_Component60 extends fgui.GComponent {
  14853. static createInstance() {
  14854. return (fgui.UIPackage.createObject("game", "Component60"));
  14855. }
  14856. onConstruct() {
  14857. this.c1 = this.getController("c1");
  14858. this.n48 = (this.getChild("n48"));
  14859. this.womanTxt = (this.getChild("womanTxt"));
  14860. this.t0 = this.getTransition("t0");
  14861. }
  14862. }
  14863. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14864. class ui_Button_h extends fgui.GButton {
  14865. static createInstance() {
  14866. return (fgui.UIPackage.createObject("game", "Button_h"));
  14867. }
  14868. onConstruct() {
  14869. this.button = this.getController("button");
  14870. this.n0 = (this.getChild("n0"));
  14871. }
  14872. }
  14873. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14874. class ui_Button_lv extends fgui.GButton {
  14875. static createInstance() {
  14876. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14877. }
  14878. onConstruct() {
  14879. this.button = this.getController("button");
  14880. this.n0 = (this.getChild("n0"));
  14881. }
  14882. }
  14883. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14884. class ui_Component98_3 extends fgui.GButton {
  14885. static createInstance() {
  14886. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14887. }
  14888. onConstruct() {
  14889. this.c1 = this.getController("c1");
  14890. this.n8 = (this.getChild("n8"));
  14891. this.n41 = (this.getChild("n41"));
  14892. this.n40 = (this.getChild("n40"));
  14893. }
  14894. }
  14895. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14896. class ui_ModeSelection_com1 extends fgui.GButton {
  14897. static createInstance() {
  14898. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14899. }
  14900. onConstruct() {
  14901. this.n34 = (this.getChild("n34"));
  14902. this.n36 = (this.getChild("n36"));
  14903. this.n22 = (this.getChild("n22"));
  14904. this.n20 = (this.getChild("n20"));
  14905. this.n23 = (this.getChild("n23"));
  14906. this.n24 = (this.getChild("n24"));
  14907. this.n26 = (this.getChild("n26"));
  14908. this.n33 = (this.getChild("n33"));
  14909. this.coinImg = (this.getChild("coinImg"));
  14910. this.need = (this.getChild("need"));
  14911. this.n35 = (this.getChild("n35"));
  14912. this.n29 = (this.getChild("n29"));
  14913. this.tipsTxt = (this.getChild("tipsTxt"));
  14914. this.n30 = (this.getChild("n30"));
  14915. this.peopleTxt = (this.getChild("peopleTxt"));
  14916. this.t0 = this.getTransition("t0");
  14917. }
  14918. }
  14919. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14920. class ui_ModeSelection_com2 extends fgui.GButton {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14923. }
  14924. onConstruct() {
  14925. this.n36 = (this.getChild("n36"));
  14926. this.n34 = (this.getChild("n34"));
  14927. this.n22 = (this.getChild("n22"));
  14928. this.n20 = (this.getChild("n20"));
  14929. this.n23 = (this.getChild("n23"));
  14930. this.n24 = (this.getChild("n24"));
  14931. this.n26 = (this.getChild("n26"));
  14932. this.n33 = (this.getChild("n33"));
  14933. this.coinImg = (this.getChild("coinImg"));
  14934. this.need = (this.getChild("need"));
  14935. this.n35 = (this.getChild("n35"));
  14936. this.n29 = (this.getChild("n29"));
  14937. this.tipsTxt = (this.getChild("tipsTxt"));
  14938. this.n30 = (this.getChild("n30"));
  14939. this.peopleTxt = (this.getChild("peopleTxt"));
  14940. this.t0 = this.getTransition("t0");
  14941. }
  14942. }
  14943. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14944. class ui_ModeSelection_com3 extends fgui.GButton {
  14945. static createInstance() {
  14946. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14947. }
  14948. onConstruct() {
  14949. this.n34 = (this.getChild("n34"));
  14950. this.n36 = (this.getChild("n36"));
  14951. this.n22 = (this.getChild("n22"));
  14952. this.n20 = (this.getChild("n20"));
  14953. this.n23 = (this.getChild("n23"));
  14954. this.n24 = (this.getChild("n24"));
  14955. this.n26 = (this.getChild("n26"));
  14956. this.n33 = (this.getChild("n33"));
  14957. this.coinImg = (this.getChild("coinImg"));
  14958. this.need = (this.getChild("need"));
  14959. this.n35 = (this.getChild("n35"));
  14960. this.n29 = (this.getChild("n29"));
  14961. this.tipsTxt = (this.getChild("tipsTxt"));
  14962. this.n30 = (this.getChild("n30"));
  14963. this.peopleTxt = (this.getChild("peopleTxt"));
  14964. this.t0 = this.getTransition("t0");
  14965. }
  14966. }
  14967. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14968. class ui_Invitation_com1 extends fgui.GComponent {
  14969. static createInstance() {
  14970. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14971. }
  14972. onConstruct() {
  14973. this.n14 = (this.getChild("n14"));
  14974. this.n13 = (this.getChild("n13"));
  14975. this.n3 = (this.getChild("n3"));
  14976. this.n1 = (this.getChild("n1"));
  14977. this.n6 = (this.getChild("n6"));
  14978. this.n7 = (this.getChild("n7"));
  14979. this.enterBtn = (this.getChild("enterBtn"));
  14980. this.n11 = (this.getChild("n11"));
  14981. this.n12 = (this.getChild("n12"));
  14982. this.n15 = (this.getChild("n15"));
  14983. this.t0 = this.getTransition("t0");
  14984. this.t1 = this.getTransition("t1");
  14985. }
  14986. }
  14987. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14988. class ui_Component87_1 extends fgui.GComponent {
  14989. static createInstance() {
  14990. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14991. }
  14992. onConstruct() {
  14993. this.n74 = (this.getChild("n74"));
  14994. this.n73 = (this.getChild("n73"));
  14995. this.ballTxt = (this.getChild("ballTxt"));
  14996. this.n76 = (this.getChild("n76"));
  14997. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14998. this.levelTxt = (this.getChild("levelTxt"));
  14999. this.n87 = (this.getChild("n87"));
  15000. this.n84 = (this.getChild("n84"));
  15001. this.hpTxt = (this.getChild("hpTxt"));
  15002. this.n89 = (this.getChild("n89"));
  15003. this.tipsTxt = (this.getChild("tipsTxt"));
  15004. }
  15005. }
  15006. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  15007. class ui_sqg1 extends fgui.GComponent {
  15008. static createInstance() {
  15009. return (fgui.UIPackage.createObject("game", "sqg1"));
  15010. }
  15011. onConstruct() {
  15012. this.n1 = (this.getChild("n1"));
  15013. this.n0 = (this.getChild("n0"));
  15014. }
  15015. }
  15016. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  15017. class ui_sqg2 extends fgui.GComponent {
  15018. static createInstance() {
  15019. return (fgui.UIPackage.createObject("game", "sqg2"));
  15020. }
  15021. onConstruct() {
  15022. this.n1 = (this.getChild("n1"));
  15023. this.n0 = (this.getChild("n0"));
  15024. }
  15025. }
  15026. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15027. class ui_sqg3 extends fgui.GComponent {
  15028. static createInstance() {
  15029. return (fgui.UIPackage.createObject("game", "sqg3"));
  15030. }
  15031. onConstruct() {
  15032. this.n1 = (this.getChild("n1"));
  15033. this.n0 = (this.getChild("n0"));
  15034. }
  15035. }
  15036. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15037. class ui_sqg4 extends fgui.GComponent {
  15038. static createInstance() {
  15039. return (fgui.UIPackage.createObject("game", "sqg4"));
  15040. }
  15041. onConstruct() {
  15042. this.n1 = (this.getChild("n1"));
  15043. this.n0 = (this.getChild("n0"));
  15044. }
  15045. }
  15046. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15047. class ui_Component36 extends fgui.GButton {
  15048. static createInstance() {
  15049. return (fgui.UIPackage.createObject("game", "Component36"));
  15050. }
  15051. onConstruct() {
  15052. this.c1 = this.getController("c1");
  15053. this.n53 = (this.getChild("n53"));
  15054. this.n56 = (this.getChild("n56"));
  15055. }
  15056. }
  15057. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15058. class ui_Component37 extends fgui.GButton {
  15059. static createInstance() {
  15060. return (fgui.UIPackage.createObject("game", "Component37"));
  15061. }
  15062. onConstruct() {
  15063. this.c1 = this.getController("c1");
  15064. this.n52 = (this.getChild("n52"));
  15065. this.n54 = (this.getChild("n54"));
  15066. }
  15067. }
  15068. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15069. class ui_UISetting extends fgui.GComponent {
  15070. static createInstance() {
  15071. return (fgui.UIPackage.createObject("game", "UISetting"));
  15072. }
  15073. onConstruct() {
  15074. this.c1 = this.getController("c1");
  15075. this.n4 = (this.getChild("n4"));
  15076. this.soundBtn = (this.getChild("soundBtn"));
  15077. this.shakeBtn = (this.getChild("shakeBtn"));
  15078. this.clickNode = (this.getChild("clickNode"));
  15079. this.xyBtn = (this.getChild("xyBtn"));
  15080. }
  15081. }
  15082. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15083. class ui_Component39 extends fgui.GComponent {
  15084. static createInstance() {
  15085. return (fgui.UIPackage.createObject("game", "Component39"));
  15086. }
  15087. onConstruct() {
  15088. this.n5 = (this.getChild("n5"));
  15089. this.n6 = (this.getChild("n6"));
  15090. this.n7 = (this.getChild("n7"));
  15091. this.t0 = this.getTransition("t0");
  15092. }
  15093. }
  15094. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15095. class ui_Component40 extends fgui.GButton {
  15096. static createInstance() {
  15097. return (fgui.UIPackage.createObject("game", "Component40"));
  15098. }
  15099. onConstruct() {
  15100. this.n46 = (this.getChild("n46"));
  15101. this.n47 = (this.getChild("n47"));
  15102. }
  15103. }
  15104. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15105. class ui_Component41 extends fgui.GComponent {
  15106. static createInstance() {
  15107. return (fgui.UIPackage.createObject("game", "Component41"));
  15108. }
  15109. onConstruct() {
  15110. this.c1 = this.getController("c1");
  15111. this.n0 = (this.getChild("n0"));
  15112. this.titleTxt = (this.getChild("titleTxt"));
  15113. this.n2 = (this.getChild("n2"));
  15114. this.msgTips = (this.getChild("msgTips"));
  15115. this.numTxt = (this.getChild("numTxt"));
  15116. this.n18 = (this.getChild("n18"));
  15117. this.cancelBtn = (this.getChild("cancelBtn"));
  15118. this.videoBtn = (this.getChild("videoBtn"));
  15119. this.n10 = (this.getChild("n10"));
  15120. }
  15121. }
  15122. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15123. class ui_Component42 extends fgui.GComponent {
  15124. static createInstance() {
  15125. return (fgui.UIPackage.createObject("game", "Component42"));
  15126. }
  15127. onConstruct() {
  15128. this.c1 = this.getController("c1");
  15129. this.n1 = (this.getChild("n1"));
  15130. this.n2 = (this.getChild("n2"));
  15131. this.n3 = (this.getChild("n3"));
  15132. this.tipsTxt = (this.getChild("tipsTxt"));
  15133. this.cancelBtn = (this.getChild("cancelBtn"));
  15134. this.sureBtn = (this.getChild("sureBtn"));
  15135. this.n11 = (this.getChild("n11"));
  15136. this.n13 = (this.getChild("n13"));
  15137. this.n14 = (this.getChild("n14"));
  15138. this.womanTxt = (this.getChild("womanTxt"));
  15139. this.t0 = this.getTransition("t0");
  15140. }
  15141. }
  15142. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15143. class ui_dh_js_shengli extends fgui.GComponent {
  15144. static createInstance() {
  15145. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15146. }
  15147. onConstruct() {
  15148. this.n3 = (this.getChild("n3"));
  15149. this.n4 = (this.getChild("n4"));
  15150. this.n1 = (this.getChild("n1"));
  15151. this.n2 = (this.getChild("n2"));
  15152. this.n5 = (this.getChild("n5"));
  15153. this.n6 = (this.getChild("n6"));
  15154. this.n7 = (this.getChild("n7"));
  15155. this.n8 = (this.getChild("n8"));
  15156. this.attack = this.getTransition("attack");
  15157. this.idle = this.getTransition("idle");
  15158. }
  15159. }
  15160. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15161. class ui_dh_js_shengli_g extends fgui.GComponent {
  15162. static createInstance() {
  15163. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15164. }
  15165. onConstruct() {
  15166. this.n3 = (this.getChild("n3"));
  15167. this.n1 = (this.getChild("n1"));
  15168. this.t0 = this.getTransition("t0");
  15169. }
  15170. }
  15171. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15172. class ui_dh_js_shibai extends fgui.GComponent {
  15173. static createInstance() {
  15174. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15175. }
  15176. onConstruct() {
  15177. this.n0 = (this.getChild("n0"));
  15178. this.n1 = (this.getChild("n1"));
  15179. this.n2 = (this.getChild("n2"));
  15180. this.n3 = (this.getChild("n3"));
  15181. this.idle = this.getTransition("idle");
  15182. this.attack = this.getTransition("attack");
  15183. }
  15184. }
  15185. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15186. class ui_dh_zy_ganfa extends fgui.GButton {
  15187. static createInstance() {
  15188. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15189. }
  15190. onConstruct() {
  15191. this.n0 = (this.getChild("n0"));
  15192. }
  15193. }
  15194. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15195. class ui_dh_zy_sc_guang extends fgui.GButton {
  15196. static createInstance() {
  15197. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15198. }
  15199. onConstruct() {
  15200. this.n0 = (this.getChild("n0"));
  15201. this.n2 = (this.getChild("n2"));
  15202. }
  15203. }
  15204. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15205. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15206. static createInstance() {
  15207. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15208. }
  15209. onConstruct() {
  15210. this.n0 = (this.getChild("n0"));
  15211. this.n3 = (this.getChild("n3"));
  15212. }
  15213. }
  15214. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15215. class ui_dh_zy_wanfa extends fgui.GButton {
  15216. static createInstance() {
  15217. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15218. }
  15219. onConstruct() {
  15220. this.n0 = (this.getChild("n0"));
  15221. }
  15222. }
  15223. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15224. class ui_Button_login extends fgui.GButton {
  15225. static createInstance() {
  15226. return (fgui.UIPackage.createObject("game", "Button_login"));
  15227. }
  15228. onConstruct() {
  15229. this.button = this.getController("button");
  15230. this.n5 = (this.getChild("n5"));
  15231. }
  15232. }
  15233. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15234. class ui_Component53_1 extends fgui.GComponent {
  15235. static createInstance() {
  15236. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15237. }
  15238. onConstruct() {
  15239. this.n0 = (this.getChild("n0"));
  15240. this.n1 = (this.getChild("n1"));
  15241. this.n2 = (this.getChild("n2"));
  15242. this.n3 = (this.getChild("n3"));
  15243. this.n4 = (this.getChild("n4"));
  15244. this.n5 = (this.getChild("n5"));
  15245. this.n6 = (this.getChild("n6"));
  15246. this.n7 = (this.getChild("n7"));
  15247. this.n8 = (this.getChild("n8"));
  15248. this.n9 = (this.getChild("n9"));
  15249. this.n10 = (this.getChild("n10"));
  15250. this.n11 = (this.getChild("n11"));
  15251. this.n12 = (this.getChild("n12"));
  15252. this.n13 = (this.getChild("n13"));
  15253. this.n14 = (this.getChild("n14"));
  15254. this.n15 = (this.getChild("n15"));
  15255. this.n16 = (this.getChild("n16"));
  15256. this.n19 = (this.getChild("n19"));
  15257. this.n20 = (this.getChild("n20"));
  15258. this.n21 = (this.getChild("n21"));
  15259. this.n22 = (this.getChild("n22"));
  15260. this.n23 = (this.getChild("n23"));
  15261. this.n24 = (this.getChild("n24"));
  15262. this.n25 = (this.getChild("n25"));
  15263. this.n26 = (this.getChild("n26"));
  15264. this.n27 = (this.getChild("n27"));
  15265. this.n28 = (this.getChild("n28"));
  15266. this.n29 = (this.getChild("n29"));
  15267. this.n30 = (this.getChild("n30"));
  15268. this.n31 = (this.getChild("n31"));
  15269. this.n32 = (this.getChild("n32"));
  15270. this.n33 = (this.getChild("n33"));
  15271. this.n34 = (this.getChild("n34"));
  15272. this.n35 = (this.getChild("n35"));
  15273. this.t0 = this.getTransition("t0");
  15274. }
  15275. }
  15276. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15277. class ui_Component30 extends fgui.GComponent {
  15278. static createInstance() {
  15279. return (fgui.UIPackage.createObject("game", "Component30"));
  15280. }
  15281. onConstruct() {
  15282. this.c1 = this.getController("c1");
  15283. this.n46 = (this.getChild("n46"));
  15284. this.n47 = (this.getChild("n47"));
  15285. this.numTxt = (this.getChild("numTxt"));
  15286. this.n50 = (this.getChild("n50"));
  15287. this.n53 = (this.getChild("n53"));
  15288. this.n54 = (this.getChild("n54"));
  15289. this.n55 = (this.getChild("n55"));
  15290. this.n56 = (this.getChild("n56"));
  15291. }
  15292. }
  15293. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15294. class ui_Component30_1 extends fgui.GComponent {
  15295. static createInstance() {
  15296. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15297. }
  15298. onConstruct() {
  15299. this.c1 = this.getController("c1");
  15300. this.n46 = (this.getChild("n46"));
  15301. this.n47 = (this.getChild("n47"));
  15302. this.numTxt = (this.getChild("numTxt"));
  15303. this.n50 = (this.getChild("n50"));
  15304. this.n51 = (this.getChild("n51"));
  15305. this.n52 = (this.getChild("n52"));
  15306. this.n53 = (this.getChild("n53"));
  15307. this.n54 = (this.getChild("n54"));
  15308. }
  15309. }
  15310. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15311. class ui_Component31 extends fgui.GComponent {
  15312. static createInstance() {
  15313. return (fgui.UIPackage.createObject("game", "Component31"));
  15314. }
  15315. onConstruct() {
  15316. this.n55 = (this.getChild("n55"));
  15317. this.n54 = (this.getChild("n54"));
  15318. this.conditionTxt = (this.getChild("conditionTxt"));
  15319. this.n57 = (this.getChild("n57"));
  15320. this.t0 = this.getTransition("t0");
  15321. }
  15322. }
  15323. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15324. class ui_Component32 extends fgui.GComponent {
  15325. static createInstance() {
  15326. return (fgui.UIPackage.createObject("game", "Component32"));
  15327. }
  15328. onConstruct() {
  15329. this.n5 = (this.getChild("n5"));
  15330. this.n6 = (this.getChild("n6"));
  15331. this.n7 = (this.getChild("n7"));
  15332. this.t0 = this.getTransition("t0");
  15333. }
  15334. }
  15335. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15336. class ui_AwardItem extends fgui.GComponent {
  15337. static createInstance() {
  15338. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15339. }
  15340. onConstruct() {
  15341. this.n9 = (this.getChild("n9"));
  15342. this.myIcon = (this.getChild("myIcon"));
  15343. this.numTxt = (this.getChild("numTxt"));
  15344. this.nameTxt = (this.getChild("nameTxt"));
  15345. this.n16 = (this.getChild("n16"));
  15346. this.n17 = (this.getChild("n17"));
  15347. }
  15348. }
  15349. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15350. class ui_ranking_com1 extends fgui.GButton {
  15351. static createInstance() {
  15352. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15353. }
  15354. onConstruct() {
  15355. this.c1 = this.getController("c1");
  15356. this.n49 = (this.getChild("n49"));
  15357. this.n18 = (this.getChild("n18"));
  15358. this.n46 = (this.getChild("n46"));
  15359. this.n48 = (this.getChild("n48"));
  15360. this.n50 = (this.getChild("n50"));
  15361. }
  15362. }
  15363. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15364. class ui_ranking_com2 extends fgui.GButton {
  15365. static createInstance() {
  15366. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15367. }
  15368. onConstruct() {
  15369. this.c1 = this.getController("c1");
  15370. this.n49 = (this.getChild("n49"));
  15371. this.n18 = (this.getChild("n18"));
  15372. this.n46 = (this.getChild("n46"));
  15373. this.n48 = (this.getChild("n48"));
  15374. this.n50 = (this.getChild("n50"));
  15375. }
  15376. }
  15377. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15378. class ui_ranking_com3 extends fgui.GComponent {
  15379. static createInstance() {
  15380. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15381. }
  15382. onConstruct() {
  15383. this.n17 = (this.getChild("n17"));
  15384. this.myIcon = (this.getChild("myIcon"));
  15385. }
  15386. }
  15387. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15388. class ui_ranking_com4 extends fgui.GComponent {
  15389. static createInstance() {
  15390. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15391. }
  15392. onConstruct() {
  15393. this.n16 = (this.getChild("n16"));
  15394. this.head = (this.getChild("head"));
  15395. }
  15396. }
  15397. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15398. class ui_ranking_com5 extends fgui.GComponent {
  15399. static createInstance() {
  15400. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15401. }
  15402. onConstruct() {
  15403. this.c1 = this.getController("c1");
  15404. this.c2 = this.getController("c2");
  15405. this.n2 = (this.getChild("n2"));
  15406. this.n3 = (this.getChild("n3"));
  15407. this.levelBtn = (this.getChild("levelBtn"));
  15408. this.starBtn = (this.getChild("starBtn"));
  15409. this.n23 = (this.getChild("n23"));
  15410. this.n24 = (this.getChild("n24"));
  15411. this.n25 = (this.getChild("n25"));
  15412. this.myList = (this.getChild("myList"));
  15413. this.selfNode = (this.getChild("selfNode"));
  15414. this.n9 = (this.getChild("n9"));
  15415. this.n12 = (this.getChild("n12"));
  15416. this.n13 = (this.getChild("n13"));
  15417. this.n14 = (this.getChild("n14"));
  15418. this.n39 = (this.getChild("n39"));
  15419. this.n41 = (this.getChild("n41"));
  15420. this.n42 = (this.getChild("n42"));
  15421. this.n45 = (this.getChild("n45"));
  15422. this.changeBtn = (this.getChild("changeBtn"));
  15423. this.closeBtn = (this.getChild("closeBtn"));
  15424. this.t0 = this.getTransition("t0");
  15425. }
  15426. }
  15427. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15428. class ui_RankItem extends fgui.GComponent {
  15429. static createInstance() {
  15430. return (fgui.UIPackage.createObject("game", "RankItem"));
  15431. }
  15432. onConstruct() {
  15433. this.n10 = (this.getChild("n10"));
  15434. this.n11 = (this.getChild("n11"));
  15435. this.rankTxt = (this.getChild("rankTxt"));
  15436. this.headNode = (this.getChild("headNode"));
  15437. this.nameTxt = (this.getChild("nameTxt"));
  15438. this.n19 = (this.getChild("n19"));
  15439. this.valueTxt = (this.getChild("valueTxt"));
  15440. this.img1 = (this.getChild("img1"));
  15441. this.img2 = (this.getChild("img2"));
  15442. this.img3 = (this.getChild("img3"));
  15443. }
  15444. }
  15445. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15446. class ui_ranking_com9 extends fgui.GComponent {
  15447. static createInstance() {
  15448. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15449. }
  15450. onConstruct() {
  15451. this.c1 = this.getController("c1");
  15452. this.n27 = (this.getChild("n27"));
  15453. this.n28 = (this.getChild("n28"));
  15454. this.headNode = (this.getChild("headNode"));
  15455. this.rankTxt = (this.getChild("rankTxt"));
  15456. this.nameTxt = (this.getChild("nameTxt"));
  15457. this.n34 = (this.getChild("n34"));
  15458. this.valueTxt = (this.getChild("valueTxt"));
  15459. this.n36 = (this.getChild("n36"));
  15460. this.n37 = (this.getChild("n37"));
  15461. this.n38 = (this.getChild("n38"));
  15462. this.n39 = (this.getChild("n39"));
  15463. this.n40 = (this.getChild("n40"));
  15464. }
  15465. }
  15466. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15467. class ui_ranking_com10 extends fgui.GComponent {
  15468. static createInstance() {
  15469. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15470. }
  15471. onConstruct() {
  15472. this.n23 = (this.getChild("n23"));
  15473. this.n24 = (this.getChild("n24"));
  15474. }
  15475. }
  15476. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15477. class ui_ranking_com11 extends fgui.GComponent {
  15478. static createInstance() {
  15479. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15480. }
  15481. onConstruct() {
  15482. this.n24 = (this.getChild("n24"));
  15483. this.n25 = (this.getChild("n25"));
  15484. this.t0 = this.getTransition("t0");
  15485. }
  15486. }
  15487. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15488. class ui_ranking_com13 extends fgui.GButton {
  15489. static createInstance() {
  15490. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15491. }
  15492. onConstruct() {
  15493. this.c1 = this.getController("c1");
  15494. this.n44 = (this.getChild("n44"));
  15495. this.n45 = (this.getChild("n45"));
  15496. this.n46 = (this.getChild("n46"));
  15497. }
  15498. }
  15499. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15500. class ui_Component122 extends fgui.GComponent {
  15501. static createInstance() {
  15502. return (fgui.UIPackage.createObject("game", "Component122"));
  15503. }
  15504. onConstruct() {
  15505. this.gameNode3 = (this.getChild("gameNode3"));
  15506. }
  15507. }
  15508. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15509. class ui_skillItem extends fgui.GComponent {
  15510. static createInstance() {
  15511. return (fgui.UIPackage.createObject("game", "skillItem"));
  15512. }
  15513. onConstruct() {
  15514. this.c1 = this.getController("c1");
  15515. this.n31 = (this.getChild("n31"));
  15516. this.n6 = (this.getChild("n6"));
  15517. this.skillImg = (this.getChild("skillImg"));
  15518. this.nameTxt = (this.getChild("nameTxt"));
  15519. this.levelTxt = (this.getChild("levelTxt"));
  15520. this.n28 = (this.getChild("n28"));
  15521. this.describeTxt = (this.getChild("describeTxt"));
  15522. this.n32 = (this.getChild("n32"));
  15523. this.mutiBtn = (this.getChild("mutiBtn"));
  15524. this.tryNode = (this.getChild("tryNode"));
  15525. this.normalBtn = (this.getChild("normalBtn"));
  15526. this.startBtn = (this.getChild("startBtn"));
  15527. this.n42 = (this.getChild("n42"));
  15528. this.n43 = (this.getChild("n43"));
  15529. this.n44 = (this.getChild("n44"));
  15530. }
  15531. }
  15532. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15533. class ui_Component26 extends fgui.GButton {
  15534. static createInstance() {
  15535. return (fgui.UIPackage.createObject("game", "Component26"));
  15536. }
  15537. onConstruct() {
  15538. this.n11 = (this.getChild("n11"));
  15539. this.n30 = (this.getChild("n30"));
  15540. this.n34 = (this.getChild("n34"));
  15541. }
  15542. }
  15543. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15544. class ui_Component28 extends fgui.GButton {
  15545. static createInstance() {
  15546. return (fgui.UIPackage.createObject("game", "Component28"));
  15547. }
  15548. onConstruct() {
  15549. this.n12 = (this.getChild("n12"));
  15550. this.n31 = (this.getChild("n31"));
  15551. this.curTxt = (this.getChild("curTxt"));
  15552. this.n33 = (this.getChild("n33"));
  15553. }
  15554. }
  15555. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15556. class ui_Component1302 extends fgui.GComponent {
  15557. static createInstance() {
  15558. return (fgui.UIPackage.createObject("game", "Component1302"));
  15559. }
  15560. onConstruct() {
  15561. this.n2 = (this.getChild("n2"));
  15562. this.n3 = (this.getChild("n3"));
  15563. }
  15564. }
  15565. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15566. class ui_Component113 extends fgui.GComponent {
  15567. static createInstance() {
  15568. return (fgui.UIPackage.createObject("game", "Component113"));
  15569. }
  15570. onConstruct() {
  15571. this.n85 = (this.getChild("n85"));
  15572. this.n86 = (this.getChild("n86"));
  15573. this.n77 = (this.getChild("n77"));
  15574. this.n79 = (this.getChild("n79"));
  15575. this.n80 = (this.getChild("n80"));
  15576. this.n81 = (this.getChild("n81"));
  15577. this.n82 = (this.getChild("n82"));
  15578. this.n84 = (this.getChild("n84"));
  15579. this.n87 = (this.getChild("n87"));
  15580. this.t0 = this.getTransition("t0");
  15581. }
  15582. }
  15583. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15584. class ui_Component114 extends fgui.GComponent {
  15585. static createInstance() {
  15586. return (fgui.UIPackage.createObject("game", "Component114"));
  15587. }
  15588. onConstruct() {
  15589. this.n77 = (this.getChild("n77"));
  15590. this.t0 = this.getTransition("t0");
  15591. }
  15592. }
  15593. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15594. class ui_Component115 extends fgui.GComponent {
  15595. static createInstance() {
  15596. return (fgui.UIPackage.createObject("game", "Component115"));
  15597. }
  15598. onConstruct() {
  15599. this.n83 = (this.getChild("n83"));
  15600. this.fingerNode = (this.getChild("fingerNode"));
  15601. this.n84 = (this.getChild("n84"));
  15602. }
  15603. }
  15604. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15605. class ui_Component117 extends fgui.GComponent {
  15606. static createInstance() {
  15607. return (fgui.UIPackage.createObject("game", "Component117"));
  15608. }
  15609. onConstruct() {
  15610. this.n87 = (this.getChild("n87"));
  15611. this.n88 = (this.getChild("n88"));
  15612. this.n84 = (this.getChild("n84"));
  15613. this.n85 = (this.getChild("n85"));
  15614. this.n86 = (this.getChild("n86"));
  15615. this.t0 = this.getTransition("t0");
  15616. }
  15617. }
  15618. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15619. class ui_Component98_1 extends fgui.GButton {
  15620. static createInstance() {
  15621. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15622. }
  15623. onConstruct() {
  15624. this.c1 = this.getController("c1");
  15625. this.n8 = (this.getChild("n8"));
  15626. this.n41 = (this.getChild("n41"));
  15627. this.n40 = (this.getChild("n40"));
  15628. }
  15629. }
  15630. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15631. class ui_Component61 extends fgui.GComponent {
  15632. static createInstance() {
  15633. return (fgui.UIPackage.createObject("game", "Component61"));
  15634. }
  15635. onConstruct() {
  15636. this.n14 = (this.getChild("n14"));
  15637. this.n6 = (this.getChild("n6"));
  15638. this.t0 = this.getTransition("t0");
  15639. }
  15640. }
  15641. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15642. class ui_Component62 extends fgui.GComponent {
  15643. static createInstance() {
  15644. return (fgui.UIPackage.createObject("game", "Component62"));
  15645. }
  15646. onConstruct() {
  15647. this.n66 = (this.getChild("n66"));
  15648. this.n56 = (this.getChild("n56"));
  15649. this.n63 = (this.getChild("n63"));
  15650. this.n65 = (this.getChild("n65"));
  15651. this.t0 = this.getTransition("t0");
  15652. }
  15653. }
  15654. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15655. class ui_d3Root extends fgui.GComponent {
  15656. static createInstance() {
  15657. return (fgui.UIPackage.createObject("game", "d3Root"));
  15658. }
  15659. onConstruct() {
  15660. }
  15661. }
  15662. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15663. class ui_d2Root extends fgui.GComponent {
  15664. static createInstance() {
  15665. return (fgui.UIPackage.createObject("game", "d2Root"));
  15666. }
  15667. onConstruct() {
  15668. }
  15669. }
  15670. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15671. class ui_ballNode extends fgui.GComponent {
  15672. static createInstance() {
  15673. return (fgui.UIPackage.createObject("game", "ballNode"));
  15674. }
  15675. onConstruct() {
  15676. }
  15677. }
  15678. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15679. class ui_border extends fgui.GComponent {
  15680. static createInstance() {
  15681. return (fgui.UIPackage.createObject("game", "border"));
  15682. }
  15683. onConstruct() {
  15684. this.bar1 = (this.getChild("bar1"));
  15685. this.bar2 = (this.getChild("bar2"));
  15686. this.bar3 = (this.getChild("bar3"));
  15687. this.bar4 = (this.getChild("bar4"));
  15688. this.bar5 = (this.getChild("bar5"));
  15689. this.bar6 = (this.getChild("bar6"));
  15690. this.circle1 = (this.getChild("circle1"));
  15691. this.circle2 = (this.getChild("circle2"));
  15692. this.circle3 = (this.getChild("circle3"));
  15693. this.circle4 = (this.getChild("circle4"));
  15694. this.circle5 = (this.getChild("circle5"));
  15695. this.circle6 = (this.getChild("circle6"));
  15696. this.n28 = (this.getChild("n28"));
  15697. }
  15698. }
  15699. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15700. class ui_btn_buy extends fgui.GButton {
  15701. static createInstance() {
  15702. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15703. }
  15704. onConstruct() {
  15705. this.button = this.getController("button");
  15706. this.n0 = (this.getChild("n0"));
  15707. this.n1 = (this.getChild("n1"));
  15708. this.n2 = (this.getChild("n2"));
  15709. }
  15710. }
  15711. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15712. class ui_Component41_2 extends fgui.GComponent {
  15713. static createInstance() {
  15714. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15715. }
  15716. onConstruct() {
  15717. this.c1 = this.getController("c1");
  15718. this.n0 = (this.getChild("n0"));
  15719. this.n2 = (this.getChild("n2"));
  15720. this.n19 = (this.getChild("n19"));
  15721. this.cancelBtn = (this.getChild("cancelBtn"));
  15722. this.videoBtn = (this.getChild("videoBtn"));
  15723. this.n9 = (this.getChild("n9"));
  15724. this.n22 = (this.getChild("n22"));
  15725. this.tipsTxt = (this.getChild("tipsTxt"));
  15726. this.n23 = (this.getChild("n23"));
  15727. this.n24 = (this.getChild("n24"));
  15728. this.n26 = (this.getChild("n26"));
  15729. this.n27 = (this.getChild("n27"));
  15730. this.titleTxt = (this.getChild("titleTxt"));
  15731. }
  15732. }
  15733. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15734. class ui_Component41_1 extends fgui.GComponent {
  15735. static createInstance() {
  15736. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15737. }
  15738. onConstruct() {
  15739. this.c1 = this.getController("c1");
  15740. this.n0 = (this.getChild("n0"));
  15741. this.n2 = (this.getChild("n2"));
  15742. this.cancelBtn = (this.getChild("cancelBtn"));
  15743. this.videoBtn = (this.getChild("videoBtn"));
  15744. this.n27 = (this.getChild("n27"));
  15745. this.n30 = (this.getChild("n30"));
  15746. this.n31 = (this.getChild("n31"));
  15747. this.n32 = (this.getChild("n32"));
  15748. this.n33 = (this.getChild("n33"));
  15749. this.n34 = (this.getChild("n34"));
  15750. this.n35 = (this.getChild("n35"));
  15751. this.n36 = (this.getChild("n36"));
  15752. this.n1 = (this.getChild("n1"));
  15753. this.n37 = (this.getChild("n37"));
  15754. this.t0 = this.getTransition("t0");
  15755. this.t1 = this.getTransition("t1");
  15756. this.t2 = this.getTransition("t2");
  15757. this.t3 = this.getTransition("t3");
  15758. }
  15759. }
  15760. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15761. class ui_againBtn extends fgui.GButton {
  15762. static createInstance() {
  15763. return (fgui.UIPackage.createObject("game", "againBtn"));
  15764. }
  15765. onConstruct() {
  15766. this.n2 = (this.getChild("n2"));
  15767. this.n1 = (this.getChild("n1"));
  15768. this.n5 = (this.getChild("n5"));
  15769. }
  15770. }
  15771. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15772. class ui_Component118 extends fgui.GButton {
  15773. static createInstance() {
  15774. return (fgui.UIPackage.createObject("game", "Component118"));
  15775. }
  15776. onConstruct() {
  15777. this.c1 = this.getController("c1");
  15778. this.n14 = (this.getChild("n14"));
  15779. this.n9 = (this.getChild("n9"));
  15780. this.n10 = (this.getChild("n10"));
  15781. this.diamondTxt = (this.getChild("diamondTxt"));
  15782. this.n13 = (this.getChild("n13"));
  15783. this.n15 = (this.getChild("n15"));
  15784. }
  15785. }
  15786. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15787. class ui_Component119 extends fgui.GComponent {
  15788. static createInstance() {
  15789. return (fgui.UIPackage.createObject("game", "Component119"));
  15790. }
  15791. onConstruct() {
  15792. this.n1 = (this.getChild("n1"));
  15793. this.n2 = (this.getChild("n2"));
  15794. this.n13 = (this.getChild("n13"));
  15795. this.n6 = (this.getChild("n6"));
  15796. this.screenNode = (this.getChild("screenNode"));
  15797. this.n15 = (this.getChild("n15"));
  15798. this.closeBtn = (this.getChild("closeBtn"));
  15799. this.share2Btn = (this.getChild("share2Btn"));
  15800. this.shareBtn = (this.getChild("shareBtn"));
  15801. this.tipsNode = (this.getChild("tipsNode"));
  15802. this.awardNode = (this.getChild("awardNode"));
  15803. }
  15804. }
  15805. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15806. class ui_daoJuDisplay extends fgui.GComponent {
  15807. static createInstance() {
  15808. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15809. }
  15810. onConstruct() {
  15811. this.n6 = (this.getChild("n6"));
  15812. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15813. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15814. this.btn_buy = (this.getChild("btn_buy"));
  15815. this.nameTxt = (this.getChild("nameTxt"));
  15816. this.zsImg = (this.getChild("zsImg"));
  15817. }
  15818. }
  15819. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15820. class ui_Component132_1 extends fgui.GComponent {
  15821. static createInstance() {
  15822. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15823. }
  15824. onConstruct() {
  15825. this.n25 = (this.getChild("n25"));
  15826. this.n26 = (this.getChild("n26"));
  15827. this.n27 = (this.getChild("n27"));
  15828. this.t0 = this.getTransition("t0");
  15829. }
  15830. }
  15831. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15832. class ui_SecretaryDisplay extends fgui.GComponent {
  15833. static createInstance() {
  15834. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15835. }
  15836. onConstruct() {
  15837. this.n2 = (this.getChild("n2"));
  15838. this.levelTxt = (this.getChild("levelTxt"));
  15839. this.n4 = (this.getChild("n4"));
  15840. this.secretary = (this.getChild("secretary"));
  15841. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15842. this.n16 = (this.getChild("n16"));
  15843. this.n37 = (this.getChild("n37"));
  15844. this.n41 = (this.getChild("n41"));
  15845. this.n14 = (this.getChild("n14"));
  15846. this.n17 = (this.getChild("n17"));
  15847. this.heightTxt = (this.getChild("heightTxt"));
  15848. this.n46 = (this.getChild("n46"));
  15849. this.n36 = (this.getChild("n36"));
  15850. this.n38 = (this.getChild("n38"));
  15851. this.foodTxt = (this.getChild("foodTxt"));
  15852. this.n47 = (this.getChild("n47"));
  15853. this.n40 = (this.getChild("n40"));
  15854. this.n42 = (this.getChild("n42"));
  15855. this.historyTxt = (this.getChild("historyTxt"));
  15856. this.n48 = (this.getChild("n48"));
  15857. this.nameImg = (this.getChild("nameImg"));
  15858. this.n12 = (this.getChild("n12"));
  15859. this.n49 = (this.getChild("n49"));
  15860. this.t0 = this.getTransition("t0");
  15861. }
  15862. }
  15863. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15864. class ui_BallRodDisplay extends fgui.GComponent {
  15865. static createInstance() {
  15866. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15867. }
  15868. onConstruct() {
  15869. this.c1 = this.getController("c1");
  15870. this.n31 = (this.getChild("n31"));
  15871. this.n6 = (this.getChild("n6"));
  15872. this.nameTxt = (this.getChild("nameTxt"));
  15873. this.rodImg = (this.getChild("rodImg"));
  15874. this.eftRod = (this.getChild("eftRod"));
  15875. this.levelNode = (this.getChild("levelNode"));
  15876. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15877. }
  15878. }
  15879. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15880. class ui_Component111_11 extends fgui.GComponent {
  15881. static createInstance() {
  15882. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15883. }
  15884. onConstruct() {
  15885. this.n68 = (this.getChild("n68"));
  15886. this.n69 = (this.getChild("n69"));
  15887. }
  15888. }
  15889. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15890. class ui_Component112 extends fgui.GComponent {
  15891. static createInstance() {
  15892. return (fgui.UIPackage.createObject("game", "Component112"));
  15893. }
  15894. onConstruct() {
  15895. this.n68 = (this.getChild("n68"));
  15896. this.n70 = (this.getChild("n70"));
  15897. this.myMask = (this.getChild("myMask"));
  15898. }
  15899. }
  15900. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15901. class ui_Component111 extends fgui.GComponent {
  15902. static createInstance() {
  15903. return (fgui.UIPackage.createObject("game", "Component111"));
  15904. }
  15905. onConstruct() {
  15906. this.n68 = (this.getChild("n68"));
  15907. this.myMask = (this.getChild("myMask"));
  15908. }
  15909. }
  15910. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15911. class ui_Component144 extends fgui.GButton {
  15912. static createInstance() {
  15913. return (fgui.UIPackage.createObject("game", "Component144"));
  15914. }
  15915. onConstruct() {
  15916. this.n8 = (this.getChild("n8"));
  15917. }
  15918. }
  15919. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15920. class ui_Sign_com2 extends fgui.GComponent {
  15921. static createInstance() {
  15922. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15923. }
  15924. onConstruct() {
  15925. this.n0 = (this.getChild("n0"));
  15926. this.n1 = (this.getChild("n1"));
  15927. this.t0 = this.getTransition("t0");
  15928. }
  15929. }
  15930. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15931. class ui_Sign_guang extends fgui.GComponent {
  15932. static createInstance() {
  15933. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15934. }
  15935. onConstruct() {
  15936. this.n1 = (this.getChild("n1"));
  15937. this.n2 = (this.getChild("n2"));
  15938. this.n3 = (this.getChild("n3"));
  15939. this.n4 = (this.getChild("n4"));
  15940. this.n5 = (this.getChild("n5"));
  15941. this.n6 = (this.getChild("n6"));
  15942. this.n8 = (this.getChild("n8"));
  15943. }
  15944. }
  15945. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15946. class ui_SignMax extends fgui.GComponent {
  15947. static createInstance() {
  15948. return (fgui.UIPackage.createObject("game", "SignMax"));
  15949. }
  15950. onConstruct() {
  15951. this.c1 = this.getController("c1");
  15952. this.n7 = (this.getChild("n7"));
  15953. this.n15 = (this.getChild("n15"));
  15954. this.n8 = (this.getChild("n8"));
  15955. this.titleTxt = (this.getChild("titleTxt"));
  15956. this.myIcon1 = (this.getChild("myIcon1"));
  15957. this.numTxt1 = (this.getChild("numTxt1"));
  15958. this.myIcon2 = (this.getChild("myIcon2"));
  15959. this.n20 = (this.getChild("n20"));
  15960. this.n17 = (this.getChild("n17"));
  15961. this.numTxt2 = (this.getChild("numTxt2"));
  15962. this.n12 = (this.getChild("n12"));
  15963. this.n13 = (this.getChild("n13"));
  15964. this.n21 = (this.getChild("n21"));
  15965. this.n14 = (this.getChild("n14"));
  15966. }
  15967. }
  15968. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15969. class ui_Sign_com2_1 extends fgui.GComponent {
  15970. static createInstance() {
  15971. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15972. }
  15973. onConstruct() {
  15974. this.n0 = (this.getChild("n0"));
  15975. this.n1 = (this.getChild("n1"));
  15976. this.t0 = this.getTransition("t0");
  15977. }
  15978. }
  15979. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15980. class ui_Sign_com5 extends fgui.GComponent {
  15981. static createInstance() {
  15982. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15983. }
  15984. onConstruct() {
  15985. this.n3 = (this.getChild("n3"));
  15986. this.n29 = (this.getChild("n29"));
  15987. this.n4 = (this.getChild("n4"));
  15988. this.day1 = (this.getChild("day1"));
  15989. this.day2 = (this.getChild("day2"));
  15990. this.day3 = (this.getChild("day3"));
  15991. this.day4 = (this.getChild("day4"));
  15992. this.day5 = (this.getChild("day5"));
  15993. this.day6 = (this.getChild("day6"));
  15994. this.day7 = (this.getChild("day7"));
  15995. this.t0 = this.getTransition("t0");
  15996. }
  15997. }
  15998. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15999. class ui_Sign_com8 extends fgui.GComponent {
  16000. static createInstance() {
  16001. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  16002. }
  16003. onConstruct() {
  16004. this.n48 = (this.getChild("n48"));
  16005. this.womanTxt = (this.getChild("womanTxt"));
  16006. this.t0 = this.getTransition("t0");
  16007. }
  16008. }
  16009. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  16010. class ui_Sign_com6 extends fgui.GComponent {
  16011. static createInstance() {
  16012. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  16013. }
  16014. onConstruct() {
  16015. this.n2 = (this.getChild("n2"));
  16016. this.n3 = (this.getChild("n3"));
  16017. this.t0 = this.getTransition("t0");
  16018. }
  16019. }
  16020. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  16021. class ui_Sign_com7 extends fgui.GComponent {
  16022. static createInstance() {
  16023. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16024. }
  16025. onConstruct() {
  16026. this.n29 = (this.getChild("n29"));
  16027. this.n2 = (this.getChild("n2"));
  16028. }
  16029. }
  16030. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16031. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16032. static createInstance() {
  16033. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16034. }
  16035. onConstruct() {
  16036. this.n5 = (this.getChild("n5"));
  16037. this.n4 = (this.getChild("n4"));
  16038. this.t0 = this.getTransition("t0");
  16039. }
  16040. }
  16041. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16042. class ui_UITurntable_com2 extends fgui.GComponent {
  16043. static createInstance() {
  16044. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16045. }
  16046. onConstruct() {
  16047. this.c1 = this.getController("c1");
  16048. this.n4 = (this.getChild("n4"));
  16049. this.n6 = (this.getChild("n6"));
  16050. this.n10 = (this.getChild("n10"));
  16051. this.n11 = (this.getChild("n11"));
  16052. this.n12 = (this.getChild("n12"));
  16053. this.n13 = (this.getChild("n13"));
  16054. this.n14 = (this.getChild("n14"));
  16055. this.n15 = (this.getChild("n15"));
  16056. this.n16 = (this.getChild("n16"));
  16057. this.n17 = (this.getChild("n17"));
  16058. this.n18 = (this.getChild("n18"));
  16059. this.n19 = (this.getChild("n19"));
  16060. this.n20 = (this.getChild("n20"));
  16061. this.n21 = (this.getChild("n21"));
  16062. this.n22 = (this.getChild("n22"));
  16063. this.n23 = (this.getChild("n23"));
  16064. this.n24 = (this.getChild("n24"));
  16065. this.n25 = (this.getChild("n25"));
  16066. this.n26 = (this.getChild("n26"));
  16067. this.n27 = (this.getChild("n27"));
  16068. this.n28 = (this.getChild("n28"));
  16069. this.n29 = (this.getChild("n29"));
  16070. this.n30 = (this.getChild("n30"));
  16071. this.n31 = (this.getChild("n31"));
  16072. this.n32 = (this.getChild("n32"));
  16073. this.n33 = (this.getChild("n33"));
  16074. }
  16075. }
  16076. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16077. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16078. static createInstance() {
  16079. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16080. }
  16081. onConstruct() {
  16082. this.n5 = (this.getChild("n5"));
  16083. this.n4 = (this.getChild("n4"));
  16084. this.t0 = this.getTransition("t0");
  16085. }
  16086. }
  16087. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16088. class ui_UITurntable_com5 extends fgui.GComponent {
  16089. static createInstance() {
  16090. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16091. }
  16092. onConstruct() {
  16093. this.flashNode = (this.getChild("flashNode"));
  16094. this.rotNode = (this.getChild("rotNode"));
  16095. this.n3 = (this.getChild("n3"));
  16096. this.n21 = (this.getChild("n21"));
  16097. this.t0 = this.getTransition("t0");
  16098. }
  16099. }
  16100. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16101. class ui_UITurntable_com7 extends fgui.GComponent {
  16102. static createInstance() {
  16103. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16104. }
  16105. onConstruct() {
  16106. this.n2 = (this.getChild("n2"));
  16107. this.n35 = (this.getChild("n35"));
  16108. this.img1 = (this.getChild("img1"));
  16109. this.img2 = (this.getChild("img2"));
  16110. this.img3 = (this.getChild("img3"));
  16111. this.img4 = (this.getChild("img4"));
  16112. this.img6 = (this.getChild("img6"));
  16113. this.img5 = (this.getChild("img5"));
  16114. this.txt1 = (this.getChild("txt1"));
  16115. this.txt2 = (this.getChild("txt2"));
  16116. this.txt3 = (this.getChild("txt3"));
  16117. this.txt4 = (this.getChild("txt4"));
  16118. this.txt5 = (this.getChild("txt5"));
  16119. this.txt6 = (this.getChild("txt6"));
  16120. }
  16121. }
  16122. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16123. class ui_UITurntable_com9 extends fgui.GComponent {
  16124. static createInstance() {
  16125. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16126. }
  16127. onConstruct() {
  16128. this.n38 = (this.getChild("n38"));
  16129. this.n39 = (this.getChild("n39"));
  16130. }
  16131. }
  16132. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16133. class ui_UITurntable_com10 extends fgui.GComponent {
  16134. static createInstance() {
  16135. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16136. }
  16137. onConstruct() {
  16138. this.n39 = (this.getChild("n39"));
  16139. this.n40 = (this.getChild("n40"));
  16140. this.t0 = this.getTransition("t0");
  16141. }
  16142. }
  16143. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16144. class ui_UITurntable_com11 extends fgui.GComponent {
  16145. static createInstance() {
  16146. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16147. }
  16148. onConstruct() {
  16149. this.n38 = (this.getChild("n38"));
  16150. this.n39 = (this.getChild("n39"));
  16151. this.n40 = (this.getChild("n40"));
  16152. this.t0 = this.getTransition("t0");
  16153. }
  16154. }
  16155. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16156. class ui_UITurntable_com12 extends fgui.GComponent {
  16157. static createInstance() {
  16158. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16159. }
  16160. onConstruct() {
  16161. this.n43 = (this.getChild("n43"));
  16162. this.barNode = (this.getChild("barNode"));
  16163. this.tipsTxt = (this.getChild("tipsTxt"));
  16164. this.n45 = (this.getChild("n45"));
  16165. this.boxBtn = (this.getChild("boxBtn"));
  16166. }
  16167. }
  16168. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16169. class ui_UITurntable_com1 extends fgui.GButton {
  16170. static createInstance() {
  16171. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16172. }
  16173. onConstruct() {
  16174. this.n41 = (this.getChild("n41"));
  16175. this.n42 = (this.getChild("n42"));
  16176. this.t0 = this.getTransition("t0");
  16177. }
  16178. }
  16179. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16180. class ui_UITurntable_com3 extends fgui.GComponent {
  16181. static createInstance() {
  16182. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16183. }
  16184. onConstruct() {
  16185. this.n48 = (this.getChild("n48"));
  16186. this.womanTxt = (this.getChild("womanTxt"));
  16187. this.t0 = this.getTransition("t0");
  16188. }
  16189. }
  16190. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16191. class ui_cancelBtn2 extends fgui.GButton {
  16192. static createInstance() {
  16193. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16194. }
  16195. onConstruct() {
  16196. this.c1 = this.getController("c1");
  16197. this.n0 = (this.getChild("n0"));
  16198. this.n1 = (this.getChild("n1"));
  16199. this.n2 = (this.getChild("n2"));
  16200. this.n3 = (this.getChild("n3"));
  16201. this.n4 = (this.getChild("n4"));
  16202. this.n5 = (this.getChild("n5"));
  16203. this.n6 = (this.getChild("n6"));
  16204. this.n7 = (this.getChild("n7"));
  16205. this.n8 = (this.getChild("n8"));
  16206. this.powerEft = (this.getChild("powerEft"));
  16207. }
  16208. }
  16209. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16210. class ui_shareBtn2 extends fgui.GButton {
  16211. static createInstance() {
  16212. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16213. }
  16214. onConstruct() {
  16215. this.c1 = this.getController("c1");
  16216. this.n2 = (this.getChild("n2"));
  16217. this.n24 = (this.getChild("n24"));
  16218. this.n1 = (this.getChild("n1"));
  16219. this.n3 = (this.getChild("n3"));
  16220. this.n23 = (this.getChild("n23"));
  16221. this.n4 = (this.getChild("n4"));
  16222. this.n5 = (this.getChild("n5"));
  16223. this.n6 = (this.getChild("n6"));
  16224. this.n20 = (this.getChild("n20"));
  16225. this.n21 = (this.getChild("n21"));
  16226. this.n22 = (this.getChild("n22"));
  16227. this.powerEft = (this.getChild("powerEft"));
  16228. }
  16229. }
  16230. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16231. class ui_UIMoney extends fgui.GComponent {
  16232. static createInstance() {
  16233. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16234. }
  16235. onConstruct() {
  16236. this.c1 = this.getController("c1");
  16237. this.n4 = (this.getChild("n4"));
  16238. this.coinImg = (this.getChild("coinImg"));
  16239. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16240. this.coinTxt = (this.getChild("coinTxt"));
  16241. this.n7 = (this.getChild("n7"));
  16242. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16243. this.diamondTxt = (this.getChild("diamondTxt"));
  16244. this.diamondImg = (this.getChild("diamondImg"));
  16245. this.n12 = (this.getChild("n12"));
  16246. this.powerImg = (this.getChild("powerImg"));
  16247. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16248. this.powerTxt = (this.getChild("powerTxt"));
  16249. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16250. }
  16251. }
  16252. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16253. class ui_backBtn extends fgui.GButton {
  16254. static createInstance() {
  16255. return (fgui.UIPackage.createObject("game", "backBtn"));
  16256. }
  16257. onConstruct() {
  16258. this.n0 = (this.getChild("n0"));
  16259. this.t0 = this.getTransition("t0");
  16260. this.t1 = this.getTransition("t1");
  16261. }
  16262. }
  16263. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16264. class ui_MoneyBtn extends fgui.GButton {
  16265. static createInstance() {
  16266. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16267. }
  16268. onConstruct() {
  16269. this.button = this.getController("button");
  16270. this.n0 = (this.getChild("n0"));
  16271. }
  16272. }
  16273. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16274. class ui_UIMoneyBtn extends fgui.GComponent {
  16275. static createInstance() {
  16276. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16277. }
  16278. onConstruct() {
  16279. this.n1 = (this.getChild("n1"));
  16280. this.closeBtn = (this.getChild("closeBtn"));
  16281. }
  16282. }
  16283. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16284. class ui_Component64 extends fgui.GComponent {
  16285. static createInstance() {
  16286. return (fgui.UIPackage.createObject("game", "Component64"));
  16287. }
  16288. onConstruct() {
  16289. this.n57 = (this.getChild("n57"));
  16290. this.n54 = (this.getChild("n54"));
  16291. this.n55 = (this.getChild("n55"));
  16292. this.n56 = (this.getChild("n56"));
  16293. this.t1 = this.getTransition("t1");
  16294. }
  16295. }
  16296. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16297. class ui_Component41_3 extends fgui.GComponent {
  16298. static createInstance() {
  16299. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16300. }
  16301. onConstruct() {
  16302. this.c1 = this.getController("c1");
  16303. this.n0 = (this.getChild("n0"));
  16304. this.n2 = (this.getChild("n2"));
  16305. this.cancelBtn = (this.getChild("cancelBtn"));
  16306. this.videoBtn = (this.getChild("videoBtn"));
  16307. this.n9 = (this.getChild("n9"));
  16308. this.n24 = (this.getChild("n24"));
  16309. this.n27 = (this.getChild("n27"));
  16310. this.titleTxt = (this.getChild("titleTxt"));
  16311. this.n28 = (this.getChild("n28"));
  16312. this.t0 = this.getTransition("t0");
  16313. }
  16314. }
  16315. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16316. class ui_dh_zs_4 extends fgui.GComponent {
  16317. static createInstance() {
  16318. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16319. }
  16320. onConstruct() {
  16321. this.n1 = (this.getChild("n1"));
  16322. this.n2 = (this.getChild("n2"));
  16323. this.n3 = (this.getChild("n3"));
  16324. this.n4 = (this.getChild("n4"));
  16325. this.n5 = (this.getChild("n5"));
  16326. this.n6 = (this.getChild("n6"));
  16327. this.n8 = (this.getChild("n8"));
  16328. this.t0 = this.getTransition("t0");
  16329. }
  16330. }
  16331. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16332. class ui_Component71_1 extends fgui.GButton {
  16333. static createInstance() {
  16334. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16335. }
  16336. onConstruct() {
  16337. this.n17 = (this.getChild("n17"));
  16338. this.t0 = this.getTransition("t0");
  16339. }
  16340. }
  16341. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16342. class ui_Component83 extends fgui.GComponent {
  16343. static createInstance() {
  16344. return (fgui.UIPackage.createObject("game", "Component83"));
  16345. }
  16346. onConstruct() {
  16347. this.c1 = this.getController("c1");
  16348. this.n17 = (this.getChild("n17"));
  16349. this.n19 = (this.getChild("n19"));
  16350. this.n20 = (this.getChild("n20"));
  16351. }
  16352. }
  16353. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16354. class ui_Component84 extends fgui.GComponent {
  16355. static createInstance() {
  16356. return (fgui.UIPackage.createObject("game", "Component84"));
  16357. }
  16358. onConstruct() {
  16359. this.c1 = this.getController("c1");
  16360. this.n4 = (this.getChild("n4"));
  16361. this.n22 = (this.getChild("n22"));
  16362. this.n23 = (this.getChild("n23"));
  16363. this.numTxt = (this.getChild("numTxt"));
  16364. this.n25 = (this.getChild("n25"));
  16365. this.n26 = (this.getChild("n26"));
  16366. }
  16367. }
  16368. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16369. class ui_Component84_1 extends fgui.GComponent {
  16370. static createInstance() {
  16371. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16372. }
  16373. onConstruct() {
  16374. this.c1 = this.getController("c1");
  16375. this.n4 = (this.getChild("n4"));
  16376. this.n22 = (this.getChild("n22"));
  16377. this.n23 = (this.getChild("n23"));
  16378. this.numTxt = (this.getChild("numTxt"));
  16379. this.n25 = (this.getChild("n25"));
  16380. this.n26 = (this.getChild("n26"));
  16381. }
  16382. }
  16383. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16384. class ui_Component85 extends fgui.GComponent {
  16385. static createInstance() {
  16386. return (fgui.UIPackage.createObject("game", "Component85"));
  16387. }
  16388. onConstruct() {
  16389. this.n1 = (this.getChild("n1"));
  16390. this.n6 = (this.getChild("n6"));
  16391. this.n2 = (this.getChild("n2"));
  16392. this.n3 = (this.getChild("n3"));
  16393. this.levelTxt = (this.getChild("levelTxt"));
  16394. this.n10 = (this.getChild("n10"));
  16395. this.n11 = (this.getChild("n11"));
  16396. this.n12 = (this.getChild("n12"));
  16397. this.n13 = (this.getChild("n13"));
  16398. this.n14 = (this.getChild("n14"));
  16399. this.modeNode = (this.getChild("modeNode"));
  16400. this.n18 = (this.getChild("n18"));
  16401. this.conditionTxt = (this.getChild("conditionTxt"));
  16402. this.diamondNode = (this.getChild("diamondNode"));
  16403. this.coinNode = (this.getChild("coinNode"));
  16404. this.startBtn = (this.getChild("startBtn"));
  16405. this.n28 = (this.getChild("n28"));
  16406. this.displayRoot = (this.getChild("displayRoot"));
  16407. this.t0 = this.getTransition("t0");
  16408. }
  16409. }
  16410. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16411. class ui_Component86 extends fgui.GButton {
  16412. static createInstance() {
  16413. return (fgui.UIPackage.createObject("game", "Component86"));
  16414. }
  16415. onConstruct() {
  16416. this.n15 = (this.getChild("n15"));
  16417. this.t0 = this.getTransition("t0");
  16418. }
  16419. }
  16420. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16421. class ui_Component87 extends fgui.GComponent {
  16422. static createInstance() {
  16423. return (fgui.UIPackage.createObject("game", "Component87"));
  16424. }
  16425. onConstruct() {
  16426. this.n66 = (this.getChild("n66"));
  16427. this.myProgress = (this.getChild("myProgress"));
  16428. this.starAni = (this.getChild("starAni"));
  16429. this.hpTxt = (this.getChild("hpTxt"));
  16430. this.n74 = (this.getChild("n74"));
  16431. this.n73 = (this.getChild("n73"));
  16432. this.ballTxt = (this.getChild("ballTxt"));
  16433. this.n76 = (this.getChild("n76"));
  16434. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16435. this.levelTxt = (this.getChild("levelTxt"));
  16436. this.star1 = (this.getChild("star1"));
  16437. this.star2 = (this.getChild("star2"));
  16438. this.star3 = (this.getChild("star3"));
  16439. }
  16440. }
  16441. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16442. class ui_Component88 extends fgui.GProgressBar {
  16443. static createInstance() {
  16444. return (fgui.UIPackage.createObject("game", "Component88"));
  16445. }
  16446. onConstruct() {
  16447. this.n68 = (this.getChild("n68"));
  16448. this.bar = (this.getChild("bar"));
  16449. }
  16450. }
  16451. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16452. class ui_Component89 extends fgui.GComponent {
  16453. static createInstance() {
  16454. return (fgui.UIPackage.createObject("game", "Component89"));
  16455. }
  16456. onConstruct() {
  16457. this.c1 = this.getController("c1");
  16458. this.n71 = (this.getChild("n71"));
  16459. this.n72 = (this.getChild("n72"));
  16460. }
  16461. }
  16462. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16463. class ui_Component90 extends fgui.GComponent {
  16464. static createInstance() {
  16465. return (fgui.UIPackage.createObject("game", "Component90"));
  16466. }
  16467. onConstruct() {
  16468. this.c1 = this.getController("c1");
  16469. this.n64 = (this.getChild("n64"));
  16470. this.n65 = (this.getChild("n65"));
  16471. this.n66 = (this.getChild("n66"));
  16472. this.t0 = this.getTransition("t0");
  16473. }
  16474. }
  16475. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16476. class ui_Component127 extends fgui.GButton {
  16477. static createInstance() {
  16478. return (fgui.UIPackage.createObject("game", "Component127"));
  16479. }
  16480. onConstruct() {
  16481. this.n5 = (this.getChild("n5"));
  16482. }
  16483. }
  16484. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16485. class gameBinder {
  16486. static bindAll() {
  16487. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16488. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16489. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16490. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16491. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16492. fgui.UIObjectFactory.setExtension(ui_Component1305_logo.URL, ui_Component1305_logo);
  16493. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16494. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16495. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16496. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16497. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16498. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16499. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16500. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16501. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16502. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16503. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16504. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16505. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16506. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16507. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16508. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16509. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16510. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16511. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16512. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16513. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16514. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16515. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16516. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16517. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16518. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16519. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16520. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16521. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16522. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16523. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16524. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16525. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16526. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16527. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16528. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16529. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16530. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16531. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16532. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16533. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16534. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16535. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16536. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16537. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16538. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16539. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16540. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16541. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16542. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16543. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16544. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16545. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16546. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16547. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16548. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16549. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16550. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16551. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16552. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16553. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16554. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16555. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16556. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16557. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16558. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16559. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16560. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16561. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16562. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16563. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16564. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16565. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16566. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16567. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16568. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16569. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16570. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16571. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16572. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16573. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16574. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16575. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16576. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16577. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16578. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16579. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16580. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16581. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16582. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16583. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16584. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16585. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16586. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16587. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16588. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16589. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16590. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16591. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16592. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16593. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16594. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16595. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16596. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16597. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16598. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16599. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16600. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16601. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16602. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16603. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16604. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16605. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16606. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16607. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16608. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16609. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16610. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16611. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16612. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16613. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16614. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16615. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16616. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16617. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16618. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16619. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16620. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16621. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16622. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16623. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16624. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16625. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16626. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16627. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16628. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16629. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16630. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16631. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16632. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16633. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16634. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16635. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16636. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16637. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16638. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16639. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16640. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16641. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16642. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16643. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16644. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16645. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16646. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16647. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16648. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16649. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16650. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16651. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16652. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16653. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16654. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16655. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16656. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16657. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16658. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16659. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16660. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16661. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16662. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16663. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16664. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16665. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16666. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16667. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16668. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16669. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16670. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16671. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16672. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16673. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16674. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16675. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16676. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16677. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16678. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16679. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16680. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16681. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16682. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16683. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16684. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16685. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16686. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16687. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16688. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16689. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16690. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16691. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16692. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16693. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16694. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16695. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16696. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16697. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16698. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16699. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16700. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16701. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16702. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16703. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16704. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16705. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16706. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16707. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16708. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16709. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16710. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16711. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16712. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16713. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16714. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16715. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16716. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16717. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16718. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16719. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16720. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16721. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16722. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16723. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16724. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16725. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16726. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16727. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16728. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16729. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16730. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16731. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16732. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16733. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16734. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16735. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16736. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16737. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16738. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16739. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16740. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16741. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16742. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16743. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16744. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16745. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16746. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16747. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16748. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16749. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16750. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16751. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16752. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16753. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16754. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16755. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16756. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16757. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16758. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16759. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16760. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16761. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16762. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16763. }
  16764. }
  16765. class ui_btn6 extends fgui.GButton {
  16766. static createInstance() {
  16767. return (fgui.UIPackage.createObject("loading", "btn6"));
  16768. }
  16769. onConstruct() {
  16770. this.n6 = (this.getChild("n6"));
  16771. this.n1 = (this.getChild("n1"));
  16772. }
  16773. }
  16774. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16775. class ui_xyItem extends fgui.GComponent {
  16776. static createInstance() {
  16777. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16778. }
  16779. onConstruct() {
  16780. this.xyItem = (this.getChild("xyItem"));
  16781. }
  16782. }
  16783. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16784. class ui_loadinfo extends fgui.GProgressBar {
  16785. static createInstance() {
  16786. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16787. }
  16788. onConstruct() {
  16789. this.bg = (this.getChild("bg"));
  16790. this.bar = (this.getChild("bar"));
  16791. this.title = (this.getChild("title"));
  16792. this.ani = (this.getChild("ani"));
  16793. }
  16794. }
  16795. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16796. class ui_xyNode extends fgui.GComponent {
  16797. static createInstance() {
  16798. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16799. }
  16800. onConstruct() {
  16801. this.n0 = (this.getChild("n0"));
  16802. this.btnYes = (this.getChild("btnYes"));
  16803. this.btnNo = (this.getChild("btnNo"));
  16804. this.btnKnown = (this.getChild("btnKnown"));
  16805. this.btnSure = (this.getChild("btnSure"));
  16806. this.txtWelcom = (this.getChild("txtWelcom"));
  16807. this.txtXy = (this.getChild("txtXy"));
  16808. this.n75 = (this.getChild("n75"));
  16809. this.btnXy1 = (this.getChild("btnXy1"));
  16810. this.btnXy3 = (this.getChild("btnXy3"));
  16811. this.btnXy2 = (this.getChild("btnXy2"));
  16812. this.n74 = (this.getChild("n74"));
  16813. this.xy1 = (this.getChild("xy1"));
  16814. this.txtTitle = (this.getChild("txtTitle"));
  16815. this.btnBack = (this.getChild("btnBack"));
  16816. this.xyList = (this.getChild("xyList"));
  16817. this.xy2 = (this.getChild("xy2"));
  16818. this.xyNode = (this.getChild("xyNode"));
  16819. }
  16820. }
  16821. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16822. class ui_ageNode extends fgui.GComponent {
  16823. static createInstance() {
  16824. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16825. }
  16826. onConstruct() {
  16827. this.n3 = (this.getChild("n3"));
  16828. this.n7 = (this.getChild("n7"));
  16829. this.n4 = (this.getChild("n4"));
  16830. this.btnAge = (this.getChild("btnAge"));
  16831. this.ageNode = (this.getChild("ageNode"));
  16832. }
  16833. }
  16834. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16835. class ui_rnNode extends fgui.GComponent {
  16836. static createInstance() {
  16837. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16838. }
  16839. onConstruct() {
  16840. this.n28 = (this.getChild("n28"));
  16841. this.n30 = (this.getChild("n30"));
  16842. this.n33 = (this.getChild("n33"));
  16843. this.rn1 = (this.getChild("rn1"));
  16844. this.n40 = (this.getChild("n40"));
  16845. this.n41 = (this.getChild("n41"));
  16846. this.rn3 = (this.getChild("rn3"));
  16847. this.n37 = (this.getChild("n37"));
  16848. this.n39 = (this.getChild("n39"));
  16849. this.rn2 = (this.getChild("rn2"));
  16850. this.n47 = (this.getChild("n47"));
  16851. this.n49 = (this.getChild("n49"));
  16852. this.n44 = (this.getChild("n44"));
  16853. this.inputCode = (this.getChild("inputCode"));
  16854. this.inputName = (this.getChild("inputName"));
  16855. this.n48 = (this.getChild("n48"));
  16856. this.n50 = (this.getChild("n50"));
  16857. this.rn4 = (this.getChild("rn4"));
  16858. this.btnCheck = (this.getChild("btnCheck"));
  16859. this.btnExit = (this.getChild("btnExit"));
  16860. this.btnDone = (this.getChild("btnDone"));
  16861. this.rnNode = (this.getChild("rnNode"));
  16862. }
  16863. }
  16864. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16865. class ui_tipNode extends fgui.GComponent {
  16866. static createInstance() {
  16867. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16868. }
  16869. onConstruct() {
  16870. this.bg = (this.getChild("bg"));
  16871. this.n55 = (this.getChild("n55"));
  16872. this.n56 = (this.getChild("n56"));
  16873. this.tipNode = (this.getChild("tipNode"));
  16874. }
  16875. }
  16876. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16877. class ui_fcmNode extends fgui.GComponent {
  16878. static createInstance() {
  16879. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16880. }
  16881. onConstruct() {
  16882. this.n63 = (this.getChild("n63"));
  16883. this.n62 = (this.getChild("n62"));
  16884. this.btnRn = (this.getChild("btnRn"));
  16885. this.n61 = (this.getChild("n61"));
  16886. this.n58 = (this.getChild("n58"));
  16887. this.fcmNode = (this.getChild("fcmNode"));
  16888. }
  16889. }
  16890. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16891. class ui_msgNode extends fgui.GComponent {
  16892. static createInstance() {
  16893. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16894. }
  16895. onConstruct() {
  16896. this.n69 = (this.getChild("n69"));
  16897. this.txtMsg = (this.getChild("txtMsg"));
  16898. this.msgNode = (this.getChild("msgNode"));
  16899. }
  16900. }
  16901. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16902. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16903. static createInstance() {
  16904. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16905. }
  16906. onConstruct() {
  16907. this.n1 = (this.getChild("n1"));
  16908. this.n13 = (this.getChild("n13"));
  16909. this.n14 = (this.getChild("n14"));
  16910. this.n15 = (this.getChild("n15"));
  16911. this.n3 = (this.getChild("n3"));
  16912. this.n4 = (this.getChild("n4"));
  16913. this.n5 = (this.getChild("n5"));
  16914. this.n6 = (this.getChild("n6"));
  16915. this.n7 = (this.getChild("n7"));
  16916. this.n8 = (this.getChild("n8"));
  16917. this.n9 = (this.getChild("n9"));
  16918. this.n10 = (this.getChild("n10"));
  16919. this.n12 = (this.getChild("n12"));
  16920. this.n11 = (this.getChild("n11"));
  16921. this.n16 = (this.getChild("n16"));
  16922. this.n17 = (this.getChild("n17"));
  16923. this.n18 = (this.getChild("n18"));
  16924. this.n20 = (this.getChild("n20"));
  16925. this.n21 = (this.getChild("n21"));
  16926. this.t0 = this.getTransition("t0");
  16927. }
  16928. }
  16929. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16930. class ui_btn5 extends fgui.GButton {
  16931. static createInstance() {
  16932. return (fgui.UIPackage.createObject("loading", "btn5"));
  16933. }
  16934. onConstruct() {
  16935. this.n9 = (this.getChild("n9"));
  16936. this.n1 = (this.getChild("n1"));
  16937. }
  16938. }
  16939. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16940. class ui_UILoading extends fgui.GComponent {
  16941. static createInstance() {
  16942. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16943. }
  16944. onConstruct() {
  16945. this.n12 = (this.getChild("n12"));
  16946. this.loadinfo = (this.getChild("loadinfo"));
  16947. this.n13 = (this.getChild("n13"));
  16948. this.txtLoad = (this.getChild("txtLoad"));
  16949. this.n18 = (this.getChild("n18"));
  16950. }
  16951. }
  16952. ui_UILoading.URL = "ui://37nctnhwphc33";
  16953. class ui_AgeItem extends fgui.GComponent {
  16954. static createInstance() {
  16955. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16956. }
  16957. onConstruct() {
  16958. this.txtAge = (this.getChild("txtAge"));
  16959. }
  16960. }
  16961. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16962. class ui_btn1 extends fgui.GButton {
  16963. static createInstance() {
  16964. return (fgui.UIPackage.createObject("loading", "btn1"));
  16965. }
  16966. onConstruct() {
  16967. this.n6 = (this.getChild("n6"));
  16968. this.n1 = (this.getChild("n1"));
  16969. }
  16970. }
  16971. ui_btn1.URL = "ui://37nctnhwxe622p";
  16972. class ui_btn3 extends fgui.GButton {
  16973. static createInstance() {
  16974. return (fgui.UIPackage.createObject("loading", "btn3"));
  16975. }
  16976. onConstruct() {
  16977. this.n9 = (this.getChild("n9"));
  16978. this.n1 = (this.getChild("n1"));
  16979. }
  16980. }
  16981. ui_btn3.URL = "ui://37nctnhwxe622s";
  16982. class ui_btn2 extends fgui.GButton {
  16983. static createInstance() {
  16984. return (fgui.UIPackage.createObject("loading", "btn2"));
  16985. }
  16986. onConstruct() {
  16987. this.n6 = (this.getChild("n6"));
  16988. this.n1 = (this.getChild("n1"));
  16989. }
  16990. }
  16991. ui_btn2.URL = "ui://37nctnhwxe622t";
  16992. class ui_btnBack extends fgui.GButton {
  16993. static createInstance() {
  16994. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16995. }
  16996. onConstruct() {
  16997. this.n6 = (this.getChild("n6"));
  16998. this.n7 = (this.getChild("n7"));
  16999. }
  17000. }
  17001. ui_btnBack.URL = "ui://37nctnhwxe622u";
  17002. class ui_btnXy1 extends fgui.GButton {
  17003. static createInstance() {
  17004. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  17005. }
  17006. onConstruct() {
  17007. this.n1 = (this.getChild("n1"));
  17008. }
  17009. }
  17010. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  17011. class ui_btnXy2 extends fgui.GButton {
  17012. static createInstance() {
  17013. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  17014. }
  17015. onConstruct() {
  17016. this.n1 = (this.getChild("n1"));
  17017. }
  17018. }
  17019. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17020. class ui_btnXy3 extends fgui.GButton {
  17021. static createInstance() {
  17022. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17023. }
  17024. onConstruct() {
  17025. this.n1 = (this.getChild("n1"));
  17026. }
  17027. }
  17028. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17029. class ui_btn4 extends fgui.GButton {
  17030. static createInstance() {
  17031. return (fgui.UIPackage.createObject("loading", "btn4"));
  17032. }
  17033. onConstruct() {
  17034. this.n9 = (this.getChild("n9"));
  17035. this.n1 = (this.getChild("n1"));
  17036. }
  17037. }
  17038. ui_btn4.URL = "ui://37nctnhwxe622z";
  17039. class loadingBinder {
  17040. static bindAll() {
  17041. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17042. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17043. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17044. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17045. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17046. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17047. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17048. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17049. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17050. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17051. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17052. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17053. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17054. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17055. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17056. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17057. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17058. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17059. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17060. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17061. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17062. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17063. }
  17064. }
  17065. class UIMgr {
  17066. constructor() {
  17067. this._stage = null;
  17068. this._uiList = [];
  17069. this._showList = [];
  17070. this._bindPkgList = [];
  17071. this.uiIndex = 0;
  17072. }
  17073. static get inst() {
  17074. if (UIMgr._inst == null) {
  17075. UIMgr._inst = new UIMgr();
  17076. }
  17077. return UIMgr._inst;
  17078. }
  17079. setStage(s) {
  17080. if (this._stage) {
  17081. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17082. return;
  17083. }
  17084. this._stage = s;
  17085. }
  17086. clearTempData() {
  17087. console.log('zh:clearTempData start');
  17088. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17089. console.log('zh:clearTempData end');
  17090. }
  17091. init() {
  17092. this.setStage(Laya.stage);
  17093. fairygui.UIConfig.defaultFont = "arial";
  17094. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17095. fairygui.UIConfig.packageFileExtension = "obj";
  17096. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17097. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17098. fairygui.GRoot.inst.width = Laya.stage.width;
  17099. fairygui.GRoot.inst.height = Laya.stage.height;
  17100. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17101. }
  17102. addAllUpdate() {
  17103. this.uiIndex = 0;
  17104. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17105. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17106. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17107. }
  17108. }
  17109. }
  17110. bindFUI(pkgname) {
  17111. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17112. return;
  17113. }
  17114. switch (pkgname) {
  17115. case fguiRes.loading:
  17116. fairygui.UIPackage.addPackage(pkgname);
  17117. loadingBinder.bindAll();
  17118. this._bindPkgList.push(pkgname);
  17119. break;
  17120. case fguiRes.game:
  17121. fairygui.UIPackage.addPackage(pkgname);
  17122. gameBinder.bindAll();
  17123. this._bindPkgList.push(pkgname);
  17124. break;
  17125. default:
  17126. break;
  17127. }
  17128. }
  17129. Show(cls, ...param) {
  17130. let nameStr = cls.uiName;
  17131. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17132. let temp = this._uiList[i];
  17133. let str = temp.className;
  17134. if (str == nameStr) {
  17135. if (temp.isMuti) {
  17136. if (temp.isHide) {
  17137. temp.show(...param);
  17138. this._uiList.splice(i, 1);
  17139. this._uiList.push(temp);
  17140. return temp;
  17141. }
  17142. }
  17143. else {
  17144. temp.show(...param);
  17145. this._uiList.splice(i, 1);
  17146. this._uiList.push(temp);
  17147. return temp;
  17148. }
  17149. }
  17150. }
  17151. let ui = new cls();
  17152. ui.className = nameStr;
  17153. this._showUI(ui, param);
  17154. return ui;
  17155. }
  17156. destroyUI(ui) {
  17157. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17158. let temp = this._uiList[i].className;
  17159. if (temp == ui.className) {
  17160. this._uiList.splice(i, 1);
  17161. break;
  17162. }
  17163. }
  17164. this.checkUIState();
  17165. }
  17166. _showUI(ui, param) {
  17167. this._uiList.push(ui);
  17168. ui.show(...param);
  17169. }
  17170. Hide(uiClass) {
  17171. let ui = this.getUI(uiClass);
  17172. if (ui && !ui.isHide) {
  17173. ui.hide();
  17174. }
  17175. }
  17176. getUI(ui) {
  17177. let nameStr = ui.uiName;
  17178. for (let index = 0; index < this._uiList.length; index++) {
  17179. let temp = this._uiList[index];
  17180. if (temp.className == nameStr) {
  17181. return temp;
  17182. }
  17183. }
  17184. return null;
  17185. }
  17186. isShow(cls) {
  17187. for (var i of this._uiList) {
  17188. if (i instanceof cls) {
  17189. return i.isShowing;
  17190. }
  17191. }
  17192. return false;
  17193. }
  17194. showUINum() {
  17195. let num = 0;
  17196. for (var i of this._uiList) {
  17197. if (i.isShowing) {
  17198. num++;
  17199. }
  17200. }
  17201. return num;
  17202. }
  17203. checkUIState() {
  17204. Laya.timer.clear(this, this._uiCheck);
  17205. Laya.timer.once(400, this, this._uiCheck);
  17206. }
  17207. _uiCheck() {
  17208. let showList = [];
  17209. for (var i of this._uiList) {
  17210. if (!i.isHide) {
  17211. showList.push(i);
  17212. }
  17213. }
  17214. for (let index = 0; index < showList.length; index++) {
  17215. if (index == showList.length - 1) {
  17216. showList[index].checkActive(true);
  17217. }
  17218. else {
  17219. showList[index].checkActive(false);
  17220. }
  17221. }
  17222. }
  17223. showTip(msg, time = 600, size = 30) {
  17224. }
  17225. }
  17226. class UIShowList {
  17227. }
  17228. class SoundMgr {
  17229. constructor() {
  17230. this.soundMax = 4;
  17231. this.isLoad = false;
  17232. this.soundMap = {};
  17233. this.isSound = true;
  17234. this.openShake = true;
  17235. SoundMgr._instance = this;
  17236. }
  17237. static getInstance() {
  17238. if (!this._instance) {
  17239. this._instance = new SoundMgr();
  17240. }
  17241. return this._instance;
  17242. }
  17243. init() {
  17244. console.log('zh:sm init 1');
  17245. Laya.SoundManager.autoReleaseSound = true;
  17246. Laya.SoundManager.autoStopMusic = true;
  17247. Laya.SoundManager.musicVolume = 0.3;
  17248. Laya.SoundManager.soundVolume = 0.5;
  17249. this.musicPlayed = false;
  17250. this.audioUrl = "asset/sound/ogg/";
  17251. console.log('zh:sm init 2');
  17252. console.log('zh:dev type ');
  17253. if (Laya.Browser.onAndroid) {
  17254. console.log('zh:dev type android');
  17255. this.audioUrl = "asset/sound/ogg/";
  17256. this.isLoad = true;
  17257. }
  17258. else {
  17259. console.log('zh:dev type not android');
  17260. this.audioUrl = "asset/sound/mp3/";
  17261. this.isLoad = true;
  17262. }
  17263. }
  17264. onSetting(isS) {
  17265. this.isSound = isS;
  17266. this.mute(!this.isSound);
  17267. }
  17268. clearCount() {
  17269. for (var key in this.soundMap) {
  17270. delete this.soundMap[key];
  17271. }
  17272. }
  17273. playMusic(path, loop = 0) {
  17274. console.log('zh:playMusic 1 PATH=' + path);
  17275. this.musicPath = path;
  17276. if (!this.isLoad) {
  17277. return;
  17278. }
  17279. if (!path || path == "") {
  17280. return;
  17281. }
  17282. if (!this.isSound) {
  17283. return;
  17284. }
  17285. this.musicPlayed = true;
  17286. let url = this.getUrl(path);
  17287. if (!Laya.Browser.onAndroid) {
  17288. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17289. this.play(url, loop);
  17290. }));
  17291. }
  17292. else {
  17293. this.play(url, loop);
  17294. }
  17295. }
  17296. play(url, loop) {
  17297. Laya.SoundManager.playMusic(url, loop);
  17298. }
  17299. getUrl(path) {
  17300. let url = this.audioUrl + path;
  17301. if (Laya.Browser.onAndroid) {
  17302. url += ".ogg";
  17303. }
  17304. else {
  17305. url += ".mp3";
  17306. }
  17307. return url;
  17308. }
  17309. pauseMusic(pause) {
  17310. if (pause) {
  17311. this.mute(true);
  17312. }
  17313. else if (this.isSound)
  17314. this.mute(false);
  17315. }
  17316. stopMusic() {
  17317. Laya.SoundManager.stopMusic();
  17318. if (Moyu.isNeedPlatAudio) {
  17319. Moyu.stopMusic();
  17320. }
  17321. }
  17322. mute(mute) {
  17323. if (Moyu.isNeedPlatAudio) {
  17324. Moyu.pauseMusic(mute);
  17325. }
  17326. else {
  17327. Laya.SoundManager.musicMuted = mute;
  17328. if (!mute && !this.musicPlayed && this.musicPath) {
  17329. this.playMusic(this.musicPath);
  17330. }
  17331. }
  17332. }
  17333. stopSound(path) {
  17334. let url = this.getUrl(path);
  17335. Laya.SoundManager.stopSound(url);
  17336. }
  17337. playSound(path, loop = 1, soundMax = this.soundMax) {
  17338. if (!this.isLoad)
  17339. return;
  17340. if (!this.isSound)
  17341. return;
  17342. if (!path || path == "")
  17343. return;
  17344. let url = this.getUrl(path);
  17345. if (Moyu.isNeedPlatAudio) {
  17346. Moyu.playSound(path, loop == 0);
  17347. }
  17348. else {
  17349. let count = 1;
  17350. if (this.soundMap[path])
  17351. count = this.soundMap[path] + 1;
  17352. if (count > soundMax)
  17353. return;
  17354. this.soundMap[path] = count;
  17355. Laya.SoundManager.playSound(url, loop);
  17356. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17357. }
  17358. }
  17359. removePath(path) {
  17360. if (this.soundMap[path]) {
  17361. let count = this.soundMap[path];
  17362. count--;
  17363. if (count < 1)
  17364. delete this.soundMap[path];
  17365. else
  17366. this.soundMap[path] = count;
  17367. }
  17368. }
  17369. playBtnSound() {
  17370. this.playSound("btn");
  17371. }
  17372. playGetSound() {
  17373. }
  17374. playCloseUISound() {
  17375. }
  17376. }
  17377. SoundMgr._instance = null;
  17378. var Handler$1 = Laya.Handler;
  17379. var EResType;
  17380. (function (EResType) {
  17381. EResType[EResType["none"] = 0] = "none";
  17382. EResType[EResType["nromal"] = 1] = "nromal";
  17383. EResType[EResType["td"] = 2] = "td";
  17384. EResType[EResType["sk"] = 3] = "sk";
  17385. })(EResType || (EResType = {}));
  17386. class CResLoader {
  17387. constructor(doneCall, proCall) {
  17388. this.completrCall = doneCall;
  17389. this.progressCall = proCall;
  17390. this.progressHander = new Handler$1(this, this.onProgress);
  17391. this.tdResMap = {};
  17392. }
  17393. load(resList) {
  17394. this.resCount = 0;
  17395. this.loadCount = 0;
  17396. for (let i = 0; i < resList.length; i++) {
  17397. let path = resList[i];
  17398. if (!path)
  17399. continue;
  17400. this.resCount++;
  17401. let type = this.getResType(path);
  17402. if (type == EResType.nromal)
  17403. this.loadNromal(path);
  17404. else if (type == EResType.td)
  17405. this.loadTd(path);
  17406. }
  17407. }
  17408. getRes(path) {
  17409. let type = this.getResType(path);
  17410. if (type == EResType.nromal)
  17411. return Laya.loader.getRes(path);
  17412. else if (type == EResType.td) {
  17413. let res = this.tdResMap[path];
  17414. if (res)
  17415. return res.clone();
  17416. return null;
  17417. }
  17418. }
  17419. destroy() {
  17420. this.progressHander.clear();
  17421. this.progressHander = null;
  17422. }
  17423. clearRes(path) {
  17424. let type = this.getResType(path);
  17425. if (type == EResType.nromal)
  17426. Laya.loader.clearRes(path);
  17427. else if (type == EResType.td) {
  17428. let obj = this.tdResMap[path];
  17429. if (obj)
  17430. obj.destroy();
  17431. delete this.tdResMap[path];
  17432. }
  17433. }
  17434. getResType(path) {
  17435. let exs = this.getExtension(path);
  17436. if (exs == "sk")
  17437. return EResType.sk;
  17438. if (exs == "ls" || exs == "lh" || exs == "lm")
  17439. return EResType.td;
  17440. else
  17441. return EResType.nromal;
  17442. }
  17443. getExtension(res) {
  17444. var index = res.lastIndexOf(".");
  17445. return res.substr(index + 1);
  17446. }
  17447. loadNromal(path) {
  17448. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17449. if (res) {
  17450. this.onLoad();
  17451. }
  17452. else
  17453. console.log("load res fail:" + path);
  17454. }), this.progressHander);
  17455. }
  17456. loadSk() {
  17457. }
  17458. loadTd(path) {
  17459. if (this.tdResMap[path]) {
  17460. this.onLoad();
  17461. return;
  17462. }
  17463. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17464. if (res) {
  17465. this.tdResMap[path] = res;
  17466. this.onLoad();
  17467. }
  17468. else
  17469. console.log("load res fail:" + path);
  17470. }));
  17471. }
  17472. onLoad() {
  17473. this.loadCount++;
  17474. this.onProgress(1);
  17475. if (this.loadCount >= this.resCount) {
  17476. this.completrCall.run();
  17477. }
  17478. }
  17479. onProgress(pro) {
  17480. let progress = (this.loadCount + pro) / this.resCount;
  17481. this.progressCall.runWith(progress);
  17482. }
  17483. }
  17484. var Handler$2 = Laya.Handler;
  17485. class ResInfo {
  17486. constructor() {
  17487. this.index = 0;
  17488. }
  17489. }
  17490. class ResMgr {
  17491. constructor() {
  17492. this.resList = [];
  17493. this.doneList = [];
  17494. this.resMap = {};
  17495. this.currentLoad = null;
  17496. this.completeHandler = new Handler$2(this, this.onComplete);
  17497. this.progressHandler = new Handler$2(this, this.onProgress);
  17498. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17499. }
  17500. static getInstance() {
  17501. if (ResMgr._instance == null) {
  17502. ResMgr._instance = new ResMgr();
  17503. }
  17504. return ResMgr._instance;
  17505. }
  17506. loadList(list, completeHandler, progressHandler) {
  17507. if (list.length < 1) {
  17508. completeHandler.run();
  17509. return;
  17510. }
  17511. let info = this.getResInfo();
  17512. info.resList = list;
  17513. info.completeHandler = completeHandler;
  17514. info.progressHandler = progressHandler;
  17515. this.resList.push(info);
  17516. this.startLoad();
  17517. }
  17518. loadFguiRes(list, completeHandler, progressHandler) {
  17519. Laya.loader.load(list, completeHandler, progressHandler);
  17520. }
  17521. loadAny(list, completeHandler, progressHandler) {
  17522. Laya.loader.load(list, completeHandler, progressHandler);
  17523. }
  17524. load(path, completeHandler, progressHandler) {
  17525. let count = this.resMap[path];
  17526. if (count && count > 0) {
  17527. if (completeHandler)
  17528. completeHandler.run();
  17529. }
  17530. else
  17531. this.loadList([path], completeHandler, progressHandler);
  17532. }
  17533. getRes(path) {
  17534. let res = this.resMap[path];
  17535. if (!res)
  17536. this.showLog("资源不存在:" + path);
  17537. else
  17538. return this.loader.getRes(path);
  17539. }
  17540. clearList(list, force = false) {
  17541. if (!list || list.length < 1)
  17542. return;
  17543. let cr = () => {
  17544. for (const k in list) {
  17545. let v = list[k];
  17546. if (!v)
  17547. continue;
  17548. if (force) {
  17549. this.loader.clearRes(v);
  17550. delete this.resMap[v];
  17551. }
  17552. else {
  17553. let count = this.resMap[v];
  17554. if (count && count > 1) {
  17555. count--;
  17556. this.resMap[v] = count;
  17557. }
  17558. else {
  17559. this.loader.clearRes(v);
  17560. delete this.resMap[v];
  17561. }
  17562. }
  17563. }
  17564. if (!window.hasOwnProperty("ks"))
  17565. Laya.Resource.destroyUnusedResources();
  17566. };
  17567. Laya.timer.clearAll(this);
  17568. Laya.timer.once(2000, this, cr);
  17569. }
  17570. clear3D() {
  17571. for (const k in this.loader.tdResMap) {
  17572. this.loader.clearRes(k);
  17573. if (this.resMap[k])
  17574. delete this.resMap[k];
  17575. }
  17576. if (!window.hasOwnProperty("ks"))
  17577. Laya.Resource.destroyUnusedResources();
  17578. }
  17579. clear(path, force = false) {
  17580. this.clearList([path], force);
  17581. }
  17582. getResInfo() {
  17583. if (this.doneList.length > 0)
  17584. return this.doneList.pop();
  17585. else
  17586. return new ResInfo();
  17587. }
  17588. startLoad() {
  17589. if (this.currentLoad)
  17590. return;
  17591. this.currentLoad = this.resList.pop();
  17592. if (this.currentLoad) {
  17593. this.loader.load(this.currentLoad.resList);
  17594. }
  17595. }
  17596. onComplete() {
  17597. if (!this.currentLoad)
  17598. return;
  17599. for (const k in this.currentLoad.resList) {
  17600. let v = this.currentLoad.resList[k];
  17601. let count = this.resMap[v];
  17602. if (count)
  17603. count++;
  17604. else
  17605. count = 1;
  17606. this.resMap[v] = count;
  17607. }
  17608. if (this.currentLoad.completeHandler)
  17609. this.currentLoad.completeHandler.run();
  17610. this.doneList.push(this.currentLoad);
  17611. this.currentLoad = null;
  17612. this.startLoad();
  17613. }
  17614. onProgress(pro) {
  17615. if (!this.currentLoad)
  17616. return;
  17617. if (this.currentLoad.progressHandler)
  17618. this.currentLoad.progressHandler.runWith(pro);
  17619. }
  17620. showLog(str, ...args) {
  17621. console.log("[ResLoader] " + str);
  17622. }
  17623. }
  17624. ResMgr._instance = null;
  17625. class EventMgr extends Laya.EventDispatcher {
  17626. }
  17627. let eventMgr = new EventMgr();
  17628. /*! *****************************************************************************
  17629. Copyright (c) Microsoft Corporation. All rights reserved.
  17630. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17631. this file except in compliance with the License. You may obtain a copy of the
  17632. License at http://www.apache.org/licenses/LICENSE-2.0
  17633. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17634. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17635. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17636. MERCHANTABLITY OR NON-INFRINGEMENT.
  17637. See the Apache Version 2.0 License for specific language governing permissions
  17638. and limitations under the License.
  17639. ***************************************************************************** */
  17640. /* global Reflect, Promise */
  17641. var extendStatics = function(d, b) {
  17642. extendStatics = Object.setPrototypeOf ||
  17643. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17644. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17645. return extendStatics(d, b);
  17646. };
  17647. function __extends(d, b) {
  17648. extendStatics(d, b);
  17649. function __() { this.constructor = d; }
  17650. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17651. }
  17652. var __assign = function() {
  17653. __assign = Object.assign || function __assign(t) {
  17654. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17655. s = arguments[i];
  17656. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17657. }
  17658. return t;
  17659. };
  17660. return __assign.apply(this, arguments);
  17661. };
  17662. function __rest(s, e) {
  17663. var t = {};
  17664. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17665. t[p] = s[p];
  17666. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17667. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17668. t[p[i]] = s[p[i]];
  17669. return t;
  17670. }
  17671. function __decorate(decorators, target, key, desc) {
  17672. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17673. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17674. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  17675. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17676. }
  17677. function __param(paramIndex, decorator) {
  17678. return function (target, key) { decorator(target, key, paramIndex); }
  17679. }
  17680. function __metadata(metadataKey, metadataValue) {
  17681. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17682. }
  17683. function __awaiter(thisArg, _arguments, P, generator) {
  17684. return new (P || (P = Promise))(function (resolve, reject) {
  17685. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17686. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17687. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17688. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17689. });
  17690. }
  17691. function __generator(thisArg, body) {
  17692. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17693. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17694. function verb(n) { return function (v) { return step([n, v]); }; }
  17695. function step(op) {
  17696. if (f) throw new TypeError("Generator is already executing.");
  17697. while (_) try {
  17698. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  17699. if (y = 0, t) op = [op[0] & 2, t.value];
  17700. switch (op[0]) {
  17701. case 0: case 1: t = op; break;
  17702. case 4: _.label++; return { value: op[1], done: false };
  17703. case 5: _.label++; y = op[1]; op = [0]; continue;
  17704. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17705. default:
  17706. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17707. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17708. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17709. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17710. if (t[2]) _.ops.pop();
  17711. _.trys.pop(); continue;
  17712. }
  17713. op = body.call(thisArg, _);
  17714. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17715. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17716. }
  17717. }
  17718. function __exportStar(m, exports) {
  17719. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17720. }
  17721. function __values(o) {
  17722. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17723. if (m) return m.call(o);
  17724. return {
  17725. next: function () {
  17726. if (o && i >= o.length) o = void 0;
  17727. return { value: o && o[i++], done: !o };
  17728. }
  17729. };
  17730. }
  17731. function __read(o, n) {
  17732. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17733. if (!m) return o;
  17734. var i = m.call(o), r, ar = [], e;
  17735. try {
  17736. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17737. }
  17738. catch (error) { e = { error: error }; }
  17739. finally {
  17740. try {
  17741. if (r && !r.done && (m = i["return"])) m.call(i);
  17742. }
  17743. finally { if (e) throw e.error; }
  17744. }
  17745. return ar;
  17746. }
  17747. function __spread() {
  17748. for (var ar = [], i = 0; i < arguments.length; i++)
  17749. ar = ar.concat(__read(arguments[i]));
  17750. return ar;
  17751. }
  17752. function __await(v) {
  17753. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17754. }
  17755. function __asyncGenerator(thisArg, _arguments, generator) {
  17756. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17757. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17758. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17759. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  17760. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17761. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17762. function fulfill(value) { resume("next", value); }
  17763. function reject(value) { resume("throw", value); }
  17764. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17765. }
  17766. function __asyncDelegator(o) {
  17767. var i, p;
  17768. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17769. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  17770. }
  17771. function __asyncValues(o) {
  17772. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17773. var m = o[Symbol.asyncIterator], i;
  17774. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  17775. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  17776. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17777. }
  17778. function __makeTemplateObject(cooked, raw) {
  17779. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17780. return cooked;
  17781. };
  17782. function __importStar(mod) {
  17783. if (mod && mod.__esModule) return mod;
  17784. var result = {};
  17785. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17786. result.default = mod;
  17787. return result;
  17788. }
  17789. function __importDefault(mod) {
  17790. return (mod && mod.__esModule) ? mod : { default: mod };
  17791. }
  17792. class CustomAlert {
  17793. static show(title, content, buttons) {
  17794. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17795. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17796. return;
  17797. }
  17798. const bg = new Laya.Box();
  17799. bg.alpha = 0;
  17800. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17801. Laya.stage.addChild(bg);
  17802. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17803. const panel = new Laya.Box();
  17804. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17805. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17806. bg.addChild(panel);
  17807. const titleText = new Laya.Text();
  17808. titleText.text = title;
  17809. titleText.fontSize = 32;
  17810. titleText.color = "#333333";
  17811. titleText.bold = true;
  17812. titleText.pos(20, 20);
  17813. titleText.width = 360;
  17814. titleText.align = "center";
  17815. panel.addChild(titleText);
  17816. const contentText = new Laya.Text();
  17817. contentText.text = content;
  17818. contentText.fontSize = 21;
  17819. contentText.color = "#555555";
  17820. contentText.pos(20, 70);
  17821. contentText.width = 360;
  17822. contentText.wordWrap = true;
  17823. contentText.align = "center";
  17824. panel.addChild(contentText);
  17825. const buttonContainer = new Laya.Box();
  17826. buttonContainer.pos(20, 160);
  17827. panel.addChild(buttonContainer);
  17828. const btnWidth = 120;
  17829. const spacing = 30;
  17830. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17831. buttons.forEach((btn, index) => {
  17832. const button = new Laya.Button();
  17833. button.label = btn.label;
  17834. button.size(btnWidth, 40);
  17835. button.labelSize = 22;
  17836. button.pos(index * (btnWidth + spacing), 0);
  17837. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17838. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17839. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17840. button.alpha = 0.9;
  17841. });
  17842. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17843. button.alpha = 1;
  17844. });
  17845. button.on(Laya.Event.CLICK, this, () => {
  17846. btn.handler();
  17847. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17848. bg.removeSelf();
  17849. }));
  17850. });
  17851. buttonContainer.addChild(button);
  17852. });
  17853. buttonContainer.x = (panel.width - totalWidth) / 2;
  17854. }
  17855. }
  17856. class ConfigMgr {
  17857. constructor() {
  17858. this.httpReqCount = 4;
  17859. this.httpReqOkCount = 0;
  17860. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17861. try {
  17862. this.httpReqOkCount = 0;
  17863. let reqData = xGame.httpMgr.getReqData();
  17864. console.log('zh:第1个请求getClassicCfg');
  17865. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17866. this.classicCfg = classicCfg;
  17867. this.httpReqOkCount++;
  17868. console.log('zh:第2个请求getLevelCfg');
  17869. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17870. this.levelCfg = levelCfg;
  17871. this.httpReqOkCount++;
  17872. console.log('zh:第3个请求 getPlaceBallCfg');
  17873. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17874. this.placeBallCfg = placeBallCfg;
  17875. this.httpReqOkCount++;
  17876. console.log('zh:第4个请求 npc');
  17877. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17878. this.npcJson = npc.Data;
  17879. this.httpReqOkCount++;
  17880. console.log('zh:所有配置加载完成');
  17881. }
  17882. catch (error) {
  17883. console.error('zh:❌请求失败:', error);
  17884. Laya.timer.once(5000, this, () => {
  17885. let retryCount = 0;
  17886. const maxRetries = 3;
  17887. const tryFetchConfig = () => {
  17888. try {
  17889. xGame.cfgMgr.getConfigFromServer();
  17890. }
  17891. catch (error) {
  17892. if (retryCount < maxRetries) {
  17893. retryCount++;
  17894. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  17895. Laya.timer.once(5000, this, tryFetchConfig);
  17896. }
  17897. else {
  17898. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  17899. }
  17900. }
  17901. };
  17902. tryFetchConfig();
  17903. });
  17904. }
  17905. finally {
  17906. if (this.httpReqCount > this.httpReqOkCount) {
  17907. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  17908. label: "Okay", handler: () => {
  17909. JSBridgeUtils.instance.exitAndCloseGame();
  17910. }
  17911. }]);
  17912. }
  17913. }
  17914. });
  17915. this.sendPostAsync = (action, reqData) => {
  17916. return new Promise((resolve, reject) => {
  17917. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17918. try {
  17919. let code = res.code;
  17920. if (code == 200) {
  17921. const parsedData = JSON.parse(res.msg);
  17922. resolve(parsedData);
  17923. }
  17924. else {
  17925. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17926. reject(new Error(`Request failed with code: ${code}`));
  17927. }
  17928. }
  17929. catch (error) {
  17930. console.error(`ERROR=${error}`);
  17931. alert("Please check your network connection.");
  17932. reject(error);
  17933. }
  17934. finally {
  17935. console.log(`zh:${action}的请求处理完毕`);
  17936. }
  17937. });
  17938. });
  17939. };
  17940. }
  17941. static getInstance() {
  17942. if (!this._instance) {
  17943. this._instance = new ConfigMgr();
  17944. }
  17945. return this._instance;
  17946. }
  17947. init() {
  17948. this.getConfigFromServer();
  17949. }
  17950. test() {
  17951. let reqData = xGame.httpMgr.getReqData();
  17952. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17953. console.log('zh:1s');
  17954. try {
  17955. let code = res.code;
  17956. let data = res.data;
  17957. if (code == 200) {
  17958. const parsedData = JSON.parse(data);
  17959. this.classicCfg = parsedData;
  17960. }
  17961. else {
  17962. console.log('zh:res = ' + JSON.stringify(res));
  17963. }
  17964. }
  17965. catch (error) {
  17966. console.log('error=' + error);
  17967. alert("Please check your network connection.");
  17968. }
  17969. finally {
  17970. console.log('zh:1');
  17971. }
  17972. });
  17973. }
  17974. getUserInfoByIndex(index) {
  17975. return this.npcJson[index];
  17976. }
  17977. getRandomUserInfo() {
  17978. let index = xGame.tools.random(0, this.npcJson.length);
  17979. let rs = this.npcJson[index];
  17980. return rs;
  17981. }
  17982. getMaxBigMoveLength() {
  17983. return Object.keys(this.levelCfg).length;
  17984. }
  17985. getBigMoveLevelByIndex(index) {
  17986. let cfg = this.levelCfg;
  17987. cfg = cfg[index];
  17988. return cfg;
  17989. }
  17990. getRandomClassicLevel() {
  17991. let cfg = this.classicCfg;
  17992. let num = Object.keys(cfg).length;
  17993. let rand = xGame.common.randomNum(1, num);
  17994. return cfg[rand];
  17995. }
  17996. getPlaceBallByLevel(level) {
  17997. return this.placeBallCfg[level];
  17998. }
  17999. getMaxPlaceBall() {
  18000. return Object.keys(this.placeBallCfg).length;
  18001. }
  18002. }
  18003. class PoolD3Mgr {
  18004. constructor() {
  18005. this.pool = {};
  18006. }
  18007. static get ins() {
  18008. return this._ins || (this._ins = new PoolD3Mgr);
  18009. }
  18010. createList(key, prefab, parent) {
  18011. if (!this.pool[key]) {
  18012. this.pool[key] = {};
  18013. this.pool[key].prefab = prefab;
  18014. this.pool[key].list = [];
  18015. this.pool[key].parent = parent;
  18016. }
  18017. }
  18018. getItem(key) {
  18019. if (!this.pool[key]) {
  18020. return;
  18021. }
  18022. let temp;
  18023. if (this.pool[key].list.length > 0) {
  18024. temp = this.pool[key].list.pop();
  18025. }
  18026. else {
  18027. temp = this.pool[key].prefab.clone();
  18028. if (this.pool[key].parent) {
  18029. this.pool[key].parent.addChild(temp);
  18030. }
  18031. }
  18032. temp.active = true;
  18033. return temp;
  18034. }
  18035. putItem(key, obj) {
  18036. if (!this.pool[key]) {
  18037. return;
  18038. }
  18039. obj.active = false;
  18040. this.pool[key].list.push(obj);
  18041. }
  18042. }
  18043. let context$1 = context;
  18044. let uiMgr = UIMgr.inst;
  18045. let soundMgr = SoundMgr.getInstance();
  18046. let resMgr = ResMgr.getInstance();
  18047. let httpMgr = HttpMgr.getInstance();
  18048. let common = Common.getInstance();
  18049. let cfgMgr = ConfigMgr.getInstance();
  18050. let poolD3Mgr = PoolD3Mgr.ins;
  18051. let d3TexUrl = "res/d3Res/";
  18052. let d3ModeUrl = "res/unityRes/";
  18053. function setStageSize(view) {
  18054. if (view.width) {
  18055. view.width = Laya.stage.width;
  18056. view.height = Laya.stage.height;
  18057. }
  18058. }
  18059. function filledBg(view) {
  18060. let wh = Laya.stage.height / Laya.stage.width;
  18061. if (wh > 16 / 9) {
  18062. view.height = Laya.stage.height;
  18063. view.width = Laya.stage.height / 1334 * 750;
  18064. }
  18065. else {
  18066. view.width = Laya.stage.width;
  18067. view.height = Laya.stage.width / 750 * 1334;
  18068. }
  18069. }
  18070. function setNotch(view) {
  18071. if (view.height) {
  18072. view.y += context$1.notchHeight;
  18073. }
  18074. }
  18075. function showTip(str) {
  18076. uiMgr.Show(UIMsg, str);
  18077. }
  18078. function log(...args) {
  18079. console.log(args);
  18080. }
  18081. let xGame = {
  18082. context: context$1,
  18083. eventMgr,
  18084. resMgr,
  18085. uiMgr,
  18086. soundMgr,
  18087. define,
  18088. tools,
  18089. httpMgr,
  18090. d3TexUrl,
  18091. d3ModeUrl,
  18092. common,
  18093. cfgMgr,
  18094. poolD3Mgr,
  18095. setStageSize,
  18096. filledBg,
  18097. setNotch,
  18098. showTip,
  18099. log,
  18100. };
  18101. window["xGame"] = xGame;
  18102. let dataName = 'tBall_';
  18103. class UserData {
  18104. constructor() {
  18105. this.userId = "";
  18106. this.isAgree = false;
  18107. this.coinNum = 0;
  18108. this.gemNum = 0;
  18109. this.sound = true;
  18110. this.vibration = true;
  18111. this.currentDate = 0;
  18112. this.createTime = 0;
  18113. this.awardTime = 0;
  18114. this.roleId = 1;
  18115. this.roleList = [];
  18116. this.roleAds = [];
  18117. this.dressId = 101;
  18118. this.itemId = 201;
  18119. this.bigSkills = [1, 1, 1, 1, 1];
  18120. this.coin = 4000;
  18121. this.diamond = 0;
  18122. this.skillSuccessTimes = 0;
  18123. this.skillGuide = 0;
  18124. this.skillAccTimes = 0;
  18125. this.placeBallData = [];
  18126. this.shareDiamondTimes = 0;
  18127. this.dailyVideoShareTimes = 0;
  18128. this.secretary = [1, 0];
  18129. this.curSecretary = 0;
  18130. this.ballRod = [1, 0, 0, 0, 0, 1];
  18131. this.curBallRod = 5;
  18132. this.signData = 0;
  18133. this.signTime = 0;
  18134. this.drawTimes = 0;
  18135. this.drawAwardTimes = 0;
  18136. this.dailyfreeDrawTimes = 1;
  18137. this.power = 5;
  18138. this.powerTime = 0;
  18139. this.challengeTimes = 0;
  18140. this.extraSign = 0;
  18141. this.classicTimes = 0;
  18142. this.guideHelpLine = 0;
  18143. this.newUser = true;
  18144. this.rootBallFoul = 0;
  18145. this.timeoutFoul = 0;
  18146. this.roleList = [1];
  18147. }
  18148. saveData() {
  18149. let data = {};
  18150. for (let k in this) {
  18151. data[k.toString()] = this[k];
  18152. }
  18153. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18154. }
  18155. getData() {
  18156. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18157. if (ld) {
  18158. let localData = JSON.parse(ld);
  18159. if (localData) {
  18160. for (let k in this) {
  18161. let key = k.toString();
  18162. let data = localData[key];
  18163. if (data != undefined) {
  18164. this[k] = data;
  18165. }
  18166. }
  18167. }
  18168. }
  18169. }
  18170. }
  18171. class ItemData {
  18172. constructor() {
  18173. this.itemList = {};
  18174. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18175. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18176. }
  18177. saveData() {
  18178. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18179. }
  18180. getData() {
  18181. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18182. if (ld) {
  18183. let localData = JSON.parse(ld);
  18184. if (localData) {
  18185. this.itemList = localData;
  18186. }
  18187. }
  18188. }
  18189. }
  18190. class GameData {
  18191. constructor() {
  18192. this.curLevel = 0;
  18193. this.gameType = 1;
  18194. this.signIdx = 0;
  18195. this.signMax = 0;
  18196. this.rotaryTime = 0;
  18197. this.rotaryCount = 0;
  18198. this.rotaryList = [];
  18199. this.diyCount = 3;
  18200. this.awardIdx = 0;
  18201. this.shareNum = 2;
  18202. this.rankWeek = 0;
  18203. this.rankScore = 0;
  18204. this.gameCount = 0;
  18205. this.trySkill = -1;
  18206. this.tryTime = 0;
  18207. }
  18208. saveData() {
  18209. let data = {};
  18210. for (let k in this) {
  18211. data[k.toString()] = this[k];
  18212. }
  18213. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18214. }
  18215. getData() {
  18216. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18217. if (ld) {
  18218. let localData = JSON.parse(ld);
  18219. if (localData) {
  18220. for (let k in this) {
  18221. let key = k.toString();
  18222. let data = localData[key];
  18223. if (data != undefined) {
  18224. this[k] = data;
  18225. }
  18226. }
  18227. }
  18228. }
  18229. }
  18230. }
  18231. class Diy2025GameData {
  18232. constructor() {
  18233. this.challengeMode_overLev = 0;
  18234. this.xszyForClassic = false;
  18235. this.xszyForChallenge = false;
  18236. }
  18237. saveData() {
  18238. let data = {};
  18239. for (let k in this) {
  18240. data[k.toString()] = this[k];
  18241. }
  18242. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18243. }
  18244. getData() {
  18245. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18246. if (ld) {
  18247. let localData = JSON.parse(ld);
  18248. if (localData) {
  18249. for (let k in this) {
  18250. let key = k.toString();
  18251. let data = localData[key];
  18252. if (data != undefined) {
  18253. this[k] = data;
  18254. }
  18255. }
  18256. }
  18257. }
  18258. }
  18259. }
  18260. class DataMgr {
  18261. static Init() {
  18262. this.userData = new UserData();
  18263. this.gameData = new GameData();
  18264. this.itemData = new ItemData();
  18265. this.diyGameData = new Diy2025GameData();
  18266. this.userData.getData();
  18267. this.gameData.getData();
  18268. this.itemData.getData();
  18269. this.diyGameData.getData();
  18270. this.roleId = this.userData.roleId;
  18271. this.resetUse();
  18272. }
  18273. static isNewDay() {
  18274. Moyu.isNewDay(this, (isnew) => {
  18275. xGame.common.isNewDay = isnew;
  18276. if (!isnew)
  18277. return;
  18278. DataMgr.setShareDiamondTimes(0, false);
  18279. DataMgr.setDailyVideoShareTimes(0, false);
  18280. DataMgr.setDailyfreeDrawTimes(1);
  18281. DataMgr.setExtraSign(0);
  18282. });
  18283. }
  18284. static deletData() {
  18285. Laya.LocalStorage.clear();
  18286. }
  18287. static upRankData() {
  18288. let num = xGame.common.getAllStarNum();
  18289. if (num > 0)
  18290. Moyu.upRankData(xGame.common.curRankID, num);
  18291. }
  18292. static addItem(id, count = 1) {
  18293. let v = this.itemData.itemList[id];
  18294. if (!v)
  18295. v = { id: id, count: count, adnum: 0, active: true };
  18296. else {
  18297. if (v.active) {
  18298. v.count += count;
  18299. }
  18300. else {
  18301. v.count = count;
  18302. v.active = true;
  18303. }
  18304. }
  18305. this.itemData.itemList[id] = v;
  18306. xGame.soundMgr.playGetSound();
  18307. this.saveItemData();
  18308. }
  18309. static hasItem(id) {
  18310. let v = this.itemData.itemList[id];
  18311. if (v && v.active)
  18312. return true;
  18313. return false;
  18314. }
  18315. static getItem(id) {
  18316. let v = this.itemData.itemList[id];
  18317. return v;
  18318. }
  18319. static getItemCount(id) {
  18320. let v = this.itemData.itemList[id];
  18321. if (v && v.active)
  18322. return v.count;
  18323. return 0;
  18324. }
  18325. static getItemAd(id) {
  18326. let v = this.itemData.itemList[id];
  18327. if (v) {
  18328. return v.adnum;
  18329. }
  18330. return 0;
  18331. }
  18332. static onItemAd(id, num = 1) {
  18333. let v = this.itemData.itemList[id];
  18334. if (!v)
  18335. v = { id: id, count: 1, adnum: num, active: false };
  18336. else
  18337. v.adnum += num;
  18338. this.itemData.itemList[id] = v;
  18339. this.saveItemData();
  18340. }
  18341. static costItem(id, count) {
  18342. let v = this.itemData.itemList[id];
  18343. if (v && v.active) {
  18344. if (v.count < count)
  18345. return false;
  18346. else {
  18347. v.count -= count;
  18348. this.itemData.itemList[id] = v;
  18349. return true;
  18350. }
  18351. }
  18352. return false;
  18353. }
  18354. static resetUse() {
  18355. this.dressId = this.userData.dressId;
  18356. this.itemId = this.userData.itemId;
  18357. }
  18358. static passLevel() {
  18359. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18360. this.gameData.curLevel++;
  18361. this.curLevel = this.gameData.curLevel;
  18362. this.saveGameData();
  18363. }
  18364. static useRole(id) {
  18365. this.roleId = id;
  18366. if (this.hasRole(id)) {
  18367. this.userData.roleId = id;
  18368. this.saveUserData();
  18369. }
  18370. }
  18371. static addRole(id) {
  18372. if (this.hasRole(id))
  18373. return;
  18374. this.userData.roleList.push(id);
  18375. this.saveUserData();
  18376. }
  18377. static hasRole(id) {
  18378. return this.userData.roleList.indexOf(id) >= 0;
  18379. }
  18380. static gemEnough(num) {
  18381. return this.userData.gemNum >= num;
  18382. }
  18383. static roleHasAd(id) {
  18384. let count = this.userData.roleAds[id];
  18385. if (count != undefined && count >= 0)
  18386. return true;
  18387. else
  18388. return false;
  18389. }
  18390. static saveUserData(time = 500, event, arg) {
  18391. if (this.userSaving)
  18392. return;
  18393. this.userSaving = true;
  18394. Laya.timer.once(time, this, () => {
  18395. this.userSaving = false;
  18396. this.userData.saveData();
  18397. if (event)
  18398. xGame.eventMgr.event(event, arg);
  18399. });
  18400. }
  18401. static updateUserNickName(loginUserName) {
  18402. let kyeStr = 'moyudata_180';
  18403. console.log('zh:################### kyeStr=' + kyeStr);
  18404. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18405. if (moyudata) {
  18406. const obj = JSON.parse(moyudata);
  18407. obj.nickName = loginUserName;
  18408. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18409. console.log('zh:################### updateUserNickName');
  18410. }
  18411. }
  18412. static saveGameData() {
  18413. if (this.gameSaving)
  18414. return;
  18415. this.gameSaving = true;
  18416. Laya.timer.once(1000, this, () => {
  18417. this.gameSaving = false;
  18418. this.gameData.saveData();
  18419. });
  18420. }
  18421. static saveItemData() {
  18422. let fun = () => {
  18423. this.itemData.saveData();
  18424. };
  18425. Laya.timer.clear(this, fun);
  18426. Laya.timer.once(500, this, fun);
  18427. }
  18428. static saveData() {
  18429. this.saveUserData();
  18430. this.saveGameData();
  18431. }
  18432. static getBigSkillList() {
  18433. return this.userData.bigSkills;
  18434. }
  18435. static getBigSkillByIndex(index) {
  18436. return this.userData.bigSkills[index];
  18437. }
  18438. static setBigSkill(index, val, addUp = true) {
  18439. if (addUp) {
  18440. this.userData.bigSkills[index] += val;
  18441. }
  18442. else {
  18443. this.userData.bigSkills[index] = val;
  18444. }
  18445. this.saveUserData();
  18446. }
  18447. static coinEnough(need) {
  18448. if (typeof need != "number") {
  18449. console.error("金币格式错误");
  18450. return;
  18451. }
  18452. return this.userData.coin >= need;
  18453. }
  18454. static setCoin(val) {
  18455. if (typeof val != "number") {
  18456. return;
  18457. }
  18458. this.userData.coin += val;
  18459. this.saveUserData();
  18460. xGame.eventMgr.event(COIN_CHANGE);
  18461. this.updateUserInfo2Server("jb");
  18462. }
  18463. static setCoin2(val) {
  18464. if (typeof val != "number") {
  18465. return;
  18466. }
  18467. this.userData.coin = val;
  18468. this.saveUserData();
  18469. xGame.eventMgr.event(COIN_CHANGE);
  18470. }
  18471. static setCoinFormServer(val) {
  18472. if (typeof val != "number") {
  18473. return;
  18474. }
  18475. this.userData.coin = val;
  18476. this.saveUserData();
  18477. console.log('zh:通知更新金币变化' + val);
  18478. xGame.eventMgr.event(COIN_CHANGE);
  18479. }
  18480. static getCoin() {
  18481. return this.userData.coin;
  18482. }
  18483. static diamondEnough(need) {
  18484. if (typeof need != "number") {
  18485. console.error("金币格式错误");
  18486. return;
  18487. }
  18488. return this.userData.diamond >= need;
  18489. }
  18490. static setDiamond(val) {
  18491. if (typeof val != "number") {
  18492. return;
  18493. }
  18494. this.userData.diamond += val;
  18495. this.saveUserData();
  18496. xGame.eventMgr.event(DIAMOND_CHANGE);
  18497. this.updateUserInfo2Server("zs");
  18498. }
  18499. static setDiamond2(val) {
  18500. if (typeof val != "number") {
  18501. return;
  18502. }
  18503. this.userData.diamond = val;
  18504. this.saveUserData();
  18505. xGame.eventMgr.event(DIAMOND_CHANGE);
  18506. }
  18507. static setDiamondFormServer(val) {
  18508. if (typeof val != "number") {
  18509. return;
  18510. }
  18511. this.userData.diamond = val;
  18512. this.saveUserData();
  18513. console.log('zh:通知更新钻石变化' + val);
  18514. xGame.eventMgr.event(DIAMOND_CHANGE);
  18515. }
  18516. static getDiamond() {
  18517. return this.userData.diamond;
  18518. }
  18519. static getSkillSuccessTimes() {
  18520. return this.userData.skillSuccessTimes;
  18521. }
  18522. static setSkillSuccessTimes(val, addUp = true) {
  18523. if (addUp)
  18524. this.userData.skillSuccessTimes += val;
  18525. else
  18526. this.userData.skillSuccessTimes = val;
  18527. this.saveUserData();
  18528. }
  18529. static getSkillAccTimes() {
  18530. return this.userData.skillAccTimes;
  18531. }
  18532. static setSkillAccTimes(val) {
  18533. this.userData.skillAccTimes += val;
  18534. this.saveUserData();
  18535. }
  18536. static getSkillGuide() {
  18537. if (!xGame.common.openGuide) {
  18538. return 1;
  18539. }
  18540. return this.userData.skillGuide;
  18541. }
  18542. static setSkillGuide(val) {
  18543. this.userData.skillGuide = val;
  18544. this.saveUserData();
  18545. }
  18546. static getPlaceBallLevelList() {
  18547. return this.userData.placeBallData;
  18548. }
  18549. static setPlaceBallLevelList(objStr) {
  18550. if (objStr) {
  18551. let obj = JSON.parse(objStr);
  18552. this.userData.placeBallData = obj;
  18553. let cd = obj.length;
  18554. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18555. xGame.common.placeBallCurLevel = cd;
  18556. DataMgr.setChallengeMode_overLev(cd);
  18557. this.saveUserData();
  18558. }
  18559. else {
  18560. this.userData.placeBallData = [];
  18561. this.saveUserData();
  18562. }
  18563. }
  18564. static getPlaceBallLevel(level) {
  18565. let arr = this.userData.placeBallData;
  18566. let index = level - 1;
  18567. let out;
  18568. if (arr[index]) {
  18569. out = arr[index];
  18570. }
  18571. else {
  18572. let max = arr.length;
  18573. if (max == index) {
  18574. out = {
  18575. star: 0,
  18576. play: true,
  18577. isCur: true,
  18578. getAward: false
  18579. };
  18580. }
  18581. else {
  18582. out = {
  18583. star: 0,
  18584. play: false,
  18585. getAward: false
  18586. };
  18587. }
  18588. }
  18589. return out;
  18590. }
  18591. static setPlaceBallLevel(level, star) {
  18592. let arr = this.userData.placeBallData;
  18593. let index = level - 1;
  18594. if (arr[index]) {
  18595. arr[index].star = Math.max(arr[index].star, star);
  18596. }
  18597. else {
  18598. let max = arr.length;
  18599. if (max == index) {
  18600. arr.push({
  18601. star: star,
  18602. play: true,
  18603. getAward: false
  18604. });
  18605. }
  18606. else {
  18607. console.error("关卡存储出错");
  18608. }
  18609. }
  18610. this.saveUserData();
  18611. }
  18612. static setPlaceBallAward(level) {
  18613. let arr = this.userData.placeBallData;
  18614. let index = level - 1;
  18615. if (arr[index]) {
  18616. arr[index].getAward = true;
  18617. }
  18618. this.saveUserData();
  18619. }
  18620. static getShareDiamondTimes() {
  18621. return this.userData.shareDiamondTimes;
  18622. }
  18623. static setShareDiamondTimes(val, addUp = true) {
  18624. if (addUp) {
  18625. this.userData.shareDiamondTimes += val;
  18626. }
  18627. else {
  18628. this.userData.shareDiamondTimes = val;
  18629. }
  18630. this.saveUserData();
  18631. }
  18632. static getDailyVideoShareTimes() {
  18633. return this.userData.dailyVideoShareTimes;
  18634. }
  18635. static setDailyVideoShareTimes(val, addUp = true) {
  18636. if (addUp) {
  18637. this.userData.dailyVideoShareTimes += val;
  18638. }
  18639. else {
  18640. this.userData.dailyVideoShareTimes = val;
  18641. }
  18642. this.saveUserData();
  18643. }
  18644. static getSecretary(index) {
  18645. return this.userData.secretary[index];
  18646. }
  18647. static setSecretary(index, val) {
  18648. this.userData.secretary[index] = val;
  18649. this.saveUserData();
  18650. }
  18651. static getCurSecretary() {
  18652. return this.userData.curSecretary;
  18653. }
  18654. static setCurSecretary(index) {
  18655. this.userData.curSecretary = index;
  18656. this.saveUserData();
  18657. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18658. }
  18659. static getBallRod(index) {
  18660. return this.userData.ballRod[index];
  18661. }
  18662. static setBallRod(index, val) {
  18663. this.userData.ballRod[index] = val;
  18664. this.saveUserData();
  18665. }
  18666. static setBallRodFormServer(haveQiuGanJsonStr) {
  18667. if (!haveQiuGanJsonStr) {
  18668. console.log("setBallRodFormServer数据为空或未定义");
  18669. return;
  18670. }
  18671. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18672. const keys = Object.keys(haveQiuGanJsonObj);
  18673. keys.forEach(key => {
  18674. let v = haveQiuGanJsonObj[key];
  18675. let k = parseInt(key);
  18676. let idx = k - 1;
  18677. this.userData.ballRod[idx] = v;
  18678. });
  18679. }
  18680. static getCurBallRod() {
  18681. return this.userData.curBallRod;
  18682. }
  18683. static setCurBallRod(index) {
  18684. this.userData.curBallRod = index;
  18685. this.saveUserData();
  18686. }
  18687. static setSignData(val) {
  18688. this.userData.signData = val;
  18689. this.saveUserData();
  18690. }
  18691. static getSignData() {
  18692. return this.userData.signData;
  18693. }
  18694. static setSignTime(val) {
  18695. this.userData.signTime = val;
  18696. this.saveUserData();
  18697. }
  18698. static getSignTime() {
  18699. return this.userData.signTime;
  18700. }
  18701. static getDrawTimes() {
  18702. return this.userData.drawTimes;
  18703. }
  18704. static setDrawTimes(val, addUp = true) {
  18705. if (addUp) {
  18706. this.userData.drawTimes += val;
  18707. }
  18708. else {
  18709. this.userData.drawTimes = val;
  18710. }
  18711. this.saveUserData();
  18712. }
  18713. static getDrawAwardTimes() {
  18714. return this.userData.drawAwardTimes;
  18715. }
  18716. static setDrawAwardTimes(val) {
  18717. this.userData.drawAwardTimes = val;
  18718. this.saveUserData();
  18719. }
  18720. static getDailyfreeDrawTimes() {
  18721. return this.userData.dailyfreeDrawTimes;
  18722. }
  18723. static setDailyfreeDrawTimes(val) {
  18724. this.userData.dailyfreeDrawTimes = val;
  18725. this.saveUserData();
  18726. }
  18727. static setPower(val, addUp = true) {
  18728. if (addUp)
  18729. this.userData.power += val;
  18730. else
  18731. this.userData.power = val;
  18732. if (this.userData.power >= xGame.common.maxPower) {
  18733. this.userData.power = xGame.common.maxPower;
  18734. }
  18735. xGame.eventMgr.event(POWER_CHANGE, val);
  18736. this.saveUserData();
  18737. }
  18738. static getPower() {
  18739. return this.userData.power;
  18740. }
  18741. static setPowerTime(val) {
  18742. this.userData.powerTime = val;
  18743. this.saveUserData();
  18744. }
  18745. static getPowerTime() {
  18746. return this.userData.powerTime;
  18747. }
  18748. static powerEnough() {
  18749. return this.getPower() > 0;
  18750. }
  18751. static getChallengeTimes() {
  18752. return this.userData.challengeTimes;
  18753. }
  18754. static setChallengeTimes(val) {
  18755. this.userData.challengeTimes += val;
  18756. this.saveUserData();
  18757. }
  18758. static getExtraSign() {
  18759. return this.userData.extraSign;
  18760. }
  18761. static setExtraSign(val) {
  18762. this.userData.extraSign = val;
  18763. this.saveUserData();
  18764. }
  18765. static getClassicTimes() {
  18766. return this.userData.classicTimes;
  18767. }
  18768. static setClassicTimes() {
  18769. this.userData.classicTimes += 1;
  18770. this.saveUserData();
  18771. }
  18772. static getGuideHelpLine() {
  18773. return this.userData.guideHelpLine;
  18774. }
  18775. static setGuideHelpLine() {
  18776. this.userData.guideHelpLine = 1;
  18777. this.saveUserData();
  18778. }
  18779. static getNewUser() {
  18780. return this.userData.newUser;
  18781. }
  18782. static setNewUser() {
  18783. this.userData.newUser = false;
  18784. this.saveUserData();
  18785. }
  18786. static getRootBallFoul() {
  18787. return this.userData.rootBallFoul;
  18788. }
  18789. static setRootBallFoul() {
  18790. this.userData.rootBallFoul = 1;
  18791. this.saveUserData();
  18792. }
  18793. static getTimeoutFoul() {
  18794. return this.userData.timeoutFoul;
  18795. }
  18796. static setTimeoutFoul() {
  18797. this.userData.timeoutFoul = 1;
  18798. this.saveUserData();
  18799. }
  18800. static saveDiyGameData() {
  18801. if (this.diyGameSaving)
  18802. return;
  18803. this.diyGameSaving = true;
  18804. Laya.timer.once(500, this, () => {
  18805. this.diyGameSaving = false;
  18806. this.diyGameData.saveData();
  18807. });
  18808. }
  18809. static getChallengeMode_overLev() {
  18810. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18811. return this.challengeMode_overLev;
  18812. }
  18813. static setChallengeMode_overLev(levNum) {
  18814. this.diyGameData.challengeMode_overLev = levNum;
  18815. this.saveDiyGameData();
  18816. }
  18817. static updateUserInfo2Server(type, count = 0) {
  18818. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18819. if (userInfoData == null) {
  18820. return;
  18821. }
  18822. let reqData = xGame.httpMgr.getReqData();
  18823. let rd = JSON.parse(reqData);
  18824. rd.dataType = type;
  18825. let dataValue = 0;
  18826. if (type == "zs") {
  18827. dataValue = this.getDiamond();
  18828. }
  18829. if (type == "jb") {
  18830. dataValue = this.getCoin();
  18831. }
  18832. rd.dataValue = dataValue;
  18833. reqData = JSON.stringify(rd);
  18834. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18835. try {
  18836. let code = res.code;
  18837. let data = res.data;
  18838. if (code == 401) {
  18839. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18840. console.log('zh:保存资产信息失败,请重新登录 ');
  18841. return;
  18842. }
  18843. if (code == 200) {
  18844. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18845. }
  18846. else {
  18847. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18848. }
  18849. }
  18850. catch (error) {
  18851. console.log('error=' + error);
  18852. alert("Please check your network connection.");
  18853. }
  18854. finally {
  18855. }
  18856. });
  18857. }
  18858. static getUserZiChanInfo(winTip = false) {
  18859. console.log('zh:getUserZCI');
  18860. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18861. console.log('zh:userInfoData=' + userInfoData);
  18862. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  18863. if (winTip) {
  18864. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18865. }
  18866. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18867. return;
  18868. }
  18869. let reqData = xGame.httpMgr.getReqData();
  18870. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18871. try {
  18872. let code = res.code;
  18873. let msg = res.msg;
  18874. if (code == 401) {
  18875. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18876. if (winTip) {
  18877. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18878. }
  18879. return;
  18880. }
  18881. if (code == 200) {
  18882. let d = res.data;
  18883. let zuanShi = d.zuanShi;
  18884. let jinBi = d.jinBi;
  18885. let haveQiuGanJson = d.haveQiuGanJson;
  18886. let signData = d.signData;
  18887. let placeBallData = d.placeBallData;
  18888. DataMgr.setDiamondFormServer(zuanShi);
  18889. DataMgr.setCoinFormServer(jinBi);
  18890. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18891. DataMgr.setPlaceBallLevelList(placeBallData);
  18892. if (signData && signData > 0) {
  18893. DataMgr.setSignData(signData);
  18894. }
  18895. }
  18896. else {
  18897. console.log("zh:更新用户资产信息error" + msg);
  18898. if (winTip) {
  18899. xGame.uiMgr.Show(UIMsg, msg);
  18900. }
  18901. }
  18902. }
  18903. catch (error) {
  18904. console.log('error=' + error);
  18905. if (winTip) {
  18906. alert(error);
  18907. }
  18908. }
  18909. finally {
  18910. console.log("zh:更新用户资产信息结束");
  18911. }
  18912. });
  18913. }
  18914. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18915. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18916. console.log('zh:updateLocalUserData=' + userInfo);
  18917. if (userInfo != null) {
  18918. if (!userInfo.buySpids) {
  18919. userInfo.buySpids = { 1: false, 7: false };
  18920. }
  18921. else {
  18922. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18923. }
  18924. userInfo.buySpids[spid] = isBuyOk;
  18925. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18926. }
  18927. else {
  18928. }
  18929. }
  18930. static loadUserSpOrderForAd() {
  18931. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18932. if (userInfo == null) {
  18933. return;
  18934. }
  18935. console.log('zh:重新加载更新广告权利');
  18936. let reqData = xGame.httpMgr.getReqData();
  18937. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18938. try {
  18939. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  18940. let code = res.code;
  18941. let msg = res.msg;
  18942. if (code == 401) {
  18943. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18944. return;
  18945. }
  18946. if (code == 200) {
  18947. let data = res.data;
  18948. let buy_spid1 = false;
  18949. let buy_spid7 = false;
  18950. for (let index = 0; index < data.length; index++) {
  18951. let element = data[index];
  18952. console.log('zh:list element.spid = ' + element.spid);
  18953. if (element.spid == 1) {
  18954. buy_spid1 = true;
  18955. }
  18956. if (element.spid == 7) {
  18957. buy_spid7 = true;
  18958. }
  18959. }
  18960. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  18961. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  18962. }
  18963. else {
  18964. }
  18965. }
  18966. catch (error) {
  18967. console.log('error=' + error);
  18968. alert(error);
  18969. }
  18970. finally {
  18971. }
  18972. });
  18973. }
  18974. }
  18975. DataMgr.isNewUser = false;
  18976. DataMgr.fristEnter = true;
  18977. DataMgr.levelType = 0;
  18978. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18979. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18980. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18981. DataMgr.challengeMode_overLev = 0;
  18982. DataMgr.xszyForClassic = false;
  18983. DataMgr.xszyForChallenge = false;
  18984. DataMgr.awardId = 0;
  18985. DataMgr.awardCoin = 0;
  18986. DataMgr.sceneId = -1;
  18987. DataMgr.tryId = 0;
  18988. DataMgr.curLevel = 1;
  18989. DataMgr.vipLevel = 0;
  18990. DataMgr.maxLevel = 0;
  18991. DataMgr.awardRatio = 1;
  18992. DataMgr.gameList = [];
  18993. DataMgr.rankList = [];
  18994. DataMgr.recoverTime = 480000;
  18995. DataMgr.minScore = 0;
  18996. DataMgr.rankDis = 0;
  18997. DataMgr.userSaving = false;
  18998. DataMgr.gameSaving = false;
  18999. DataMgr.diyGameSaving = false;
  19000. class D3Tween extends Laya.Script3D {
  19001. constructor() {
  19002. super();
  19003. this.isInited = false;
  19004. }
  19005. ;
  19006. init() {
  19007. if (this.isInited)
  19008. return;
  19009. this.isInited = true;
  19010. this.gameObj = this.owner;
  19011. this.transform = this.gameObj.transform;
  19012. }
  19013. get rotX() {
  19014. return this.transform.localRotationEulerX;
  19015. }
  19016. set rotX(v) {
  19017. this.transform.localRotationEulerX = v;
  19018. }
  19019. get rotY() {
  19020. return this.transform.localRotationEulerY;
  19021. }
  19022. set rotY(v) {
  19023. this.transform.localRotationEulerY = v;
  19024. }
  19025. get rotZ() {
  19026. return this.transform.localRotationEulerZ;
  19027. }
  19028. set rotZ(v) {
  19029. this.transform.localRotationEulerZ = v;
  19030. }
  19031. get posX() {
  19032. return this.transform.localPositionX;
  19033. }
  19034. set posX(v) {
  19035. this.transform.localPositionX = v;
  19036. }
  19037. get posY() {
  19038. return this.transform.localPositionY;
  19039. }
  19040. set posY(v) {
  19041. this.transform.localPositionY = v;
  19042. }
  19043. get posZ() {
  19044. return this.transform.localPositionZ;
  19045. }
  19046. set posZ(v) {
  19047. this.transform.localPositionZ = v;
  19048. }
  19049. get rotation() {
  19050. return this.transform.localRotation;
  19051. }
  19052. set rotation(v) {
  19053. this.transform.localRotation = v;
  19054. }
  19055. }
  19056. class D2Hole extends Laya.Script {
  19057. constructor() { super(); }
  19058. onTriggerEnter(collider) {
  19059. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19060. return;
  19061. }
  19062. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19063. if (collider.owner["mySrc"].isRunSkillAni) {
  19064. return;
  19065. }
  19066. if (collider.owner["mySrc"].number != 0) {
  19067. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19068. }
  19069. xGame.common.ballColliHole(collider);
  19070. xGame.common.recoverCameraView();
  19071. }
  19072. }
  19073. }
  19074. class Table extends Laya.Script3D {
  19075. constructor() {
  19076. super();
  19077. this.isSetBorder = false;
  19078. this.inited = false;
  19079. }
  19080. ;
  19081. onAwake() {
  19082. this.init();
  19083. }
  19084. init() {
  19085. if (this.inited)
  19086. return;
  19087. this.inited = true;
  19088. this.gameObj = this.owner;
  19089. this.border = this.gameObj.getChildByName("border");
  19090. }
  19091. setBorderPos() {
  19092. if (this.isSetBorder)
  19093. return;
  19094. this.isSetBorder = true;
  19095. let ui = xGame.common.gameUI.ui;
  19096. let bar1 = this.border.getChildByName("bar1");
  19097. let bar2 = this.border.getChildByName("bar2");
  19098. let bar3 = this.border.getChildByName("bar3");
  19099. let bar4 = this.border.getChildByName("bar4");
  19100. let bar5 = this.border.getChildByName("bar5");
  19101. let bar6 = this.border.getChildByName("bar6");
  19102. this.setInfo(bar1, ui.border.bar1, "box");
  19103. this.setInfo(bar2, ui.border.bar2, "box");
  19104. this.setInfo(bar3, ui.border.bar3, "box");
  19105. this.setInfo(bar4, ui.border.bar4, "box");
  19106. this.setInfo(bar5, ui.border.bar5, "box");
  19107. this.setInfo(bar6, ui.border.bar6, "box");
  19108. let circle1 = this.border.getChildByName("circle1");
  19109. let circle2 = this.border.getChildByName("circle2");
  19110. let circle3 = this.border.getChildByName("circle3");
  19111. let circle4 = this.border.getChildByName("circle4");
  19112. let circle5 = this.border.getChildByName("circle5");
  19113. let circle6 = this.border.getChildByName("circle6");
  19114. this.setInfo(circle1, ui.border.circle1, "circle");
  19115. this.setInfo(circle2, ui.border.circle2, "circle");
  19116. this.setInfo(circle3, ui.border.circle3, "circle");
  19117. this.setInfo(circle4, ui.border.circle4, "circle");
  19118. this.setInfo(circle5, ui.border.circle5, "circle");
  19119. this.setInfo(circle6, ui.border.circle6, "circle");
  19120. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19121. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19122. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19123. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19124. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19125. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19126. let arr = xGame.common.gameMgr.holePosList;
  19127. xGame.common.gameMgr.posObj = {
  19128. "1": arr[0],
  19129. "3": arr[2],
  19130. "4": arr[3],
  19131. "6": arr[5]
  19132. };
  19133. }
  19134. initHolePos(x, y) {
  19135. if (x < 300)
  19136. x += 25;
  19137. else if (x > 1000)
  19138. x -= 25;
  19139. else if (y > 200)
  19140. y -= 10;
  19141. else
  19142. y += 10;
  19143. if (y < 200)
  19144. y += 30;
  19145. else if (y > 500)
  19146. y -= 30;
  19147. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19148. }
  19149. setInfo(d3Obj, d2Obj, type) {
  19150. let ui = xGame.common.gameUI.ui;
  19151. let sprite = new Laya.Sprite();
  19152. ui.border.displayObject.addChild(sprite);
  19153. let colli = xGame.common.getCollider(type);
  19154. sprite.addComponentIntance(colli);
  19155. let rigy = xGame.common.getRigbody();
  19156. rigy.type = "static";
  19157. sprite.addComponentIntance(rigy);
  19158. let d3Pos = d3Obj.transform.position;
  19159. xGame.common.pos3to2Convert(d3Pos);
  19160. let scaleX = d3Obj.transform.localScaleX;
  19161. let scaleZ = d3Obj.transform.localScaleZ;
  19162. let width = xGame.common.scale3to2Convert(scaleZ);
  19163. let height = xGame.common.scale3to2Convert(scaleX);
  19164. sprite.pivotX = width / 2;
  19165. sprite.pivotY = height / 2;
  19166. sprite.x = d3Pos.x;
  19167. sprite.y = d3Pos.y;
  19168. sprite.width = width;
  19169. sprite.height = height;
  19170. d2Obj.x = d3Pos.x;
  19171. d2Obj.y = d3Pos.y;
  19172. d2Obj.width = width;
  19173. d2Obj.height = height;
  19174. if (type == "box") {
  19175. colli.width = width;
  19176. colli.height = height;
  19177. colli.isSensor = false;
  19178. colli.label = "border";
  19179. }
  19180. else {
  19181. colli.radius = width / 2;
  19182. colli.isSensor = true;
  19183. colli.label = "hole";
  19184. sprite.addComponent(D2Hole);
  19185. }
  19186. }
  19187. }
  19188. class D3World extends Laya.Script3D {
  19189. constructor() {
  19190. super();
  19191. this.loadNum = 0;
  19192. this.setLoadNum = 7;
  19193. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19194. }
  19195. onAwake() {
  19196. }
  19197. loadScene() {
  19198. this.scene = this.owner;
  19199. let url = `res/unityRes/root.lh`;
  19200. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19201. this.scene.addChild(prefab);
  19202. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19203. this.putCameraInfo();
  19204. this.camera.enableHDR = false;
  19205. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19206. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19207. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19208. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19209. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19210. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19211. this.knife.active = false;
  19212. this.loadD3Obj();
  19213. }));
  19214. }
  19215. putCameraInfo() {
  19216. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19217. this.cameraObj = new cameraType();
  19218. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19219. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19220. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19221. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19222. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19223. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19224. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19225. this.visitAngleChild.init();
  19226. this.visitRootObj.posX = this.visitAngleChild.posX;
  19227. this.visitRootObj.posY = this.visitAngleChild.posY;
  19228. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19229. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19230. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19231. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19232. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19233. xGame.common.showOneCamera("mainCamera");
  19234. }
  19235. loadD3Obj() {
  19236. this.loadTable();
  19237. this.loadRoom();
  19238. this.loadInHoleParticial();
  19239. this.loadIceParticial();
  19240. this.loadHitParticial();
  19241. this.loadFireworksParticial();
  19242. this.loadBall();
  19243. }
  19244. loadInHoleParticial() {
  19245. this.loadD3Res("inHoleEft", "", (prefab) => {
  19246. prefab.addComponent(Partical);
  19247. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19248. });
  19249. }
  19250. loadIceParticial() {
  19251. this.loadD3Res("iceEft", "", (prefab) => {
  19252. prefab.addComponent(Partical);
  19253. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19254. });
  19255. }
  19256. loadHitParticial() {
  19257. this.loadD3Res("hitEft", "", (prefab) => {
  19258. prefab.addComponent(Partical);
  19259. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19260. });
  19261. }
  19262. loadFireworksParticial() {
  19263. this.loadD3Res("fireworksEft", "", (prefab) => {
  19264. prefab.addComponent(Partical);
  19265. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19266. });
  19267. }
  19268. loadBall(index = 1) {
  19269. this.loadD3Res("ball", index, (prefab) => {
  19270. this.ballPrefab = prefab;
  19271. this.ballPrefab.addComponent(Ball);
  19272. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19273. });
  19274. }
  19275. loadTable(index = 1) {
  19276. this.loadD3Res("table", index, (prefab) => {
  19277. this.tableSrc = prefab.addComponent(Table);
  19278. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19279. this.d3Hand.init();
  19280. this.tableRoot.addChild(prefab);
  19281. });
  19282. }
  19283. loadRoom(index = 1) {
  19284. this.loadD3Res("room", index, (prefab) => {
  19285. this.roomRoot.addChild(prefab);
  19286. });
  19287. }
  19288. loadD3Res(type, index, callback) {
  19289. let url = `res/unityRes/${type}${index}.lh`;
  19290. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19291. callback && callback(prefab);
  19292. this.checkResLoad();
  19293. }));
  19294. }
  19295. checkResLoad() {
  19296. this.loadNum++;
  19297. if (this.loadNum >= this.setLoadNum) {
  19298. xGame.eventMgr.event(D3RES_LOADED);
  19299. }
  19300. }
  19301. prePlayEft() {
  19302. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19303. eft.transform.localPositionX = 0;
  19304. eft.transform.localPositionY = -5;
  19305. eft.transform.localPositionZ = 0;
  19306. eft.active = true;
  19307. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19308. ice.transform.localPositionX = 0;
  19309. ice.transform.localPositionY = -5;
  19310. ice.transform.localPositionZ = 0;
  19311. ice.active = true;
  19312. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19313. hit.transform.localPositionX = 0;
  19314. hit.transform.localPositionY = -5;
  19315. hit.transform.localPositionZ = 0;
  19316. hit.active = true;
  19317. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19318. fireworks.transform.localPositionX = 0;
  19319. fireworks.transform.localPositionY = -5;
  19320. fireworks.transform.localPositionZ = 0;
  19321. fireworks.active = true;
  19322. }
  19323. }
  19324. class cameraType {
  19325. }
  19326. class MoyuMgr$1 {
  19327. static initMoyu() {
  19328. this.moyuView = new MoyuView$1();
  19329. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19330. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19331. this.moyuView.ui.displayObject.zOrder = 1000;
  19332. this.moyuView.init();
  19333. this.moyuView.showTip(true);
  19334. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19335. window['XApk'] = this;
  19336. }
  19337. static showAge(show) {
  19338. if (this.moyuView)
  19339. this.moyuView.showAge(show);
  19340. }
  19341. static onPlatMsg(idx) {
  19342. if (!MoyuMgr$1.moyuView)
  19343. return;
  19344. if (idx == '0') {
  19345. MoyuMgr$1.moyuView.showTip(false);
  19346. }
  19347. }
  19348. static showAgree(call) {
  19349. if (this.moyuView)
  19350. this.moyuView.showAgree(call);
  19351. else
  19352. call && call();
  19353. }
  19354. static showXy(type = 1) {
  19355. if (this.moyuView)
  19356. this.moyuView.showXy(type);
  19357. }
  19358. }
  19359. MoyuMgr$1.isAdvise = false;
  19360. class MoyuView$1 {
  19361. constructor() {
  19362. this.ysxyNum = 1;
  19363. this.ysJson = null;
  19364. this.ui = ui_UIMoyu.createInstance();
  19365. }
  19366. init() {
  19367. this.ui.mainBg.visible = false;
  19368. this.ui.xyNode.visible = false;
  19369. this.ui.ageNode.visible = false;
  19370. this.ui.tipNode.visible = false;
  19371. this.ui.rnNode.visible = false;
  19372. this.ui.fcmNode.visible = false;
  19373. this.ui.ageTip.visible = false;
  19374. this.ui.msgNode.visible = false;
  19375. this.ui.visible = false;
  19376. this.ui.xyNode.xyList.setVirtual();
  19377. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19378. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19379. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19380. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19381. this.ui.xyNode.btnKnown.visible = false;
  19382. this.ui.xyNode.xy1.visible = false;
  19383. this.ui.xyNode.xy2.visible = false;
  19384. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19385. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19386. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19387. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19388. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19389. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19390. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19391. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19392. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19393. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19394. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19395. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19396. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19397. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19398. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19399. this.ysxyNum = 2;
  19400. }
  19401. }
  19402. onClick(obj) {
  19403. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19404. switch (obj) {
  19405. case this.ui.ageTip:
  19406. if (Moyu.isTTApk) {
  19407. this.ui.ageNode.visible = true;
  19408. this.ui.mainBg.visible = true;
  19409. }
  19410. break;
  19411. case this.ui.tipNode:
  19412. this.showTip(false);
  19413. break;
  19414. case this.ui.ageNode.btnAge:
  19415. this.ui.ageNode.visible = false;
  19416. this.ui.mainBg.visible = false;
  19417. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19418. this.ui.visible = false;
  19419. break;
  19420. case this.ui.xyNode.btnXy3:
  19421. case this.ui.xyNode.btnXy1:
  19422. this.loadXy(1);
  19423. break;
  19424. case this.ui.xyNode.btnXy2:
  19425. this.loadXy(2);
  19426. break;
  19427. case this.ui.xyNode.btnBack:
  19428. this.ui.xyNode.xy1.visible = true;
  19429. this.ui.xyNode.xy2.visible = false;
  19430. break;
  19431. case this.ui.xyNode.btnKnown:
  19432. this.ui.xyNode.visible = false;
  19433. this.ui.mainBg.visible = false;
  19434. this.ui.visible = false;
  19435. break;
  19436. case this.ui.rnNode.btnCheck:
  19437. this.check();
  19438. break;
  19439. case this.ui.rnNode.btnExit:
  19440. case this.ui.xyNode.btnNo:
  19441. this.ysxyNum--;
  19442. if (this.ysxyNum > 0)
  19443. this.showMsg("Refuse to quit the game once again");
  19444. else {
  19445. Moyu.userAgree(false);
  19446. Moyu.exit();
  19447. }
  19448. break;
  19449. case this.ui.xyNode.btnSure:
  19450. case this.ui.xyNode.btnYes:
  19451. DataMgr.userData.isAgree = true;
  19452. DataMgr.saveUserData();
  19453. this.onAgree();
  19454. break;
  19455. case this.ui.rnNode.btnDone:
  19456. this.ui.rnNode.visible = false;
  19457. this.ui.visible = false;
  19458. break;
  19459. case this.ui.fcmNode.btnRn:
  19460. this.showRn();
  19461. break;
  19462. }
  19463. }
  19464. showTip(show) {
  19465. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19466. return;
  19467. if (show) {
  19468. MoyuMgr$1.isAdvise = true;
  19469. this.ui.visible = true;
  19470. this.ui.tipNode.visible = true;
  19471. this.ui.tipNode.alpha = 1;
  19472. Laya.timer.once(1000, this, this.showTip, [false]);
  19473. }
  19474. else {
  19475. this.ui.tipNode.alpha = 1;
  19476. this.ui.tipNode.visible = true;
  19477. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19478. this.ui.tipNode.visible = false;
  19479. MoyuMgr$1.isAdvise = false;
  19480. }), 1000);
  19481. }
  19482. }
  19483. showAge(show, px = 0, py = 0) {
  19484. if (Moyu.platType > 10 && !Moyu.isIos) {
  19485. this.ui.ageTip.x = px;
  19486. this.ui.ageTip.y = py;
  19487. this.ui.ageTip.visible = show;
  19488. if (show)
  19489. this.ui.visible = true;
  19490. }
  19491. }
  19492. showAgree(call) {
  19493. this.agreeCall = call;
  19494. this.onAgree();
  19495. return;
  19496. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19497. this.showXy(0);
  19498. }
  19499. else
  19500. this.onAgree();
  19501. }
  19502. onAgree() {
  19503. if (!this.ui.ageNode.visible)
  19504. this.ui.visible = false;
  19505. this.ui.xyNode.visible = false;
  19506. Moyu.userAgree(true);
  19507. this.showAge(false);
  19508. this.agreeCall && this.agreeCall();
  19509. this.showRn();
  19510. }
  19511. showMsg(txt) {
  19512. this.ui.msgNode.txtMsg.text = txt;
  19513. this.ui.msgNode.visible = true;
  19514. this.ui.msgNode.alpha = 1;
  19515. this.ui.visible = true;
  19516. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19517. this.ui.msgNode.visible = false;
  19518. }), 2500, true);
  19519. }
  19520. showRn() {
  19521. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19522. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19523. this.ui.rnNode.rn1.visible = true;
  19524. this.ui.rnNode.rn2.visible = false;
  19525. this.ui.rnNode.rn3.visible = false;
  19526. this.ui.rnNode.rn4.visible = false;
  19527. this.ui.rnNode.visible = true;
  19528. this.ui.mainBg.visible = true;
  19529. this.ui.rnNode.btnDone.visible = false;
  19530. this.ui.rnNode.btnExit.visible = true;
  19531. this.ui.rnNode.btnCheck.visible = true;
  19532. this.ui.fcmNode.visible = false;
  19533. this.ui.visible = true;
  19534. return;
  19535. }
  19536. }
  19537. this.showFcm();
  19538. }
  19539. showFcm() {
  19540. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19541. Moyu.initFCM(true);
  19542. if (Moyu.gameTime < 1)
  19543. this.fcmLoop();
  19544. else if (Moyu.gameTime < 999)
  19545. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19546. }
  19547. }
  19548. fcmLoop() {
  19549. if (Moyu.gameTime < 1) {
  19550. this.ui.rnNode.visible = false;
  19551. this.ui.fcmNode.visible = true;
  19552. this.ui.mainBg.visible = true;
  19553. this.ui.visible = true;
  19554. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19555. Laya.timer.clear(this.ui, this.fcmLoop);
  19556. }
  19557. }
  19558. check() {
  19559. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19560. this.ui.rnNode.rn1.visible = false;
  19561. this.ui.rnNode.rn2.visible = false;
  19562. this.ui.rnNode.rn4.visible = true;
  19563. }
  19564. else if (this.ui.rnNode.rn4.visible) {
  19565. let name = this.ui.rnNode.inputName.text;
  19566. let code = this.ui.rnNode.inputCode.text;
  19567. if (code && code.length == 18) {
  19568. this.ui.rnNode.rn1.visible = false;
  19569. this.ui.rnNode.rn4.visible = false;
  19570. Moyu.authenticate(name, code, (res) => {
  19571. this.ui.rnNode.rn2.visible = !res;
  19572. this.ui.rnNode.rn3.visible = res;
  19573. this.ui.rnNode.btnDone.visible = res;
  19574. this.ui.rnNode.btnExit.visible = !res;
  19575. this.ui.rnNode.btnCheck.visible = !res;
  19576. if (res)
  19577. this.showFcm();
  19578. });
  19579. }
  19580. else
  19581. this.showMsg("信息填写不完整");
  19582. }
  19583. }
  19584. loadXy(type = 0) {
  19585. this.ui.xyNode.xy1.visible = false;
  19586. this.ui.xyNode.xy2.visible = true;
  19587. this.ui.xyNode.xyList.scrollToView(0);
  19588. if (type == 1) {
  19589. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19590. }
  19591. else if (type == 2) {
  19592. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19593. }
  19594. }
  19595. showXy(type = 0) {
  19596. this.xyBtn();
  19597. if (type == 0) {
  19598. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19599. this.ui.xyNode.btnSure.visible = true;
  19600. }
  19601. else {
  19602. this.ui.xyNode.btnYes.visible = true;
  19603. this.ui.xyNode.btnNo.visible = true;
  19604. }
  19605. }
  19606. else {
  19607. this.ui.xyNode.btnKnown.visible = true;
  19608. this.ui.mainBg.visible = true;
  19609. }
  19610. this.ui.xyNode.xy1.visible = true;
  19611. this.ui.xyNode.xy2.visible = false;
  19612. this.ui.xyNode.visible = true;
  19613. this.ui.visible = true;
  19614. }
  19615. xyBtn() {
  19616. this.ui.xyNode.btnSure.visible = false;
  19617. this.ui.xyNode.btnYes.visible = false;
  19618. this.ui.xyNode.btnNo.visible = false;
  19619. this.ui.xyNode.btnKnown.visible = false;
  19620. {
  19621. this.ui.xyNode.btnXy3.visible = false;
  19622. this.ui.xyNode.btnXy2.visible = true;
  19623. this.ui.xyNode.btnXy1.visible = true;
  19624. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19625. }
  19626. }
  19627. createXY(json) {
  19628. this.ysJson = json.content;
  19629. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19630. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19631. this.ui.xyNode.xy2.visible = true;
  19632. }
  19633. renderListItem(idx, cell) {
  19634. let xy = this.ysJson[idx];
  19635. cell.height = xy.line * 30;
  19636. cell.xyItem.text = xy.text;
  19637. }
  19638. onDestroy() {
  19639. this.agreeCall = null;
  19640. }
  19641. }
  19642. class UILoading extends UIBase {
  19643. constructor() {
  19644. super();
  19645. this.accTime = 0;
  19646. this.curNum = 0;
  19647. this.rate = 1;
  19648. this.loadSubOk = false;
  19649. this.loadResOK = false;
  19650. this.openLoading = true;
  19651. this.beginLoadRes = false;
  19652. this.finishD2 = false;
  19653. this.finishD3 = false;
  19654. }
  19655. onConstructor() {
  19656. this.ui = ui_UILoading.createInstance();
  19657. this.contentPane = this.ui;
  19658. this.isEject = false;
  19659. this._initUI();
  19660. this._addEvent();
  19661. }
  19662. _initUI() {
  19663. MoyuMgr$1.initMoyu();
  19664. }
  19665. _addEvent() {
  19666. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19667. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19668. }
  19669. show() {
  19670. super.show();
  19671. console.log('zh:加载分包资源');
  19672. loadSubRes(this.subResProgress.bind(this));
  19673. this.ui.txtLoad.text = "Loading...";
  19674. this.setGlobalFont(this.ui);
  19675. }
  19676. subResProgress(pro, finish) {
  19677. this.curNum = pro;
  19678. if (finish) {
  19679. this.curNum = 1;
  19680. this.loadSubOk = true;
  19681. }
  19682. }
  19683. laodD3Res() {
  19684. let scene3D = new Laya.Scene3D();
  19685. xGame.common.d3Scene = scene3D;
  19686. xGame.common.d3World = scene3D.addComponent(D3World);
  19687. xGame.common.d3World.loadScene();
  19688. }
  19689. loadD2Res() {
  19690. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19691. this.finishD2 = true;
  19692. this.checkLoadAll();
  19693. this.curNum = 1;
  19694. }), Laya.Handler.create(this, (pro) => {
  19695. this.curNum = pro;
  19696. }, null, false));
  19697. }
  19698. d3ResFinish() {
  19699. this.finishD3 = true;
  19700. this.checkLoadAll();
  19701. }
  19702. checkLoadAll() {
  19703. if (this.finishD2 && this.finishD3) {
  19704. this.loadResOK = true;
  19705. }
  19706. }
  19707. loadRes() {
  19708. this.laodD3Res();
  19709. this.loadD2Res();
  19710. }
  19711. myUpdate(dt) {
  19712. if (!this.openLoading)
  19713. return;
  19714. this.accTime += dt * this.rate;
  19715. if (this.accTime >= this.curNum)
  19716. this.accTime = this.curNum;
  19717. this.ui.loadinfo.value = this.accTime * 100;
  19718. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19719. if (!this.beginLoadRes) {
  19720. this.beginLoadRes = true;
  19721. this.ui.txtLoad.text = "Loading...";
  19722. this.curNum = 0;
  19723. this.accTime = 0;
  19724. this.loadRes();
  19725. }
  19726. if (this.loadResOK) {
  19727. this.openLoading = false;
  19728. Laya.timer.once(300, this, () => {
  19729. xGame.common.d3Scene.active = false;
  19730. MoyuMgr$1.showAgree(enterGame);
  19731. });
  19732. }
  19733. }
  19734. }
  19735. release() {
  19736. }
  19737. hide() {
  19738. super.hide();
  19739. this.release();
  19740. }
  19741. onClose() {
  19742. this.hide();
  19743. }
  19744. }
  19745. UILoading.uiName = "UILoading";
  19746. class UIRepentProp$1 extends UIBase {
  19747. constructor() {
  19748. super();
  19749. this.viewType = 0;
  19750. this.regretType = 0;
  19751. }
  19752. onConstructor() {
  19753. this.ui = ui_UIRepentProp.createInstance();
  19754. this.contentPane = this.ui;
  19755. this.isEject = false;
  19756. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19757. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19758. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19759. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19760. }
  19761. show(viewType, regretType, callback) {
  19762. PlatMgr.showInsert(true);
  19763. this.viewType = viewType;
  19764. this.regretType = regretType;
  19765. this.callback = callback;
  19766. super.show();
  19767. this.ui.t0.play();
  19768. this.ui.c1.selectedIndex = this.viewType;
  19769. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19770. if (this.viewType == 0) {
  19771. let guide = DataMgr.getGuideHelpLine();
  19772. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19773. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19774. }
  19775. xGame.common.gameMgr.gamePause = true;
  19776. this.setGlobalFont(this.ui);
  19777. }
  19778. hideSelf() {
  19779. xGame.common.gameMgr.gamePause = false;
  19780. this.callback && this.callback(false);
  19781. this.hide();
  19782. }
  19783. videoRegret() {
  19784. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19785. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19786. }
  19787. else {
  19788. console.log('zh:AD 失败,直接发放奖励');
  19789. this.qjff_AD_for_UIrepentProp_videoRegret();
  19790. }
  19791. }
  19792. qjff_AD_for_UIrepentProp_videoRegret() {
  19793. this.callback && this.callback(true);
  19794. this.hideSelf();
  19795. }
  19796. videoAddHelpLine() {
  19797. let guide = DataMgr.getGuideHelpLine();
  19798. if (guide == 0) {
  19799. this.callback && this.callback(true);
  19800. this.hideSelf();
  19801. DataMgr.setGuideHelpLine();
  19802. xGame.common.gameUI.ui.guideNode.visible = false;
  19803. }
  19804. else {
  19805. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19806. if (Laya.Browser.onAndroid) {
  19807. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19808. if (!boo) {
  19809. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19810. return;
  19811. }
  19812. }
  19813. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19814. }
  19815. else {
  19816. console.log('zh:AD 失败,直接发放奖励');
  19817. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19818. }
  19819. }
  19820. }
  19821. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19822. this.callback && this.callback(true);
  19823. this.hideSelf();
  19824. }
  19825. }
  19826. UIRepentProp$1.uiName = "UIRepentProp";
  19827. class UIRodMethod$1 extends UIBase {
  19828. constructor() {
  19829. super();
  19830. this.isPressd = false;
  19831. }
  19832. onConstructor() {
  19833. this.ui = ui_UIRodMethod.createInstance();
  19834. this.contentPane = this.ui;
  19835. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19836. this.moveDir = new Laya.Vector2();
  19837. this.moveDest = new Laya.Vector2();
  19838. this.centerPos = new Laya.Vector2();
  19839. xGame.common.uiRodMethod = this;
  19840. }
  19841. show() {
  19842. super.show();
  19843. xGame.common.gameMgr.gamePause = true;
  19844. this.openPressDotEvent();
  19845. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19846. this.centerPos.x = this.ui.white.x;
  19847. this.centerPos.y = this.ui.white.y;
  19848. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19849. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19850. this.setDot();
  19851. this.setGlobalFont(this.ui);
  19852. }
  19853. setDot() {
  19854. this.ui.dot.x = this.moveDest.x;
  19855. this.ui.dot.y = this.moveDest.y;
  19856. }
  19857. closeSelf() {
  19858. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19859. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19860. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19861. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19862. xGame.common.gameMgr.gamePause = false;
  19863. this.hide();
  19864. }
  19865. openPressDotEvent() {
  19866. this.closePressDotEvent();
  19867. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19868. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19869. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19870. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19871. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19872. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19873. }
  19874. closePressDotEvent() {
  19875. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19876. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19877. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19878. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19879. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19880. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19881. }
  19882. onDown(e) {
  19883. if (e.type == Laya.Event.MOUSE_DOWN)
  19884. this.isPressd = true;
  19885. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19886. this.isPressd = false;
  19887. if (!this.isPressd)
  19888. return;
  19889. this.moveDest.x = e.stageX;
  19890. this.moveDest.y = e.stageY;
  19891. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19892. if (dis > 6724) {
  19893. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19894. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19895. }
  19896. this.setDot();
  19897. }
  19898. resetRod() {
  19899. this.ui.dot.x = this.ui.white.x;
  19900. this.ui.dot.y = this.ui.white.y;
  19901. this.gameRod.dot.x = this.gameRod.bg.x;
  19902. this.gameRod.dot.y = this.gameRod.bg.y;
  19903. xGame.common.rodOffest.x = 0;
  19904. xGame.common.rodOffest.y = 0;
  19905. }
  19906. }
  19907. UIRodMethod$1.uiName = "UIRodMethod";
  19908. class UIMsg$1 extends UIBase {
  19909. constructor() {
  19910. super();
  19911. }
  19912. onConstructor() {
  19913. this.ui = ui_UIMsg.createInstance();
  19914. this.contentPane = this.ui;
  19915. this.isEject = false;
  19916. this.isMuti = true;
  19917. }
  19918. show(msg, callback) {
  19919. super.show();
  19920. this.ui.tipsNode.msgTxt.text = msg;
  19921. this.ui.alpha = 1;
  19922. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19923. this.hide();
  19924. callback && callback();
  19925. }), 1000);
  19926. this.setGlobalFont(this.ui);
  19927. }
  19928. }
  19929. UIMsg$1.uiName = "UIMsg";
  19930. class UITips$1 extends UIBase {
  19931. constructor() {
  19932. super();
  19933. this.type = 0;
  19934. }
  19935. onConstructor() {
  19936. this.ui = ui_UITips.createInstance();
  19937. this.contentPane = this.ui;
  19938. this.isEject = false;
  19939. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19940. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19941. }
  19942. show(tipsTxt, womanTxt, type) {
  19943. super.show();
  19944. this.ui.t0.play();
  19945. this.ui.myNode.tipsTxt.text = tipsTxt;
  19946. this.ui.myNode.womanTxt.text = womanTxt;
  19947. PlatMgr.showInsert(true);
  19948. this.ui.myNode.c1.selectedIndex = type;
  19949. this.type = type;
  19950. switch (this.type) {
  19951. case TipsType.exitGame:
  19952. xGame.common.gameMgr.gamePause = true;
  19953. break;
  19954. case TipsType.foul:
  19955. Laya.timer.once(200, this, () => {
  19956. xGame.common.gameMgr.gamePause = true;
  19957. });
  19958. break;
  19959. default:
  19960. break;
  19961. }
  19962. this.setGlobalFont(this.ui);
  19963. }
  19964. clickLeftBtn() {
  19965. this.hide();
  19966. xGame.common.gameMgr.gamePause = false;
  19967. switch (this.type) {
  19968. case TipsType.exitGame:
  19969. break;
  19970. case TipsType.foul:
  19971. break;
  19972. default:
  19973. break;
  19974. }
  19975. }
  19976. clickRightBtn() {
  19977. this.hide();
  19978. switch (this.type) {
  19979. case TipsType.exitGame:
  19980. xGame.eventMgr.event(RESET_GAME);
  19981. xGame.uiMgr.Show(UIMain$1);
  19982. Moyu.recordEnd(this, null);
  19983. xGame.common.longHelpLine = false;
  19984. break;
  19985. case TipsType.foul:
  19986. xGame.common.gameMgr.gamePause = false;
  19987. Laya.timer.clearAll(this);
  19988. break;
  19989. default:
  19990. break;
  19991. }
  19992. }
  19993. }
  19994. UITips$1.uiName = "UITips";
  19995. class UIGame$1 extends UIBase {
  19996. constructor() {
  19997. super();
  19998. this.powerNum = 0;
  19999. this.isD3Inited = false;
  20000. this.isPrePlay = false;
  20001. this.isMoveRod = false;
  20002. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20003. this.rulerDis = 20;
  20004. this.rulerOffset = 0;
  20005. }
  20006. onConstructor() {
  20007. this.ui = ui_UIGame.createInstance();
  20008. this.contentPane = this.ui;
  20009. this.ui.x += xGame.common.sysOffestNum;
  20010. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20011. this.isEject = false;
  20012. xGame.common.gameUI = this;
  20013. this.initSelf();
  20014. }
  20015. isTurnSelf() {
  20016. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20017. return true;
  20018. }
  20019. }
  20020. initSelf() {
  20021. let topUI = this.ui.topNode;
  20022. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20023. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20024. this.barInfo = {};
  20025. this.barInfo.curY = 0;
  20026. this.barInfo.height = this.ui.powerNode.height;
  20027. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20028. this.barInfo.powerStartY = this.ui.powerNode.y;
  20029. xGame.common.aiPlayer = new AIPlayer();
  20030. xGame.common.gameMgr = new GameMgr();
  20031. xGame.common.skillMgr = new SkillMgr();
  20032. xGame.common.wordsMgr = new WordsMgr();
  20033. xGame.common.talkMgr = new TalkMgr();
  20034. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20035. });
  20036. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20037. });
  20038. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20039. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20040. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20041. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20042. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20043. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20044. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20045. }
  20046. getGanZiImg() {
  20047. let index = DataMgr.getCurBallRod();
  20048. let data = cfgTable.ballrodData[index + 1];
  20049. let gan_url = xGame.common.getGameIconUrl(data.img);
  20050. this.ui.powerNode.showImg.url = gan_url;
  20051. }
  20052. returnHome() {
  20053. let tips = "Are you sure to exit the game?";
  20054. let woman = "Boss, why don't you play for a while longer?";
  20055. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20056. }
  20057. addRodMethodClick() {
  20058. if (this.isTurnSelf()) {
  20059. xGame.uiMgr.Show(UIRodMethod$1);
  20060. }
  20061. }
  20062. clickHelpLineBtn(force = false) {
  20063. if (!this.isTurnSelf())
  20064. return;
  20065. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20066. if (success) {
  20067. xGame.common.longHelpLine = true;
  20068. xGame.common.d2World.getHelpLine();
  20069. Moyu.sendDataEvent("guideNum");
  20070. }
  20071. else {
  20072. }
  20073. });
  20074. }
  20075. renderSelfDisplayBalls(index, target) {
  20076. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20077. target.myImg.url = xGame.common.getGameIconUrl(str);
  20078. }
  20079. renderAIDisplayBalls(index, target) {
  20080. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20081. target.myImg.url = xGame.common.getGameIconUrl(str);
  20082. ;
  20083. }
  20084. updateMode() {
  20085. if (xGame.common.gameMode == GameMode.classic) {
  20086. this.ui.topNode.scoreNode.visible = false;
  20087. }
  20088. else if (xGame.common.gameMode == GameMode.bigMove) {
  20089. this.ui.topNode.scoreNode.visible = true;
  20090. }
  20091. }
  20092. show() {
  20093. super.show();
  20094. this.ui.alpha = 0;
  20095. this.updateSelf();
  20096. xGame.common.gameMgr.gamePause = false;
  20097. xGame.common.gameUI.ui.blackAni.visible = false;
  20098. xGame.common.gameUI.ui.whiteAni.visible = false;
  20099. this.ui.powerEft.visible = false;
  20100. this.ui.colorNode.visible = false;
  20101. this.updateHead();
  20102. let curUse = DataMgr.getCurBallRod();
  20103. this.getGanZiImg();
  20104. this.setGlobalFont(this.ui);
  20105. }
  20106. updateSelf() {
  20107. if (xGame.common.gameMode == GameMode.classic) {
  20108. this.ui.c1.selectedIndex = 0;
  20109. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20110. this.ui.topNode.middleNode.visible = true;
  20111. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20112. }
  20113. else if (xGame.common.gameMode == GameMode.bigMove) {
  20114. this.ui.c1.selectedIndex = 0;
  20115. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20116. this.ui.topNode.middleNode.visible = false;
  20117. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20118. let rand = xGame.common.randomNum(1, max);
  20119. let guide = DataMgr.getSkillGuide();
  20120. if (guide == 0)
  20121. rand = 1;
  20122. xGame.common.bigMoveLevelIndex = rand;
  20123. }
  20124. else if (xGame.common.gameMode == GameMode.placeBall) {
  20125. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20126. this.ui.c1.selectedIndex = 1 + data.type;
  20127. this.ui.alpha = 1;
  20128. this.startGame();
  20129. }
  20130. this.updateMode();
  20131. this.initD3world();
  20132. this.initD2world();
  20133. }
  20134. startGame() {
  20135. this.ui.snowNode.visible = Math.random() <= 0.1;
  20136. this.ui.d2Node.visible = false;
  20137. xGame.common.d3World.d3Hand.gameObj.active = false;
  20138. xGame.common.d3World.tableSrc.init();
  20139. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20140. this.cameraViewChange(() => {
  20141. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20142. switch (xGame.common.gameMode) {
  20143. case GameMode.classic:
  20144. xGame.common.d3World.d3Hand.gameObj.active = true;
  20145. this.playPutBallD3Ani();
  20146. break;
  20147. case GameMode.bigMove:
  20148. this.enterGame();
  20149. Laya.timer.once(500, this, () => {
  20150. this.ui.topNode.middleNode.visible = true;
  20151. this.ui.topNode.middleNode.t0.play();
  20152. });
  20153. break;
  20154. case GameMode.placeBall:
  20155. this.enterGame();
  20156. break;
  20157. default:
  20158. break;
  20159. }
  20160. });
  20161. PlatMgr.showBanner(false);
  20162. }
  20163. enterGame() {
  20164. this.ui.d2Node.visible = true;
  20165. xGame.common.d3World.d3Hand.gameObj.active = false;
  20166. xGame.common.showOneCamera("mainCamera");
  20167. Moyu.recordGame(30, true);
  20168. if (!this.isPrePlay) {
  20169. this.isPrePlay = true;
  20170. xGame.common.d3World.prePlayEft();
  20171. }
  20172. xGame.common.gameMgr.gameReady();
  20173. this.openAllEvent();
  20174. this.ui.snowNode.visible = false;
  20175. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20176. this.ui.helpBtn.visible = condition;
  20177. }
  20178. showHelpLineGuide() {
  20179. let longGuide = DataMgr.getGuideHelpLine();
  20180. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20181. this.ui.helpBtn.visible = true;
  20182. this.ui.guideNode.visible = true;
  20183. }
  20184. }
  20185. setTurnAlpha(alpha) {
  20186. this.ui.keduNode.alpha = alpha;
  20187. this.ui.ganNode.alpha = alpha;
  20188. this.ui.rodMethodNode.alpha = alpha;
  20189. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20190. }
  20191. cameraViewChange(callback) {
  20192. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20193. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20194. xGame.common.showOneCamera("visitAngle");
  20195. cameraSrc.localRotationEulerY = 180;
  20196. cameraSrc.localRotationEulerZ = 0;
  20197. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20198. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20199. callback && callback();
  20200. }));
  20201. }));
  20202. }
  20203. playPutBallD3Ani() {
  20204. xGame.common.showOneCamera("mainCamera");
  20205. let handSrc = xGame.common.d3World.d3Hand;
  20206. handSrc.gameObj.active = true;
  20207. handSrc.transform.localPositionZ = 3;
  20208. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20209. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20210. handSrc.gameObj.active = false;
  20211. this.enterGame();
  20212. }), 400);
  20213. }));
  20214. }
  20215. updateHead() {
  20216. let user = Moyu.getUserInfo();
  20217. this.ui.topNode.selfNameTxt.text = user.nickName;
  20218. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20219. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20220. if (DataMgr.getSkillGuide() < 1) {
  20221. this.ui.topNode.aiNameTxt.text = 'billiards';
  20222. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20223. }
  20224. else {
  20225. this.ui.topNode.aiNameTxt.text = aiData.name;
  20226. let randNo = Math.floor(Math.random() * 10) + 1;
  20227. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20228. }
  20229. }
  20230. initD2world() {
  20231. let node = this.ui.d2Root.displayObject;
  20232. let src = node.getComponent(D2World);
  20233. if (!src) {
  20234. xGame.common.d2World = node.addComponent(D2World);
  20235. }
  20236. xGame.common.d2World.initSelf();
  20237. }
  20238. initD3world() {
  20239. if (this.isD3Inited)
  20240. return;
  20241. this.isD3Inited = true;
  20242. let scene3D = xGame.common.d3Scene;
  20243. this.ui.d3Root.displayObject.addChild(scene3D);
  20244. scene3D.active = true;
  20245. xGame.common.d3World.tableSrc.setBorderPos();
  20246. }
  20247. onRootMove(e) {
  20248. let rootBall = xGame.common.d2World.rootBall;
  20249. this.ui.moveNode.x = e.x;
  20250. this.ui.moveNode.y = e.y;
  20251. rootBall.gameObj.x = e.x;
  20252. rootBall.gameObj.y = e.y;
  20253. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20254. }
  20255. aiRootMove(move) {
  20256. if (move)
  20257. this.hideBallUI();
  20258. else {
  20259. this.showBallUI();
  20260. xGame.common.d2World.getHelpLine();
  20261. }
  20262. }
  20263. aiForce(type, force = 0) {
  20264. this.pressTarget = PressType.powerNode;
  20265. if (type == 1)
  20266. this.onEventUp({ force: true });
  20267. else if (type == 2)
  20268. this.onEventMove({ stageY: force, force: true });
  20269. }
  20270. onEventPress(e) {
  20271. if (e.stopPropagation)
  20272. e.stopPropagation();
  20273. if (!this.isTurnSelf())
  20274. return;
  20275. let target = e.target;
  20276. switch (target) {
  20277. case this.ui.myPowerNode.displayObject:
  20278. this.pressTarget = PressType.powerNode;
  20279. this.barInfo.curY = e.stageY;
  20280. this.updateBarInfo();
  20281. break;
  20282. case this.ui.moveNode.displayObject:
  20283. this.pressTarget = PressType.moveNode;
  20284. this.hideBallUI();
  20285. this.eventObj.curX = this.ui.moveNode.x;
  20286. this.eventObj.curY = this.ui.moveNode.y;
  20287. this.ui.moveNode.finger.visible = false;
  20288. this.eventObj.lastX = e.stageX;
  20289. this.eventObj.lastY = e.stageY;
  20290. break;
  20291. case this.ui.rulerClickNode.displayObject:
  20292. this.pressTarget = PressType.rulerNode;
  20293. this.eventObj.lastY = e.stageY;
  20294. break;
  20295. case this.ui.d2Root.displayObject:
  20296. this.pressTarget = PressType.d2Root;
  20297. this.eventObj.lastX = e.stageX;
  20298. this.eventObj.lastY = e.stageY;
  20299. this.eventObj.starX = e.stageX;
  20300. this.eventObj.starY = e.stageY;
  20301. this.eventObj.curX = 0;
  20302. this.eventObj.curY = 0;
  20303. xGame.common.d2World.d2Gan.setGanLastInfo();
  20304. this.rulerOffset = 0;
  20305. break;
  20306. default:
  20307. break;
  20308. }
  20309. }
  20310. onEventMove(e) {
  20311. if (e.stopPropagation)
  20312. e.stopPropagation();
  20313. if (e && e.force) {
  20314. }
  20315. else {
  20316. if (!this.isTurnSelf())
  20317. return;
  20318. }
  20319. switch (this.pressTarget) {
  20320. case PressType.powerNode:
  20321. this.barInfo.curY = e.stageY;
  20322. this.updateBarInfo();
  20323. this.isMoveRod = true;
  20324. break;
  20325. case PressType.moveNode:
  20326. let rootBall = xGame.common.d2World.rootBall;
  20327. let radius = rootBall.gameObj.width / 2;
  20328. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20329. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20330. let border = xGame.common.d2World.borderRect;
  20331. if (curX <= border.x + radius)
  20332. curX = border.x + radius;
  20333. else if (curX >= border.x + border.width - radius)
  20334. curX = border.x + border.width - radius;
  20335. if (curY <= border.y + radius)
  20336. curY = border.y + radius;
  20337. else if (curY >= border.y + border.height - radius)
  20338. curY = border.y + border.height - radius;
  20339. if (xGame.common.gameMgr.isOpenBall) {
  20340. if (curX >= border.x + border.openBallW - radius)
  20341. curX = border.x + border.openBallW - radius;
  20342. }
  20343. this.ui.moveNode.x = curX;
  20344. this.ui.moveNode.y = curY;
  20345. rootBall.gameObj.x = curX;
  20346. rootBall.gameObj.y = curY;
  20347. rootBall.d3BallSrc.setTransPos(curX, curY);
  20348. this.isMoveRod = true;
  20349. break;
  20350. case PressType.rulerNode:
  20351. let yy = e.stageY - this.eventObj.lastY;
  20352. this.eventObj.lastY = e.stageY;
  20353. let ruler1 = this.ui.rulerNode.img1;
  20354. let ruler2 = this.ui.rulerNode.img2;
  20355. ruler1.y += yy;
  20356. ruler2.y += yy;
  20357. this.rulerOffset += yy;
  20358. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20359. this.rulerOffset = 0;
  20360. xGame.soundMgr.playSound("inch", 1, 10);
  20361. }
  20362. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20363. let h = ruler1.height;
  20364. this.checkGuide();
  20365. this.isMoveRod = true;
  20366. if (ruler1.y >= h) {
  20367. ruler1.y = -h;
  20368. ruler2.y = 0;
  20369. return;
  20370. }
  20371. else if (ruler1.y <= -h) {
  20372. ruler1.y = h;
  20373. ruler2.y = 0;
  20374. return;
  20375. }
  20376. if (ruler2.y >= h) {
  20377. ruler2.y = -h;
  20378. ruler1.y = 0;
  20379. return;
  20380. }
  20381. else if (ruler2.y <= -h) {
  20382. ruler2.y = h;
  20383. ruler1.y = 0;
  20384. return;
  20385. }
  20386. break;
  20387. case PressType.d2Root:
  20388. this.eventObj.curX = e.stageX;
  20389. this.eventObj.curY = e.stageY;
  20390. let offset = this.checkRodMoveDir();
  20391. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20392. this.eventObj.lastX = e.stageX;
  20393. this.eventObj.lastY = e.stageY;
  20394. break;
  20395. default:
  20396. break;
  20397. }
  20398. }
  20399. onEventUp(e) {
  20400. if (e.stopPropagation)
  20401. e.stopPropagation();
  20402. if (e && e.force) {
  20403. }
  20404. else {
  20405. if (!this.isTurnSelf())
  20406. return;
  20407. }
  20408. switch (this.pressTarget) {
  20409. case PressType.powerNode:
  20410. this.ui.powerNode.value = 0;
  20411. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20412. this.ui.powerTxt.text = "";
  20413. if (this.powerNum > 0) {
  20414. xGame.eventMgr.event(BALL_SHOOT);
  20415. xGame.common.d2World.shoot(this.powerNum);
  20416. xGame.common.d2World.d2Gan.shoot();
  20417. xGame.common.d2World.d2HelpLine.shoot();
  20418. this.finishGuide();
  20419. this.ui.powerEft.visible = false;
  20420. this.ui.colorNode.visible = false;
  20421. let ganStr = "";
  20422. if (this.powerNum <= 30) {
  20423. ganStr = "gan_30";
  20424. }
  20425. else if (this.powerNum <= 60) {
  20426. ganStr = "gan_50";
  20427. }
  20428. else {
  20429. ganStr = "gan_80";
  20430. }
  20431. xGame.soundMgr.playSound(ganStr);
  20432. }
  20433. break;
  20434. case PressType.moveNode:
  20435. let rootBall = xGame.common.d2World.rootBall;
  20436. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20437. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20438. let isIntersect = this.judgeBallIntersect();
  20439. if (isIntersect) {
  20440. this.ui.moveNode.x = lastX;
  20441. this.ui.moveNode.y = lastY;
  20442. rootBall.gameObj.x = lastX;
  20443. rootBall.gameObj.y = lastY;
  20444. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20445. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20446. }
  20447. else {
  20448. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20449. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20450. }
  20451. this.showBallUI();
  20452. this.ui.moveNode.finger.visible = true;
  20453. xGame.common.d2World.getHelpLine();
  20454. break;
  20455. case PressType.rulerNode:
  20456. break;
  20457. case PressType.d2Root:
  20458. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20459. if (dis <= 25) {
  20460. this.moveToClickDot(e);
  20461. }
  20462. break;
  20463. default:
  20464. break;
  20465. }
  20466. this.pressTarget = -1;
  20467. }
  20468. checkGuide() {
  20469. let guide = DataMgr.getSkillGuide();
  20470. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20471. xGame.common.guideStep++;
  20472. xGame.common.gameUI.ui.guide2.visible = false;
  20473. xGame.common.gameUI.ui.guide3.visible = true;
  20474. }
  20475. }
  20476. finishGuide() {
  20477. let guide = DataMgr.getSkillGuide();
  20478. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20479. xGame.common.guideStep = 10;
  20480. this.closeAllGuide();
  20481. console.log('zh: 新手引导完毕');
  20482. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20483. }
  20484. }
  20485. closeAllGuide() {
  20486. xGame.common.gameUI.ui.guide1.visible = false;
  20487. xGame.common.gameUI.ui.guide2.visible = false;
  20488. xGame.common.gameUI.ui.guide3.visible = false;
  20489. }
  20490. updateBarInfo() {
  20491. let star = this.ui.powerNode.y;
  20492. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20493. if (rate >= 1)
  20494. rate = 1;
  20495. if (rate <= 0)
  20496. rate = 0;
  20497. this.powerNum = Math.ceil(rate * 100);
  20498. this.ui.powerNode.value = this.powerNum;
  20499. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20500. this.ui.colorNode.value = this.powerNum;
  20501. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20502. this.ui.powerEft.visible = this.powerNum != 0;
  20503. this.ui.colorNode.visible = this.powerNum != 0;
  20504. this.ui.powerTxt.text = this.powerNum + "";
  20505. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20506. }
  20507. forceCancel() {
  20508. this.ui.powerNode.value = 0;
  20509. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20510. this.ui.powerTxt.text = "";
  20511. }
  20512. checkRodMoveDir() {
  20513. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20514. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20515. if (tempX >= 0 && tempY <= 0) {
  20516. return this.checkDir();
  20517. }
  20518. else if (tempX < 0 && tempY < 0) {
  20519. return this.checkDir(1, -1);
  20520. }
  20521. else if (tempX < 0 && tempY > 0) {
  20522. return this.checkDir(-1, -1);
  20523. }
  20524. else {
  20525. return this.checkDir(-1, 1);
  20526. }
  20527. }
  20528. checkDir(flagX = 1, flagY = 1) {
  20529. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20530. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20531. if (offsetY == 0) {
  20532. return offsetX * flagX;
  20533. }
  20534. if (offsetX == 0) {
  20535. return offsetY * flagY;
  20536. }
  20537. let angle = offsetY / offsetX;
  20538. if (Math.abs(angle) >= 1) {
  20539. return offsetY * flagY;
  20540. }
  20541. else {
  20542. return offsetX * flagX;
  20543. }
  20544. }
  20545. judgeBallIntersect() {
  20546. let rootBall = xGame.common.d2World.rootBall;
  20547. let ballArr = xGame.common.d2World.ballArr;
  20548. let radius = rootBall.gameObj.width / 2;
  20549. let temp;
  20550. let isIntersect = false;
  20551. for (let index = 0; index < ballArr.length; index++) {
  20552. temp = ballArr[index];
  20553. if (temp.number == rootBall.number)
  20554. continue;
  20555. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20556. if (isIntersect) {
  20557. break;
  20558. }
  20559. }
  20560. return isIntersect;
  20561. }
  20562. hideBallUI() {
  20563. let d2Gan = xGame.common.d2World.d2Gan;
  20564. if (!d2Gan.ui.isDisposed)
  20565. d2Gan.ui.visible = false;
  20566. let d2Help = xGame.common.d2World.d2HelpLine;
  20567. if (!d2Help.ui.isDisposed)
  20568. d2Help.ui.visible = false;
  20569. let rootBall = xGame.common.d2World.rootBall;
  20570. if (!rootBall.destroyed) {
  20571. rootBall.gameObj.active = false;
  20572. }
  20573. }
  20574. showBallUI() {
  20575. let d2Gan = xGame.common.d2World.d2Gan;
  20576. if (!d2Gan.ui.isDisposed)
  20577. d2Gan.ui.visible = true;
  20578. let d2Help = xGame.common.d2World.d2HelpLine;
  20579. if (!d2Help.ui.isDisposed)
  20580. d2Help.ui.visible = true;
  20581. let rootBall = xGame.common.d2World.rootBall;
  20582. if (!rootBall.destroyed) {
  20583. rootBall.gameObj.active = true;
  20584. }
  20585. }
  20586. moveToClickDot(e) {
  20587. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20588. let root = xGame.common.d2World.rootBall.gameObj;
  20589. let xx = e.stageX - xGame.common.sysOffestNum;
  20590. let yy = e.stageY;
  20591. let x = xx - root.x;
  20592. let y = yy - root.y;
  20593. let angle = xGame.common.getfguiRotation(x, y);
  20594. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20595. xGame.common.d2World.getHelpLine();
  20596. }
  20597. this.isMoveRod = false;
  20598. xGame.common.clickedBall = false;
  20599. }
  20600. openAllEvent() {
  20601. this.closeAllEvent();
  20602. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20603. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20604. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20605. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20606. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20607. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20608. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20609. }
  20610. closeAllEvent() {
  20611. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20612. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20613. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20614. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20615. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20616. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20617. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20618. }
  20619. resetGame() {
  20620. this.closeAllEvent();
  20621. this.hideBallUI();
  20622. xGame.common.gameMgr.gamePause = true;
  20623. }
  20624. }
  20625. UIGame$1.uiName = "UIGame";
  20626. class UIAddCoin$1 extends UIBase {
  20627. constructor() {
  20628. super();
  20629. this.coinNum = 2000;
  20630. }
  20631. onConstructor() {
  20632. this.ui = ui_UIAddCoin.createInstance();
  20633. this.contentPane = this.ui;
  20634. this.isEject = false;
  20635. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20636. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20637. }
  20638. show() {
  20639. super.show();
  20640. this.ui.t0.play();
  20641. this.setGlobalFont(this.ui);
  20642. }
  20643. videoAddCoin() {
  20644. console.log('zh:qjff_AD_for_UIAddCoin');
  20645. if (Laya.Browser.onAndroid) {
  20646. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20647. if (!boo) {
  20648. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20649. return;
  20650. }
  20651. }
  20652. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20653. }
  20654. else {
  20655. console.log('zh:AD 失败,直接发放奖励');
  20656. this.qjff_AD_for_UIAddCoin();
  20657. }
  20658. }
  20659. qjff_AD_for_UIAddCoin() {
  20660. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20661. this.hide();
  20662. }
  20663. }
  20664. UIAddCoin$1.uiName = "UIAddCoin";
  20665. class UIInvitation$1 extends UIBase {
  20666. constructor() {
  20667. super();
  20668. }
  20669. onConstructor() {
  20670. this.ui = ui_UIInvitation.createInstance();
  20671. this.contentPane = this.ui;
  20672. this.isEject = false;
  20673. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20674. }
  20675. show() {
  20676. super.show();
  20677. this.setGlobalFont(this.ui);
  20678. }
  20679. enterGame() {
  20680. xGame.common.gameMode = GameMode.classic;
  20681. DataMgr.setChallengeTimes(1);
  20682. xGame.common.passAwardCoin = 2000;
  20683. let need = xGame.common.classicNiceNeddCoin;
  20684. if (DataMgr.coinEnough(need)) {
  20685. DataMgr.setCoin(-need);
  20686. xGame.eventMgr.event(RESTART_GAME, true);
  20687. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20688. }
  20689. else {
  20690. xGame.eventMgr.event(RESTART_GAME, true);
  20691. }
  20692. this.hide();
  20693. }
  20694. hide() {
  20695. super.hide();
  20696. }
  20697. }
  20698. UIInvitation$1.uiName = "UIInvitation";
  20699. class UIPower$1 extends UIBase {
  20700. constructor() {
  20701. super();
  20702. }
  20703. onConstructor() {
  20704. this.ui = ui_UIPower.createInstance();
  20705. this.contentPane = this.ui;
  20706. this.isEject = false;
  20707. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20708. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20709. }
  20710. show() {
  20711. super.show();
  20712. this.ui.t0.play();
  20713. this.setGlobalFont(this.ui);
  20714. }
  20715. videoGetPower() {
  20716. console.log('zh:qjff_AD_for_uipower');
  20717. if (Laya.Browser.onAndroid) {
  20718. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20719. if (!boo) {
  20720. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20721. return;
  20722. }
  20723. }
  20724. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20725. }
  20726. else {
  20727. console.log('zh:AD 失败,直接发放奖励');
  20728. this.qjff_AD_for_uipower();
  20729. }
  20730. }
  20731. qjff_AD_for_uipower() {
  20732. DataMgr.setPower(xGame.common.videoPower, true);
  20733. xGame.eventMgr.event(POWER_TIME);
  20734. this.hide();
  20735. }
  20736. }
  20737. UIPower$1.uiName = "UIPower";
  20738. class UIGameEnd$1 extends UIBase {
  20739. constructor() {
  20740. super();
  20741. this.success = false;
  20742. this.awardCoinNum = 1000;
  20743. this.awardDiamondNum = 10;
  20744. }
  20745. onConstructor() {
  20746. this.ui = ui_UIGameEnd.createInstance();
  20747. this.contentPane = this.ui;
  20748. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20749. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20750. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20751. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20752. this.ui.talkNode.visible = false;
  20753. if (Moyu.isKs)
  20754. this.ui.closeNode.closeBtn.x += 100;
  20755. }
  20756. updateType() {
  20757. switch (xGame.common.gameMode) {
  20758. case GameMode.classic:
  20759. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20760. this.ui.coinNode.visible = this.success;
  20761. if (!this.success) {
  20762. Laya.timer.once(500, this, () => {
  20763. xGame.uiMgr.Show(UIAddCoin$1);
  20764. });
  20765. }
  20766. else {
  20767. this.logEventForClassic_win();
  20768. }
  20769. this.logEventForClassic_complete();
  20770. this.ui.isGetAward.visible = false;
  20771. this.ui.leftBtn.c1.selectedIndex = 3;
  20772. this.ui.rightBtn.c1.selectedIndex = 0;
  20773. this.moneyNode.ui.c1.selectedIndex = 1;
  20774. break;
  20775. case GameMode.bigMove:
  20776. console.log('zh:招法模式 aaaaaa bigMove');
  20777. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20778. this.ui.coinNode.visible = this.success;
  20779. if (xGame.common.gameMode == GameMode.bigMove) {
  20780. if (this.success) {
  20781. DataMgr.setSkillSuccessTimes(1, true);
  20782. DataMgr.setSkillAccTimes(1);
  20783. }
  20784. else {
  20785. DataMgr.setSkillSuccessTimes(0, false);
  20786. }
  20787. }
  20788. this.logEventForRod_complete_N();
  20789. if (!this.success) {
  20790. Laya.timer.once(500, this, () => {
  20791. xGame.uiMgr.Show(UIAddCoin$1);
  20792. });
  20793. }
  20794. else {
  20795. this.logEventForRod_win();
  20796. }
  20797. this.ui.isGetAward.visible = false;
  20798. this.ui.leftBtn.c1.selectedIndex = 3;
  20799. this.ui.rightBtn.c1.selectedIndex = 0;
  20800. this.moneyNode.ui.c1.selectedIndex = 1;
  20801. break;
  20802. case GameMode.placeBall:
  20803. this.ui.coinNode.visible = false;
  20804. if (this.success) {
  20805. if (xGame.common.placeBallStarNum == 3) {
  20806. this.ui.c1.selectedIndex = 2;
  20807. }
  20808. else {
  20809. this.ui.c1.selectedIndex = 3;
  20810. }
  20811. let level = xGame.common.placeBallCurLevel;
  20812. if (level > 59) {
  20813. this.logEventForChallenge_level_complete(level);
  20814. }
  20815. else {
  20816. this.logEventForChallenge_level_N(level);
  20817. }
  20818. }
  20819. else {
  20820. this.ui.c1.selectedIndex = 4;
  20821. }
  20822. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20823. if (cfg.type == PlaceBallType.challenge) {
  20824. this.ui.c1.selectedIndex = 2;
  20825. }
  20826. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20827. this.updatePlaceBallBtn();
  20828. this.updatePlaceBallStarNum();
  20829. this.updatePlaceBallAwardState();
  20830. this.moneyNode.ui.c1.selectedIndex = 2;
  20831. this.moneyNode.checkPowerTime();
  20832. this.moneyNode.powerChange();
  20833. DataMgr.upRankData();
  20834. break;
  20835. default:
  20836. break;
  20837. }
  20838. }
  20839. logEventForRod_complete_N() {
  20840. let gfmsIdx = xGame.common.curPlayerSkillType;
  20841. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20842. let gfmc = 'Skyfall Shot';
  20843. if (gfmsIdx == 0) {
  20844. gfmc = 'Skyfall Shot';
  20845. }
  20846. if (gfmsIdx == 1) {
  20847. gfmc = 'Surging break';
  20848. }
  20849. if (gfmsIdx == 2) {
  20850. gfmc = 'Frost Lock';
  20851. }
  20852. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20853. console.log('zh:logEventForRod_complete_N level = ' + level);
  20854. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20855. let jsonStr = {
  20856. "count": 0,
  20857. "name": gfmc
  20858. };
  20859. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20860. const d = LocalStorageManager.getItem(keyStr);
  20861. jsonStr.count = d.count + 1;
  20862. LocalStorageManager.setItem(keyStr, jsonStr);
  20863. }
  20864. else {
  20865. LocalStorageManager.setItem(keyStr, jsonStr);
  20866. }
  20867. const d2 = LocalStorageManager.getItem(keyStr);
  20868. let count = d2.count;
  20869. console.log('zh:logEventForRod_complete_N count = ' + count);
  20870. if (count % 5 == 0) {
  20871. const reqStr = JSON.stringify(jsonStr);
  20872. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20873. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20874. }
  20875. }
  20876. logEventForRod_win() {
  20877. console.log('zh:logEventForRod_win,胜利');
  20878. let gfmsIdx = xGame.common.curPlayerSkillType;
  20879. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20880. let gfmc = 'Skyfall Shot';
  20881. if (gfmsIdx == 0) {
  20882. gfmc = 'Skyfall Shot';
  20883. }
  20884. if (gfmsIdx == 1) {
  20885. gfmc = 'Surging break';
  20886. }
  20887. if (gfmsIdx == 2) {
  20888. gfmc = 'Frost Lock';
  20889. }
  20890. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20891. console.log('zh:logEventForRod_win level = ' + level);
  20892. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20893. let jsonStr = {
  20894. "count": 1,
  20895. "name": gfmc + ' Lev' + level
  20896. };
  20897. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20898. const d = LocalStorageManager.getItem(keyStr);
  20899. jsonStr.count = d.count + 1;
  20900. LocalStorageManager.setItem(keyStr, jsonStr);
  20901. }
  20902. else {
  20903. LocalStorageManager.setItem(keyStr, jsonStr);
  20904. }
  20905. const reqStr = JSON.stringify(jsonStr);
  20906. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20907. }
  20908. logEventForClassic_win() {
  20909. console.log('zh:logEventForClassic_win,胜利');
  20910. let rtype = xGame.common.classicRoomType;
  20911. let msmc = '';
  20912. if (rtype == 1) {
  20913. msmc = 'beginner';
  20914. }
  20915. if (rtype == 2) {
  20916. msmc = 'expert';
  20917. }
  20918. if (rtype == 3) {
  20919. msmc = 'master';
  20920. }
  20921. let keyStr = 'sjmd_classic_win_' + rtype;
  20922. let jsonStr = {
  20923. "difficulty": msmc,
  20924. "classic_count": 1,
  20925. "difficulty_count": 1
  20926. };
  20927. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20928. const d = LocalStorageManager.getItem(keyStr);
  20929. jsonStr.classic_count = d.classic_count + 1;
  20930. jsonStr.difficulty_count = d.difficulty_count + 1;
  20931. LocalStorageManager.setItem(keyStr, jsonStr);
  20932. }
  20933. else {
  20934. LocalStorageManager.setItem(keyStr, jsonStr);
  20935. }
  20936. const reqStr = JSON.stringify(jsonStr);
  20937. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20938. }
  20939. logEventForClassic_complete() {
  20940. console.log('zh:logEventForClassic_complete,胜利');
  20941. let rtype = xGame.common.classicRoomType;
  20942. let msmc = '';
  20943. if (rtype == 1) {
  20944. msmc = 'beginner';
  20945. }
  20946. if (rtype == 2) {
  20947. msmc = 'expert';
  20948. }
  20949. if (rtype == 3) {
  20950. msmc = 'master';
  20951. }
  20952. let keyStr = 'sjmd_classic_complete_' + rtype;
  20953. let jsonStr = {
  20954. "msmc": msmc,
  20955. "count": 0
  20956. };
  20957. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20958. const d = LocalStorageManager.getItem(keyStr);
  20959. jsonStr.count = d.count + 1;
  20960. LocalStorageManager.setItem(keyStr, jsonStr);
  20961. }
  20962. else {
  20963. LocalStorageManager.setItem(keyStr, jsonStr);
  20964. }
  20965. if (jsonStr.count % 5 == 0) {
  20966. const reqStr = JSON.stringify(jsonStr);
  20967. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20968. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20969. }
  20970. }
  20971. updatePlaceBallBtn() {
  20972. this.ui.leftBtn.c1.selectedIndex = 5;
  20973. if (this.success) {
  20974. this.ui.rightBtn.c1.selectedIndex = 14;
  20975. }
  20976. else {
  20977. if (xGame.common.placeBallStarNum == 3) {
  20978. this.ui.rightBtn.c1.selectedIndex = 14;
  20979. }
  20980. else {
  20981. this.ui.rightBtn.c1.selectedIndex = 1;
  20982. }
  20983. }
  20984. }
  20985. updatePlaceBallStarNum() {
  20986. let starNum = xGame.common.placeBallStarNum;
  20987. if (starNum == 0)
  20988. this.ui.starNumNode.c1.selectedIndex = 3;
  20989. else {
  20990. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20991. }
  20992. }
  20993. updatePlaceBallAwardState() {
  20994. let level = xGame.common.placeBallCurLevel;
  20995. let starNum = xGame.common.placeBallStarNum;
  20996. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20997. let data = cfgTable.placeballData[level].award;
  20998. let cfg = cfgTable.placeballData[level];
  20999. this.awardDiamondNum = data[1];
  21000. this.awardCoinNum = data[0];
  21001. if (cfg.type == PlaceBallType.challenge) {
  21002. this.awardDiamondNum = 0;
  21003. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21004. }
  21005. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21006. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21007. if (cfg.type == PlaceBallType.challenge) {
  21008. this.ui.awardNode.coinNode.visible = true;
  21009. }
  21010. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21011. this.ui.awardNode.diamondNode.x = 265;
  21012. this.ui.awardNode.coinNode.x = 354;
  21013. }
  21014. else {
  21015. this.ui.awardNode.diamondNode.x = 291;
  21016. this.ui.awardNode.coinNode.x = 291;
  21017. }
  21018. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21019. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21020. if (this.awardCoinNum == 0) {
  21021. this.ui.awardNode.coinNode.numTxt.text = "";
  21022. }
  21023. if (getAward) {
  21024. this.ui.isGetAward.visible = true;
  21025. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21026. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21027. }
  21028. else {
  21029. this.ui.isGetAward.visible = false;
  21030. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21031. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21032. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21033. }
  21034. else {
  21035. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21036. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21037. }
  21038. }
  21039. }
  21040. show(success) {
  21041. super.show();
  21042. xGame.eventMgr.event(RESET_GAME);
  21043. this.success = success;
  21044. Laya.timer.clearAll(this);
  21045. this.playSecretaryAni();
  21046. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21047. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21048. offsetTime = Math.floor(offsetTime / 1000);
  21049. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21050. this.updateType();
  21051. Laya.timer.once(200, this, () => {
  21052. this.addAward(() => {
  21053. this.updateType();
  21054. Laya.timer.once(500, this, () => {
  21055. this.showChallengeLevel();
  21056. });
  21057. });
  21058. });
  21059. if (this.success) {
  21060. JSBridgeUtils.instance.showInternAd('gameend_success');
  21061. console.log('zh:game end 成功');
  21062. xGame.soundMgr.playSound('slots_roll01');
  21063. xGame.soundMgr.playSound("s_win");
  21064. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21065. this.diyGameDataUtilForGameWin();
  21066. this.updateGamePlaceBallData2Server();
  21067. }
  21068. else {
  21069. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21070. console.log('zh:game end失败');
  21071. xGame.soundMgr.playSound('matchwin01');
  21072. xGame.soundMgr.playSound("s_lose");
  21073. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21074. }
  21075. let challengeNum = DataMgr.getChallengeTimes();
  21076. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21077. DataMgr.setChallengeTimes(1);
  21078. }
  21079. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21080. DataMgr.setClassicTimes();
  21081. }
  21082. this.setGlobalFont(this.ui);
  21083. }
  21084. diyGameDataUtilForGameWin() {
  21085. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21086. switch (xGame.common.gameMode) {
  21087. case GameMode.classic:
  21088. console.log('zh:DiyGameDataUtilForGameWin 111');
  21089. case GameMode.bigMove:
  21090. console.log('zh:DiyGameDataUtilForGameWin 222');
  21091. this.restartGame();
  21092. break;
  21093. case GameMode.placeBall:
  21094. console.log('zh:DiyGameDataUtilForGameWin 333');
  21095. var level = xGame.common.placeBallCurLevel;
  21096. console.log('zh:练习模式 联系了多少LEV=' + level);
  21097. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21098. if (level > db_over_lev) {
  21099. DataMgr.setChallengeMode_overLev(level);
  21100. }
  21101. break;
  21102. default:
  21103. console.log('zh:DiyGameDataUtilForGameWin 444');
  21104. break;
  21105. }
  21106. }
  21107. updateGamePlaceBallData2Server() {
  21108. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21109. if (userInfo == null) {
  21110. return;
  21111. }
  21112. let pbdObj = DataMgr.getPlaceBallLevelList();
  21113. let reqData = xGame.httpMgr.getReqData();
  21114. let pd = JSON.parse(reqData);
  21115. pd.placeBallData = JSON.stringify(pbdObj);
  21116. reqData = JSON.stringify(pd);
  21117. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21118. try {
  21119. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21120. let code = res.code;
  21121. let msg = res.msg;
  21122. if (code == 401) {
  21123. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21124. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21125. return;
  21126. }
  21127. if (code == 200) {
  21128. let data = res.data;
  21129. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21130. }
  21131. else {
  21132. xGame.uiMgr.Show(UIMsg$1, msg);
  21133. }
  21134. }
  21135. catch (error) {
  21136. console.log('error=' + error);
  21137. alert(error);
  21138. }
  21139. finally {
  21140. }
  21141. });
  21142. }
  21143. showChallengeLevel() {
  21144. if (DataMgr.getChallengeTimes() != 0)
  21145. return;
  21146. let skill = DataMgr.getSkillAccTimes();
  21147. let put = DataMgr.getPlaceBallLevelList().length;
  21148. if (skill >= 3 || put >= 5) {
  21149. xGame.uiMgr.Show(UIInvitation$1);
  21150. this.hide();
  21151. }
  21152. }
  21153. addAward(callback) {
  21154. if (!this.success) {
  21155. callback && callback();
  21156. return;
  21157. }
  21158. switch (xGame.common.gameMode) {
  21159. case GameMode.classic:
  21160. this.awardCoinNum = xGame.common.passAwardCoin;
  21161. this.awardDiamondNum = 0;
  21162. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21163. break;
  21164. case GameMode.bigMove:
  21165. this.awardCoinNum = xGame.common.passAwardCoin;
  21166. this.awardDiamondNum = 0;
  21167. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21168. callback && callback();
  21169. break;
  21170. case GameMode.placeBall:
  21171. let level = xGame.common.placeBallCurLevel;
  21172. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21173. if (xGame.common.placeBallStarNum != 3) {
  21174. callback && callback();
  21175. return;
  21176. }
  21177. else {
  21178. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21179. if (getAward) {
  21180. callback && callback();
  21181. return;
  21182. }
  21183. }
  21184. let cfg = cfgTable.placeballData[level];
  21185. let data = cfgTable.placeballData[level].award;
  21186. this.awardCoinNum = data[0];
  21187. this.awardDiamondNum = data[1];
  21188. if (cfg.type == PlaceBallType.challenge) {
  21189. this.awardDiamondNum = 0;
  21190. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21191. }
  21192. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21193. let diamondAward;
  21194. if (this.awardDiamondNum > 0) {
  21195. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21196. xGame.common.getAward([diamondAward, coinAward], callback);
  21197. }
  21198. else {
  21199. xGame.common.getAward([coinAward], callback);
  21200. }
  21201. if (cfg.type == PlaceBallType.normal) {
  21202. DataMgr.setPlaceBallAward(level);
  21203. }
  21204. break;
  21205. default:
  21206. break;
  21207. }
  21208. }
  21209. playSecretaryAni_old() {
  21210. let parent = this.ui.secretary.displayObject;
  21211. parent.destroyChildren();
  21212. let xx = this.ui.secretary.width / 2;
  21213. let yy = this.ui.secretary.height;
  21214. let scale = xGame.common.getSecretaryScale();
  21215. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21216. if (this.success) {
  21217. let rand = Math.random() <= 0.5 ? 2 : 3;
  21218. xGame.common.secretary.play(data, rand, false, parent, () => {
  21219. xGame.common.secretary.play(data, 1, true, parent);
  21220. });
  21221. }
  21222. else {
  21223. xGame.common.secretary.play(data, 0, true, parent);
  21224. }
  21225. }
  21226. playSecretaryAni() {
  21227. let parent = this.ui.secretary.displayObject;
  21228. parent.destroyChildren();
  21229. let xx = this.ui.secretary.width / 2;
  21230. let yy = this.ui.secretary.height;
  21231. let scale = xGame.common.getSecretaryScale();
  21232. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21233. if (this.success) {
  21234. let rand = 0;
  21235. xGame.common.secretary.play(data, 0, true, parent);
  21236. }
  21237. else {
  21238. xGame.common.secretary.play(data, 0, true, parent);
  21239. }
  21240. }
  21241. restartGame() {
  21242. switch (xGame.common.gameMode) {
  21243. case GameMode.classic:
  21244. xGame.eventMgr.event(RESTART_GAME);
  21245. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21246. break;
  21247. case GameMode.bigMove:
  21248. this.hide();
  21249. xGame.eventMgr.event(RESTART_GAME);
  21250. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21251. break;
  21252. default:
  21253. break;
  21254. }
  21255. }
  21256. hide() {
  21257. super.hide();
  21258. xGame.common.stopGirlPop(this.ui.talkNode);
  21259. PlatMgr.showBanner(false);
  21260. }
  21261. returnHome() {
  21262. this.hide();
  21263. let showFailWords = !this.success;
  21264. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21265. }
  21266. clickLeftBtn() {
  21267. switch (xGame.common.gameMode) {
  21268. case GameMode.classic:
  21269. case GameMode.bigMove:
  21270. this.returnHome();
  21271. break;
  21272. case GameMode.placeBall:
  21273. let level = xGame.common.placeBallCurLevel;
  21274. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21275. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21276. break;
  21277. default:
  21278. break;
  21279. }
  21280. }
  21281. powerStartPlaceBallLevel(level, btn) {
  21282. if (DataMgr.powerEnough()) {
  21283. btn.touchable = false;
  21284. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21285. btn.touchable = true;
  21286. DataMgr.setPower(-1);
  21287. xGame.eventMgr.event(POWER_TIME);
  21288. this.startPlaceBallLevel(level);
  21289. this.logEventForChallenge_level_start(level);
  21290. }));
  21291. }
  21292. else {
  21293. xGame.uiMgr.Show(UIPower$1, 0);
  21294. }
  21295. }
  21296. clickRightBtn() {
  21297. switch (xGame.common.gameMode) {
  21298. case GameMode.classic:
  21299. console.log('zh:clickRightBtn 111');
  21300. case GameMode.bigMove:
  21301. console.log('zh:clickRightBtn 222');
  21302. this.restartGame();
  21303. break;
  21304. case GameMode.placeBall:
  21305. console.log('zh:clickRightBtn 333');
  21306. let level = xGame.common.placeBallCurLevel;
  21307. let data = DataMgr.getPlaceBallLevel(level);
  21308. let curPss = data.play && !data.isCur;
  21309. if (curPss) {
  21310. console.log('zh:clickRightBtn 333-111');
  21311. console.log('zh:当前LV=' + level);
  21312. if (level == 60) {
  21313. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21314. Laya.timer.once(3000, this, () => {
  21315. this.returnHome();
  21316. });
  21317. }
  21318. else {
  21319. let lev = level + 1;
  21320. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21321. }
  21322. }
  21323. else {
  21324. console.log('zh:clickRightBtn 333-000');
  21325. Moyu.sendDataEvent("placeBallNextLevel");
  21326. console.log('zh:qjff_AD_for_uiGameEnd');
  21327. if (Laya.Browser.onAndroid) {
  21328. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21329. if (!boo) {
  21330. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21331. return;
  21332. }
  21333. }
  21334. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21335. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21336. }
  21337. else {
  21338. console.log('zh:AD 失败,直接发放奖励');
  21339. this.qjff_AD_for_uiGameEnd(level);
  21340. }
  21341. }
  21342. break;
  21343. default:
  21344. console.log('zh:clickRightBtn 444');
  21345. break;
  21346. }
  21347. }
  21348. logEventForChallenge_level_start(level) {
  21349. let keyStr = 'sjmd_challenge_level_start';
  21350. let jsonStr = {
  21351. "count": 0,
  21352. "gold_balance ": DataMgr.getCoin(),
  21353. "level": level,
  21354. "diamond_balance ": DataMgr.getDiamond()
  21355. };
  21356. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21357. const d = LocalStorageManager.getItem(keyStr);
  21358. if (level > d.level) {
  21359. jsonStr.count = d.count + 1;
  21360. LocalStorageManager.setItem(keyStr, jsonStr);
  21361. }
  21362. else {
  21363. }
  21364. }
  21365. else {
  21366. LocalStorageManager.setItem(keyStr, jsonStr);
  21367. }
  21368. const reqStr = JSON.stringify(jsonStr);
  21369. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21370. }
  21371. qjff_AD_for_uiGameEnd(level) {
  21372. DataMgr.setPlaceBallLevel(level, 1);
  21373. this.startPlaceBallLevel(level + 1);
  21374. }
  21375. startPlaceBallLevel(level) {
  21376. xGame.common.gameMode = GameMode.placeBall;
  21377. xGame.common.placeBallCurLevel = level;
  21378. xGame.uiMgr.Show(UIGame$1);
  21379. this.hide();
  21380. }
  21381. logEventForChallenge_level_complete(level) {
  21382. let keyStr = 'sjmd_challenge_level_complete';
  21383. let jsonStr = {
  21384. "count": 1,
  21385. "gold_balance ": DataMgr.getCoin(),
  21386. "level": level,
  21387. "diamond_balance ": DataMgr.getDiamond()
  21388. };
  21389. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21390. const d = LocalStorageManager.getItem(keyStr);
  21391. jsonStr.count = d.count + 1;
  21392. LocalStorageManager.setItem(keyStr, jsonStr);
  21393. }
  21394. else {
  21395. LocalStorageManager.setItem(keyStr, jsonStr);
  21396. }
  21397. const reqStr = JSON.stringify(jsonStr);
  21398. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21399. }
  21400. logEventForChallenge_level_N(level) {
  21401. console.log('zh:logEventForChallenge_level_N ' + level);
  21402. let keyStr = 'sjmd_challenge_level_N';
  21403. if (LocalStorageManager.hasKey(keyStr)) {
  21404. let lev = LocalStorageManager.getItem(keyStr);
  21405. if (level > lev) {
  21406. LocalStorageManager.setItem(keyStr, level);
  21407. }
  21408. if ((level) % 5 == 0) {
  21409. console.log('zh:每5关上报1次');
  21410. let sjmc = 'challenge_level_' + level;
  21411. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21412. let sjmcForFirebase = 'challenge_level_' + level;
  21413. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21414. }
  21415. else {
  21416. console.log('zh:5 no 上报');
  21417. }
  21418. }
  21419. else {
  21420. LocalStorageManager.setItem(keyStr, level);
  21421. }
  21422. }
  21423. }
  21424. UIGameEnd$1.uiName = "UIGameEnd";
  21425. class ShowItem$1 {
  21426. constructor() {
  21427. this.ui = ui_ShowItem.createInstance();
  21428. }
  21429. destroySelf() {
  21430. if (!this.ui.isDisposed) {
  21431. this.ui.removeFromParent();
  21432. this.ui.dispose();
  21433. }
  21434. }
  21435. setParent(parent) {
  21436. parent.addChild(this.ui);
  21437. }
  21438. setPos(x, y) {
  21439. this.ui.x = x;
  21440. this.ui.y = y;
  21441. }
  21442. setUrl(index) {
  21443. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21444. }
  21445. }
  21446. class UILevelProp$1 extends UIBase {
  21447. constructor() {
  21448. super();
  21449. this.firstPos = 385;
  21450. this.secondPos = 467;
  21451. this.showItemArr = [];
  21452. }
  21453. onConstructor() {
  21454. this.ui = ui_UILevelProp.createInstance();
  21455. this.contentPane = this.ui;
  21456. this.isEject = false;
  21457. this.addUIClick(this.ui.closeBtn, this.hide);
  21458. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21459. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21460. }
  21461. show(level) {
  21462. super.show();
  21463. this.ui.t1.play();
  21464. this.level = level;
  21465. this.data = cfgTable.placeballData[this.level];
  21466. this.updateSelf();
  21467. this.showPreView();
  21468. this.moneyNode.ui.c1.selectedIndex = 2;
  21469. this.moneyNode.checkPowerTime();
  21470. this.moneyNode.powerChange();
  21471. this.setGlobalFont(this.ui);
  21472. }
  21473. showPreView() {
  21474. let item;
  21475. let data;
  21476. for (let index = 0; index < this.showItemArr.length; index++) {
  21477. item = this.showItemArr[index];
  21478. item.destroySelf();
  21479. }
  21480. this.showItemArr = [];
  21481. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21482. for (const key in cfgData) {
  21483. data = cfgData[key];
  21484. item = new ShowItem$1();
  21485. item.setParent(this.ui.myNode.displayRoot);
  21486. item.setPos(data.x, data.y);
  21487. item.setUrl(data.value);
  21488. this.showItemArr.push(item);
  21489. }
  21490. }
  21491. updateSelf() {
  21492. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21493. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21494. if (this.data.ball == -1) {
  21495. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21496. }
  21497. else {
  21498. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21499. }
  21500. let localData = DataMgr.getPlaceBallLevel(this.level);
  21501. let getAward = localData.getAward;
  21502. let cfg = cfgTable.placeballData[this.level];
  21503. let coin = this.data.award[0];
  21504. let diamond = this.data.award[1];
  21505. if (cfg.type == PlaceBallType.challenge) {
  21506. diamond = 0;
  21507. coin = 100;
  21508. }
  21509. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21510. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21511. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21512. if (cfg.type == PlaceBallType.challenge) {
  21513. this.ui.myNode.coinNode.numTxt.text = "";
  21514. }
  21515. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21516. if (coin > 0 && diamond > 0) {
  21517. this.ui.myNode.diamondNode.x = 385;
  21518. this.ui.myNode.coinNode.x = 467;
  21519. }
  21520. else {
  21521. this.ui.myNode.diamondNode.x = 385;
  21522. this.ui.myNode.coinNode.x = 385;
  21523. }
  21524. if (!getAward) {
  21525. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21526. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21527. }
  21528. else {
  21529. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21530. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21531. }
  21532. }
  21533. startGame() {
  21534. if (DataMgr.powerEnough()) {
  21535. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21536. this.ui.myNode.startBtn.touchable = false;
  21537. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21538. console.log('zh:startGame ');
  21539. this.ui.myNode.startBtn.touchable = true;
  21540. DataMgr.setPower(-1);
  21541. xGame.eventMgr.event(POWER_TIME);
  21542. xGame.common.gameMode = GameMode.placeBall;
  21543. xGame.common.placeBallCurLevel = this.level;
  21544. xGame.uiMgr.Show(UIGame$1);
  21545. this.logEventForChallenge_level_start(this.level);
  21546. xGame.uiMgr.Hide(UILevelDisplay$1);
  21547. xGame.uiMgr.Hide(UIMain$1);
  21548. this.hide();
  21549. }));
  21550. }
  21551. else {
  21552. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21553. xGame.uiMgr.Show(UIPower$1);
  21554. }
  21555. }
  21556. logEventForChallenge_level_start(level) {
  21557. let keyStr = 'sjmd_challenge_level_start';
  21558. let jsonStr = {
  21559. "count": 1,
  21560. "gold_balance ": DataMgr.getCoin(),
  21561. "level": level,
  21562. "diamond_balance ": DataMgr.getDiamond()
  21563. };
  21564. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21565. const d = LocalStorageManager.getItem(keyStr);
  21566. if (level > d.level) {
  21567. jsonStr.count = d.count + 1;
  21568. LocalStorageManager.setItem(keyStr, jsonStr);
  21569. }
  21570. else {
  21571. }
  21572. }
  21573. else {
  21574. LocalStorageManager.setItem(keyStr, jsonStr);
  21575. }
  21576. const reqStr = JSON.stringify(jsonStr);
  21577. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21578. }
  21579. hide() {
  21580. super.hide();
  21581. }
  21582. }
  21583. UILevelProp$1.uiName = "UILevelProp";
  21584. class PutBallLevelDisplay$1 {
  21585. constructor(ui, index) {
  21586. this.index = 0;
  21587. this.ui = ui;
  21588. this.index = index;
  21589. this.ui.onClick(this, this.clickSelf);
  21590. this.updateSelf();
  21591. this.ui.levelTxt.text = (this.index + 1) + "";
  21592. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21593. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21594. }
  21595. updateSelf() {
  21596. let level = this.index + 1;
  21597. this.data = DataMgr.getPlaceBallLevel(level);
  21598. this.ui.starNode.c1.selectedIndex = this.data.star;
  21599. let isChallenge = cfgTable.placeballData[level].type;
  21600. if (this.data.isCur) {
  21601. if (isChallenge) {
  21602. this.ui.c1.selectedIndex = 5;
  21603. }
  21604. else {
  21605. this.ui.c1.selectedIndex = 2;
  21606. }
  21607. }
  21608. else {
  21609. if (this.data.play) {
  21610. if (this.data.star == 3) {
  21611. this.ui.c1.selectedIndex = 0;
  21612. }
  21613. else {
  21614. this.ui.c1.selectedIndex = 1;
  21615. }
  21616. }
  21617. else {
  21618. if (isChallenge) {
  21619. this.ui.c1.selectedIndex = 4;
  21620. }
  21621. else {
  21622. this.ui.c1.selectedIndex = 3;
  21623. }
  21624. }
  21625. }
  21626. }
  21627. clickSelf() {
  21628. if (!this.data.play)
  21629. return;
  21630. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21631. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21632. }
  21633. }
  21634. class UILevelDisplay$1 extends UIBase {
  21635. constructor() {
  21636. super();
  21637. }
  21638. onConstructor() {
  21639. this.ui = ui_UILevelDisplay.createInstance();
  21640. this.contentPane = this.ui;
  21641. this.isEject = false;
  21642. this.myList = this.ui.myNode.myList;
  21643. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21644. this.levelItemArr = [];
  21645. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21646. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21647. this.myList.numItems = levelNum;
  21648. }
  21649. levelItemRender(index, target) {
  21650. let item = new PutBallLevelDisplay$1(target, index);
  21651. this.levelItemArr.push(item);
  21652. }
  21653. show() {
  21654. super.show();
  21655. this.updateLevel();
  21656. this.scrollToPlace();
  21657. this.setGlobalFont(this.ui);
  21658. }
  21659. updateLevel() {
  21660. let temp;
  21661. for (let index = 0; index < this.levelItemArr.length; index++) {
  21662. temp = this.levelItemArr[index];
  21663. temp.updateSelf();
  21664. }
  21665. }
  21666. scrollToPlace() {
  21667. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21668. let passArr = DataMgr.getPlaceBallLevelList();
  21669. let offest = passArr.length;
  21670. if (offest >= maxNum - 1)
  21671. offest = maxNum - 1;
  21672. this.myList.scrollToView(offest, true, true);
  21673. }
  21674. hide() {
  21675. super.hide();
  21676. }
  21677. }
  21678. UILevelDisplay$1.uiName = "UILevelDisplay";
  21679. class UIMatching$1 extends UIBase {
  21680. constructor() {
  21681. super();
  21682. }
  21683. onConstructor() {
  21684. this.ui = ui_UIMatching.createInstance();
  21685. this.contentPane = this.ui;
  21686. this.isEject = false;
  21687. }
  21688. show(callback) {
  21689. super.show();
  21690. PlatMgr.showBanner(true);
  21691. this.callback = callback;
  21692. let user = Moyu.getUserInfo();
  21693. if (!this.selfPot) {
  21694. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21695. }
  21696. if (!this.aiPot) {
  21697. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21698. }
  21699. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21700. this.ui.selfHead.nameTxt.text = user.nickName;
  21701. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21702. this.ui.aiHead.nameTxt.text = "???";
  21703. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21704. this.ui.selfHead.c1.selectedIndex = 0;
  21705. this.ui.aiHead.c1.selectedIndex = 0;
  21706. this.ui.selfHead.x = this.selfPot.x;
  21707. this.ui.selfHead.y = this.selfPot.y;
  21708. this.ui.aiHead.x = this.aiPot.x;
  21709. this.ui.aiHead.y = this.aiPot.y;
  21710. switch (xGame.common.gameMode) {
  21711. case GameMode.classic:
  21712. break;
  21713. case GameMode.bigMove:
  21714. this.initSkillData();
  21715. break;
  21716. default:
  21717. break;
  21718. }
  21719. this.ui.t1.play(Laya.Handler.create(this, () => {
  21720. this.ui.t2.play(Laya.Handler.create(this, () => {
  21721. switch (xGame.common.gameMode) {
  21722. case GameMode.classic:
  21723. this.waitingPeople();
  21724. break;
  21725. case GameMode.bigMove:
  21726. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21727. break;
  21728. default:
  21729. break;
  21730. }
  21731. }));
  21732. }));
  21733. this.setGlobalFont(this.ui);
  21734. }
  21735. initSkillData() {
  21736. this.skillSelectData = [];
  21737. let skillUrl = xGame.common.skillIconList;
  21738. let skillName = xGame.common.skillNameList;
  21739. let skillLevel = DataMgr.getBigSkillList();
  21740. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21741. for (let index = 0; index < 5; index++) {
  21742. let obj = {};
  21743. obj.skillImg = skillUrl[index];
  21744. obj.skillName = skillName[index];
  21745. obj.skillType = skillType[index];
  21746. obj.skillLevel = skillLevel[index];
  21747. this.skillSelectData.push(obj);
  21748. }
  21749. }
  21750. getAISkillLevel(myLevel) {
  21751. let video = xGame.common.upSkillLevel;
  21752. let aiLevel;
  21753. let temp;
  21754. if (video) {
  21755. temp = xGame.common.randomNum(-2, -1);
  21756. }
  21757. else {
  21758. if (myLevel <= 5) {
  21759. temp = xGame.common.randomNum(1, 3);
  21760. }
  21761. else if (myLevel <= 9) {
  21762. temp = xGame.common.randomNum(-2, 1);
  21763. }
  21764. else {
  21765. temp = xGame.common.randomNum(-4, 0);
  21766. }
  21767. }
  21768. aiLevel = temp + myLevel;
  21769. if (aiLevel <= 1)
  21770. aiLevel = 1;
  21771. if (aiLevel >= 10)
  21772. aiLevel = 10;
  21773. return aiLevel;
  21774. }
  21775. getAISkillType() {
  21776. return xGame.common.randomNum(1, 4);
  21777. let successTimes = DataMgr.getSkillSuccessTimes();
  21778. let info = cfgTable.aiskillData[successTimes];
  21779. if (!info) {
  21780. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21781. info = cfgTable.aiskillData[max];
  21782. }
  21783. let dataArr = info.skillselect;
  21784. let myCfg = {};
  21785. for (let index = 0; index < dataArr.length; index++) {
  21786. let temp = dataArr[index].split('-');
  21787. myCfg[temp[0]] = {};
  21788. myCfg[temp[0]].id = parseInt(temp[0]);
  21789. myCfg[temp[0]].weight = parseInt(temp[1]);
  21790. }
  21791. let aiCfg = xGame.common.initWeight(myCfg);
  21792. let curData = xGame.common.getRandomWeightData(aiCfg);
  21793. return parseInt(curData.id);
  21794. }
  21795. getAISkillData(index) {
  21796. let myLevel = this.skillSelectData[index].skillLevel;
  21797. let aiLevel = this.getAISkillLevel(myLevel);
  21798. let aiType = this.getAISkillType() - 1;
  21799. return { aiLevel, aiType } = { aiLevel, aiType };
  21800. }
  21801. skillSelectFinish(index) {
  21802. let aiInfo = this.getAISkillData(index);
  21803. xGame.common.gameMgr.selfCurSkill = index;
  21804. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21805. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21806. this.ui.selfHead.c1.selectedIndex = 1;
  21807. this.ui.aiHead.c1.selectedIndex = 1;
  21808. let myData = this.skillSelectData[index];
  21809. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21810. let guide = DataMgr.getSkillGuide();
  21811. if (guide == 0) {
  21812. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21813. }
  21814. else {
  21815. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21816. }
  21817. let aiData = this.skillSelectData[aiInfo.aiType];
  21818. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21819. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21820. this.waitingPeople();
  21821. }
  21822. waitingPeople() {
  21823. let time = xGame.common.randomNum(1000, 3000);
  21824. time += 1000;
  21825. Laya.timer.once(time, this, () => {
  21826. this.matchingSuccess();
  21827. });
  21828. }
  21829. matchingSuccess() {
  21830. let gameUI = xGame.common.gameUI;
  21831. let name = gameUI.ui.topNode.aiNameTxt.text;
  21832. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21833. this.ui.aiHead.nameTxt.text = name;
  21834. this.ui.aiHead.headImg.url = url;
  21835. name = gameUI.ui.topNode.selfNameTxt.text;
  21836. url = gameUI.ui.topNode.selfHeadLoader.url;
  21837. this.ui.selfHead.nameTxt.text = name;
  21838. this.ui.selfHead.headImg.url = url;
  21839. this.ui.t3.play(Laya.Handler.create(this, () => {
  21840. this.callback && this.callback();
  21841. this.ui.t4.play(Laya.Handler.create(this, () => {
  21842. this.destroySelf();
  21843. }));
  21844. }));
  21845. }
  21846. destroySelf() {
  21847. this.callback = null;
  21848. this.skillSelectData = null;
  21849. this.selfPot = null;
  21850. this.aiPot = null;
  21851. if (!this.ui.isDisposed) {
  21852. this.ui.removeFromParent();
  21853. this.ui.dispose();
  21854. }
  21855. xGame.uiMgr.destroyUI(this);
  21856. }
  21857. }
  21858. UIMatching$1.uiName = "UIMatching";
  21859. class SkillDisplay$1 {
  21860. constructor(ui, data, uiIndex) {
  21861. this.starX = 0;
  21862. this.starY = 0;
  21863. this.index = 0;
  21864. this.ui = ui;
  21865. this.data = data;
  21866. this.index = uiIndex;
  21867. this.initSelf();
  21868. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21869. }
  21870. initSelf() {
  21871. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21872. this.ui.nameTxt.text = this.data.name;
  21873. this.ui.describeTxt.text = this.data.describe;
  21874. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21875. this.ui.startBtn.onClick(this, this.startGame);
  21876. this.updateSelf();
  21877. }
  21878. updateSelf() {
  21879. this.checkTry();
  21880. let level = DataMgr.getBigSkillByIndex(this.index);
  21881. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21882. }
  21883. checkTry() {
  21884. let index = this.index;
  21885. let level = DataMgr.getBigSkillByIndex(index);
  21886. if (level == null) {
  21887. DataMgr.setBigSkill(index, 1, false);
  21888. level = 1;
  21889. }
  21890. this.ui.levelTxt.text = "LV." + level;
  21891. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21892. this.ui.tryNode.visible = true;
  21893. else
  21894. this.ui.tryNode.visible = false;
  21895. }
  21896. clickAddLevel() {
  21897. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21898. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21899. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21900. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21901. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21902. }
  21903. else {
  21904. console.log('zh:AD 失败,直接发放奖励');
  21905. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21906. }
  21907. }
  21908. qjff_AD_for_skilldisplay_clickAddLevel() {
  21909. DataMgr.setBigSkill(this.data.index, 1);
  21910. this.updateSelf();
  21911. xGame.common.upSkillLevel = true;
  21912. }
  21913. startGame() {
  21914. console.log('zh:rod skill startgame');
  21915. if (this.data.index == 3) {
  21916. alert('Coming soon!');
  21917. return;
  21918. }
  21919. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21920. let needCoin = xGame.common.bigMoveNeedCoin;
  21921. xGame.common.passAwardCoin = 2000;
  21922. let guide = DataMgr.getSkillGuide();
  21923. console.log('zh:startGame guide=' + guide);
  21924. xGame.common.temSelfLevel = 0;
  21925. if (guide == 0) {
  21926. needCoin = 0;
  21927. xGame.common.temSelfLevel = 100;
  21928. }
  21929. if (DataMgr.coinEnough(needCoin)) {
  21930. DataMgr.setCoin(-needCoin);
  21931. xGame.common.curPlayerSkillType = this.index;
  21932. if (guide == 0)
  21933. xGame.common.curPlayerSkillType = 0;
  21934. console.log('zh: skilldisplay 1');
  21935. xGame.uiMgr.Show(UIGame$1);
  21936. xGame.uiMgr.Hide(UIMain$1);
  21937. xGame.uiMgr.Show(UIMatching$1, () => {
  21938. xGame.common.gameUI.ui.alpha = 1;
  21939. xGame.common.gameUI.startGame();
  21940. xGame.uiMgr.Hide(UISkill$1);
  21941. });
  21942. this.logEventForRod_start();
  21943. }
  21944. else {
  21945. console.log('zh: skilldisplay 2');
  21946. xGame.uiMgr.Show(UIAddProp$1, 0);
  21947. Moyu.sendDataEvent("AddCoinVideo");
  21948. }
  21949. }
  21950. logEventForRod_start() {
  21951. let gfmsIdx = xGame.common.curPlayerSkillType;
  21952. console.log('zh:选择的技能=' + gfmsIdx);
  21953. let gfmc = 'Skyfall Shot';
  21954. if (gfmsIdx == 0) {
  21955. gfmc = 'Skyfall Shot';
  21956. }
  21957. if (gfmsIdx == 1) {
  21958. gfmc = 'Surging break';
  21959. }
  21960. if (gfmsIdx == 2) {
  21961. gfmc = 'Frost Lock';
  21962. }
  21963. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21964. let jsonStr = {
  21965. "count": 0,
  21966. "name": gfmc
  21967. };
  21968. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21969. const d = LocalStorageManager.getItem(keyStr);
  21970. jsonStr.count = d.count + 1;
  21971. LocalStorageManager.setItem(keyStr, jsonStr);
  21972. }
  21973. else {
  21974. LocalStorageManager.setItem(keyStr, jsonStr);
  21975. }
  21976. const reqStr = JSON.stringify(jsonStr);
  21977. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21978. }
  21979. }
  21980. class UISkill$1 extends UIBase {
  21981. constructor() {
  21982. super();
  21983. this.skillData = [];
  21984. }
  21985. onConstructor() {
  21986. this.ui = ui_UISkill.createInstance();
  21987. this.contentPane = this.ui;
  21988. this.isEject = false;
  21989. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21990. this.initSkillData();
  21991. console.log('zh:aaaaaa1111111111');
  21992. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21993. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21994. console.log('zh:aaaaaa22222222');
  21995. this.displayList = [];
  21996. this.ui.skillNode.skillList.numItems = 3;
  21997. this.addUIClick(this.ui, this.interuptSecretary);
  21998. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21999. this.ui.talkNode.visible = false;
  22000. if (Moyu.isKs)
  22001. this.ui.closeNode.closeBtn.x += 100;
  22002. }
  22003. show() {
  22004. super.show();
  22005. this.playSecretaryIdle();
  22006. this.moneyNode.ui.c1.selectedIndex = 1;
  22007. Laya.timer.clearAll(this);
  22008. xGame.soundMgr.playSound("s_start");
  22009. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22010. let guide = DataMgr.getSkillGuide();
  22011. this.ui.guideNode.visible = guide == 0;
  22012. let item = this.getSkillItemByUIIndex(0);
  22013. if (guide == 0) {
  22014. item.ui.c1.selectedIndex = 1;
  22015. }
  22016. else {
  22017. item.ui.c1.selectedIndex = 0;
  22018. }
  22019. this.ui.guideNode.guideBtn.visible = guide == 0;
  22020. for (let index = 0; index < this.displayList.length; index++) {
  22021. this.displayList[index].checkTry();
  22022. }
  22023. this.setGlobalFont(this.ui);
  22024. }
  22025. getSkillItemByUIIndex(cur) {
  22026. for (let index = 0; index < this.displayList.length; index++) {
  22027. if (this.displayList[index].index == cur) {
  22028. return this.displayList[index];
  22029. }
  22030. }
  22031. }
  22032. enterGuideLevel() {
  22033. let item = this.getSkillItemByUIIndex(0);
  22034. item.startGame();
  22035. if (DataMgr.getNewUser())
  22036. Moyu.sendDataEvent("gameStart1");
  22037. }
  22038. initSkillData() {
  22039. this.skillData = [];
  22040. let nameList = xGame.common.skillNameList;
  22041. let iconList = xGame.common.skillIconList;
  22042. let describeList = [
  22043. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22044. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22045. "The power of frost descends—freezing the flow and taking full control of the game!"
  22046. ];
  22047. console.log('zh:initSkillData 111111111');
  22048. let data;
  22049. for (let index = 0; index < nameList.length; index++) {
  22050. data = {};
  22051. data.name = nameList[index];
  22052. data.icon = iconList[index];
  22053. data.describe = describeList[index];
  22054. data.index = index;
  22055. this.skillData.push(data);
  22056. }
  22057. }
  22058. updateSkillItem(index, target) {
  22059. if (this.displayList[index] == null) {
  22060. let uiIndex;
  22061. switch (index) {
  22062. case 0:
  22063. uiIndex = 1;
  22064. break;
  22065. case 1:
  22066. uiIndex = 0;
  22067. break;
  22068. case 2:
  22069. uiIndex = 2;
  22070. break;
  22071. case 3:
  22072. uiIndex = 3;
  22073. break;
  22074. default:
  22075. break;
  22076. }
  22077. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22078. this.displayList.push(temp);
  22079. }
  22080. }
  22081. playSecretaryIdle() {
  22082. let parent = this.ui.secretary.displayObject;
  22083. parent.destroyChildren();
  22084. let xx = this.ui.secretary.width / 2;
  22085. let yy = this.ui.secretary.height;
  22086. let scale = xGame.common.getSecretaryScale();
  22087. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22088. xGame.common.secretary.play(data, 0, true, parent);
  22089. }
  22090. returnUIMain() {
  22091. this.hide();
  22092. xGame.common.stopGirlPop(this.ui.talkNode);
  22093. xGame.uiMgr.Show(UIMain$1);
  22094. }
  22095. interuptSecretary() {
  22096. Laya.timer.clearAll(this);
  22097. this.playSecretaryRandomSound();
  22098. }
  22099. playSecretaryRandomSound() {
  22100. if (this.isHide)
  22101. return;
  22102. let time = xGame.common.randomNum(45000, 60000);
  22103. Laya.timer.once(time, this, () => {
  22104. if (this.isHide)
  22105. return;
  22106. let index = xGame.common.randomNum(4, 7);
  22107. xGame.soundMgr.playSound("s_main0" + index);
  22108. let words = 1;
  22109. switch (index) {
  22110. case 4:
  22111. words = 5;
  22112. break;
  22113. case 5:
  22114. words = 3;
  22115. break;
  22116. case 6:
  22117. words = 6;
  22118. break;
  22119. case 7:
  22120. words = 7;
  22121. break;
  22122. default:
  22123. break;
  22124. }
  22125. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22126. this.playSecretaryRandomSound();
  22127. });
  22128. }
  22129. }
  22130. UISkill$1.uiName = "UISkill";
  22131. class UIAddProp$1 extends UIBase {
  22132. constructor() {
  22133. super();
  22134. this.curType = "";
  22135. }
  22136. onConstructor() {
  22137. this.ui = ui_UIAddProp.createInstance();
  22138. this.contentPane = this.ui;
  22139. this.isEject = false;
  22140. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22141. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22142. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22143. this.updateUI();
  22144. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22145. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22146. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22147. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22148. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22149. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22150. }
  22151. show(type) {
  22152. super.show();
  22153. this.curType = type == 0 ? "coin" : "diamond";
  22154. this.switchBtn("");
  22155. this.ui.t0.play();
  22156. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22157. PlatMgr.showInsert(true);
  22158. this.setGlobalFont(this.ui);
  22159. }
  22160. closeSelf() {
  22161. this.hide();
  22162. }
  22163. updateUI() {
  22164. let data = cfgTable.moneyData;
  22165. let temp;
  22166. let obj;
  22167. for (const key in data) {
  22168. temp = data[key];
  22169. obj = this.ui.myNode["node" + key];
  22170. if (parseInt(key) <= 2) {
  22171. obj.diamondTxt.text = "+" + temp.num;
  22172. }
  22173. else {
  22174. obj.coinTxt.text = temp.num;
  22175. obj.diamondTxt.text = temp.get.split('_')[1];
  22176. }
  22177. }
  22178. this.updateDiamondShare();
  22179. }
  22180. updateDiamondShare() {
  22181. let data = DataMgr.getShareDiamondTimes();
  22182. if (data >= xGame.common.maxShareDiamondTimes) {
  22183. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22184. this.ui.myNode.node1.touchable = false;
  22185. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22186. }
  22187. else {
  22188. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22189. this.ui.myNode.node1.touchable = true;
  22190. }
  22191. }
  22192. switchBtn(type) {
  22193. if (type == "")
  22194. type = this.curType;
  22195. else {
  22196. if (this.curType == type) {
  22197. return;
  22198. }
  22199. else {
  22200. this.curType = type;
  22201. }
  22202. }
  22203. if (type == "coin") {
  22204. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22205. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22206. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22207. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22208. this.ui.myNode.c1.selectedIndex = 0;
  22209. }
  22210. else {
  22211. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22212. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22213. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22214. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22215. this.ui.myNode.c1.selectedIndex = 1;
  22216. }
  22217. }
  22218. convertCoin(index) {
  22219. let data = cfgTable.moneyData[index];
  22220. let coinNum = data.num;
  22221. let str = data.get.split('_')[1];
  22222. let needDiamond = parseInt(str);
  22223. if (DataMgr.diamondEnough(needDiamond)) {
  22224. DataMgr.setDiamond(-needDiamond);
  22225. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22226. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22227. }
  22228. else {
  22229. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22230. this.switchBtn("diamond");
  22231. }
  22232. }
  22233. videoGetDiamond() {
  22234. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22235. if (Laya.Browser.onAndroid) {
  22236. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22237. if (!boo) {
  22238. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22239. return;
  22240. }
  22241. }
  22242. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22243. }
  22244. else {
  22245. console.log('zh:AD 失败,直接发放奖励');
  22246. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22247. }
  22248. }
  22249. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22250. let num = cfgTable.moneyData[2].num;
  22251. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22252. this.closeSelf();
  22253. }
  22254. videoGetCoin() {
  22255. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22256. if (Laya.Browser.onAndroid) {
  22257. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22258. if (!boo) {
  22259. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22260. return;
  22261. }
  22262. }
  22263. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22264. }
  22265. else {
  22266. console.log('zh:AD 失败,直接发放奖励');
  22267. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22268. }
  22269. }
  22270. qjff_AD_for_uiAddProp_videoGetCoin() {
  22271. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22272. this.closeSelf();
  22273. }
  22274. shareGetDiamond() {
  22275. let times = DataMgr.getShareDiamondTimes();
  22276. if (times >= xGame.common.maxShareDiamondTimes) {
  22277. console.log('zh: 233333333333 maxShareDiamondTimes');
  22278. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22279. }
  22280. else {
  22281. console.log('zh:33333333333333ad');
  22282. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22283. if (Laya.Browser.onAndroid) {
  22284. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22285. if (!boo) {
  22286. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22287. return;
  22288. }
  22289. }
  22290. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22291. }
  22292. else {
  22293. console.log('zh:AD 失败,直接发放奖励');
  22294. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22295. }
  22296. }
  22297. }
  22298. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22299. let diamond = xGame.common.randomNum(50, 100);
  22300. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22301. DataMgr.setShareDiamondTimes(1);
  22302. this.updateDiamondShare();
  22303. }
  22304. openPutBallView() {
  22305. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22306. let skill = xGame.uiMgr.getUI(UISkill$1);
  22307. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22308. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22309. if (end && !end.isHide) {
  22310. xGame.uiMgr.Hide(UIGameEnd$1);
  22311. xGame.uiMgr.Show(UIMain$1);
  22312. }
  22313. if (skill && !skill.isHide)
  22314. xGame.uiMgr.Hide(UISkill$1);
  22315. if (uigame && !uigame.isHide)
  22316. xGame.uiMgr.Hide(UIGame$1);
  22317. if (level && !level.isHide) {
  22318. }
  22319. else {
  22320. xGame.uiMgr.Show(UILevelDisplay$1);
  22321. }
  22322. this.closeSelf();
  22323. }
  22324. }
  22325. UIAddProp$1.uiName = "UIAddProp";
  22326. class MoneyNode$1 {
  22327. constructor(ui) {
  22328. this.leftTime = 0;
  22329. this.ui = ui;
  22330. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22331. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22332. this.ui.addPowerBtn.onClick(this, this.addPower);
  22333. this.ui.c1.selectedIndex = 1;
  22334. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22335. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22336. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22337. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22338. this.coinChange();
  22339. this.diamondChange();
  22340. this.powerChange();
  22341. }
  22342. addPower() {
  22343. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22344. xGame.uiMgr.Show(UIPower$1);
  22345. }
  22346. powerChange() {
  22347. let powerNum = DataMgr.getPower();
  22348. this.ui.powerTxt.text = powerNum + "";
  22349. }
  22350. checkPowerTime() {
  22351. let cur = new Date().getTime();
  22352. let last = DataMgr.getPowerTime();
  22353. if (last == 0) {
  22354. last = cur;
  22355. DataMgr.setPowerTime(cur);
  22356. }
  22357. let power = DataMgr.getPower();
  22358. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22359. Laya.timer.clearAll(this);
  22360. if (power >= xGame.common.natureMaxPower) {
  22361. this.ui.powerTimeTxt.text = "";
  22362. DataMgr.setPowerTime(cur);
  22363. return;
  22364. }
  22365. if (power + offset >= xGame.common.natureMaxPower) {
  22366. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22367. this.ui.powerTimeTxt.text = "";
  22368. DataMgr.setPowerTime(cur);
  22369. }
  22370. else {
  22371. if (offset > 0) {
  22372. DataMgr.setPower(offset);
  22373. DataMgr.setPowerTime(cur);
  22374. }
  22375. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22376. this.leftTime = xGame.common.powerRecoverNum - time;
  22377. if (this.leftTime <= 0)
  22378. this.leftTime = 0;
  22379. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22380. Laya.timer.loop(1000, this, this.updatePowerTime);
  22381. }
  22382. }
  22383. updatePowerTime() {
  22384. this.leftTime -= 1;
  22385. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22386. if (this.leftTime <= 0) {
  22387. this.checkPowerTime();
  22388. }
  22389. }
  22390. coinChange() {
  22391. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22392. }
  22393. diamondChange() {
  22394. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22395. }
  22396. addCoin() {
  22397. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22398. Moyu.sendDataEvent("AddCoinBtn");
  22399. xGame.uiMgr.Show(UIAddProp$1, 0);
  22400. }
  22401. addDiamond() {
  22402. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22403. Moyu.sendDataEvent("AddDiamondBtn");
  22404. xGame.uiMgr.Show(UIAddProp$1, 1);
  22405. }
  22406. }
  22407. class SettingNode$1 {
  22408. constructor(ui) {
  22409. this.showSetting = false;
  22410. this.openSound = true;
  22411. this.openShake = true;
  22412. this.ui = ui;
  22413. this.ui.soundBtn.onClick(this, this.switchSound);
  22414. this.ui.shakeBtn.onClick(this, this.switchShake);
  22415. this.ui.xyBtn.onClick(this, this.onXy);
  22416. this.ui.clickNode.onClick(this, this.changeSetting);
  22417. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22418. this.ui.xyBtn.visible = false;
  22419. this.ui.shakeBtn.visible = false;
  22420. }
  22421. changeSetting() {
  22422. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22423. this.showSetting = !this.showSetting;
  22424. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22425. }
  22426. switchSound() {
  22427. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22428. this.openSound = !this.openSound;
  22429. Moyu.onSetting(this.openSound, this.openShake);
  22430. xGame.soundMgr.onSetting(this.openSound);
  22431. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22432. }
  22433. switchShake() {
  22434. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22435. this.openShake = !this.openShake;
  22436. Moyu.onSetting(this.openSound, this.openShake);
  22437. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22438. }
  22439. onXy() {
  22440. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22441. MoyuMgr$1.showXy(1);
  22442. }
  22443. }
  22444. class UIDraw$1 extends UIBase {
  22445. constructor() {
  22446. super();
  22447. this.curKey = 0;
  22448. }
  22449. onConstructor() {
  22450. this.ui = ui_UIDraw.createInstance();
  22451. this.contentPane = this.ui;
  22452. this.isEject = false;
  22453. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22454. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22455. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22456. this.initDraw();
  22457. this.initUI();
  22458. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22459. }
  22460. show() {
  22461. super.show();
  22462. this.ui.t0.play();
  22463. this.playSecretaryIdle();
  22464. this.updateDraw();
  22465. this.checkFree();
  22466. if (PlatMgr.bannerDelay > 0) {
  22467. this.ui.closeNode.closeBtn.visible = false;
  22468. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22469. this.ui.closeNode.closeBtn.visible = true;
  22470. });
  22471. }
  22472. PlatMgr.showRateBanner();
  22473. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22474. this.setGlobalFont(this.ui);
  22475. }
  22476. hide() {
  22477. Laya.timer.clearAll(this);
  22478. super.hide();
  22479. }
  22480. checkFree() {
  22481. let isFree = DataMgr.getDailyfreeDrawTimes();
  22482. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22483. }
  22484. initDraw() {
  22485. this.drawObj = [];
  22486. let data = cfgTable.drawData;
  22487. let temp;
  22488. let weight = 0;
  22489. for (const key in data) {
  22490. temp = data[key];
  22491. weight += temp.weight;
  22492. this.drawObj.push(weight);
  22493. }
  22494. this.allWeight = weight;
  22495. }
  22496. initUI() {
  22497. let data = cfgTable.drawData;
  22498. let temp;
  22499. let img;
  22500. let txt;
  22501. for (const key in data) {
  22502. temp = data[key];
  22503. img = this.ui.myNode.rotNode["img" + key];
  22504. txt = this.ui.myNode.rotNode["txt" + key];
  22505. img.url = xGame.common.getGameIconUrl(temp.icon);
  22506. txt.visible = true;
  22507. if (temp.award > 2) {
  22508. img.rotation = 0;
  22509. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22510. }
  22511. else {
  22512. img.rotation = temp.rotation;
  22513. txt.text = temp.num;
  22514. }
  22515. }
  22516. }
  22517. getCurkey() {
  22518. let rand = Math.random() * this.allWeight;
  22519. let temp;
  22520. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22521. temp = this.drawObj[index];
  22522. if (index == 0) {
  22523. if (rand < temp) {
  22524. return index + 1;
  22525. }
  22526. }
  22527. else {
  22528. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22529. return index + 1;
  22530. }
  22531. }
  22532. }
  22533. return 2;
  22534. }
  22535. startDraw() {
  22536. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22537. if (freeTimes > 0) {
  22538. this.beginDraw();
  22539. DataMgr.setDailyfreeDrawTimes(0);
  22540. this.checkFree();
  22541. }
  22542. else {
  22543. if (Laya.Browser.onAndroid) {
  22544. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22545. if (!boo) {
  22546. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22547. return;
  22548. }
  22549. }
  22550. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22551. }
  22552. else {
  22553. console.log('zh:AD 失败,直接发放奖励');
  22554. this.qjff_chouJiang();
  22555. }
  22556. }
  22557. }
  22558. qjff_chouJiang() {
  22559. this.beginDraw();
  22560. }
  22561. beginDraw() {
  22562. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22563. this.ui.drawBtn.touchable = false;
  22564. this.curKey = this.getCurkey();
  22565. console.log("当前key", this.curKey);
  22566. let cell = 60;
  22567. let lap = 3;
  22568. let angle = cell * (this.curKey - 1) + lap * 360;
  22569. let target = this.ui.myNode.rotNode;
  22570. target.rotation = 0;
  22571. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22572. console.log("旋转完成");
  22573. this.ui.drawBtn.touchable = true;
  22574. this.getAward();
  22575. }));
  22576. }
  22577. getAward() {
  22578. let data = cfgTable.drawData[this.curKey];
  22579. let temp = new AwardType();
  22580. temp.type = data.award;
  22581. temp.num = data.num;
  22582. xGame.common.getAward([temp], () => {
  22583. DataMgr.setDrawTimes(1);
  22584. this.updateDraw();
  22585. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22586. });
  22587. }
  22588. updateDraw() {
  22589. let drawTimes = DataMgr.getDrawTimes();
  22590. let awardTimes = DataMgr.getDrawAwardTimes();
  22591. if (Math.floor(drawTimes / 3) > awardTimes) {
  22592. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22593. this.ui.extraNode.boxBtn.touchable = true;
  22594. this.ui.extraNode.tipsTxt.text = "3/3";
  22595. this.ui.extraNode.barNode.width = 265;
  22596. this.getExtraAward();
  22597. }
  22598. else {
  22599. this.ui.extraNode.boxBtn.t0.stop();
  22600. this.ui.extraNode.boxBtn.touchable = false;
  22601. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22602. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22603. }
  22604. let data = cfgTable.drawData[1];
  22605. if (awardTimes == 0) {
  22606. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22607. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22608. this.ui.myNode.rotNode.img1.rotation = 0;
  22609. }
  22610. else {
  22611. let award = data.nextid;
  22612. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22613. this.ui.myNode.rotNode.txt1.text = award[1];
  22614. this.ui.myNode.rotNode.img1.rotation = 0;
  22615. }
  22616. }
  22617. getExtraAward() {
  22618. let drawTimes = DataMgr.getDrawTimes();
  22619. let awardTimes = DataMgr.getDrawAwardTimes();
  22620. let data = cfgTable.drawData[1];
  22621. let award = new AwardType();
  22622. if (awardTimes == 0) {
  22623. award.num = data.num;
  22624. award.type = data.award;
  22625. xGame.common.getAward([award], () => {
  22626. let all = Math.floor(drawTimes / 3);
  22627. DataMgr.setDrawAwardTimes(all);
  22628. this.updateDraw();
  22629. });
  22630. }
  22631. else {
  22632. award.num = parseInt(data.nextid[1]);
  22633. award.type = parseInt(data.nextid[0]);
  22634. xGame.common.getAward([award], () => {
  22635. let all = Math.floor(drawTimes / 3);
  22636. DataMgr.setDrawAwardTimes(all);
  22637. this.updateDraw();
  22638. });
  22639. }
  22640. }
  22641. closeSelf() {
  22642. this.hide();
  22643. }
  22644. playSecretaryIdle() {
  22645. let parent = this.ui.secretary.displayObject;
  22646. parent.destroyChildren();
  22647. let xx = this.ui.secretary.width / 2;
  22648. let yy = this.ui.secretary.height;
  22649. let scale = xGame.common.getSecretaryScale();
  22650. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22651. xGame.common.secretary.play(data, 0, true, parent);
  22652. }
  22653. }
  22654. UIDraw$1.uiName = "UIDraw";
  22655. class UIRanking$1 extends UIBase {
  22656. constructor() {
  22657. super();
  22658. this.showSelf = true;
  22659. this.rankType = 1;
  22660. this.rankList = [];
  22661. this.topX = 10;
  22662. this.myIndex = this.topX + 1;
  22663. this.myStar = 0;
  22664. }
  22665. onConstructor() {
  22666. this.ui = ui_UIRanking.createInstance();
  22667. this.contentPane = this.ui;
  22668. this.isEject = false;
  22669. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22670. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22671. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22672. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22673. this.ui.myNode.myList.setVirtual();
  22674. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22675. }
  22676. show() {
  22677. super.show();
  22678. this.getPaiHangBangDataFormJosnFile();
  22679. this.updateSelf();
  22680. let self = Moyu.getUserInfo();
  22681. if (!self.isAuth) {
  22682. Moyu.initUser(this, () => {
  22683. DataMgr.upRankData();
  22684. });
  22685. }
  22686. this.setGlobalFont(this.ui);
  22687. }
  22688. getPaiHangBangDataFormJosnFile() {
  22689. const rankingList = cfgTable.paiHangBangData.list;
  22690. this.updateItemData(rankingList);
  22691. }
  22692. updateSelfItem() {
  22693. console.log('zh:Moyu.platType =' + Moyu.platType);
  22694. let self = Moyu.getUserInfo();
  22695. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22696. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22697. if (this.myIndex > this.topX) {
  22698. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22699. }
  22700. else {
  22701. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22702. }
  22703. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22704. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22705. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22706. }
  22707. updateItemData(data) {
  22708. this.myStar = xGame.common.getAllStarNum();
  22709. if (this.rankList.length < 2) {
  22710. this.rankList = data;
  22711. let self = Moyu.getUserInfo();
  22712. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22713. self.headIcon = self.headIcon;
  22714. for (let i = 0; i < data.length; i++) {
  22715. let data = this.rankList[i];
  22716. if (data.userId == self.userId) {
  22717. this.rankList.splice(i, 1);
  22718. break;
  22719. }
  22720. }
  22721. for (let i = 0; i < data.length; i++) {
  22722. let data = this.rankList[i];
  22723. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22724. this.myIndex = i + 1;
  22725. let user = { headIcon: self.headIcon, nickName: "myself" };
  22726. let ud = { user: user, data: {} };
  22727. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22728. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22729. if (Moyu.platType < 11) {
  22730. user.headIcon = self.headIcon;
  22731. user.nickName = self.nickName;
  22732. }
  22733. this.rankList.splice(i, 0, md);
  22734. break;
  22735. }
  22736. }
  22737. }
  22738. this.updateSelfItem();
  22739. this.ui.myNode.myList.numItems = this.rankList.length;
  22740. }
  22741. updateItemUI(index, obj) {
  22742. let data = this.rankList[index];
  22743. let userData = JSON.parse(data.userData).user;
  22744. obj.nameTxt.text = userData.nickName.toString();
  22745. obj.valueTxt.text = data.rankScore;
  22746. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22747. obj.rankTxt.text = index + 1;
  22748. switch (index) {
  22749. case 0:
  22750. this.setImg(obj, 1, 0, 0);
  22751. obj.rankTxt.color = "#FFC047";
  22752. break;
  22753. case 1:
  22754. this.setImg(obj, 0, 1, 0);
  22755. obj.rankTxt.color = "#ACACAC";
  22756. break;
  22757. case 2:
  22758. this.setImg(obj, 0, 0, 1);
  22759. obj.rankTxt.color = "#D09672";
  22760. break;
  22761. default:
  22762. this.setImg(obj, 0, 0, 0);
  22763. obj.rankTxt.color = "#496FAB";
  22764. break;
  22765. }
  22766. }
  22767. setImg(obj, a, b, c) {
  22768. obj.img1.visible = a ? true : false;
  22769. obj.img2.visible = b ? true : false;
  22770. obj.img3.visible = c ? true : false;
  22771. }
  22772. changeList(type) {
  22773. this.rankType = type;
  22774. this.updateSelf();
  22775. }
  22776. changeSelfNode() {
  22777. this.showSelf = !this.showSelf;
  22778. this.updateSelf();
  22779. }
  22780. updateSelf() {
  22781. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22782. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22783. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22784. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22785. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22786. }
  22787. }
  22788. UIRanking$1.uiName = "UIRanking";
  22789. class UISecretary$1 extends UIBase {
  22790. constructor() {
  22791. super();
  22792. this.curIndex = 1;
  22793. }
  22794. onConstructor() {
  22795. this.ui = ui_UISecretary.createInstance();
  22796. this.contentPane = this.ui;
  22797. this.isEject = false;
  22798. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22799. this.nodeObj = { left: null, right: null, cur: null };
  22800. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22801. }
  22802. show() {
  22803. super.show();
  22804. this.ui.t0.play();
  22805. this.updateData();
  22806. this.setGlobalFont(this.ui);
  22807. }
  22808. addSecretarySpine(node, spineName) {
  22809. if (spineName == "mishu") {
  22810. if (this.secretarySpine1) {
  22811. node.displayObject.destroyChildren();
  22812. this.playWoman(this.secretarySpine1, node.displayObject);
  22813. }
  22814. else {
  22815. let spine1 = new SpineMgr("mishu", () => {
  22816. this.secretarySpine1 = spine1;
  22817. this.playWoman(this.secretarySpine1, node.displayObject);
  22818. });
  22819. }
  22820. }
  22821. else {
  22822. if (this.secretarySpine2) {
  22823. node.displayObject.destroyChildren();
  22824. this.playWoman(this.secretarySpine2, node.displayObject);
  22825. }
  22826. else {
  22827. let spine2 = new SpineMgr("xiaomishu2", () => {
  22828. this.secretarySpine2 = spine2;
  22829. this.playWoman(this.secretarySpine2, node.displayObject);
  22830. });
  22831. }
  22832. }
  22833. }
  22834. playWoman(node, parent) {
  22835. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22836. let yy = this.ui.myNode.gameNode3.secretary.height;
  22837. let scale = 1.5;
  22838. if (node == this.secretarySpine2) {
  22839. scale = 1.2;
  22840. }
  22841. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22842. node.play(data, 0, true, parent);
  22843. }
  22844. turnLeft() {
  22845. this.curIndex--;
  22846. if (this.curIndex < 1) {
  22847. this.curIndex = 2;
  22848. }
  22849. let left = this.nodeObj.left;
  22850. let right = this.nodeObj.right;
  22851. let cur = this.nodeObj.cur;
  22852. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22853. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22854. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22855. this.updateData();
  22856. }));
  22857. this.ui.myNode.setChildIndex(right, 2);
  22858. this.nodeObj.left = cur;
  22859. this.nodeObj.right = left;
  22860. this.nodeObj.cur = right;
  22861. }
  22862. turnRight() {
  22863. this.curIndex++;
  22864. if (this.curIndex > 2) {
  22865. this.curIndex = 1;
  22866. }
  22867. let left = this.nodeObj.left;
  22868. let right = this.nodeObj.right;
  22869. let cur = this.nodeObj.cur;
  22870. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22871. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22872. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22873. this.updateData();
  22874. }));
  22875. this.ui.myNode.setChildIndex(left, 2);
  22876. this.nodeObj.left = right;
  22877. this.nodeObj.right = cur;
  22878. this.nodeObj.cur = left;
  22879. }
  22880. updateData() {
  22881. console.log('zh: updateData FFFFFFFFFF');
  22882. let data = cfgTable.secretaryshopData;
  22883. let children = this.ui.myNode._children;
  22884. let temp;
  22885. let curData;
  22886. for (let index = 0; index < children.length; index++) {
  22887. temp = children[index];
  22888. curData = data[1];
  22889. temp.heightTxt.text = curData.height;
  22890. temp.foodTxt.text = curData.food;
  22891. temp.historyTxt.text = curData.history;
  22892. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22893. this.addSecretarySpine(temp.secretary, curData.spine);
  22894. let womanIndex = curData.id - 1;
  22895. let getWoman = DataMgr.getSecretary(womanIndex);
  22896. let curUse = DataMgr.getCurSecretary();
  22897. if (getWoman) {
  22898. if (curUse == womanIndex) {
  22899. temp.purchaseBtn.c1.selectedIndex = 1;
  22900. }
  22901. else {
  22902. temp.purchaseBtn.c1.selectedIndex = 2;
  22903. }
  22904. }
  22905. else {
  22906. temp.purchaseBtn.c1.selectedIndex = 0;
  22907. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22908. }
  22909. temp.purchaseBtn.visible = false;
  22910. }
  22911. }
  22912. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22913. console.log('zh: 点击了clickSecretary ');
  22914. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22915. if (getWoman) {
  22916. if (curUse != womanIndex) {
  22917. console.log();
  22918. DataMgr.setCurSecretary(womanIndex);
  22919. this.updateData();
  22920. }
  22921. }
  22922. else {
  22923. console.log('zh:点击购买了');
  22924. let need = needDiamond;
  22925. if (DataMgr.diamondEnough(need)) {
  22926. DataMgr.setDiamond(-need);
  22927. DataMgr.setSecretary(womanIndex, 1);
  22928. DataMgr.setCurSecretary(womanIndex);
  22929. this.updateData();
  22930. }
  22931. else {
  22932. xGame.uiMgr.Show(UIAddProp$1, 1);
  22933. }
  22934. }
  22935. }
  22936. closeSelf() {
  22937. this.hide();
  22938. }
  22939. }
  22940. UISecretary$1.uiName = "UISecretary";
  22941. class BallRodDisplay$1 {
  22942. constructor(ui, index) {
  22943. this.index = 0;
  22944. this.uiIndex = 0;
  22945. this.ui = ui;
  22946. this.index = index;
  22947. this.initData();
  22948. }
  22949. initData() {
  22950. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22951. let data = cfgTable.ballrodData[this.index + 1];
  22952. this.ui.nameTxt.text = data.name;
  22953. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22954. this.ui.levelNode.c1.selectedIndex = data.quality;
  22955. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22956. if (data.spine) {
  22957. this.mySpine = new SpineMgr(data.spine, () => {
  22958. let xx = 150;
  22959. let yy = 70;
  22960. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22961. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22962. });
  22963. }
  22964. }
  22965. updateSelf() {
  22966. let get = DataMgr.getBallRod(this.index);
  22967. if (get == null)
  22968. get = 1;
  22969. let curUse = DataMgr.getCurBallRod();
  22970. if (get) {
  22971. if (curUse == this.index) {
  22972. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22973. }
  22974. else {
  22975. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22976. }
  22977. }
  22978. else {
  22979. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22980. }
  22981. }
  22982. buyBallRod() {
  22983. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22984. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22985. switch (selectedIndex) {
  22986. case 0:
  22987. break;
  22988. case 1:
  22989. console.log('zh:点击了 USE THIS');
  22990. DataMgr.setCurBallRod(this.index);
  22991. let curUse = DataMgr.getCurBallRod();
  22992. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22993. let ui = xGame.uiMgr.getUI(UIShop$1);
  22994. ui.updateBallRod();
  22995. break;
  22996. case 2:
  22997. let data = cfgTable.ballrodData[this.index + 1];
  22998. let need = data.price;
  22999. if (DataMgr.diamondEnough(need)) {
  23000. this.buyQiuGan(data);
  23001. DataMgr.setDiamond(-need);
  23002. DataMgr.setBallRod(this.index, 1);
  23003. DataMgr.setCurBallRod(this.index);
  23004. let ui = xGame.uiMgr.getUI(UIShop$1);
  23005. ui.updateBallRod();
  23006. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23007. }
  23008. else {
  23009. xGame.uiMgr.Show(UIAddProp$1, 1);
  23010. }
  23011. break;
  23012. default:
  23013. break;
  23014. }
  23015. }
  23016. buyQiuGan(qgItem) {
  23017. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23018. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23019. if (userInfo == null) {
  23020. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23021. return;
  23022. }
  23023. let reqData = xGame.httpMgr.getReqData();
  23024. let pd = JSON.parse(reqData);
  23025. pd.qiuGanData = qgItem;
  23026. reqData = JSON.stringify(pd);
  23027. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23028. try {
  23029. console.log('zh:buySp res = ' + JSON.stringify(res));
  23030. let code = res.code;
  23031. let msg = res.msg;
  23032. if (code == 401) {
  23033. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23034. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23035. return;
  23036. }
  23037. if (code == 200) {
  23038. xGame.uiMgr.Show(UIMsg$1, msg);
  23039. DataMgr.getUserZiChanInfo(false);
  23040. }
  23041. else {
  23042. xGame.uiMgr.Show(UIMsg$1, msg);
  23043. }
  23044. }
  23045. catch (error) {
  23046. console.log('error=' + error);
  23047. alert(error);
  23048. }
  23049. finally {
  23050. }
  23051. });
  23052. }
  23053. logEventForGouMaiGan(qiuGanName) {
  23054. const ev = {
  23055. value: qiuGanName
  23056. };
  23057. const jsonStr = JSON.stringify(ev);
  23058. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23059. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23060. }
  23061. }
  23062. class DaoJuDisplay$1 {
  23063. constructor(ui, index) {
  23064. this.index = 0;
  23065. this.uiIndex = 0;
  23066. this.ggSpid = "";
  23067. this.spid = 0;
  23068. this.ui = ui;
  23069. this.index = index;
  23070. this.initData();
  23071. }
  23072. initData() {
  23073. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23074. let data = cfgTable.daoJuData[this.index + 1];
  23075. this.ui.nameTxt.text = data.spbt;
  23076. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23077. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23078. this.ggSpid = data.ggSpid;
  23079. this.spid = data.spid;
  23080. let baseUrl = "asset/sound/ogg/";
  23081. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23082. }
  23083. gotoBuy() {
  23084. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23085. if (userInfo != null) {
  23086. let token = userInfo.token;
  23087. let ggSpid = this.ggSpid;
  23088. let spid = this.spid;
  23089. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23090. console.log('zh:gotoBuy1 spid =' + spid);
  23091. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23092. return;
  23093. }
  23094. else {
  23095. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23096. }
  23097. }
  23098. gotoBuy1() {
  23099. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23100. let djItem = cfgTable.daoJuData[this.index + 1];
  23101. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23102. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23103. if (userInfo == null) {
  23104. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23105. return;
  23106. }
  23107. let reqData = xGame.httpMgr.getReqData();
  23108. let pd = JSON.parse(reqData);
  23109. pd.spItem = djItem;
  23110. reqData = JSON.stringify(pd);
  23111. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23112. try {
  23113. console.log('zh:buySp res = ' + JSON.stringify(res));
  23114. let code = res.code;
  23115. let msg = res.msg;
  23116. if (code == 401) {
  23117. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23118. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23119. return;
  23120. }
  23121. if (code == 200) {
  23122. xGame.uiMgr.Show(UIMsg$1, msg);
  23123. DataMgr.getUserZiChanInfo(false);
  23124. }
  23125. else {
  23126. xGame.uiMgr.Show(UIMsg$1, msg);
  23127. }
  23128. }
  23129. catch (error) {
  23130. console.log('error=' + error);
  23131. alert(error);
  23132. }
  23133. finally {
  23134. }
  23135. });
  23136. }
  23137. }
  23138. class UIShop$1 extends UIBase {
  23139. constructor() {
  23140. super();
  23141. this.itemNums = 0;
  23142. this.itemNumsForDj = 0;
  23143. this.curType = "";
  23144. }
  23145. onConstructor() {
  23146. this.ui = ui_UIShop.createInstance();
  23147. this.contentPane = this.ui;
  23148. this.isEject = false;
  23149. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23150. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23151. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23152. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23153. this.addUIClick(this.ui, this.interuptSecretary);
  23154. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23155. this.ballRodArr = [];
  23156. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23157. this.ui.myNode.myList.numItems = this.itemNums;
  23158. this.loadDjdata_old();
  23159. }
  23160. loadDjdata_old() {
  23161. let fff = cfgTable.daoJuData;
  23162. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23163. this.daoJuArr = [];
  23164. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23165. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23166. }
  23167. getProductList() {
  23168. let reqData = xGame.httpMgr.getReqData();
  23169. let pd = JSON.parse(reqData);
  23170. pd.splx = "Consumable";
  23171. reqData = JSON.stringify(pd);
  23172. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23173. try {
  23174. let code = res.code;
  23175. let msg = res.msg;
  23176. if (code == 401) {
  23177. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23178. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23179. return;
  23180. }
  23181. if (code == 200) {
  23182. let data = res.data;
  23183. for (let index = 0; index < data.length; index++) {
  23184. let element = data[index];
  23185. cfgTable.daoJuData[element.spid] = element;
  23186. }
  23187. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23188. }
  23189. else {
  23190. xGame.uiMgr.Show(UIMsg, msg);
  23191. }
  23192. }
  23193. catch (error) {
  23194. console.log('error=' + error);
  23195. alert(error);
  23196. }
  23197. finally {
  23198. }
  23199. });
  23200. }
  23201. show(type) {
  23202. super.show();
  23203. this.curType = type == 0 ? "qiugan" : "daoju";
  23204. this.switchBtn("");
  23205. this.playSecretaryIdle();
  23206. this.updateBallRod();
  23207. this.setGlobalFont(this.ui);
  23208. }
  23209. test123() {
  23210. console.log('zh:test123 ');
  23211. }
  23212. switchBtn(type) {
  23213. console.log('zh:1111切換 sel type=' + type);
  23214. if (type == "") {
  23215. type = this.curType;
  23216. }
  23217. else {
  23218. if (this.curType == type) {
  23219. return;
  23220. }
  23221. else {
  23222. this.curType = type;
  23223. }
  23224. }
  23225. if (type == "qiugan") {
  23226. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23227. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23228. this.ui.myNode.c1.selectedIndex = 0;
  23229. this.ui.myNode.myList.visible = true;
  23230. this.ui.myNode.djList.visible = false;
  23231. }
  23232. else {
  23233. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23234. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23235. this.ui.myNode.c1.selectedIndex = 1;
  23236. this.ui.myNode.myList.visible = false;
  23237. this.ui.myNode.djList.visible = true;
  23238. }
  23239. }
  23240. updateBallRod() {
  23241. for (let index = 0; index < this.ballRodArr.length; index++) {
  23242. this.ballRodArr[index].updateSelf();
  23243. }
  23244. }
  23245. renderBallRod(sort, obj) {
  23246. let index = this.getIndexBySort(sort + 1) - 1;
  23247. let ballRod = new BallRodDisplay$1(obj, index);
  23248. this.ballRodArr.push(ballRod);
  23249. }
  23250. renderDaoJu(idx, obj) {
  23251. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23252. let b = new DaoJuDisplay$1(obj, index);
  23253. this.daoJuArr.push(b);
  23254. }
  23255. getIndexBySort(sort) {
  23256. let object = cfgTable.ballrodData;
  23257. for (const key in object) {
  23258. if (object[key].sort == sort) {
  23259. return parseInt(key);
  23260. }
  23261. }
  23262. }
  23263. getIndexBySortForDj(idx) {
  23264. let object = cfgTable.daoJuData;
  23265. for (const key in object) {
  23266. if (object[key].idx == idx) {
  23267. return parseInt(key);
  23268. }
  23269. }
  23270. }
  23271. playSecretaryIdle() {
  23272. let parent = this.ui.secretary.displayObject;
  23273. parent.destroyChildren();
  23274. let xx = this.ui.secretary.width / 2;
  23275. let yy = this.ui.secretary.height;
  23276. let scale = xGame.common.getSecretaryScale();
  23277. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23278. xGame.common.secretary.play(data, 0, true, parent);
  23279. }
  23280. interuptSecretary() {
  23281. Laya.timer.clearAll(this);
  23282. this.playSecretaryRandomSound();
  23283. }
  23284. playSecretaryRandomSound() {
  23285. if (this.isHide)
  23286. return;
  23287. let time = xGame.common.randomNum(45000, 60000);
  23288. Laya.timer.once(time, this, () => {
  23289. if (this.isHide)
  23290. return;
  23291. let index = xGame.common.randomNum(4, 7);
  23292. xGame.soundMgr.playSound("s_main0" + index);
  23293. let words = 1;
  23294. switch (index) {
  23295. case 4:
  23296. words = 5;
  23297. break;
  23298. case 5:
  23299. words = 3;
  23300. break;
  23301. case 6:
  23302. words = 6;
  23303. break;
  23304. case 7:
  23305. words = 7;
  23306. break;
  23307. default:
  23308. break;
  23309. }
  23310. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23311. this.playSecretaryRandomSound();
  23312. });
  23313. }
  23314. closeSelf() {
  23315. this.hide();
  23316. }
  23317. }
  23318. UIShop$1.uiName = "UIShop";
  23319. class SignMax$1 {
  23320. constructor(ui) {
  23321. this.ui = ui;
  23322. }
  23323. updateSelf(index, sameDay, curDayIndex) {
  23324. let data = cfgTable.signData[index + 1];
  23325. this.ui.titleTxt.text = data.title;
  23326. let arr1 = data.award[0].split('-');
  23327. let arr2 = data.award[1].split('-');
  23328. let num1 = parseInt(arr1[1]);
  23329. let num2 = parseInt(arr2[1]);
  23330. this.ui.numTxt1.text = num1 + "";
  23331. this.ui.numTxt2.text = num2 + "";
  23332. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23333. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23334. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23335. this.ui.numTxt1.visible = false;
  23336. }
  23337. else {
  23338. this.ui.numTxt1.visible = true;
  23339. }
  23340. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23341. this.ui.numTxt2.visible = false;
  23342. }
  23343. else {
  23344. this.ui.numTxt2.visible = true;
  23345. }
  23346. if (index < curDayIndex) {
  23347. this.ui.c1.selectedIndex = 1;
  23348. }
  23349. else if (index == curDayIndex) {
  23350. if (sameDay) {
  23351. this.ui.c1.selectedIndex = 2;
  23352. }
  23353. else {
  23354. this.ui.c1.selectedIndex = 2;
  23355. }
  23356. }
  23357. else {
  23358. this.ui.c1.selectedIndex = 0;
  23359. }
  23360. }
  23361. }
  23362. class SignNormal$1 {
  23363. constructor(ui) {
  23364. this.ui = ui;
  23365. }
  23366. updateSelf(index, sameDay, curDayIndex) {
  23367. let data = cfgTable.signData[index + 1];
  23368. this.ui.titleTxt.text = data.title;
  23369. let arr = data.award[0].split('-');
  23370. let type = parseInt(arr[0]);
  23371. let num = parseInt(arr[1]);
  23372. this.ui.numTxt.text = num + "";
  23373. if (type > 2) {
  23374. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23375. this.ui.myIcon.rotation = 0;
  23376. }
  23377. else {
  23378. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23379. this.ui.myIcon.rotation = 0;
  23380. }
  23381. if (xGame.common.signAwardContainsRod(data.award)) {
  23382. this.ui.numTxt.visible = false;
  23383. }
  23384. else {
  23385. this.ui.numTxt.visible = true;
  23386. }
  23387. if (index < curDayIndex) {
  23388. this.ui.c1.selectedIndex = 1;
  23389. }
  23390. else if (index == curDayIndex) {
  23391. if (sameDay) {
  23392. this.ui.c1.selectedIndex = 2;
  23393. }
  23394. else {
  23395. this.ui.c1.selectedIndex = 2;
  23396. }
  23397. }
  23398. else {
  23399. this.ui.c1.selectedIndex = 0;
  23400. }
  23401. }
  23402. }
  23403. class UISign$1 extends UIBase {
  23404. constructor() {
  23405. super();
  23406. this.curDayIndex = 0;
  23407. this.starX = 0;
  23408. }
  23409. onConstructor() {
  23410. this.ui = ui_UISign.createInstance();
  23411. this.contentPane = this.ui;
  23412. this.isEject = false;
  23413. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23414. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23415. this.initSignItem();
  23416. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23417. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23418. }
  23419. show() {
  23420. super.show();
  23421. this.ui.t0.play();
  23422. this.playSecretaryIdle();
  23423. this.updateSign();
  23424. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23425. this.setGlobalFont(this.ui);
  23426. }
  23427. initSignItem() {
  23428. this.signArr = [];
  23429. for (let index = 0; index < 6; index++) {
  23430. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23431. this.signArr.push(temp);
  23432. }
  23433. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23434. if (Moyu.isKs)
  23435. this.ui.closeNode.closeBtn.x += 100;
  23436. }
  23437. updateSign() {
  23438. let sameDay = xGame.common.judgeSameDay();
  23439. let max = 7;
  23440. this.curDayIndex = DataMgr.getSignData();
  23441. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23442. this.curDayIndex = 0;
  23443. if (!sameDay) {
  23444. this.ui.normalBtn.visible = true;
  23445. this.ui.tipsNode.visible = false;
  23446. this.ui.againBtn.visible = false;
  23447. }
  23448. else {
  23449. this.ui.normalBtn.visible = false;
  23450. let again = DataMgr.getExtraSign();
  23451. let isCurrency = false;
  23452. let index = this.curDayIndex;
  23453. if (index == 0)
  23454. index = 7;
  23455. let award = cfgTable.signData[index].award;
  23456. let num = award[0].split("-")[0];
  23457. if (num == "1" || num == "2")
  23458. isCurrency = true;
  23459. let showAgain = again == 0 && isCurrency;
  23460. this.ui.againBtn.visible = showAgain;
  23461. this.ui.tipsNode.visible = !showAgain;
  23462. }
  23463. for (let index = 0; index < this.signArr.length; index++) {
  23464. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23465. }
  23466. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23467. }
  23468. playSecretaryIdle() {
  23469. let parent = this.ui.secretary.displayObject;
  23470. parent.destroyChildren();
  23471. let xx = this.ui.secretary.width / 2;
  23472. let yy = this.ui.secretary.height;
  23473. let scale = xGame.common.getSecretaryScale();
  23474. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23475. xGame.common.secretary.play(data, 0, true, parent);
  23476. }
  23477. closeSelf() {
  23478. this.hide();
  23479. }
  23480. normalGetAward() {
  23481. let sameDay = xGame.common.judgeSameDay();
  23482. if (!sameDay) {
  23483. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23484. let temp;
  23485. let type;
  23486. let num;
  23487. let arr = [];
  23488. for (let index = 0; index < award.length; index++) {
  23489. temp = award[index].split("-");
  23490. type = parseInt(temp[0]);
  23491. num = parseInt(temp[1]);
  23492. let awardType = new AwardType();
  23493. awardType.num = num;
  23494. awardType.type = type;
  23495. arr.push(awardType);
  23496. }
  23497. xGame.common.getAward(arr, (watchVideo) => {
  23498. this.curDayIndex++;
  23499. if (this.curDayIndex > 7)
  23500. this.curDayIndex = 0;
  23501. DataMgr.setSignData(this.curDayIndex);
  23502. this.updateSignData2Server(this.curDayIndex);
  23503. DataMgr.setSignTime(new Date().getTime());
  23504. if (watchVideo) {
  23505. DataMgr.setExtraSign(1);
  23506. Moyu.sendDataEvent("signIn1");
  23507. }
  23508. this.updateSign();
  23509. });
  23510. }
  23511. }
  23512. againGetAward() {
  23513. Moyu.sendDataEvent("signIn2");
  23514. console.log('zh:qjff_AD_for_uisign');
  23515. if (Laya.Browser.onAndroid) {
  23516. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23517. if (!boo) {
  23518. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23519. return;
  23520. }
  23521. }
  23522. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23523. }
  23524. else {
  23525. console.log('zh:AD 失败,直接发放奖励');
  23526. this.qjff_AD_for_uisign();
  23527. }
  23528. }
  23529. qjff_AD_for_uisign() {
  23530. let index = this.curDayIndex;
  23531. if (index == 0)
  23532. index = 7;
  23533. let award = cfgTable.signData[index].award;
  23534. let temp;
  23535. let type;
  23536. let num;
  23537. for (let index = 0; index < award.length; index++) {
  23538. temp = award[index].split("-");
  23539. type = parseInt(temp[0]);
  23540. num = parseInt(temp[1]) * 3;
  23541. xGame.common.playObjFlyAnim(num, type);
  23542. }
  23543. DataMgr.setExtraSign(1);
  23544. this.updateSign();
  23545. }
  23546. updateSignData2Server(day) {
  23547. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23548. if (userInfo == null) {
  23549. return;
  23550. }
  23551. let reqData = xGame.httpMgr.getReqData();
  23552. let pd = JSON.parse(reqData);
  23553. pd.signData = day;
  23554. reqData = JSON.stringify(pd);
  23555. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23556. try {
  23557. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23558. let code = res.code;
  23559. let msg = res.msg;
  23560. if (code == 401) {
  23561. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23562. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23563. return;
  23564. }
  23565. if (code == 200) {
  23566. let data = res.data;
  23567. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23568. }
  23569. else {
  23570. xGame.uiMgr.Show(UIMsg$1, msg);
  23571. }
  23572. }
  23573. catch (error) {
  23574. console.log('error=' + error);
  23575. alert(error);
  23576. }
  23577. finally {
  23578. }
  23579. });
  23580. }
  23581. }
  23582. UISign$1.uiName = "UISign";
  23583. class UIModeSelection$1 extends UIBase {
  23584. constructor() {
  23585. super();
  23586. }
  23587. onConstructor() {
  23588. this.ui = ui_UIModeSelection.createInstance();
  23589. this.contentPane = this.ui;
  23590. this.isEject = false;
  23591. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23592. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23593. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23594. this.addUIClick(this.ui.closeBtn, this.hide);
  23595. this.peopleArr = [65, 990, 580];
  23596. this.peopleOffest = [5, 10, 10];
  23597. }
  23598. show(callback) {
  23599. this.updateSelf();
  23600. super.show();
  23601. this.ui.t0.play();
  23602. this.callback = callback;
  23603. this.setGlobalFont(this.ui);
  23604. }
  23605. updateSelf() {
  23606. let cfg = cfgTable.modeselectData;
  23607. for (let index = 1; index <= 3; index++) {
  23608. let node = this.ui.myNode["type" + index];
  23609. node.need.text = cfg[index].need;
  23610. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23611. node.peopleTxt.text = this.getRandPeople(index - 1);
  23612. }
  23613. }
  23614. enterGame(type) {
  23615. console.log('zh: 进入经典模式 type: ' + type);
  23616. xGame.common.classicRoomType = type;
  23617. let cfg = cfgTable.modeselectData[type];
  23618. let need = cfg.need;
  23619. xGame.common.passAwardCoin = cfg.award;
  23620. if (DataMgr.coinEnough(need)) {
  23621. DataMgr.setCoin(-need);
  23622. this.ui.myNode["type" + type].t0.play();
  23623. Laya.timer.once(200, this, () => {
  23624. this.callback && this.callback();
  23625. });
  23626. this.logEventForClassic_start();
  23627. }
  23628. else {
  23629. Moyu.sendDataEvent("AddCoinVideo");
  23630. xGame.uiMgr.Show(UIAddProp$1, 0);
  23631. }
  23632. }
  23633. getRandPeople(index) {
  23634. let rand = this.peopleOffest[index];
  23635. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23636. }
  23637. logEventForClassic_start() {
  23638. let rtype = xGame.common.classicRoomType;
  23639. let msmc = '';
  23640. if (rtype == 1) {
  23641. msmc = 'beginner';
  23642. }
  23643. if (rtype == 2) {
  23644. msmc = 'expert';
  23645. }
  23646. if (rtype == 3) {
  23647. msmc = 'master';
  23648. }
  23649. let keyStr = 'sjmd_classic_start_' + rtype;
  23650. let jsonStr = {
  23651. "difficulty": msmc,
  23652. "classic_count": 1,
  23653. "difficulty_count": 1
  23654. };
  23655. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23656. const d = LocalStorageManager.getItem(keyStr);
  23657. jsonStr.classic_count = d.classic_count + 1;
  23658. jsonStr.difficulty_count = d.difficulty_count + 1;
  23659. LocalStorageManager.setItem(keyStr, jsonStr);
  23660. }
  23661. else {
  23662. LocalStorageManager.setItem(keyStr, jsonStr);
  23663. }
  23664. const reqStr = JSON.stringify(jsonStr);
  23665. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23666. }
  23667. }
  23668. UIModeSelection$1.uiName = "UIModeSelection";
  23669. class UILogin$1 extends UIBase {
  23670. constructor() {
  23671. super();
  23672. this.fontStr = 'big-john-woff2-2';
  23673. try {
  23674. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23675. console.log("zh: constructor加载arial字体成功");
  23676. }
  23677. catch (error) {
  23678. console.log("zh: constructor加载arial字体失败");
  23679. }
  23680. }
  23681. onFontLoaded() {
  23682. try {
  23683. Laya.Text.defaultFont = this.fontStr;
  23684. this.ui.n19.txt_ua.font = this.fontStr;
  23685. this.ui.n19.txt_up.font = this.fontStr;
  23686. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23687. }
  23688. catch (error) {
  23689. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23690. }
  23691. }
  23692. onConstructor() {
  23693. this.ui = ui_UILogin.createInstance();
  23694. this.contentPane = this.ui;
  23695. this.isEject = false;
  23696. this.addUIClick(this.ui.n19.closeBtn, this.closeSelf);
  23697. this.addUIClick(this.ui.n19.btn_gotoReg, this.gotoRegPage);
  23698. this.addUIClick(this.ui.n19.btn_login, this.userLogin);
  23699. }
  23700. show() {
  23701. super.show();
  23702. this.x = (Laya.stage.width - this.width) / 2;
  23703. this.y = (Laya.stage.height - this.height) / 2;
  23704. this.onFontLoaded();
  23705. }
  23706. closeSelf() {
  23707. this.hide();
  23708. }
  23709. userLogin() {
  23710. let ua = this.ui.n19.txt_ua.text;
  23711. let up = this.ui.n19.txt_up.text;
  23712. console.log('zh:ua font' + this.ui.n19.txt_ua.font);
  23713. if (ua && up) {
  23714. let reqData = JSON.stringify({
  23715. username: ua.trim(),
  23716. password: up.trim(),
  23717. fromMark: 'app_game'
  23718. });
  23719. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23720. try {
  23721. console.log('zh:res = ' + JSON.stringify(res));
  23722. let code = res.code;
  23723. let msg = res.msg;
  23724. if (code == 200) {
  23725. let keyStr = keyForLoginInfo;
  23726. let jsonStr = {
  23727. "username": res.username,
  23728. "token": res.token,
  23729. "buySpids": { 1: false, 7: false }
  23730. };
  23731. LocalStorageManager.setItem(keyStr, jsonStr);
  23732. let myu = Moyu.getUserInfo();
  23733. console.log('zh:myu = ' + JSON.stringify(myu));
  23734. DataMgr.updateUserNickName(res.username);
  23735. Moyu.updateUserInfo(res.username);
  23736. xGame.uiMgr.Show(UIMsg$1, msg);
  23737. DataMgr.loadUserSpOrderForAd();
  23738. DataMgr.getUserZiChanInfo(false);
  23739. xGame.eventMgr.event(LOGIN_IN);
  23740. this.closeSelf();
  23741. }
  23742. else {
  23743. xGame.uiMgr.Show(UIMsg$1, msg);
  23744. }
  23745. }
  23746. catch (error) {
  23747. console.log('error=' + error);
  23748. alert(error);
  23749. }
  23750. finally {
  23751. }
  23752. });
  23753. }
  23754. else {
  23755. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23756. }
  23757. }
  23758. gotoRegPage() {
  23759. this.closeSelf();
  23760. xGame.uiMgr.Show(UIReg$1);
  23761. }
  23762. }
  23763. UILogin$1.uiName = "UILogin";
  23764. class UIReg$1 extends UIBase {
  23765. constructor() {
  23766. super();
  23767. this.fontStr = 'big-john-woff2-2';
  23768. try {
  23769. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23770. console.log("zh: constructor加载arial字体成功");
  23771. }
  23772. catch (error) {
  23773. console.log("zh: constructor加载arial字体失败");
  23774. }
  23775. }
  23776. onFontLoaded() {
  23777. try {
  23778. Laya.Text.defaultFont = this.fontStr;
  23779. this.ui.txt_ua.font = this.fontStr;
  23780. this.ui.txt_up1.font = this.fontStr;
  23781. this.ui.txt_up2.font = this.fontStr;
  23782. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23783. }
  23784. catch (error) {
  23785. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23786. }
  23787. }
  23788. onConstructor() {
  23789. this.ui = ui_UIReg.createInstance();
  23790. this.contentPane = this.ui;
  23791. this.isEject = false;
  23792. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23793. this.addUIClick(this.ui.btn_reg, this.regUser);
  23794. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23795. }
  23796. show() {
  23797. super.show();
  23798. this.x = (Laya.stage.width - this.width) / 2;
  23799. this.y = (Laya.stage.height - this.height) / 2;
  23800. this.onFontLoaded();
  23801. }
  23802. closeSelf() {
  23803. this.hide();
  23804. }
  23805. regUser() {
  23806. this.ui.lab_tip.visible = false;
  23807. let ua = this.ui.txt_ua.text;
  23808. let up1 = this.ui.txt_up1.text;
  23809. let up2 = this.ui.txt_up2.text;
  23810. if (ua && up1 && up2 && up1 == up2) {
  23811. let reqData = JSON.stringify({
  23812. username: ua.trim(),
  23813. password: up1.trim(),
  23814. fromMark: 'app_game'
  23815. });
  23816. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23817. try {
  23818. console.log('zh:res = ' + JSON.stringify(res));
  23819. let code = res.code;
  23820. let msg = res.msg;
  23821. xGame.uiMgr.Show(UIMsg$1, msg);
  23822. if (code == 200) {
  23823. this.ui.lab_tip.color = "#FFFFFF";
  23824. xGame.uiMgr.Show(UIMsg$1, msg);
  23825. this.closeSelf();
  23826. }
  23827. else {
  23828. this.ui.lab_tip.color = "#FF0000";
  23829. xGame.uiMgr.Show(UIMsg$1, msg);
  23830. }
  23831. }
  23832. catch (error) {
  23833. console.log('error=' + error);
  23834. alert(error);
  23835. }
  23836. finally {
  23837. }
  23838. });
  23839. }
  23840. else {
  23841. if (up1 != up2) {
  23842. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23843. }
  23844. else {
  23845. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23846. }
  23847. }
  23848. }
  23849. gotoLogin() {
  23850. this.closeSelf();
  23851. xGame.uiMgr.Show(UILogin$1);
  23852. }
  23853. }
  23854. UIReg$1.uiName = "UIReg";
  23855. class UIFuli1$1 extends UIBase {
  23856. constructor() {
  23857. super();
  23858. this.jiage = 4.99;
  23859. }
  23860. onConstructor() {
  23861. this.ui = ui_UIFuli1.createInstance();
  23862. this.contentPane = this.ui;
  23863. this.isEject = false;
  23864. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23865. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23866. }
  23867. show() {
  23868. super.show();
  23869. this.x = (Laya.stage.width - this.width) / 2;
  23870. this.y = (Laya.stage.height - this.height) / 2;
  23871. this.ui.n2.txt_price.text = "$" + this.jiage;
  23872. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  23873. this.setGlobalFont(this.ui);
  23874. }
  23875. closeSelf() {
  23876. DataMgr.loadUserSpOrderForAd();
  23877. this.hide();
  23878. }
  23879. gotoBuy() {
  23880. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23881. if (userInfo != null) {
  23882. let token = userInfo.token;
  23883. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23884. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23885. DataMgr.loadUserSpOrderForAd();
  23886. return;
  23887. }
  23888. else {
  23889. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23890. }
  23891. }
  23892. gotoBuy2() {
  23893. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23894. if (userInfo == null) {
  23895. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23896. return;
  23897. }
  23898. let reqData = xGame.httpMgr.getReqData();
  23899. let pd = JSON.parse(reqData);
  23900. pd.productId = 1;
  23901. reqData = JSON.stringify(pd);
  23902. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23903. try {
  23904. console.log('zh:buySp res = ' + JSON.stringify(res));
  23905. let code = res.code;
  23906. let msg = res.msg;
  23907. if (code == 401) {
  23908. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23909. alert(TIP_MSG_key.loginTimeOut);
  23910. xGame.uiMgr.Show(UIMsg$1, msg);
  23911. return;
  23912. }
  23913. if (code == 200) {
  23914. xGame.uiMgr.Show(UIMsg$1, msg);
  23915. DataMgr.loadUserSpOrderForAd();
  23916. DataMgr.getUserZiChanInfo(false);
  23917. this.closeSelf();
  23918. }
  23919. else {
  23920. xGame.uiMgr.Show(UIMsg$1, msg);
  23921. }
  23922. }
  23923. catch (error) {
  23924. console.log('error=' + error);
  23925. alert(error);
  23926. }
  23927. finally {
  23928. }
  23929. });
  23930. }
  23931. }
  23932. UIFuli1$1.uiName = "UIFuli1";
  23933. class UIFuli2$1 extends UIBase {
  23934. constructor() {
  23935. super();
  23936. this.jiage = 14.99;
  23937. }
  23938. onConstructor() {
  23939. this.ui = ui_UIFuli2.createInstance();
  23940. this.contentPane = this.ui;
  23941. this.isEject = false;
  23942. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23943. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23944. }
  23945. show() {
  23946. super.show();
  23947. this.x = (Laya.stage.width - this.width) / 2;
  23948. this.y = (Laya.stage.height - this.height) / 2;
  23949. this.ui.n2.txt_price.text = "$" + this.jiage;
  23950. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  23951. this.setGlobalFont(this.ui);
  23952. }
  23953. closeSelf() {
  23954. DataMgr.loadUserSpOrderForAd();
  23955. this.hide();
  23956. }
  23957. gotoBuy() {
  23958. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23959. if (userInfo != null) {
  23960. let token = userInfo.token;
  23961. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23962. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23963. DataMgr.loadUserSpOrderForAd();
  23964. return;
  23965. }
  23966. else {
  23967. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23968. }
  23969. }
  23970. gotoBuy1() {
  23971. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23972. if (userInfo == null) {
  23973. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23974. return;
  23975. }
  23976. let reqData = xGame.httpMgr.getReqData();
  23977. let pd = JSON.parse(reqData);
  23978. pd.productId = 2;
  23979. reqData = JSON.stringify(pd);
  23980. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23981. try {
  23982. console.log('zh:buySp res = ' + JSON.stringify(res));
  23983. let code = res.code;
  23984. let msg = res.msg;
  23985. if (code == 401) {
  23986. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23987. alert(TIP_MSG_key.loginTimeOut);
  23988. xGame.uiMgr.Show(UIMsg$1, msg);
  23989. return;
  23990. }
  23991. if (code == 200) {
  23992. xGame.uiMgr.Show(UIMsg$1, msg);
  23993. DataMgr.loadUserSpOrderForAd();
  23994. DataMgr.getUserZiChanInfo(false);
  23995. this.closeSelf();
  23996. }
  23997. else {
  23998. xGame.uiMgr.Show(UIMsg$1, msg);
  23999. }
  24000. }
  24001. catch (error) {
  24002. console.log('error=' + error);
  24003. alert(error);
  24004. }
  24005. finally {
  24006. }
  24007. });
  24008. }
  24009. }
  24010. UIFuli2$1.uiName = "UIFuli2";
  24011. class UITry$1 extends UIBase {
  24012. constructor() {
  24013. super();
  24014. this.closeTime = 0;
  24015. this.closeNum = 0;
  24016. this.skillUrl = xGame.common.skillIconList;
  24017. }
  24018. onConstructor() {
  24019. this.ui = ui_UITry.createInstance();
  24020. this.contentPane = this.ui;
  24021. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24022. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24023. }
  24024. show() {
  24025. super.show();
  24026. this.closeNum = 0;
  24027. this.closeTime = 15;
  24028. this.ui.t0.play();
  24029. PlatMgr.showRateBanner();
  24030. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24031. Laya.timer.loop(1000, this, this.updateTime);
  24032. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24033. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24034. xGame.common.gameMgr.gamePause = true;
  24035. this.setGlobalFont(this.ui);
  24036. }
  24037. updateTime() {
  24038. if (this.closeTime > 1) {
  24039. this.closeTime--;
  24040. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24041. }
  24042. else
  24043. this.hide();
  24044. }
  24045. hide() {
  24046. Laya.timer.clearAll(this);
  24047. Moyu.showBannerAd(false);
  24048. super.hide();
  24049. xGame.common.gameMgr.gamePause = false;
  24050. }
  24051. onTry() {
  24052. console.log('zh:qjff_AD_for_uitry');
  24053. if (Laya.Browser.onAndroid) {
  24054. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24055. if (!boo) {
  24056. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24057. return;
  24058. }
  24059. }
  24060. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24061. }
  24062. else {
  24063. console.log('zh:AD 失败,直接发放奖励');
  24064. this.qjff_AD_for_uitry();
  24065. }
  24066. }
  24067. qjff_AD_for_uitry() {
  24068. let select = xGame.common.curPlayerSkillType;
  24069. DataMgr.gameData.trySkill = select;
  24070. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24071. DataMgr.saveGameData();
  24072. DataMgr.setBigSkill(select, 1);
  24073. xGame.showTip("Trial Successful");
  24074. this.hide();
  24075. }
  24076. onCancel() {
  24077. if (this.closeNum > 0) {
  24078. this.closeNum--;
  24079. if (this.closeNum < 2)
  24080. this.hide();
  24081. return;
  24082. }
  24083. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24084. this.onTry();
  24085. }
  24086. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24087. this.closeNum = 3;
  24088. }
  24089. else
  24090. this.hide();
  24091. }
  24092. }
  24093. UITry$1.uiName = "UITry";
  24094. class UIGetAward$1 extends UIBase {
  24095. constructor() {
  24096. super();
  24097. this.showTriple = true;
  24098. }
  24099. onConstructor() {
  24100. this.ui = ui_UIGetAward.createInstance();
  24101. this.contentPane = this.ui;
  24102. this.isEject = false;
  24103. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24104. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24105. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24106. }
  24107. show(arr, showTriple, callback) {
  24108. super.show();
  24109. this.ui.t0.play();
  24110. this.ui.eftNode.visible = true;
  24111. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24112. this.ui.eftNode.visible = false;
  24113. }), 1, 0, 0, 0.9);
  24114. this.awardArr = arr;
  24115. this.showTriple = showTriple;
  24116. this.callback = callback;
  24117. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24118. this.ui.myList.numItems = arr.length;
  24119. xGame.soundMgr.playSound("getaward");
  24120. this.setGlobalFont(this.ui);
  24121. }
  24122. updateSelf(index, obj) {
  24123. let temp = this.awardArr[index];
  24124. let icon = this.getIcon(temp.type);
  24125. let str = icon;
  24126. if (temp.type > 2) {
  24127. str = "s" + icon;
  24128. }
  24129. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24130. obj.myIcon.rotation = 0;
  24131. obj.numTxt.text = temp.num + "";
  24132. obj.numTxt.visible = temp.type > 2 ? false : true;
  24133. obj.nameTxt.text = this.getNameStr(temp.type);
  24134. }
  24135. renderItem(index, obj) {
  24136. this.updateSelf(index, obj);
  24137. }
  24138. tripleGetAward() {
  24139. console.log('zh:qjff_AD_for_uigetAward');
  24140. if (Laya.Browser.onAndroid) {
  24141. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24142. if (!boo) {
  24143. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24144. return;
  24145. }
  24146. }
  24147. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24148. }
  24149. else {
  24150. console.log('zh:AD 失败,直接发放奖励');
  24151. this.qjff_AD_for_uigetAward();
  24152. }
  24153. }
  24154. qjff_AD_for_uigetAward() {
  24155. this.getAward(3);
  24156. }
  24157. normalGetAward() {
  24158. if (PlatMgr.isMisVideo())
  24159. this.tripleGetAward();
  24160. else
  24161. this.getAward();
  24162. }
  24163. getAward(times = 1) {
  24164. this.hide();
  24165. for (let index = 0; index < this.awardArr.length; index++) {
  24166. this.awardArr[index].num *= times;
  24167. }
  24168. this.callback && this.callback(times != 1);
  24169. }
  24170. getIcon(type) {
  24171. switch (type) {
  24172. case Prop.diamond:
  24173. return "ty_zs";
  24174. case Prop.coin:
  24175. return "ty_jb";
  24176. case Prop.gan1:
  24177. return "qg1";
  24178. case Prop.gan2:
  24179. return "qg2";
  24180. case Prop.gan3:
  24181. return "qg3";
  24182. case Prop.gan4:
  24183. return "qg4";
  24184. default:
  24185. break;
  24186. }
  24187. }
  24188. getNameStr(type) {
  24189. switch (type) {
  24190. case Prop.diamond:
  24191. return "Diamond";
  24192. case Prop.coin:
  24193. return "Coins";
  24194. case Prop.gan1:
  24195. case Prop.gan2:
  24196. case Prop.gan3:
  24197. case Prop.gan4:
  24198. return cfgTable.ballrodData[type - 1].name;
  24199. default:
  24200. break;
  24201. }
  24202. }
  24203. }
  24204. UIGetAward$1.uiName = "UIGetAward";
  24205. class UIBox$1 extends UIBase {
  24206. constructor() {
  24207. super();
  24208. this.boxNum = 0;
  24209. this.boxMax = 10;
  24210. this.inAd = false;
  24211. this.isClose = false;
  24212. }
  24213. onConstructor() {
  24214. this.ui = ui_UIBox.createInstance();
  24215. this.contentPane = this.ui;
  24216. this.isEject = false;
  24217. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24218. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24219. Laya.timer.loop(1000, this, this.update);
  24220. }
  24221. update() {
  24222. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24223. this.boxNum -= 1;
  24224. this.upBar();
  24225. }
  24226. }
  24227. upBar() {
  24228. if (this.boxNum > this.boxMax)
  24229. this.boxNum = this.boxMax;
  24230. this.ui.bar.value = this.boxNum * 10;
  24231. }
  24232. show() {
  24233. super.show();
  24234. this.isClose = false;
  24235. this.boxNum = 0;
  24236. this.inAd = false;
  24237. this.upBar();
  24238. this.ui.t0.play();
  24239. this.ui.closeBtn.visible = false;
  24240. Laya.timer.once(3000, this, () => {
  24241. this.ui.closeBtn.visible = true;
  24242. this.ui.bar.alpha = 1;
  24243. });
  24244. Laya.timer.once(500, this, () => {
  24245. this.ui.t1.play();
  24246. });
  24247. this.setGlobalFont(this.ui);
  24248. }
  24249. hide() {
  24250. Laya.timer.clearAll(this);
  24251. Moyu.showBannerAd(false);
  24252. super.hide();
  24253. }
  24254. onOpenBox() {
  24255. this.boxNum++;
  24256. if (this.boxNum < this.boxMax) {
  24257. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24258. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24259. }
  24260. }
  24261. else if (this.boxNum == this.boxMax) {
  24262. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24263. this.ui.openBtn.c1.selectedIndex = 13;
  24264. this.inAd = true;
  24265. }
  24266. else
  24267. this.getAward();
  24268. }
  24269. else if (this.inAd) {
  24270. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24271. if (Laya.Browser.onAndroid) {
  24272. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24273. if (!boo) {
  24274. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24275. return;
  24276. }
  24277. }
  24278. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24279. }
  24280. else {
  24281. console.log('zh:AD 失败,直接发放奖励');
  24282. this.qjff_AD_for_UIBOX_onOpenBox();
  24283. }
  24284. }
  24285. this.upBar();
  24286. }
  24287. qjff_AD_for_UIBOX_onOpenBox() {
  24288. this.getAward();
  24289. }
  24290. onCloseBox() {
  24291. if (this.isClose)
  24292. this.hide();
  24293. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24294. this.isClose = true;
  24295. PlatMgr.showBanner(true, 0, 3000);
  24296. }
  24297. else
  24298. this.hide();
  24299. }
  24300. getAward() {
  24301. let str = "";
  24302. if (Math.random() < 0.5) {
  24303. let max = Moyu.isLegal ? 500 : 2500;
  24304. let num = xGame.tools.random(max, 500 + max);
  24305. DataMgr.setCoin(num);
  24306. str = "金币x" + num;
  24307. }
  24308. else {
  24309. let max = Moyu.isLegal ? 10 : 30;
  24310. let num = xGame.tools.random(max, 30 + max);
  24311. DataMgr.setDiamond(num);
  24312. str = "钻石x" + num;
  24313. }
  24314. xGame.showTip("恭喜获得-" + str);
  24315. this.hide();
  24316. }
  24317. }
  24318. UIBox$1.uiName = "UIBox";
  24319. class UIMain$1 extends UIBase {
  24320. constructor() {
  24321. super();
  24322. this.firstEnter = true;
  24323. }
  24324. nativeCallJs(msg) {
  24325. let t = msg;
  24326. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24327. switch (t) {
  24328. case 'qjff_chouJiang':
  24329. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24330. dui.qjff_chouJiang();
  24331. break;
  24332. case 'qjff_AD_for_uisign':
  24333. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24334. dui2.qjff_AD_for_uisign();
  24335. break;
  24336. case 'qjff_AD_for_uitry':
  24337. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24338. dui3.qjff_AD_for_uitry();
  24339. break;
  24340. case 'qjff_AD_for_uipower':
  24341. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24342. dui4.qjff_AD_for_uipower();
  24343. break;
  24344. case 'qjff_AD_for_uigetAward':
  24345. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24346. dui5.qjff_AD_for_uigetAward();
  24347. break;
  24348. case 'qjff_AD_for_uiGameEnd':
  24349. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24350. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24351. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24352. break;
  24353. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24354. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24355. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24356. break;
  24357. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24358. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24359. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24360. break;
  24361. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24362. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24363. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24364. break;
  24365. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24366. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24367. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24368. break;
  24369. case 'qjff_AD_for_UIBOX_onOpenBox':
  24370. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24371. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24372. break;
  24373. case 'qjff_AD_for_UIAddCoin':
  24374. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24375. dui12.qjff_AD_for_UIAddCoin();
  24376. break;
  24377. case 'app_sign_for_buyProduct_onSuccess':
  24378. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24379. DataMgr.getUserZiChanInfo(false);
  24380. break;
  24381. case '222axxxxxx':
  24382. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24383. dui15.qjff_AD_for_uisign();
  24384. break;
  24385. case '333axsxxxxxx':
  24386. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24387. dui16.qjff_AD_for_uisign();
  24388. break;
  24389. default:
  24390. console.log('zh:未知的方法名字' + t);
  24391. break;
  24392. }
  24393. }
  24394. onConstructor() {
  24395. console.log('zh: UIMain onConstructor');
  24396. this.ui = ui_UIMain.createInstance();
  24397. this.contentPane = this.ui;
  24398. this.isEject = false;
  24399. this.addEvent();
  24400. this.addClickSpine();
  24401. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24402. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24403. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24404. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24405. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24406. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24407. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24408. let curUse = DataMgr.getCurSecretary();
  24409. this.changeSecretary(curUse);
  24410. this.ui.talkNode.visible = false;
  24411. let guide = DataMgr.getSkillGuide();
  24412. if (xGame.common.isNewDay && guide == 1) {
  24413. xGame.common.isNewDay = false;
  24414. xGame.soundMgr.playSound("s_main01");
  24415. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24416. console.log("zh:播放小秘书每天语音");
  24417. }
  24418. this.onGetUserInfo();
  24419. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24420. DataMgr.getUserZiChanInfo(false);
  24421. }
  24422. this.ui.n83.visible = false;
  24423. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24424. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24425. let ua = d.username;
  24426. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24427. }
  24428. this.c_btn_for_user();
  24429. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24430. }
  24431. Logout() {
  24432. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24433. LocalStorageManager.removeItem(keyForLoginInfo);
  24434. this.freshUser();
  24435. }
  24436. JSBridgeUtils.instance.loginOutForApp();
  24437. this.setUserDefaultNickname();
  24438. DataMgr.setCoin2(4000);
  24439. DataMgr.setDiamond2(0);
  24440. this.setDefaultQiuGanInfo();
  24441. DataMgr.setPlaceBallLevelList("");
  24442. DataMgr.setChallengeMode_overLev(1);
  24443. this.setDefaultSignData();
  24444. }
  24445. setDefaultSignData() {
  24446. DataMgr.setSignData(1);
  24447. DataMgr.setSignTime(new Date().getTime());
  24448. }
  24449. setDefaultQiuGanInfo() {
  24450. DataMgr.setBallRod(0, 1);
  24451. DataMgr.setBallRod(1, 0);
  24452. DataMgr.setBallRod(2, 0);
  24453. DataMgr.setBallRod(3, 0);
  24454. DataMgr.setBallRod(4, 0);
  24455. DataMgr.setBallRod(5, 1);
  24456. }
  24457. setUserDefaultNickname() {
  24458. let defUsername = "player";
  24459. this.ui.headNode.nameTxt.text = defUsername;
  24460. DataMgr.updateUserNickName(defUsername);
  24461. Moyu.updateUserInfo(defUsername);
  24462. }
  24463. gotoLogin() {
  24464. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24465. xGame.uiMgr.Show(UILogin$1);
  24466. }
  24467. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24468. this.Logout();
  24469. }
  24470. }
  24471. gotoRegUser() {
  24472. xGame.uiMgr.Show(UIReg$1);
  24473. }
  24474. showFuLiSp1() {
  24475. console.log('zh:福利1');
  24476. this.checkForShowFuLi17(1);
  24477. }
  24478. showFuLiSp7() {
  24479. console.log('zh:福利7');
  24480. this.checkForShowFuLi17(7);
  24481. }
  24482. checkForShowFuLi17(spid) {
  24483. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24484. if (userInfo == null) {
  24485. if (spid === 1) {
  24486. xGame.uiMgr.Show(UIFuli1$1);
  24487. }
  24488. if (spid === 7) {
  24489. xGame.uiMgr.Show(UIFuli2$1);
  24490. }
  24491. return;
  24492. }
  24493. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24494. let reqData = xGame.httpMgr.getReqData();
  24495. let pd = JSON.parse(reqData);
  24496. pd.productId = spid;
  24497. reqData = JSON.stringify(pd);
  24498. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24499. try {
  24500. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24501. let code = res.code;
  24502. let msg = res.msg;
  24503. if (code == 401) {
  24504. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24505. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24506. return;
  24507. }
  24508. if (code == 200) {
  24509. let isBuyOk = res.data;
  24510. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24511. if (isBuyOk === false) {
  24512. if (spid === 1) {
  24513. xGame.uiMgr.Show(UIFuli1$1);
  24514. }
  24515. if (spid === 7) {
  24516. xGame.uiMgr.Show(UIFuli2$1);
  24517. }
  24518. }
  24519. else {
  24520. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24521. }
  24522. }
  24523. else {
  24524. xGame.uiMgr.Show(UIMsg$1, msg);
  24525. }
  24526. }
  24527. catch (error) {
  24528. console.log('error=' + error);
  24529. alert(error);
  24530. }
  24531. finally {
  24532. }
  24533. });
  24534. }
  24535. c_btn_for_user() {
  24536. this.ui.n_dengLu.c1.selectedIndex = 0;
  24537. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24538. this.ui.n_dengLu.c1.selectedIndex = 1;
  24539. }
  24540. else {
  24541. this.ui.n_dengLu.c1.selectedIndex = 0;
  24542. }
  24543. }
  24544. changeSecretary(curUse) {
  24545. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24546. xGame.common.secretary && xGame.common.secretary.dispose();
  24547. this.addSecretarySpine(name);
  24548. }
  24549. addSecretarySpine(name) {
  24550. let spine = new SpineMgr(name, () => {
  24551. this.playSecretaryIdle();
  24552. });
  24553. xGame.common.secretary = spine;
  24554. }
  24555. addClickSpine() {
  24556. let clickSpine = new SpineMgr("dianji", () => {
  24557. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24558. let parent = Laya.stage;
  24559. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24560. clickSpine.play(data, 0, false, parent, (spine) => {
  24561. spine.destroy(true);
  24562. });
  24563. });
  24564. });
  24565. }
  24566. addEvent() {
  24567. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24568. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24569. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24570. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24571. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24572. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24573. this.addUIClick(this.ui, this.interuptSecretary);
  24574. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24575. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24576. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24577. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24578. this.addUIClick(this.ui.signBtn, this.openSignView);
  24579. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24580. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24581. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24582. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24583. }
  24584. show(showFailWords) {
  24585. super.show();
  24586. DataMgr.loadUserSpOrderForAd();
  24587. this.moneyNode.ui.c1.selectedIndex = 1;
  24588. this.playSecretaryIdle();
  24589. xGame.soundMgr.playMusic("caromhall01", 0);
  24590. Laya.timer.clearAll(this);
  24591. this.playSecretaryRandomSound();
  24592. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24593. if (showFailWords) {
  24594. console.log('zh:uimain.ts ');
  24595. setTimeout(() => {
  24596. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24597. let words = -1;
  24598. if (str == "s_main02") {
  24599. words = 2;
  24600. }
  24601. else {
  24602. words = 3;
  24603. }
  24604. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24605. xGame.soundMgr.playSound(str);
  24606. }, 300);
  24607. }
  24608. this.showGuide();
  24609. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24610. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24611. let guide = DataMgr.getSkillGuide();
  24612. if (guide == 1) {
  24613. let randTime = xGame.common.randomNum(300, 800);
  24614. if (this.firstEnter) {
  24615. console.log("zh: firstEnter");
  24616. this.firstEnter = false;
  24617. randTime += 900;
  24618. }
  24619. else {
  24620. console.log("zh: no firstEnter");
  24621. }
  24622. Laya.timer.once(randTime, this, () => {
  24623. });
  24624. Laya.timer.once(1000, this, () => {
  24625. console.log('zh: 1秒后 showFuLiSp1');
  24626. this.showFuLiSp1();
  24627. });
  24628. Laya.timer.once(10000, this, () => {
  24629. console.log('zh: 10秒后 showFuLiSp1');
  24630. this.showFuLiSp7();
  24631. });
  24632. }
  24633. this.setGlobalFont(this.ui);
  24634. }
  24635. checkActive(show) {
  24636. }
  24637. showGuide() {
  24638. let guide = DataMgr.getSkillGuide();
  24639. this.ui.guideBtn.visible = guide == 0;
  24640. this.ui.enterGuide.visible = false;
  24641. this.ui.secretaryGuide.visible = guide == 0;
  24642. if (guide == 0) {
  24643. console.log("zh:显示引导");
  24644. xGame.soundMgr.playSound("s_guide");
  24645. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24646. }
  24647. else {
  24648. console.log("zh:不需要显示引导");
  24649. }
  24650. }
  24651. ensureSecretary() {
  24652. console.log('zh: ensureSecretary ');
  24653. this.ui.secretaryGuide.visible = false;
  24654. this.ui.enterGuide.visible = true;
  24655. this.ui.wordsNode.t0.play();
  24656. if (DataMgr.getNewUser())
  24657. Moyu.sendDataEvent("gameReady");
  24658. }
  24659. playSecretaryIdle() {
  24660. let parent = this.ui.secretary.displayObject;
  24661. parent.destroyChildren();
  24662. let xx = this.ui.secretary.width / 2;
  24663. let yy = this.ui.secretary.height;
  24664. let scale = xGame.common.getSecretaryScale();
  24665. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24666. xGame.common.secretary.play(data, 0, true, parent);
  24667. }
  24668. startGame(type) {
  24669. if (!this.isReadyForLoadNetSource()) {
  24670. return;
  24671. }
  24672. xGame.common.gameMode = type;
  24673. Moyu.sendDataEvent("PlayGame", { type: type });
  24674. let gm = xGame.common.gameMode;
  24675. console.log('zh:进入游戏gameMode =' + gm);
  24676. switch (gm) {
  24677. case GameMode.classic:
  24678. console.log('zh:进入经典模式111111111');
  24679. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24680. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24681. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24682. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24683. console.log('zh:判断是否可以玩该模式classic =NO');
  24684. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24685. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24686. return;
  24687. }
  24688. else {
  24689. console.log('zh:可以玩该模式classic');
  24690. this.beginGame();
  24691. }
  24692. }
  24693. else {
  24694. console.log('zh:不需要判断是否可以玩该classic');
  24695. let challengeTimes = DataMgr.getChallengeTimes();
  24696. if (challengeTimes == 0) {
  24697. xGame.uiMgr.Show(UIInvitation$1);
  24698. }
  24699. else {
  24700. this.beginGame();
  24701. }
  24702. }
  24703. break;
  24704. case GameMode.bigMove:
  24705. console.info('zh:bigMove check 大招');
  24706. let guide = DataMgr.getSkillGuide();
  24707. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24708. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24709. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24710. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24711. console.log('zh:提示不可以玩');
  24712. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24713. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24714. return;
  24715. }
  24716. else {
  24717. console.log('zh:可以玩该模式 bigMove');
  24718. this.beginGame();
  24719. if (DataMgr.getNewUser())
  24720. Moyu.sendDataEvent("gameStart0");
  24721. }
  24722. }
  24723. else {
  24724. this.beginGame();
  24725. if (DataMgr.getNewUser())
  24726. Moyu.sendDataEvent("gameStart0");
  24727. }
  24728. break;
  24729. default:
  24730. console.error('zh:未知错误!!!!');
  24731. break;
  24732. }
  24733. }
  24734. beginGame(isNice = false) {
  24735. console.log('zh:beginGame ');
  24736. let guide = DataMgr.getSkillGuide();
  24737. if (guide == 1) {
  24738. console.log('zh:非新手引导,showInternAd ');
  24739. JSBridgeUtils.instance.showInternAd('beginGame');
  24740. }
  24741. else {
  24742. console.log('zh:新手引导,不显示AD ');
  24743. }
  24744. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24745. console.log('zh:beginGame 1');
  24746. if (xGame.common.gameMode == GameMode.classic) {
  24747. console.log('zh:beginGame 2');
  24748. if (isNice) {
  24749. console.log('zh:进入巅峰赛');
  24750. this.enterClassic();
  24751. }
  24752. else {
  24753. console.log('zh:beginGame 3-1');
  24754. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24755. console.log('zh:beginGame 3-2');
  24756. this.enterClassic();
  24757. });
  24758. }
  24759. }
  24760. else if (xGame.common.gameMode == GameMode.bigMove) {
  24761. console.log('zh:beginGame 5');
  24762. this.ui.enterGuide.visible = false;
  24763. xGame.uiMgr.Show(UISkill$1);
  24764. }
  24765. }
  24766. enterClassic() {
  24767. console.log('zh:beginGame 7');
  24768. xGame.uiMgr.Show(UIGame$1);
  24769. xGame.uiMgr.Show(UIMatching$1, () => {
  24770. if (!this.isHide)
  24771. this.hide();
  24772. xGame.common.gameUI.ui.alpha = 1;
  24773. console.log('zh:beginGame 8');
  24774. xGame.common.gameUI.startGame();
  24775. xGame.uiMgr.Hide(UIGameEnd$1);
  24776. });
  24777. }
  24778. start_debug_for_moni_payOk() {
  24779. console.log('zh:start_debug_for_moni_payOk');
  24780. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24781. if (userInfo != null) {
  24782. let token = userInfo.token;
  24783. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24784. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24785. alert('模拟支付OK');
  24786. return;
  24787. }
  24788. else {
  24789. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24790. }
  24791. }
  24792. startGlobal() {
  24793. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24794. }
  24795. startWeekly() {
  24796. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24797. }
  24798. zhouSaiMonth() {
  24799. console.log('zh: zhouSaiMonth 被调用');
  24800. }
  24801. isReadyForLoadNetSource() {
  24802. let reqCount = xGame.cfgMgr.httpReqCount;
  24803. let ok = xGame.cfgMgr.httpReqOkCount;
  24804. if (reqCount > ok) {
  24805. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24806. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24807. Laya.timer.once(5000, this, () => {
  24808. let retryCount = 0;
  24809. const maxRetries = 3;
  24810. const tryFetchConfig = () => {
  24811. try {
  24812. xGame.cfgMgr.getConfigFromServer();
  24813. }
  24814. catch (error) {
  24815. if (retryCount < maxRetries) {
  24816. retryCount++;
  24817. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24818. Laya.timer.once(5000, this, tryFetchConfig);
  24819. }
  24820. else {
  24821. console.error("❌ 达到最大重试次数,配置获取失败");
  24822. }
  24823. }
  24824. };
  24825. tryFetchConfig();
  24826. });
  24827. return false;
  24828. }
  24829. return true;
  24830. }
  24831. startPlaceBall() {
  24832. if (!this.isReadyForLoadNetSource()) {
  24833. return;
  24834. }
  24835. xGame.uiMgr.Show(UILevelDisplay$1);
  24836. }
  24837. hide() {
  24838. console.log('zh:uimain hide ...');
  24839. super.hide();
  24840. xGame.common.stopGirlPop(this.ui.talkNode);
  24841. }
  24842. onGetUserInfo(force = false) {
  24843. if (Moyu.isWx) {
  24844. let info = Moyu.getSystemInfo();
  24845. if (info)
  24846. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24847. }
  24848. else {
  24849. Moyu.initUser(this, this.freshUser, force);
  24850. }
  24851. this.freshUser();
  24852. console.log('zh:5秒后更新用户信息');
  24853. setTimeout(() => {
  24854. DataMgr.getUserZiChanInfo(true);
  24855. }, 5000);
  24856. }
  24857. event_login_in() {
  24858. console.log("zh:event_login_in被触发");
  24859. this.freshUser();
  24860. }
  24861. freshUser() {
  24862. let user = Moyu.getUserInfo();
  24863. if (!user.isAuth) {
  24864. user.headIcon = 'res/ty_touxiang.png';
  24865. }
  24866. else {
  24867. DataMgr.upRankData();
  24868. }
  24869. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24870. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24871. let keyStr = keyForLoginInfo;
  24872. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24873. const d = LocalStorageManager.getItem(keyStr);
  24874. let ua = d.username;
  24875. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24876. }
  24877. else {
  24878. }
  24879. this.c_btn_for_user();
  24880. }
  24881. interuptSecretary() {
  24882. Laya.timer.clearAll(this);
  24883. this.playSecretaryRandomSound();
  24884. }
  24885. playSecretaryRandomSound() {
  24886. if (this.isHide)
  24887. return;
  24888. let time = xGame.common.randomNum(45000, 60000);
  24889. Laya.timer.once(time, this, () => {
  24890. if (this.isHide)
  24891. return;
  24892. let index = xGame.common.randomNum(4, 7);
  24893. xGame.soundMgr.playSound("s_main0" + index);
  24894. let words = 1;
  24895. switch (index) {
  24896. case 4:
  24897. words = 5;
  24898. break;
  24899. case 5:
  24900. words = 3;
  24901. break;
  24902. case 6:
  24903. words = 6;
  24904. break;
  24905. case 7:
  24906. words = 7;
  24907. break;
  24908. default:
  24909. break;
  24910. }
  24911. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24912. this.playSecretaryRandomSound();
  24913. });
  24914. }
  24915. openSecretaryView() {
  24916. xGame.uiMgr.Show(UISecretary$1);
  24917. Moyu.sendDataEvent("secretary");
  24918. }
  24919. openShopView() {
  24920. xGame.uiMgr.Show(UIShop$1, 1);
  24921. }
  24922. openShopView0() {
  24923. xGame.uiMgr.Show(UIShop$1, 0);
  24924. }
  24925. openSignView() {
  24926. xGame.uiMgr.Show(UISign$1);
  24927. }
  24928. openDrawView() {
  24929. xGame.uiMgr.Show(UIDraw$1);
  24930. }
  24931. openRanking() {
  24932. console.log('zh:phb openRanking');
  24933. xGame.uiMgr.Show(UIRanking$1);
  24934. Moyu.sendDataEvent("rankingList");
  24935. }
  24936. }
  24937. UIMain$1.uiName = "UIMain";
  24938. function InitShader() {
  24939. }
  24940. function appInit() {
  24941. xGame.context.init(getLoadingResList(), initCallback);
  24942. }
  24943. function getLoadingResList() {
  24944. return [
  24945. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24946. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24947. ];
  24948. }
  24949. function getGameResList() {
  24950. return [
  24951. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24952. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24953. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24954. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24955. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24956. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24957. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24958. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24959. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24960. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24961. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24962. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24963. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24964. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24965. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24966. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24967. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24968. ];
  24969. }
  24970. function initCallback() {
  24971. window["DataMgr"] = DataMgr;
  24972. DataMgr.Init();
  24973. Moyu.init(getPlat(), this, () => {
  24974. DataMgr.isNewDay();
  24975. PlatMgr.initConfig();
  24976. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24977. }, true);
  24978. console.log('zh:开始sm init1 start');
  24979. xGame.soundMgr.init();
  24980. console.log('zh:开始sm init1 end');
  24981. xGame.uiMgr.init();
  24982. xGame.uiMgr.clearTempData();
  24983. xGame.uiMgr.bindFUI(fguiRes.loading);
  24984. xGame.uiMgr.Show(UILoading);
  24985. }
  24986. function onFontLoaded() {
  24987. try {
  24988. Laya.Text.defaultFont = "arial";
  24989. console.log("zh: onFontLoaded 设置arial字体成功");
  24990. }
  24991. catch (error) {
  24992. console.log("zh: constructor onFontLoaded加载arial字体失败");
  24993. }
  24994. }
  24995. function loadSubRes(callback) {
  24996. var tab = ["asset", "res", "spine"];
  24997. let subDone = 0;
  24998. for (var i = 0; i < tab.length; i++) {
  24999. let sub = tab[i];
  25000. Moyu.loadSubRes(sub, (pro) => {
  25001. callback && callback(pro, false);
  25002. }).then(() => {
  25003. subDone++;
  25004. if (subDone >= tab.length)
  25005. callback && callback(1, true);
  25006. });
  25007. }
  25008. }
  25009. function enterGame() {
  25010. xGame.cfgMgr.init();
  25011. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25012. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25013. xGame.uiMgr.Hide(UILoading);
  25014. fgui.UIPackage.removePackage(fguiRes.loading);
  25015. xGame.uiMgr.bindFUI(fguiRes.game);
  25016. xGame.uiMgr.Show(UIMain$1);
  25017. if (DataMgr.getNewUser())
  25018. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25019. }
  25020. function getPlat() {
  25021. let cfg = new MoyuCfg();
  25022. cfg.plat = MoyuPlat.web;
  25023. cfg.myId = 180;
  25024. cfg.myKey = '8848a885774230a4';
  25025. cfg.version = 0;
  25026. if (window.hasOwnProperty("gamebox")) {
  25027. cfg.plat = MoyuPlat.f399;
  25028. cfg.version = 0;
  25029. }
  25030. else if (window.hasOwnProperty("ks")) {
  25031. cfg.plat = MoyuPlat.ks;
  25032. cfg.version = 0;
  25033. cfg.ads.ksVideoId = '2300002254_01';
  25034. cfg.ads.ksInsertId = '2300002254_02';
  25035. }
  25036. else if (Laya.Browser.onTTMiniGame) {
  25037. cfg.plat = MoyuPlat.tt;
  25038. cfg.version = 0;
  25039. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25040. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25041. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25042. }
  25043. else if (Laya.Browser.onMiniGame) {
  25044. cfg.plat = MoyuPlat.wx;
  25045. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25046. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25047. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25048. }
  25049. else if (Laya.Browser.onQQMiniGame) {
  25050. cfg.plat = MoyuPlat.qq;
  25051. }
  25052. else if (Laya.Browser.onQGMiniGame) {
  25053. cfg.plat = MoyuPlat.op;
  25054. cfg.ads.opVideoId = '455502';
  25055. cfg.ads.opBannerId = '455507';
  25056. }
  25057. else if (Laya.Browser.onVVMiniGame) {
  25058. cfg.plat = MoyuPlat.vv;
  25059. cfg.version = 0;
  25060. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25061. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25062. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25063. }
  25064. else if (Laya.Browser.onHWMiniGame) {
  25065. cfg.plat = MoyuPlat.hw;
  25066. }
  25067. else if (window["mz"]) {
  25068. cfg.plat = MoyuPlat.mz;
  25069. }
  25070. else {
  25071. let cfg = window['conchConfig'];
  25072. if (cfg) {
  25073. var os = cfg.getOS();
  25074. if (os == "Conch-ios") {
  25075. cfg.plat = MoyuPlat.ios;
  25076. }
  25077. else if (os == "Conch-android") {
  25078. }
  25079. }
  25080. }
  25081. return cfg;
  25082. }
  25083. class Main {
  25084. constructor() {
  25085. if (window["Laya3D"])
  25086. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25087. else {
  25088. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25089. this.initMain();
  25090. }
  25091. }
  25092. initMain() {
  25093. Laya["Physics"] && Laya["Physics"].enable();
  25094. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25095. Laya.stage.scaleMode = GameConfig.scaleMode;
  25096. Laya.stage.screenMode = GameConfig.screenMode;
  25097. Laya.stage.alignV = GameConfig.alignV;
  25098. Laya.stage.alignH = GameConfig.alignH;
  25099. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25100. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25101. Laya.enableDebugPanel();
  25102. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25103. Laya["PhysicsDebugDraw"].enable();
  25104. if (GameConfig.stat)
  25105. Laya.Stat.show();
  25106. Laya.alertGlobalError(true);
  25107. this.loadFont();
  25108. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25109. }
  25110. loadFont() {
  25111. try {
  25112. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25113. console.log("zh: constructor加载arial字体成功1");
  25114. }
  25115. catch (error) {
  25116. console.log("zh: constructor加载arial字体失败1");
  25117. }
  25118. }
  25119. onFontLoaded() {
  25120. try {
  25121. Laya.Text.defaultFont = "Arial";
  25122. console.log("zh: onFontLoaded 设置arial字体成功1");
  25123. }
  25124. catch (error) {
  25125. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25126. }
  25127. }
  25128. onVersionLoaded() {
  25129. appInit();
  25130. }
  25131. }
  25132. new Main();
  25133. }());
  25134. //# sourceMappingURL=bundle.js.map