bundle.js 1006 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162
  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 true;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return true;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. return boo;
  1450. }
  1451. showToast2(msg) {
  1452. if (!Laya.Browser.onAndroid) {
  1453. return;
  1454. }
  1455. if (!this.initBridge()) {
  1456. return;
  1457. }
  1458. this.bridge.call("showToast2", msg);
  1459. }
  1460. showConfirmationDialogForExit(title, msg) {
  1461. if (!Laya.Browser.onAndroid) {
  1462. return;
  1463. }
  1464. if (!this.initBridge()) {
  1465. return;
  1466. }
  1467. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1468. }
  1469. loginOutForApp() {
  1470. if (!Laya.Browser.onAndroid) {
  1471. return;
  1472. }
  1473. if (!this.initBridge()) {
  1474. return;
  1475. }
  1476. this.bridge.call("loginOutForApp");
  1477. }
  1478. startGgPay(token, ggSpid, spid) {
  1479. if (!Laya.Browser.onAndroid) {
  1480. return;
  1481. }
  1482. if (!this.initBridge()) {
  1483. return;
  1484. }
  1485. let jsonObj = {
  1486. token: token,
  1487. ggSpid: ggSpid,
  1488. spid: spid,
  1489. spsl: 1
  1490. };
  1491. let reqData = JSON.stringify(jsonObj);
  1492. console.log("zh:startGgPay ts reqData=" + reqData);
  1493. this.bridge.call("startGgPay", reqData);
  1494. }
  1495. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1496. if (!Laya.Browser.onAndroid) {
  1497. return;
  1498. }
  1499. if (!this.initBridge()) {
  1500. return;
  1501. }
  1502. let jsonObj = {
  1503. token: token,
  1504. ggSpid: ggSpid,
  1505. spid: spid,
  1506. spsl: 1
  1507. };
  1508. let reqData = JSON.stringify(jsonObj);
  1509. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1510. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1511. }
  1512. nativeCallJs(msg) {
  1513. console.log("zh:nativeCallJs received data: 1111", msg);
  1514. if (msg === 'Ad1') {
  1515. GlobalManager.instance.callMethod('Ad1');
  1516. console.log("zh: Ad1 奖励发送成功");
  1517. }
  1518. else if (msg === 'Ad2') {
  1519. GlobalManager.instance.callMethod('Ad2');
  1520. console.log("zh: Ad2 奖励发送成功");
  1521. }
  1522. else if (msg === 'Ad3') {
  1523. GlobalManager.instance.callMethod('Ad3');
  1524. console.log("zh: Ad3 奖励发送成功");
  1525. }
  1526. else if (msg === 'Ad4') {
  1527. GlobalManager.instance.callMethod('Ad4');
  1528. console.log("zh: Ad4 奖励发送成功");
  1529. }
  1530. else if (msg === 'Ad5') {
  1531. console.log("zh: Ad5 奖励发送成功");
  1532. GlobalManager.instance.callMethod('Ad5');
  1533. }
  1534. }
  1535. }
  1536. class UIBox extends UIBase {
  1537. constructor() {
  1538. super();
  1539. this.boxNum = 0;
  1540. this.boxMax = 10;
  1541. this.inAd = false;
  1542. this.isClose = false;
  1543. }
  1544. onConstructor() {
  1545. this.ui = ui_UIBox.createInstance();
  1546. this.contentPane = this.ui;
  1547. this.isEject = false;
  1548. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1549. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1550. Laya.timer.loop(1000, this, this.update);
  1551. }
  1552. update() {
  1553. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1554. this.boxNum -= 1;
  1555. this.upBar();
  1556. }
  1557. }
  1558. upBar() {
  1559. if (this.boxNum > this.boxMax)
  1560. this.boxNum = this.boxMax;
  1561. this.ui.bar.value = this.boxNum * 10;
  1562. }
  1563. show() {
  1564. super.show();
  1565. this.isClose = false;
  1566. this.boxNum = 0;
  1567. this.inAd = false;
  1568. this.upBar();
  1569. this.ui.t0.play();
  1570. this.ui.closeBtn.visible = false;
  1571. Laya.timer.once(3000, this, () => {
  1572. this.ui.closeBtn.visible = true;
  1573. this.ui.bar.alpha = 1;
  1574. });
  1575. Laya.timer.once(500, this, () => {
  1576. this.ui.t1.play();
  1577. });
  1578. this.setGlobalFont(this.ui);
  1579. }
  1580. hide() {
  1581. Laya.timer.clearAll(this);
  1582. Moyu.showBannerAd(false);
  1583. super.hide();
  1584. }
  1585. onOpenBox() {
  1586. this.boxNum++;
  1587. if (this.boxNum < this.boxMax) {
  1588. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1589. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1590. }
  1591. }
  1592. else if (this.boxNum == this.boxMax) {
  1593. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1594. this.ui.openBtn.c1.selectedIndex = 13;
  1595. this.inAd = true;
  1596. }
  1597. else
  1598. this.getAward();
  1599. }
  1600. else if (this.inAd) {
  1601. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1602. if (Laya.Browser.onAndroid) {
  1603. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1604. if (!boo) {
  1605. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1606. return;
  1607. }
  1608. }
  1609. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1610. }
  1611. else {
  1612. console.log('zh:AD 失败,直接发放奖励');
  1613. this.qjff_AD_for_UIBOX_onOpenBox();
  1614. }
  1615. }
  1616. this.upBar();
  1617. }
  1618. qjff_AD_for_UIBOX_onOpenBox() {
  1619. this.getAward();
  1620. }
  1621. onCloseBox() {
  1622. if (this.isClose)
  1623. this.hide();
  1624. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1625. this.isClose = true;
  1626. PlatMgr.showBanner(true, 0, 3000);
  1627. }
  1628. else
  1629. this.hide();
  1630. }
  1631. getAward() {
  1632. let str = "";
  1633. if (Math.random() < 0.5) {
  1634. let max = Moyu.isLegal ? 500 : 2500;
  1635. let num = xGame.tools.random(max, 500 + max);
  1636. DataMgr.setCoin(num);
  1637. str = "金币x" + num;
  1638. }
  1639. else {
  1640. let max = Moyu.isLegal ? 10 : 30;
  1641. let num = xGame.tools.random(max, 30 + max);
  1642. DataMgr.setDiamond(num);
  1643. str = "钻石x" + num;
  1644. }
  1645. xGame.showTip("恭喜获得-" + str);
  1646. this.hide();
  1647. }
  1648. }
  1649. UIBox.uiName = "UIBox";
  1650. class ui_UITry extends fgui.GComponent {
  1651. static createInstance() {
  1652. return (fgui.UIPackage.createObject("game", "UITry"));
  1653. }
  1654. onConstruct() {
  1655. this.n11 = (this.getChild("n11"));
  1656. this.myNode = (this.getChild("myNode"));
  1657. this.t0 = this.getTransition("t0");
  1658. }
  1659. }
  1660. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1661. class UITry extends UIBase {
  1662. constructor() {
  1663. super();
  1664. this.closeTime = 0;
  1665. this.closeNum = 0;
  1666. this.skillUrl = xGame.common.skillIconList;
  1667. }
  1668. onConstructor() {
  1669. this.ui = ui_UITry.createInstance();
  1670. this.contentPane = this.ui;
  1671. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1672. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1673. }
  1674. show() {
  1675. super.show();
  1676. this.closeNum = 0;
  1677. this.closeTime = 15;
  1678. this.ui.t0.play();
  1679. PlatMgr.showRateBanner();
  1680. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1681. Laya.timer.loop(1000, this, this.updateTime);
  1682. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1683. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1684. xGame.common.gameMgr.gamePause = true;
  1685. this.setGlobalFont(this.ui);
  1686. }
  1687. updateTime() {
  1688. if (this.closeTime > 1) {
  1689. this.closeTime--;
  1690. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1691. }
  1692. else
  1693. this.hide();
  1694. }
  1695. hide() {
  1696. Laya.timer.clearAll(this);
  1697. Moyu.showBannerAd(false);
  1698. super.hide();
  1699. xGame.common.gameMgr.gamePause = false;
  1700. }
  1701. onTry() {
  1702. console.log('zh:qjff_AD_for_uitry');
  1703. if (Laya.Browser.onAndroid) {
  1704. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1705. if (!boo) {
  1706. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1707. return;
  1708. }
  1709. }
  1710. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1711. }
  1712. else {
  1713. console.log('zh:AD 失败,直接发放奖励');
  1714. this.qjff_AD_for_uitry();
  1715. }
  1716. }
  1717. qjff_AD_for_uitry() {
  1718. let select = xGame.common.curPlayerSkillType;
  1719. DataMgr.gameData.trySkill = select;
  1720. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1721. DataMgr.saveGameData();
  1722. DataMgr.setBigSkill(select, 1);
  1723. xGame.showTip("Trial Successful");
  1724. this.hide();
  1725. }
  1726. onCancel() {
  1727. if (this.closeNum > 0) {
  1728. this.closeNum--;
  1729. if (this.closeNum < 2)
  1730. this.hide();
  1731. return;
  1732. }
  1733. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1734. this.onTry();
  1735. }
  1736. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1737. this.closeNum = 3;
  1738. }
  1739. else
  1740. this.hide();
  1741. }
  1742. }
  1743. UITry.uiName = "UITry";
  1744. class PlatMgr {
  1745. static initConfig() {
  1746. this.lastVt = 0;
  1747. if (!Moyu.platConfig)
  1748. return;
  1749. for (let k in Moyu.platConfig) {
  1750. let pd = this[k];
  1751. let pc = Moyu.platConfig[k];
  1752. if (pd != undefined && pc != undefined)
  1753. this[k] = pc;
  1754. }
  1755. Moyu.setBannerPos(0.5, 1);
  1756. }
  1757. static rand100(num) {
  1758. return xGame.tools.random(0, 100) < num;
  1759. }
  1760. static isMisVideo() {
  1761. let dt = Laya.timer.currTimer - this.lastVt;
  1762. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1763. this.lastVt = Laya.timer.currTimer;
  1764. return true;
  1765. }
  1766. else {
  1767. if (this.rand100(this.fullVideoRate)) {
  1768. console.log('zh:插屏 ad start');
  1769. JSBridgeUtils.instance.showInternAd('platMgr');
  1770. }
  1771. return false;
  1772. }
  1773. }
  1774. static showVideo(call, type) {
  1775. Moyu.showVideoAd(() => {
  1776. this.lastVt = Laya.timer.currTimer;
  1777. call && call();
  1778. }, type);
  1779. }
  1780. static showInsert(delay = false) {
  1781. if (this.getRand() < this.insertRate) {
  1782. let dt = delay ? this.insertDelay : 0;
  1783. console.log('zh:插屏 ad start');
  1784. JSBridgeUtils.instance.showInternAd('gameInsert');
  1785. }
  1786. }
  1787. static gameInsert() {
  1788. let t = this.getRand();
  1789. let r = this.gameInsertRate;
  1790. if (t < r) {
  1791. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1792. }
  1793. }
  1794. static showRateBanner() {
  1795. if (this.getRand() < this.bannerRate)
  1796. this.showBanner(true, this.bannerDelay, 3000);
  1797. }
  1798. static showBanner(show, delay = 0, hide = 0) {
  1799. if (2 > 1) {
  1800. console.log('zh:显示showBanner广告 直接返回');
  1801. return;
  1802. }
  1803. if (!show)
  1804. Moyu.showBannerAd(false);
  1805. else {
  1806. Laya.timer.clear(this, this.bannerShow);
  1807. if (delay > 0)
  1808. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1809. else
  1810. this.bannerShow(true);
  1811. if (hide > 0)
  1812. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1813. }
  1814. }
  1815. static bannerShow(show) {
  1816. if (2 > 1) {
  1817. console.log('zh:显示showBanner广告 直接返回');
  1818. return;
  1819. }
  1820. Moyu.showBannerAd(show);
  1821. console.log("showBanner" + show);
  1822. }
  1823. static getRand() {
  1824. return xGame.tools.random(0, 100);
  1825. }
  1826. static openBox() {
  1827. if (this.getRand() < this.boxRate)
  1828. xGame.uiMgr.Show(UIBox);
  1829. }
  1830. static openTry() {
  1831. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1832. return;
  1833. if (this.getRand() < this.tryRate)
  1834. xGame.uiMgr.Show(UITry);
  1835. else if (DataMgr.gameData.gameCount == 1)
  1836. xGame.uiMgr.Show(UITry);
  1837. }
  1838. }
  1839. PlatMgr.forceShare = 0;
  1840. PlatMgr.signAdRate = 0;
  1841. PlatMgr.forceVideoRate = 0;
  1842. PlatMgr.forceVideoGap = 0;
  1843. PlatMgr.fullVideoRate = 0;
  1844. PlatMgr.gameInsertRate = 0;
  1845. PlatMgr.insertGap = 0;
  1846. PlatMgr.insertDelay = 0;
  1847. PlatMgr.insertRate = 0;
  1848. PlatMgr.boxRate = 0;
  1849. PlatMgr.boxVideoRate = 0;
  1850. PlatMgr.boxInsertRate = 0;
  1851. PlatMgr.boxBannerRate = 0;
  1852. PlatMgr.tryRate = 0;
  1853. PlatMgr.tryClose3Rate = 0;
  1854. PlatMgr.tryVideoRate = 0;
  1855. PlatMgr.bannerRate = 0;
  1856. PlatMgr.lastVt = 0;
  1857. class ui_UIAddProp extends fgui.GComponent {
  1858. static createInstance() {
  1859. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1860. }
  1861. onConstruct() {
  1862. this.n11 = (this.getChild("n11"));
  1863. this.myNode = (this.getChild("myNode"));
  1864. this.closeBtn = (this.getChild("closeBtn"));
  1865. this.t0 = this.getTransition("t0");
  1866. }
  1867. }
  1868. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1869. class SpineMgr {
  1870. constructor(name, loadCb = null) {
  1871. this.loaded = false;
  1872. this.spineName = '';
  1873. this.loadedCallback = loadCb;
  1874. this.templet = new Laya.Templet();
  1875. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1876. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1877. if (name === 'mishu') {
  1878. this.templet.loadAni('spine/nvmishu.sk');
  1879. }
  1880. else {
  1881. this.templet.loadAni(`spine/${name}.sk`);
  1882. }
  1883. this.templet.lock = true;
  1884. this.spineName = name;
  1885. }
  1886. onError() {
  1887. console.log("zh:spine加载出错");
  1888. }
  1889. parseComplete() {
  1890. this.loaded = true;
  1891. this.loadedCallback && this.loadedCallback();
  1892. }
  1893. dispose() {
  1894. if (this.templet && !this.templet.destroyed) {
  1895. this.templet.destroy();
  1896. }
  1897. this.templet = null;
  1898. }
  1899. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1900. if (!this.loaded) {
  1901. return;
  1902. }
  1903. let spine;
  1904. if (mySpine) {
  1905. spine = mySpine;
  1906. }
  1907. else {
  1908. spine = this.createSpine(data, parent);
  1909. }
  1910. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1911. if (!isLoop) {
  1912. spine.on(Laya.Event.STOPPED, this, () => {
  1913. spine.offAll(Laya.Event.STOPPED);
  1914. callback && callback(spine);
  1915. });
  1916. }
  1917. return spine;
  1918. }
  1919. createSpine(data, parent, type = 1) {
  1920. let spine;
  1921. spine = this.templet.buildArmature(type);
  1922. spine.showSkinByIndex(0);
  1923. parent.addChild(spine);
  1924. spine.pos(data.x, data.y);
  1925. spine.scale(data.scaleX, data.scaleY, true);
  1926. return spine;
  1927. }
  1928. }
  1929. var AIState;
  1930. (function (AIState) {
  1931. AIState[AIState["none"] = 0] = "none";
  1932. AIState[AIState["idle"] = 1] = "idle";
  1933. AIState[AIState["reset"] = 2] = "reset";
  1934. AIState[AIState["move"] = 3] = "move";
  1935. AIState[AIState["wait"] = 4] = "wait";
  1936. AIState[AIState["select"] = 5] = "select";
  1937. AIState[AIState["turn"] = 6] = "turn";
  1938. AIState[AIState["shoot"] = 7] = "shoot";
  1939. AIState[AIState["leave"] = 8] = "leave";
  1940. })(AIState || (AIState = {}));
  1941. class AIPlayer {
  1942. constructor() {
  1943. this.dtime = 30;
  1944. this.awayTime = 0;
  1945. this.awayNum = 0;
  1946. this.hideTime = 0;
  1947. this.rootMoveTime = 0;
  1948. this.isGuide = false;
  1949. this.state = AIState.none;
  1950. this.waitTime = 0;
  1951. this.forceNum = 0;
  1952. this.forceMax = 0;
  1953. this.ballSize = 33;
  1954. this.selectNum = 0;
  1955. this.destRot = 0;
  1956. this.aiLv = 10;
  1957. this.kickBall = [];
  1958. this.lineBall = [];
  1959. this.scoreBall = [];
  1960. this.holeBall = [];
  1961. this.turnNum = 0;
  1962. this.setNum = 0;
  1963. this.setMax = 0;
  1964. this.setRate = 0;
  1965. this.rectL = 0;
  1966. this.rectR = 0;
  1967. this.rectT = 0;
  1968. this.rectB = 0;
  1969. this.rootPos = { x: 0, y: 0 };
  1970. this.bestForce = 0;
  1971. this.bestAngle = 180;
  1972. this.bestPos = { x: 0, y: 0 };
  1973. this.bestKick = { x: 0, y: 0 };
  1974. this.posList = [];
  1975. this.posIdx = 0;
  1976. this.chatTime = 3000;
  1977. this.tempDir1 = new Laya.Vector2();
  1978. this.tempDir2 = new Laya.Vector2();
  1979. this.tempDir3 = new Laya.Vector2();
  1980. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1981. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1982. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1983. this.gameSrc = xGame.common.gameUI;
  1984. this.hideTime = Laya.timer.currTimer;
  1985. Moyu.setOnTipCall((id) => {
  1986. if (id == 20012)
  1987. this.hideTime = Laya.timer.currTimer;
  1988. else
  1989. (id == 20011);
  1990. {
  1991. let dt = Laya.timer.currTimer - this.hideTime;
  1992. console.log("onshow" + dt);
  1993. if (dt > 30000 && this.state > AIState.none)
  1994. xGame.common.gameMgr.aiGameEnd(false);
  1995. }
  1996. }, this);
  1997. }
  1998. init() {
  1999. let ggg = 1;
  2000. if (DataMgr.getGuideDefaultModel() === 1) {
  2001. ggg = DataMgr.getLianXiGuide();
  2002. }
  2003. else {
  2004. ggg = DataMgr.getSkillGuide();
  2005. }
  2006. this.isGuide = ggg < 1 || DataMgr.gameData.gameCount < 1;
  2007. this.awayTime = xGame.tools.random(5000, 10000);
  2008. this.awayNum = 0;
  2009. this.hideTime = Laya.timer.currTimer;
  2010. let rect = xGame.common.d2World.borderRect;
  2011. this.rectL = Math.ceil(rect.x) + 17;
  2012. this.rectT = Math.ceil(rect.y) + 17;
  2013. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2014. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2015. this.wBall = xGame.common.d2World.rootBall;
  2016. this.ballSize = this.wBall.gameObj.width - 1;
  2017. if (this.posList.length < 1) {
  2018. let dp = 40;
  2019. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2020. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2021. let dx = i < this.rectR ? i : this.rectR;
  2022. let dy = j < this.rectB ? j : this.rectB;
  2023. let order = xGame.tools.random(0, 1000);
  2024. this.posList.push({ x: dx, y: dy, order: order });
  2025. }
  2026. }
  2027. this.posList.sort(function (a, b) {
  2028. return a.order - b.order;
  2029. });
  2030. this.setMax = this.posList.length;
  2031. }
  2032. this.state = AIState.idle;
  2033. }
  2034. setAiLevel(num) {
  2035. this.aiLv = num;
  2036. }
  2037. initBall() {
  2038. this.rootPos.x = this.wBall.gameObj.x;
  2039. this.rootPos.y = this.wBall.gameObj.y;
  2040. this.initHoleBall();
  2041. }
  2042. initHoleBall() {
  2043. this.kickBall = [];
  2044. this.lineBall = [];
  2045. this.scoreBall = [];
  2046. this.holeBall = [];
  2047. this.selectNum = 0;
  2048. this.forceNum = 0;
  2049. this.forceMax = 0;
  2050. this.turnNum = 0;
  2051. let list = xGame.common.d2World.ballArr;
  2052. if (list.length < 20 && !this.isGuide) {
  2053. let holes = xGame.common.gameMgr.holePosList;
  2054. for (let i = 0; i < list.length; i++) {
  2055. let obj = list[i];
  2056. if (!obj)
  2057. continue;
  2058. obj.kickPos.x = 0;
  2059. obj.kickPos.y = 0;
  2060. obj.poleAngle = 0;
  2061. obj.hard = 0;
  2062. obj.borderDis = 0;
  2063. obj.kickAngle = 180;
  2064. if (obj.number == 0)
  2065. continue;
  2066. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2067. continue;
  2068. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2069. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2070. continue;
  2071. }
  2072. let b = obj.gameObj;
  2073. let wbp = this.rootPos;
  2074. let bx = wbp.x - b.x;
  2075. let by = wbp.y - b.y;
  2076. obj.borderDis = xGame.tools.random(0, 100);
  2077. this.kickBall.push(obj);
  2078. if (!this.isLine(wbp, obj))
  2079. continue;
  2080. obj.kickAngle = xGame.tools.random(90, 180);
  2081. obj.kickPos.x = b.x;
  2082. obj.kickPos.y = b.y;
  2083. this.lineBall.push(obj);
  2084. let minDis = 999999;
  2085. let hole = false;
  2086. for (let j = 0; j < holes.length; j++) {
  2087. let hp = holes[j];
  2088. if (bx >= 0 && hp.x > b.x + 100)
  2089. continue;
  2090. if (bx <= 0 && hp.x < b.x - 100)
  2091. continue;
  2092. if (by < -10 && hp.y < wbp.y)
  2093. continue;
  2094. if (by > 10 && hp.y > wbp.y)
  2095. continue;
  2096. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2097. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2098. if (dis < minDis) {
  2099. let dx = b.x - this.tempDir1.x * this.ballSize;
  2100. let dy = b.y - this.tempDir1.y * this.ballSize;
  2101. this.tempDir3.x = this.tempDir1.x;
  2102. this.tempDir3.y = this.tempDir1.y;
  2103. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2104. obj.kickPos.x = dx;
  2105. obj.kickPos.y = dy;
  2106. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2107. if (num > 1)
  2108. num = 1;
  2109. obj.kickAngle = Math.acos(num) * 57.3;
  2110. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2111. dis = dis * 2;
  2112. if (Math.abs(hp.x - 600) < 100)
  2113. dis += 50;
  2114. obj.hard = dis + obj.kickAngle * 3;
  2115. hole = true;
  2116. }
  2117. }
  2118. }
  2119. }
  2120. if (hole) {
  2121. this.scoreBall.push(obj);
  2122. this.holeBall.push(obj);
  2123. }
  2124. }
  2125. this.scoreBall.sort(function (a, b) {
  2126. return a.hard - b.hard;
  2127. });
  2128. this.holeBall.sort(function (a, b) {
  2129. return a.kickAngle - b.kickAngle;
  2130. });
  2131. this.kickBall.sort(function (a, b) {
  2132. return a.borderDis - b.borderDis;
  2133. });
  2134. }
  2135. else {
  2136. let max = list.length - 1;
  2137. let i = xGame.tools.random(0, max);
  2138. for (i; i <= max; i++) {
  2139. let idx = i >= max ? i -= max : i;
  2140. let obj = list[idx];
  2141. if (obj && obj.number != 0) {
  2142. obj.kickAngle = xGame.tools.random(90, 180);
  2143. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2144. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2145. this.lineBall.push(obj);
  2146. break;
  2147. }
  2148. }
  2149. }
  2150. }
  2151. selectBall() {
  2152. let ball = null;
  2153. this.destRot = 0;
  2154. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2155. let ai = 110 - this.aiLv * 10;
  2156. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2157. let score = false;
  2158. if (this.scoreBall.length < 1) {
  2159. if (this.lineBall.length < 1) {
  2160. for (let i = 0; i < this.kickBall.length; i++) {
  2161. let list = [];
  2162. let bo = this.kickBall[i];
  2163. let bobj = bo.gameObj;
  2164. let rect = xGame.common.d2World.borderRect;
  2165. let mobj = this.wBall.gameObj;
  2166. let minb = bobj.y - rect.y - 20;
  2167. let minw = mobj.y - rect.y - 50;
  2168. if (minb > 0 && minw > 0) {
  2169. let dlenx = 0;
  2170. let dleny = mobj.y - rect.y;
  2171. let spx = mobj.x;
  2172. let spy = rect.y - dleny;
  2173. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2174. }
  2175. minb = rect.y + rect.height - bobj.y - 20;
  2176. minw = rect.y + rect.height - mobj.y - 50;
  2177. if (minb > 0 && minw > 0) {
  2178. let dlenx = 0;
  2179. let dleny = rect.y + rect.height - mobj.y;
  2180. let spx = mobj.x;
  2181. let spy = rect.y + rect.height + dleny;
  2182. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2183. }
  2184. minb = bobj.x - rect.x - 20;
  2185. minw = mobj.x - rect.x - 50;
  2186. if (minb > 0 && minw > 0) {
  2187. let dlenx = mobj.x - rect.x;
  2188. let dleny = 0;
  2189. let spx = rect.x - dlenx;
  2190. let spy = mobj.y;
  2191. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2192. }
  2193. minb = rect.x + rect.width - bobj.x - 20;
  2194. minw = rect.x + rect.width - mobj.x - 50;
  2195. if (minb > 0 && minw > 0) {
  2196. let dlenx = rect.x + rect.width - mobj.x;
  2197. let dleny = 0;
  2198. let spx = rect.x + rect.width + dlenx;
  2199. let spy = mobj.y;
  2200. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2201. }
  2202. list.sort(function (a, b) {
  2203. return a.order - b.order;
  2204. });
  2205. for (let i = 0; i < list.length; i++) {
  2206. let data = list[i];
  2207. let mx = mobj.x - bobj.x;
  2208. let my = mobj.y - bobj.y;
  2209. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2210. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2211. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2212. if (num > 1)
  2213. num = 1;
  2214. let cos = Math.acos(num);
  2215. if (cos > 1.57)
  2216. cos = 1.57;
  2217. else if (cos < 0.01)
  2218. cos = 0.01;
  2219. let tan = Math.tan(cos);
  2220. let dx = tan * data.dleny;
  2221. let dy = tan * data.dlenx;
  2222. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2223. if (Math.abs(bx - 667) < 40)
  2224. continue;
  2225. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2226. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2227. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2228. this.forceMax = dis * 0.08;
  2229. this.destRot += mis * 0.1;
  2230. this.setKick(bx, by);
  2231. return true;
  2232. }
  2233. }
  2234. }
  2235. }
  2236. else {
  2237. ball = xGame.common.getRandArrEle(this.lineBall);
  2238. }
  2239. }
  2240. else {
  2241. for (let i = 0; i < this.scoreBall.length; i++) {
  2242. if (i < this.scoreBall.length - 1) {
  2243. let rand = 70 + this.aiLv * 10 + i * 10;
  2244. if (xGame.tools.random(0, 100) < rand) {
  2245. ball = this.scoreBall[i];
  2246. break;
  2247. }
  2248. }
  2249. else {
  2250. ball = this.scoreBall[i];
  2251. break;
  2252. }
  2253. }
  2254. score = true;
  2255. this.selectNum++;
  2256. }
  2257. if (!ball)
  2258. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2259. if (this.selectNum >= max) {
  2260. console.log('zh:jian kong bug1');
  2261. if (ball && ball.gameObj) {
  2262. }
  2263. else {
  2264. console.log('zh:jian kong bug2 如果到这里应该能看到一个alert弹框报错');
  2265. }
  2266. let dx = ball.gameObj.x;
  2267. let dy = ball.gameObj.y;
  2268. let kickAngle = 0;
  2269. if (score) {
  2270. dx = ball.kickPos.x;
  2271. dy = ball.kickPos.y;
  2272. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2273. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2274. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2275. if (adot > 1)
  2276. adot = 1;
  2277. kickAngle = Math.acos(adot) * 57.3;
  2278. if (kickAngle > 45) {
  2279. let kdx = ball.kickPos.x - ball.gameObj.x;
  2280. let kdy = ball.kickPos.y - ball.gameObj.y;
  2281. dx = ball.kickPos.x - kdx * mis * 0.3;
  2282. dy = ball.kickPos.y - kdy * mis * 0.3;
  2283. }
  2284. else
  2285. this.destRot += mis;
  2286. }
  2287. else if (ball.poleAngle != 0) {
  2288. this.destRot += ball.poleAngle;
  2289. }
  2290. if (xGame.common.gameMode == 0) {
  2291. let af = kickAngle * 0.08;
  2292. this.forceMax = ball.hard * 0.1 + af * af;
  2293. }
  2294. this.setKick(dx, dy);
  2295. }
  2296. else {
  2297. let rand = this.aiLv * 5 + 40;
  2298. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2299. ball = xGame.common.getRandArrEle(this.scoreBall);
  2300. else
  2301. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2302. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2303. if (xGame.tools.random(0, 100) > rand) {
  2304. this.selectNum = max;
  2305. }
  2306. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2307. this.selectNum++;
  2308. }
  2309. ball.onClick(0, true);
  2310. }
  2311. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2312. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2313. let balls = xGame.common.d2World.ballArr;
  2314. let max = xGame.tools.getDis(hx, hy, bx, by);
  2315. for (let index = 0; index < balls.length; index++) {
  2316. let obj = balls[index];
  2317. if (obj.number == 0)
  2318. continue;
  2319. if (obj.number == bn || obj.number == dn)
  2320. continue;
  2321. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2322. if (dis * dis > max)
  2323. continue;
  2324. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2325. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2326. if (num > 1)
  2327. num = 1;
  2328. if (num < 0)
  2329. continue;
  2330. let gap = Math.sin(Math.acos(num)) * dis;
  2331. if (gap < this.ballSize)
  2332. return true;
  2333. }
  2334. return false;
  2335. }
  2336. isLine(xy, ball) {
  2337. let bx = xy.x;
  2338. let by = xy.y;
  2339. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2340. let dis = ball.getDestDis(xy);
  2341. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2342. let sin = Math.sin(angle);
  2343. let cos = Math.cos(angle);
  2344. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2345. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2346. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2347. let dx = bx + this.tempDir2.x * dis;
  2348. let dy = by + this.tempDir2.y * dis;
  2349. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2350. sin = Math.sin(-angle);
  2351. cos = Math.cos(-angle);
  2352. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2353. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2354. dx = bx + this.tempDir2.x * dis;
  2355. dy = by + this.tempDir2.y * dis;
  2356. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2357. if (isr && isl)
  2358. return false;
  2359. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2360. }
  2361. return true;
  2362. }
  2363. turnPole() {
  2364. this.turnNum++;
  2365. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2366. let dr = rot - this.destRot;
  2367. let abs = Math.abs(dr) % 360;
  2368. if (abs > 180) {
  2369. if (rot > 180)
  2370. rot -= 360;
  2371. if (this.destRot > 180)
  2372. this.destRot -= 360;
  2373. }
  2374. let max = this.turnNum * 5 + this.aiLv * 5;
  2375. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2376. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2377. let at = xGame.tools.random(1000, 2000);
  2378. if (!this.onAway(3))
  2379. at += xGame.tools.random(10000, 15000);
  2380. this.setState(AIState.shoot, at);
  2381. }
  2382. else {
  2383. let mr = 0;
  2384. if (abs > 3)
  2385. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2386. else if (Math.random() > 0.6)
  2387. mr = xGame.tools.random(1, 10) * 0.1;
  2388. mr = dr > 0 ? -mr : mr;
  2389. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2390. }
  2391. }
  2392. setKick(dx, dy) {
  2393. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2394. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2395. this.tempDir1.x = 0;
  2396. this.tempDir1.y = 1;
  2397. this.tempDir2.y = -this.tempDir2.y;
  2398. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2399. if (num > 1)
  2400. num = 1;
  2401. let rot = Math.acos(num) * 57.3;
  2402. if (this.tempDir2.x < 0)
  2403. rot = 360 - rot;
  2404. this.destRot += rot;
  2405. if (!xGame.common.gameMgr.finishOneShoot) {
  2406. this.forceMax += xGame.tools.random(10, 50);
  2407. this.forceMax -= this.aiLv * 2;
  2408. if (this.forceMax < 20)
  2409. this.forceMax = 20;
  2410. }
  2411. if (this.forceMax > 100)
  2412. this.forceMax = 101;
  2413. else if (this.forceMax < 10)
  2414. this.forceMax += xGame.tools.random(0, 10);
  2415. if (xGame.common.gameMode == 1)
  2416. this.forceMax = xGame.tools.random(80, 100);
  2417. else
  2418. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2419. let max = 2000 - this.aiLv * 100;
  2420. if (Math.random() > 0.8)
  2421. max += xGame.tools.random(100, 2000);
  2422. this.setState(AIState.turn, xGame.tools.random(500, max));
  2423. }
  2424. shoot() {
  2425. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2426. if (Math.random() > 0.8) {
  2427. this.gameSrc.aiForce(1);
  2428. this.setState(AIState.wait);
  2429. }
  2430. }
  2431. else {
  2432. let df = xGame.tools.random(3, 8);
  2433. if (this.forceNum < this.forceMax)
  2434. this.forceNum += df;
  2435. else
  2436. this.forceNum -= df;
  2437. let startY = this.gameSrc.ui.powerNode.y;
  2438. let height = this.gameSrc.ui.powerNode.height;
  2439. let force = startY + height * this.forceNum * 0.01;
  2440. this.gameSrc.aiForce(2, force);
  2441. }
  2442. }
  2443. reset() {
  2444. for (let i = 0; i < 4; i++) {
  2445. this.setRate--;
  2446. this.setNum++;
  2447. let pos = this.posList[this.posIdx];
  2448. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2449. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2450. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2451. this.rootPos.x = 387;
  2452. if (this.rootPos.x < this.rectL)
  2453. this.rootPos.x = this.rectL;
  2454. else if (this.rootPos.x > this.rectR)
  2455. this.rootPos.x = this.rectR;
  2456. if (this.rootPos.y < this.rectT)
  2457. this.rootPos.y = this.rectT;
  2458. else if (this.rootPos.y > this.rectB)
  2459. this.rootPos.y = this.rectB;
  2460. this.posIdx++;
  2461. let max = this.posList.length;
  2462. if (this.posIdx >= max)
  2463. this.posIdx -= max;
  2464. this.initHoleBall();
  2465. let ball = null;
  2466. if (this.scoreBall.length > 0)
  2467. ball = this.scoreBall[0];
  2468. else if (this.lineBall.length > 0)
  2469. ball = xGame.common.getRandArrEle(this.lineBall);
  2470. if (ball && ball.kickAngle < this.bestAngle) {
  2471. this.bestAngle = ball.kickAngle;
  2472. this.bestKick.x = ball.kickPos.x;
  2473. this.bestKick.y = ball.kickPos.y;
  2474. this.bestPos.x = this.rootPos.x;
  2475. this.bestPos.y = this.rootPos.y;
  2476. this.bestForce = ball.hard * 0.08;
  2477. }
  2478. }
  2479. if (this.setNum >= this.setMax)
  2480. this.setMax = 0;
  2481. if (this.setRate < 1) {
  2482. this.setState(AIState.move, 0);
  2483. this.rootMoveTime = Laya.timer.currTimer;
  2484. this.gameSrc.aiRootMove(true);
  2485. }
  2486. }
  2487. delayLine() {
  2488. this.gameSrc.aiRootMove(false);
  2489. }
  2490. move() {
  2491. if (this.bestPos.x < 1)
  2492. this.bestPos = this.rootPos;
  2493. let wObj = this.wBall.gameObj;
  2494. let destx = wObj.x;
  2495. let desty = wObj.y;
  2496. let dx = Math.abs(destx - this.bestPos.x);
  2497. let dy = Math.abs(desty - this.bestPos.y);
  2498. let mx = 3 + dx * 0.03;
  2499. let my = 3 + dy * 0.03;
  2500. if (dx < 4 && dy < 4) {
  2501. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2502. dt = dt < 1000 ? 1000 - dt : 0;
  2503. if (this.setMax > 0) {
  2504. let min = this.setMax * 0.3 + this.aiLv * 5;
  2505. this.setRate = xGame.tools.random(min, this.setMax);
  2506. this.setState(AIState.reset, 0);
  2507. }
  2508. else {
  2509. this.destRot = 0;
  2510. this.forceMax = this.bestForce;
  2511. this.setKick(this.bestKick.x, this.bestKick.y);
  2512. }
  2513. if (dt > 100) {
  2514. Laya.timer.clear(this, this.delayLine);
  2515. Laya.timer.once(dt, this, this.delayLine);
  2516. }
  2517. else
  2518. this.gameSrc.aiRootMove(false);
  2519. }
  2520. else {
  2521. if (dx > 4)
  2522. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2523. if (dy > 4)
  2524. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2525. this.gameSrc.onRootMove({ x: destx, y: desty });
  2526. }
  2527. }
  2528. resetRoot() {
  2529. this.bestAngle = 180;
  2530. this.bestForce = 0;
  2531. this.setMax = this.posList.length;
  2532. this.posIdx = xGame.tools.random(0, this.setMax);
  2533. let min = this.setMax * 0.3 + this.aiLv * 5;
  2534. this.setRate = xGame.tools.random(min, this.setMax);
  2535. let max = 2000 - this.aiLv * 100;
  2536. if (Math.random() > 0.8)
  2537. max += xGame.tools.random(100, 1000);
  2538. if (this.isGuide)
  2539. this.setState(AIState.select, 500);
  2540. else if (this.onAway(2))
  2541. this.setState(AIState.reset, xGame.tools.random(400, max));
  2542. else
  2543. this.setState(AIState.none);
  2544. if (xGame.common.gameMgr.finishOneShoot)
  2545. this.chat();
  2546. }
  2547. runAI() {
  2548. if (this.state > AIState.idle)
  2549. return;
  2550. this.initBall();
  2551. this.onGame(2500);
  2552. if (Math.random() > 0.6)
  2553. this.chat();
  2554. }
  2555. stopRun() {
  2556. this.setState(AIState.idle);
  2557. }
  2558. onGame(base) {
  2559. let max = base - this.aiLv * 100;
  2560. if (Math.random() > 0.8)
  2561. max += xGame.tools.random(100, 1000);
  2562. if (this.onAway(2))
  2563. this.setState(AIState.select, xGame.tools.random(500, max));
  2564. else
  2565. this.setState(AIState.none);
  2566. }
  2567. setState(sta, wt = 0) {
  2568. if (this.state == AIState.none)
  2569. return;
  2570. this.state = sta;
  2571. this.waitTime = wt;
  2572. }
  2573. onUpdate() {
  2574. if (this.state == AIState.none)
  2575. return;
  2576. this.awayTime -= this.dtime;
  2577. if (this.awayTime < 1) {
  2578. this.awayTime = xGame.tools.random(6000, 10000);
  2579. this.awayNum += (11 - this.aiLv);
  2580. this.onAway(1);
  2581. }
  2582. if (this.waitTime >= 0) {
  2583. this.waitTime -= this.dtime;
  2584. return;
  2585. }
  2586. switch (this.state) {
  2587. case AIState.idle:
  2588. this.chat();
  2589. break;
  2590. case AIState.reset:
  2591. this.reset();
  2592. break;
  2593. case AIState.move:
  2594. this.move();
  2595. break;
  2596. case AIState.leave:
  2597. this.state = AIState.none;
  2598. xGame.common.gameMgr.aiGameEnd(true);
  2599. break;
  2600. case AIState.select:
  2601. this.selectBall();
  2602. break;
  2603. case AIState.turn:
  2604. this.turnPole();
  2605. break;
  2606. case AIState.shoot:
  2607. this.shoot();
  2608. break;
  2609. }
  2610. }
  2611. onAway(type) {
  2612. if (type == 1) {
  2613. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2614. let num = this.awayNum + db * 20;
  2615. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2616. xGame.common.gameMgr.aiLeave();
  2617. this.setState(AIState.leave, 6666);
  2618. }
  2619. }
  2620. else if (type == 2) {
  2621. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2622. let num = this.awayNum + db * 30;
  2623. if (xGame.tools.random(0, 10000) < num)
  2624. return false;
  2625. }
  2626. else if (type == 3) {
  2627. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2628. let num = this.awayNum + db * 10;
  2629. if (xGame.tools.random(0, 4000) < num)
  2630. return false;
  2631. }
  2632. return true;
  2633. }
  2634. chat() {
  2635. if (this.chatTime > 0) {
  2636. this.chatTime -= this.dtime;
  2637. return;
  2638. }
  2639. this.chatTime = xGame.tools.random(2000, 10000);
  2640. let rand = xGame.tools.random(0, 100);
  2641. if (rand < 15)
  2642. this.talk();
  2643. else if (rand < 35)
  2644. this.emotion();
  2645. }
  2646. talk() {
  2647. xGame.common.talkMgr.showAITalk(0);
  2648. }
  2649. emotion() {
  2650. xGame.common.talkMgr.showAIEmotion(0);
  2651. }
  2652. resetAI() {
  2653. this.stopRun();
  2654. this.state = AIState.none;
  2655. }
  2656. }
  2657. class Partical extends Laya.Script3D {
  2658. constructor() {
  2659. super();
  2660. this.duration = 2000;
  2661. }
  2662. ;
  2663. onAwake() {
  2664. this.gameObj = this.owner;
  2665. }
  2666. onEnable() {
  2667. this.openTimer();
  2668. }
  2669. openTimer() {
  2670. Laya.timer.once(this.duration, this, this.disappear);
  2671. }
  2672. setCallback(obj, callback) {
  2673. this.obj = obj;
  2674. this.callback = callback;
  2675. Laya.timer.clearAll(this);
  2676. Laya.timer.once(this.duration, this, this.disappear);
  2677. }
  2678. disappear() {
  2679. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2680. this.callback && this.callback(this.obj);
  2681. }
  2682. }
  2683. class Ball extends Laya.Script3D {
  2684. constructor() {
  2685. super();
  2686. this.posV3 = new Laya.Vector3();
  2687. this.rotRate = 2.1;
  2688. this.rotSpeed = new Laya.Vector3();
  2689. this.myIndex = 0;
  2690. }
  2691. onAwake() {
  2692. this.gameObj = this.owner;
  2693. this.transform = this.gameObj.transform;
  2694. this.ballNode = this.gameObj.getChildByName("Ball");
  2695. this.shadowNode = this.gameObj.getChildByName("shadow");
  2696. }
  2697. initSelf(index, x, y, owner) {
  2698. this.d2BallSrc = owner;
  2699. this.myIndex = index;
  2700. this.setAlbedoTexture();
  2701. this.setTransPos(x, y);
  2702. this.setScale();
  2703. this.ballNode.transform.localRotationEulerX = 90;
  2704. if (index == 0) {
  2705. }
  2706. }
  2707. setAlbedoTexture(isIce = false) {
  2708. let url;
  2709. if (isIce) {
  2710. url = `res/d3Res/ballTexture/ice.jpg`;
  2711. }
  2712. else {
  2713. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2714. }
  2715. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2716. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2717. }));
  2718. }
  2719. runFireworks(obj, delay, callback) {
  2720. Laya.timer.clearAll(this);
  2721. Laya.timer.once(delay + 1, this, () => {
  2722. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2723. fire.transform.localPositionX = this.transform.localPositionX;
  2724. fire.transform.localPositionY = this.transform.localPositionY;
  2725. fire.transform.localPositionZ = this.transform.localPositionZ;
  2726. let src = fire.getComponent(Partical);
  2727. src.duration = 1000;
  2728. src.setCallback(obj, callback);
  2729. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2730. eft.transform.localPositionX = this.transform.localPositionX;
  2731. eft.transform.localPositionY = this.transform.localPositionY;
  2732. eft.transform.localPositionZ = this.transform.localPositionZ;
  2733. });
  2734. }
  2735. setTransPos(x, y) {
  2736. this.setRotation();
  2737. xGame.common.pos2to3Convert(x, y, this.posV3);
  2738. this.transform.localPositionX = this.posV3.x;
  2739. this.transform.localPositionY = 0;
  2740. this.transform.localPositionZ = this.posV3.z;
  2741. this.transform.localRotationEulerX = 0;
  2742. this.transform.localRotationEulerY = 0;
  2743. this.transform.localRotationEulerZ = 0;
  2744. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2745. this.shadowNode.transform.localPositionY = 0.1;
  2746. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2747. }
  2748. setRotation() {
  2749. if (this.d2BallSrc.canRot) {
  2750. let speed = this.d2BallSrc.rigy.linearVelocity;
  2751. this.rotSpeed.x = speed.x * this.rotRate;
  2752. this.rotSpeed.z = speed.y * this.rotRate;
  2753. this.rotSpeed.y = this.d2BallSrc.rotY;
  2754. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2755. }
  2756. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2757. this.rotSpeed.x = this.rotSpeed.y = 0;
  2758. this.rotSpeed.y = this.d2BallSrc.rotY;
  2759. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2760. }
  2761. }
  2762. setScale() {
  2763. let radius = xGame.common.d2World.rootBall.ui.width;
  2764. let scale = xGame.common.scale2to3Convert(radius);
  2765. this.transform.localScaleX = scale;
  2766. this.transform.localScaleY = scale;
  2767. this.transform.localScaleZ = scale;
  2768. }
  2769. playInHoleEft() {
  2770. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2771. eft.transform.position = this.transform.position;
  2772. }
  2773. playIceEft() {
  2774. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2775. eft.transform.position = this.transform.position;
  2776. }
  2777. get scaleXYZ() {
  2778. return this.transform.localScaleX;
  2779. }
  2780. set scaleXYZ(val) {
  2781. this.transform.localScaleX = val;
  2782. this.transform.localScaleY = val;
  2783. this.transform.localScaleZ = val;
  2784. }
  2785. get posX() {
  2786. return this.transform.localPositionX;
  2787. }
  2788. set posX(val) {
  2789. this.transform.localPositionX = val;
  2790. }
  2791. get posY() {
  2792. return this.transform.localPositionY;
  2793. }
  2794. set posY(val) {
  2795. this.transform.localPositionY = val;
  2796. }
  2797. get posZ() {
  2798. return this.transform.localPositionZ;
  2799. }
  2800. set posZ(val) {
  2801. this.transform.localPositionZ = val;
  2802. }
  2803. destroySelf() {
  2804. this.posV3 = null;
  2805. this.rotSpeed = null;
  2806. this.d2BallSrc = null;
  2807. this.ballNode = null;
  2808. this.gameObj.destroy(true);
  2809. this.transform = null;
  2810. this.destroy();
  2811. }
  2812. }
  2813. class ui_D2Ball extends fgui.GComponent {
  2814. static createInstance() {
  2815. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2816. }
  2817. onConstruct() {
  2818. this.myIcon = (this.getChild("myIcon"));
  2819. this.inner = (this.getChild("inner"));
  2820. this.n8 = (this.getChild("n8"));
  2821. this.n4 = (this.getChild("n4"));
  2822. this.wrongTips = (this.getChild("wrongTips"));
  2823. this.rightTips = (this.getChild("rightTips"));
  2824. this.breathAni = this.getTransition("breathAni");
  2825. }
  2826. }
  2827. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2828. class D2BallSrc extends Laya.Script {
  2829. constructor() {
  2830. super();
  2831. this.number = 0;
  2832. this.startX = 0;
  2833. this.startY = 0;
  2834. this.angleV2 = new Laya.Vector2();
  2835. this.isRootBall = false;
  2836. this.isBlackBall = false;
  2837. this.ballType = "";
  2838. this.canRot = true;
  2839. this.rotY = 0;
  2840. this.poleAngle = 0;
  2841. this.kickPos = { x: 0, y: 0 };
  2842. this.hard = 0;
  2843. this.kickAngle = 0;
  2844. this.borderDis = 0;
  2845. this.speedP10 = 5.6;
  2846. this.lastSpeed = { x: 0, y: 0 };
  2847. this.stillSpeed = 0.12;
  2848. this.ballFunc = "normal";
  2849. this.isRunSkillAni = false;
  2850. this.isInHole = false;
  2851. this.iceOwner = "";
  2852. this.forceRun = false;
  2853. this.myUNID = "";
  2854. this.rectL = 0;
  2855. this.rectR = 0;
  2856. this.rectT = 0;
  2857. this.rectB = 0;
  2858. this.forceVec = new Laya.Vector2();
  2859. this.lastDis = 0;
  2860. this.helpOut = { type: "", x: 0, y: 0 };
  2861. }
  2862. initSelf(number, x, y, d3Ball) {
  2863. if (!this.gameObj)
  2864. this.gameObj = this.owner;
  2865. this.number = number;
  2866. this.startX = x;
  2867. this.startY = y;
  2868. this.d3Ball = d3Ball;
  2869. this.isRootBall = false;
  2870. this.isBlackBall = false;
  2871. this.ballType = "";
  2872. if (number == 0) {
  2873. this.isRootBall = true;
  2874. }
  2875. else if (number == 8) {
  2876. this.isBlackBall = true;
  2877. }
  2878. else {
  2879. if (number <= 7) {
  2880. this.ballType = ballCamp.full;
  2881. }
  2882. else {
  2883. this.ballType = ballCamp.flower;
  2884. }
  2885. }
  2886. this.setInfo();
  2887. this.setD3Ball();
  2888. this.owner["mySrc"] = this;
  2889. this.rigy.linearDamping = 1;
  2890. D2BallSrc._unid++;
  2891. this.myUNID = "d2ball" + D2BallSrc._unid;
  2892. let rect = xGame.common.d2World.borderRect;
  2893. this.rectL = Math.ceil(rect.x) + 20;
  2894. this.rectT = Math.ceil(rect.y) + 20;
  2895. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2896. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2897. }
  2898. setInfo() {
  2899. this.gameObj.x = this.startX;
  2900. this.gameObj.y = this.startY;
  2901. let radius = this.ui.width / 2;
  2902. this.gameObj.width = radius * 2;
  2903. this.gameObj.height = radius * 2;
  2904. if (xGame.common.showDebug) {
  2905. this.ui.myIcon.alpha = 1;
  2906. this.ui.inner.alpha = 1;
  2907. }
  2908. else {
  2909. this.ui.myIcon.alpha = 0;
  2910. this.ui.inner.alpha = 0;
  2911. }
  2912. }
  2913. setD3Ball() {
  2914. this.d3Ball = this.d3Ball;
  2915. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2916. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2917. }
  2918. onUpdate() {
  2919. if (xGame.common.gameMgr.gamePause)
  2920. return;
  2921. if (this.isInHole)
  2922. return;
  2923. if (!xGame.common.d2World.openCheckStill)
  2924. return;
  2925. this.runBall();
  2926. }
  2927. runBall() {
  2928. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2929. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2930. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2931. this.judgeBorder();
  2932. }
  2933. getDestDis(dest) {
  2934. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2935. }
  2936. setmyXY(x, y) {
  2937. this.d3BallSrc.setTransPos(x, y);
  2938. }
  2939. getSpeed() {
  2940. let speed = this.rigy.linearVelocity;
  2941. return speed.x * speed.x + speed.y * speed.y;
  2942. }
  2943. onTriggerEnter(collider) {
  2944. if (!collider || !collider.owner)
  2945. return;
  2946. let coll = "collide";
  2947. let speed = this.getSpeed();
  2948. let sv2 = this.speedP10 * this.speedP10;
  2949. if (collider.label == "ball") {
  2950. if (speed < 9 && this.number != 0)
  2951. coll = "";
  2952. else if (speed < sv2)
  2953. coll = "collide_4";
  2954. else if (speed < sv2 * 6.2)
  2955. coll = "collide_3";
  2956. else if (speed < sv2 * 25)
  2957. coll = "collide_2";
  2958. else if (speed < sv2 * 56)
  2959. coll = "collide_1";
  2960. xGame.soundMgr.playSound(coll);
  2961. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2962. if (collider.owner) {
  2963. let rig = collider.owner.getComponent(D2BallSrc);
  2964. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2965. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2966. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2967. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2968. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2969. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2970. let rx = 0;
  2971. let ry = 0;
  2972. if (this.gameObj.x < this.rectL)
  2973. rx = vx;
  2974. else if (this.gameObj.x > this.rectR)
  2975. rx = -vx;
  2976. else if (this.gameObj.y < this.rectT)
  2977. ry = vy;
  2978. else if (this.gameObj.y > this.rectB)
  2979. ry = -vy;
  2980. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2981. }
  2982. }
  2983. if (this.number != 0) {
  2984. return;
  2985. }
  2986. else {
  2987. if (this.forceRun) {
  2988. console.log("randon force");
  2989. this.applyForce(collider);
  2990. }
  2991. }
  2992. if (xGame.common.d2World.isOnSameLine) {
  2993. xGame.common.d2World.isOnSameLine = false;
  2994. this.rigy.linearVelocity = { x: 0, y: 0 };
  2995. }
  2996. if (xGame.common.gameMgr.firstColliObj == null) {
  2997. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2998. xGame.common.gameMgr.isTouchedBall = true;
  2999. }
  3000. }
  3001. else {
  3002. xGame.common.recoverCameraView();
  3003. let wallStr = "";
  3004. if (speed < 9) { }
  3005. else if (speed < sv2) { }
  3006. else if (speed < sv2 * 6.2)
  3007. wallStr = "wall_30";
  3008. else if (speed < sv2 * 25)
  3009. wallStr = "wall_50";
  3010. else if (speed < sv2 * 56)
  3011. wallStr = "wall_80";
  3012. xGame.soundMgr.playSound(wallStr);
  3013. }
  3014. }
  3015. applyForce(collider) {
  3016. let src = collider.owner.mySrc;
  3017. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3018. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3019. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3020. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3021. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3022. }
  3023. checkWrongBall(playEft = true) {
  3024. if (this.isInHole)
  3025. return;
  3026. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3027. if (this.number != 0 && playEft)
  3028. this.d3BallSrc.playInHoleEft();
  3029. let coll = "inpocket_1";
  3030. let speed = this.getSpeed();
  3031. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3032. if (speed < 9 && this.number != 0)
  3033. coll = "";
  3034. else if (speed < sv2 * 6.2)
  3035. coll = "inpocket_4";
  3036. else if (speed < sv2 * 25)
  3037. coll = "collide_3";
  3038. else if (speed < sv2 * 56)
  3039. coll = "collide_2";
  3040. xGame.soundMgr.playSound(coll);
  3041. this.isInHole = true;
  3042. if (this.number == 0) {
  3043. console.log("白球进了。。");
  3044. this.reset();
  3045. this.rigy.linearVelocity = { x: 0, y: 0 };
  3046. this.hideSelf();
  3047. xGame.common.gameUI.ui.whiteAni.visible = true;
  3048. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3049. xGame.common.gameUI.ui.whiteAni.visible = false;
  3050. }));
  3051. }
  3052. else {
  3053. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3054. xGame.common.d2World.removeOneBall(this);
  3055. this.destroySelf();
  3056. xGame.common.playHappySound(this.number);
  3057. this.runFlyEft();
  3058. }
  3059. }
  3060. runFlyEft() {
  3061. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3062. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3063. }
  3064. }
  3065. hideSelf() {
  3066. if (this.d3Ball)
  3067. this.d3Ball.active = false;
  3068. }
  3069. showSelf() {
  3070. this.isInHole = false;
  3071. if (this.d3Ball && !this.d3Ball.active)
  3072. this.d3Ball.active = true;
  3073. }
  3074. isStill() {
  3075. let speed = this.rigy.linearVelocity;
  3076. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3077. this.rigy.linearVelocity = { x: 0, y: 0 };
  3078. return true;
  3079. }
  3080. return false;
  3081. }
  3082. reset() {
  3083. }
  3084. destroySelf() {
  3085. this.d3BallSrc.destroySelf();
  3086. if (!this.ui.isDisposed) {
  3087. this.ui.removeFromParent();
  3088. this.ui.dispose();
  3089. this.ui = null;
  3090. }
  3091. this.outColli = null;
  3092. this.innerColli = null;
  3093. this.rigy = null;
  3094. this.d3Ball = null;
  3095. this.d3BallSrc = null;
  3096. this.angleV2 = null;
  3097. this.gameObj.destroy(true);
  3098. this.destroy();
  3099. }
  3100. judgeBorder() {
  3101. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3102. return;
  3103. }
  3104. if (this.destroyed)
  3105. return;
  3106. if (xGame.common.gameMode == GameMode.classic)
  3107. return;
  3108. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3109. if (isOver) {
  3110. this.checkWrongBall();
  3111. }
  3112. }
  3113. onClick(e, force = false) {
  3114. if (this.number == 0)
  3115. return;
  3116. if (force) {
  3117. }
  3118. else {
  3119. if (xGame.common.d2World.openCheckStill)
  3120. return;
  3121. if (!xGame.common.gameMgr.selfTurn) {
  3122. return;
  3123. }
  3124. }
  3125. if (!xGame.common.gameMgr.finishOneShoot)
  3126. return;
  3127. let root = xGame.common.d2World.rootBall.gameObj;
  3128. let x = this.gameObj.x - root.x;
  3129. let y = this.gameObj.y - root.y;
  3130. let angle = xGame.common.getfguiRotation(x, y);
  3131. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3132. xGame.common.d2World.getHelpLine();
  3133. xGame.common.clickedBall = true;
  3134. console.log('zh:点击之后=判断引导');
  3135. if (DataMgr.getGuideDefaultModel() === 1) {
  3136. this.checkGuideForLianXi();
  3137. }
  3138. else {
  3139. this.checkGuide();
  3140. }
  3141. }
  3142. checkGuide() {
  3143. let guide = DataMgr.getSkillGuide();
  3144. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3145. xGame.common.guideStep++;
  3146. xGame.common.gameUI.ui.guide1.visible = false;
  3147. xGame.common.gameUI.ui.guide2.visible = true;
  3148. }
  3149. }
  3150. checkGuideForLianXi() {
  3151. let guide_lianxi = DataMgr.getLianXiGuide();
  3152. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 0) {
  3153. xGame.common.guideStepForLianXi = 1;
  3154. xGame.common.gameUI.ui.n_lxms_yd1.visible = true;
  3155. return;
  3156. }
  3157. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 1) {
  3158. xGame.common.guideStepForLianXi = 2;
  3159. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  3160. xGame.common.gameUI.ui.n_lxms_yd2.visible = true;
  3161. }
  3162. else {
  3163. console.log('zh: xGame.common.guideStepForLianXi=' + xGame.common.guideStepForLianXi);
  3164. }
  3165. }
  3166. checkDistance(disX, disY, angle) {
  3167. let diameter = this.gameObj.width - 1;
  3168. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3169. if (!this.lastDis)
  3170. this.lastDis = dis;
  3171. else {
  3172. if (dis > this.lastDis) {
  3173. this.helpOut.type = "remove";
  3174. return this.helpOut;
  3175. }
  3176. }
  3177. if (dis <= Math.pow(diameter, 2)) {
  3178. let del = 0.01;
  3179. let offest = 0;
  3180. let realX = disX - this.gameObj.x;
  3181. let realY = disY - this.gameObj.y;
  3182. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3183. offest += del;
  3184. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3185. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3186. }
  3187. this.helpOut.type = "ok";
  3188. this.helpOut.x = realX + this.gameObj.x;
  3189. this.helpOut.y = realY + this.gameObj.y;
  3190. return this.helpOut;
  3191. }
  3192. else {
  3193. this.helpOut.type = "no";
  3194. return this.helpOut;
  3195. }
  3196. }
  3197. clearBallEft() {
  3198. this.clearBallRightEft();
  3199. this.clearBallWrongEft();
  3200. }
  3201. clearBallRightEft() {
  3202. this.ui.breathAni.stop();
  3203. this.ui.rightTips.visible = false;
  3204. }
  3205. clearBallWrongEft() {
  3206. this.ui.wrongTips.visible = false;
  3207. }
  3208. showWrongEft() {
  3209. if (!xGame.common.gameMgr.selfTurn)
  3210. return;
  3211. this.ui.wrongTips.visible = true;
  3212. }
  3213. showRightEft() {
  3214. if (!xGame.common.gameMgr.selfTurn)
  3215. return;
  3216. this.ui.rightTips.visible = true;
  3217. this.ui.rightTips.scaleX = 1;
  3218. this.ui.rightTips.scaleY = 1;
  3219. this.ui.breathAni.play();
  3220. }
  3221. setBallFunc(type, owner) {
  3222. if (type == "ice") {
  3223. this.ballFunc = type;
  3224. this.d3BallSrc.setAlbedoTexture(true);
  3225. this.rigy.type = "static";
  3226. this.iceOwner = owner;
  3227. }
  3228. else {
  3229. if (owner == this.iceOwner) {
  3230. this.ballFunc = type;
  3231. this.d3BallSrc.setAlbedoTexture(false);
  3232. this.rigy.type = "dynamic";
  3233. }
  3234. }
  3235. }
  3236. }
  3237. D2BallSrc._unid = 0;
  3238. class D2RootBallSrc extends D2BallSrc {
  3239. constructor() {
  3240. super();
  3241. this.maxSpeed = 0;
  3242. this.classicMaxSpeed = 2.2;
  3243. this.bigSkillMaxSpeed = 4;
  3244. this.angle = 0;
  3245. this.allPercent = 0;
  3246. this.linearPercent = 0;
  3247. this.anglePercent = 0;
  3248. this.maxAngleRate = 0.6;
  3249. this.baseRot = 7;
  3250. this.angleMax = 0;
  3251. this.speed = new Laya.Vector2();
  3252. this.rotSpeed = new Laya.Vector2();
  3253. }
  3254. isStill() {
  3255. let speed = this.rigy.linearVelocity;
  3256. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3257. if (this.anglePercent <= 0.1) {
  3258. this.rigy.linearVelocity = { x: 0, y: 0 };
  3259. return true;
  3260. }
  3261. }
  3262. return false;
  3263. }
  3264. reset() {
  3265. this.linearPercent = 0;
  3266. this.anglePercent = 0;
  3267. }
  3268. setSpeed(percent, angle) {
  3269. this.allPercent = percent;
  3270. this.angle = angle;
  3271. this.setAngleSpeed();
  3272. this.setLinearSpeed();
  3273. let hit = "hit";
  3274. if (percent < 25)
  3275. hit = "hit03";
  3276. else if (percent < 50)
  3277. hit = "hit02";
  3278. else if (percent < 75)
  3279. hit = "hit01";
  3280. xGame.soundMgr.playSound(hit);
  3281. }
  3282. setAngleSpeed() {
  3283. let offest = xGame.common.rodOffest;
  3284. let radius = 82;
  3285. let rate = Math.abs(offest.y / radius) * 0.5;
  3286. if (offest.y > 0)
  3287. this.angleMax = -this.baseRot * 2;
  3288. else
  3289. this.angleMax = this.baseRot;
  3290. this.rotY = -offest.x / radius * 100;
  3291. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3292. this.linearPercent = this.allPercent - this.anglePercent;
  3293. }
  3294. setLinearSpeed() {
  3295. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3296. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3297. if (!xGame.common.longHelpLine) {
  3298. let offset = -150 + xGame.common.randomNum(0, 300);
  3299. offset /= 100;
  3300. this.angle += offset;
  3301. }
  3302. }
  3303. }
  3304. let sin = Math.sin(this.angle * Math.PI / 180);
  3305. let cos = Math.cos(this.angle * Math.PI / 180);
  3306. switch (xGame.common.gameMode) {
  3307. case GameMode.classic:
  3308. this.maxSpeed = this.classicMaxSpeed;
  3309. break;
  3310. case GameMode.bigMove:
  3311. this.maxSpeed = this.bigSkillMaxSpeed;
  3312. break;
  3313. case GameMode.placeBall:
  3314. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3315. if (data.type == 1) {
  3316. this.maxSpeed = this.bigSkillMaxSpeed;
  3317. }
  3318. else {
  3319. this.maxSpeed = this.classicMaxSpeed;
  3320. }
  3321. break;
  3322. default:
  3323. break;
  3324. }
  3325. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3326. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3327. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3328. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3329. this.rigy.applyLinearImpulseToCenter(this.speed);
  3330. }
  3331. onUpdate() {
  3332. if (this.anglePercent > 0.1) {
  3333. this.anglePercent *= 0.97;
  3334. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3335. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3336. this.rigy.applyForceToCenter(this.rotSpeed);
  3337. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3338. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3339. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3340. if (num > 0.9)
  3341. this.canRot = true;
  3342. }
  3343. else
  3344. this.canRot = true;
  3345. if (Math.abs(this.rotY) > 0.1)
  3346. this.rotY *= 0.98;
  3347. super.onUpdate();
  3348. }
  3349. destroySelf() {
  3350. super.destroySelf();
  3351. this.speed = null;
  3352. }
  3353. }
  3354. class D2Ball extends Laya.Sprite {
  3355. constructor(isRootBall = false) {
  3356. super();
  3357. this.ui = ui_D2Ball.createInstance();
  3358. this.pivotX = this.ui.width / 2;
  3359. this.pivotY = this.ui.width / 2;
  3360. this.x = 0;
  3361. this.y = 0;
  3362. this.addChild(this.ui.displayObject);
  3363. this.ui.displayObject.x += this.ui.width / 2;
  3364. this.ui.displayObject.y += this.ui.width / 2;
  3365. if (isRootBall) {
  3366. this.d2Src = this.addComponent(D2RootBallSrc);
  3367. }
  3368. else {
  3369. this.d2Src = this.addComponent(D2BallSrc);
  3370. }
  3371. this.d2Src.ui = this.ui;
  3372. this.addCircleCollider();
  3373. this.addInnerCircleCollider();
  3374. this.addRigyBody();
  3375. }
  3376. addCircleCollider() {
  3377. let colli = xGame.common.getCollider("circle");
  3378. colli.radius = this.ui.width / 2;
  3379. this.addComponentIntance(colli);
  3380. this.d2Src.outColli = colli;
  3381. colli.label = "ball";
  3382. }
  3383. addInnerCircleCollider() {
  3384. let colli = xGame.common.getCollider("circle");
  3385. colli.radius = this.ui.inner.width / 2;
  3386. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3387. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3388. this.addComponentIntance(colli);
  3389. this.d2Src.innerColli = colli;
  3390. colli.label = "inner";
  3391. }
  3392. addRigyBody() {
  3393. let rigy = xGame.common.getRigbody();
  3394. rigy.type = "dynamic";
  3395. this.addComponentIntance(rigy);
  3396. this.d2Src.rigy = rigy;
  3397. }
  3398. disposeSelf() {
  3399. if (!this.ui.isDisposed) {
  3400. this.ui.dispose();
  3401. this.ui.removeFromParent();
  3402. this.ui = null;
  3403. }
  3404. }
  3405. }
  3406. class ui_D2Gan extends fgui.GComponent {
  3407. static createInstance() {
  3408. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3409. }
  3410. onConstruct() {
  3411. this.myIcon = (this.getChild("myIcon"));
  3412. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3413. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3414. this.self = (this.getChild("self"));
  3415. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3416. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3417. this.ai = (this.getChild("ai"));
  3418. }
  3419. }
  3420. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3421. class D2Gan {
  3422. constructor() {
  3423. this.offset = 0.15;
  3424. this.cell = 1.5;
  3425. this.onBallCell = 0.4;
  3426. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3427. this.moveNum = 70;
  3428. this.rulerRate = 0.1;
  3429. this.ui = ui_D2Gan.createInstance();
  3430. this.changeSelfRod();
  3431. this.changeAIRod();
  3432. }
  3433. changeSelfRod() {
  3434. let index = DataMgr.getCurBallRod();
  3435. let data = cfgTable.ballrodData[index + 1];
  3436. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3437. this.selfMySpine && this.selfMySpine.dispose();
  3438. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3439. if (data.spine) {
  3440. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3441. this.selfMySpine = new SpineMgr(data.spine, () => {
  3442. let xx = this.ui.selfEftRoot.width / 2;
  3443. let yy = this.ui.selfEftRoot.height / 2;
  3444. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3445. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3446. outSpine.rotation = -90;
  3447. });
  3448. }
  3449. }
  3450. changeAIRod() {
  3451. let length = Object.keys(cfgTable.ballrodData).length;
  3452. let rand = Math.floor(length * Math.random()) + 1;
  3453. let data = cfgTable.ballrodData[rand];
  3454. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3455. this.aiMySpine && this.aiMySpine.dispose();
  3456. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3457. if (data.spine) {
  3458. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3459. this.aiMySpine = new SpineMgr(data.spine, () => {
  3460. let xx = this.ui.aiEftRoot.width / 2;
  3461. let yy = this.ui.aiEftRoot.height / 2;
  3462. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3463. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3464. outSpine.rotation = -90;
  3465. });
  3466. }
  3467. }
  3468. setGanLastInfo() {
  3469. this.lastInfo.rotation = this.ui.rotation;
  3470. this.lastInfo.x = this.ui.x;
  3471. this.lastInfo.y = this.ui.y;
  3472. }
  3473. rotateSelf(flag, isRuler = false) {
  3474. let angle;
  3475. flag = flag * this.offset;
  3476. if (xGame.common.d2World.isHelpLineOnBall) {
  3477. angle = flag * this.onBallCell;
  3478. }
  3479. else {
  3480. angle = flag * this.cell;
  3481. }
  3482. if (isRuler) {
  3483. angle *= this.rulerRate;
  3484. }
  3485. this.ui.rotation += angle;
  3486. xGame.common.d2World.getHelpLine();
  3487. }
  3488. checkDistance() {
  3489. let target = xGame.common.d2World.targetBall;
  3490. let root = xGame.common.d2World.rootBall;
  3491. if (target == null) {
  3492. return 1;
  3493. }
  3494. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3495. if (dis <= 2500) {
  3496. return 5;
  3497. }
  3498. return 1;
  3499. }
  3500. rotDest(rot) {
  3501. this.ui.rotation = rot;
  3502. xGame.common.d2World.getHelpLine();
  3503. }
  3504. storagePower(powerNum) {
  3505. let pos = (powerNum / 100) * this.moveNum;
  3506. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3507. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3508. this.ui.x = this.lastInfo.x + xx;
  3509. this.ui.y = this.lastInfo.y + yy;
  3510. }
  3511. shoot() {
  3512. this.storagePower(0);
  3513. this.ui.visible = false;
  3514. }
  3515. destroySelf() {
  3516. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3517. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3518. this.selfMySpine && this.selfMySpine.dispose();
  3519. this.aiMySpine && this.aiMySpine.dispose();
  3520. this.lastInfo = null;
  3521. if (!this.ui.isDisposed) {
  3522. this.ui.removeFromParent();
  3523. this.ui.dispose();
  3524. }
  3525. }
  3526. }
  3527. class ui_HelpLine extends fgui.GComponent {
  3528. static createInstance() {
  3529. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3530. }
  3531. onConstruct() {
  3532. this.n10 = (this.getChild("n10"));
  3533. this.rect = (this.getChild("rect"));
  3534. this.dir11 = (this.getChild("dir11"));
  3535. this.dir = (this.getChild("dir"));
  3536. this.rootDir = (this.getChild("rootDir"));
  3537. this.dirDot = (this.getChild("dirDot"));
  3538. }
  3539. }
  3540. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3541. class D2HelpLine {
  3542. constructor() {
  3543. this.starX = 0;
  3544. this.starY = 0;
  3545. this.ui = ui_HelpLine.createInstance();
  3546. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3547. this.starX = this.ui.rect.x;
  3548. this.starY = this.ui.rect.y;
  3549. }
  3550. shoot() {
  3551. this.ui.visible = false;
  3552. }
  3553. destroySelf() {
  3554. if (this.ui.isDisposed) {
  3555. this.ui.removeFromParent();
  3556. this.ui.dispose();
  3557. }
  3558. }
  3559. }
  3560. class D2World extends Laya.Script {
  3561. constructor() {
  3562. super();
  3563. this.ballArr = [];
  3564. this.openCheckStill = false;
  3565. this.checkArr = [];
  3566. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3567. this.isHelpLineOnBall = false;
  3568. this.isOnSameLine = false;
  3569. this.reflectAngle = 0;
  3570. this.powerPercent = 0;
  3571. this.inHolesSpeed = [];
  3572. this.outDir = new Laya.Vector2();
  3573. this.rootDir = new Laya.Vector2();
  3574. this.aiLv = 0;
  3575. this.rootPos = new Laya.Vector2();
  3576. this.tempDir1 = new Laya.Vector2();
  3577. this.tempDir2 = new Laya.Vector2();
  3578. this.tempDir3 = new Laya.Vector2();
  3579. this.ballSize = 33;
  3580. this.destRot = 0;
  3581. }
  3582. initSelf() {
  3583. this.createBalls();
  3584. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3585. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3586. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3587. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3588. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3589. }
  3590. setBorderRect() {
  3591. let ui = xGame.common.gameUI.ui;
  3592. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3593. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3594. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3595. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3596. this.borderRect.x = starX;
  3597. this.borderRect.y = starY;
  3598. this.borderRect.width = width;
  3599. this.borderRect.height = height;
  3600. }
  3601. resetGame() {
  3602. this.openCheckStill = false;
  3603. let temp;
  3604. for (let index = 0; index < this.ballArr.length; index++) {
  3605. temp = this.ballArr[index];
  3606. temp.destroySelf();
  3607. }
  3608. xGame.common.d3World.ballRoot.destroyChildren();
  3609. xGame.common.gameUI.ui.ballNode.removeChildren();
  3610. console.log("进入摧毁逻辑");
  3611. this.d2Gan.destroySelf();
  3612. this.d2HelpLine.destroySelf();
  3613. this.ballArr = [];
  3614. }
  3615. setD2Gan() {
  3616. let ballNode = this.rootBall.ui;
  3617. let d2Gan = new D2Gan();
  3618. this.d2Gan = d2Gan;
  3619. let ganNode = d2Gan.ui;
  3620. ballNode.addChild(ganNode);
  3621. ganNode.pivotX = ganNode.pivotX;
  3622. ganNode.pivotY = ganNode.pivotY;
  3623. ganNode.x = ganNode.myIcon.width / 2;
  3624. ganNode.y = this.rootBall.gameObj.width;
  3625. d2Gan.setGanLastInfo();
  3626. }
  3627. setHelpLine() {
  3628. let d2Help = new D2HelpLine();
  3629. this.d2HelpLine = d2Help;
  3630. }
  3631. createBalls() {
  3632. let cfg;
  3633. switch (xGame.common.gameMode) {
  3634. case GameMode.classic:
  3635. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3636. break;
  3637. case GameMode.bigMove:
  3638. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3639. break;
  3640. case GameMode.placeBall:
  3641. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3642. break;
  3643. default:
  3644. break;
  3645. }
  3646. cfg = JSON.parse(JSON.stringify(cfg));
  3647. for (const key in cfg) {
  3648. if (cfg[key].value == 0) {
  3649. this.createRootBall(cfg[key]);
  3650. delete cfg[key];
  3651. break;
  3652. }
  3653. }
  3654. this.createOtherBalls(cfg);
  3655. }
  3656. createRootBall(data) {
  3657. let root = new D2Ball(true);
  3658. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3659. this.rootBall = root.d2Src;
  3660. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3661. let d3BallSrc = d3Ball.getComponent(Ball);
  3662. xGame.common.d3World.rootBall = d3Ball;
  3663. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3664. let xx = data.x;
  3665. let yy = data.y;
  3666. let numer = data.value;
  3667. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3668. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3669. this.ballArr.push(this.rootBall);
  3670. this.setD2Gan();
  3671. this.setHelpLine();
  3672. }
  3673. createOtherBalls(cfg) {
  3674. let temp;
  3675. let src;
  3676. let data;
  3677. for (const key in cfg) {
  3678. data = cfg[key];
  3679. temp = new D2Ball();
  3680. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3681. src = temp.d2Src;
  3682. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3683. src.initSelf(data.value, data.x, data.y, d3Ball);
  3684. this.ballArr.push(src);
  3685. }
  3686. }
  3687. shoot(percent) {
  3688. this.powerPercent = percent;
  3689. this.openCheckStill = true;
  3690. let d2Angle = this.d2Gan.ui.rotation;
  3691. this.rootBall.setSpeed(percent, d2Angle);
  3692. this.clearBallAllEft();
  3693. this.changePlayerView();
  3694. }
  3695. onUpdate() {
  3696. if (!this.openCheckStill)
  3697. return;
  3698. this.checkStill();
  3699. }
  3700. checkStill() {
  3701. for (let index = 0; index < this.ballArr.length; index++) {
  3702. if (!this.ballArr[index].isStill()) {
  3703. return;
  3704. }
  3705. }
  3706. xGame.eventMgr.event(ALL_BALL_STOP);
  3707. }
  3708. allBallStop() {
  3709. this.openCheckStill = false;
  3710. xGame.common.recoverCameraView();
  3711. }
  3712. waitShoot() {
  3713. if (!this.d2Gan.ui.isDisposed) {
  3714. this.d2Gan.ui.visible = true;
  3715. }
  3716. if (!this.d2HelpLine.ui.isDisposed) {
  3717. this.d2HelpLine.ui.visible = true;
  3718. }
  3719. this.clearBallAllEft();
  3720. this.showBallRightEft();
  3721. this.getHelpLine();
  3722. this.inHolesSpeed = [];
  3723. this.selectOneBall();
  3724. }
  3725. _getAllBallArr() {
  3726. let arr = this.ballArr;
  3727. let outArr = [];
  3728. for (let index = 0; index < arr.length; index++) {
  3729. if (arr[index] instanceof D2RootBallSrc)
  3730. continue;
  3731. if (arr[index].ballFunc == "ice")
  3732. continue;
  3733. if (arr[index].destroyed)
  3734. continue;
  3735. outArr.push(arr[index]);
  3736. }
  3737. return outArr;
  3738. }
  3739. _getBlackObj() {
  3740. let arr = this.ballArr;
  3741. for (let index = 0; index < arr.length; index++) {
  3742. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3743. return arr[index];
  3744. }
  3745. }
  3746. }
  3747. selectOneBall() {
  3748. let all = this._getAllBallArr();
  3749. let target;
  3750. switch (xGame.common.gameMode) {
  3751. case GameMode.classic:
  3752. if (xGame.common.gameMgr.selfTurn) {
  3753. let self = xGame.common.gameMgr.selfBallArr;
  3754. let black = this._getBlackObj();
  3755. if (xGame.common.gameMgr.ensureBallType) {
  3756. if (self.length > 0) {
  3757. let out = [];
  3758. for (let j = 0; j < all.length; j++) {
  3759. if (self.indexOf(all[j].number) > -1) {
  3760. out.push(all[j]);
  3761. }
  3762. }
  3763. target = this.selectBestEnterOne(out);
  3764. }
  3765. else {
  3766. target = this.selectBestEnterOne([black]);
  3767. }
  3768. }
  3769. else {
  3770. target = this.selectBestEnterOne(all);
  3771. }
  3772. }
  3773. else {
  3774. target = this.selectBestEnterOne(all);
  3775. }
  3776. break;
  3777. case GameMode.bigMove:
  3778. target = this.selectBestEnterOne(all);
  3779. break;
  3780. case GameMode.placeBall:
  3781. if (all.length > 0) {
  3782. target = this.selectBestEnterOne(all);
  3783. }
  3784. break;
  3785. default:
  3786. break;
  3787. }
  3788. if (target && !target.destroyed && target.onClick) {
  3789. target.onClick(0, true);
  3790. let num = -200 + xGame.common.randomNum(0, 400);
  3791. num /= 150;
  3792. if (xGame.common.longHelpLine) {
  3793. num = 0;
  3794. }
  3795. this.destRot += num;
  3796. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3797. }
  3798. }
  3799. removeOneBall(ball) {
  3800. for (let index = 0; index < this.ballArr.length; index++) {
  3801. if (this.ballArr[index].id == ball.id) {
  3802. this.ballArr.splice(index, 1);
  3803. break;
  3804. }
  3805. }
  3806. }
  3807. getHelpLine() {
  3808. this.d2HelpLine.ui.dirDot.visible = false;
  3809. this.isOnSameLine = false;
  3810. let startX = this.rootBall.gameObj.x;
  3811. let startY = this.rootBall.gameObj.y;
  3812. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3813. if (dis == null) {
  3814. this.d2HelpLine.ui.visible = false;
  3815. console.error("辅助线异常");
  3816. return;
  3817. }
  3818. this.d2HelpLine.ui.visible = true;
  3819. let angle = this.d2Gan.ui.rotation;
  3820. let radius = 16.5;
  3821. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3822. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3823. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3824. if (colliObj == null) {
  3825. this.getColliPos(disX, disY, radius, angle);
  3826. xGame.common.d2World.isHelpLineOnBall = false;
  3827. this.targetBall = null;
  3828. this.reflectAngle = 0;
  3829. this.showBallWrongEft();
  3830. }
  3831. else {
  3832. let target = colliObj.src;
  3833. let radius = 16.5;
  3834. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3835. dis1 = Math.sqrt(dis1);
  3836. let realDis = colliObj.disHon - dis1;
  3837. let dir = colliObj.dir;
  3838. let xx = startX + dir.x * realDis;
  3839. let yy = startY + dir.y * realDis;
  3840. this.getColliPos(xx, yy, radius, angle);
  3841. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3842. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3843. let offset = xGame.common.rodOffest;
  3844. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3845. this.isOnSameLine = true;
  3846. }
  3847. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3848. xGame.common.d2World.isHelpLineOnBall = true;
  3849. this.targetBall = target;
  3850. this.reflectAngle = reflectAngle;
  3851. this.showBallWrongEft();
  3852. if (xGame.common.longHelpLine) {
  3853. this.delayReflectLine(target, reflectAngle);
  3854. }
  3855. }
  3856. }
  3857. getBorderDot(startX, startY, angle) {
  3858. let radius = 17;
  3859. let distance;
  3860. let isDone;
  3861. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3862. isDone = this.judgeUpDown(distance, angle, startX);
  3863. if (isDone != null) {
  3864. return isDone;
  3865. }
  3866. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3867. isDone = this.judgeUpDown(distance, angle, startX);
  3868. if (isDone != null) {
  3869. return isDone;
  3870. }
  3871. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3872. isDone = this.judgeLeftRight(distance, angle, startY);
  3873. if (isDone != null) {
  3874. return isDone;
  3875. }
  3876. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3877. isDone = this.judgeLeftRight(distance, angle, startY);
  3878. if (isDone != null) {
  3879. return isDone;
  3880. }
  3881. }
  3882. judgeUpDown(distance, angle, startX) {
  3883. let flag = Math.sin(angle * Math.PI / 180);
  3884. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3885. if (distance >= 0) {
  3886. if (flag > 0) {
  3887. if (temp < this.borderRect.x + this.borderRect.width) {
  3888. return distance;
  3889. }
  3890. }
  3891. else {
  3892. if (temp > this.borderRect.x) {
  3893. return distance;
  3894. }
  3895. }
  3896. }
  3897. }
  3898. judgeLeftRight(distance, angle, starY) {
  3899. let flag = -Math.cos(angle * Math.PI / 180);
  3900. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3901. if (distance >= 0) {
  3902. if (flag > 0) {
  3903. if (temp < this.borderRect.y + this.borderRect.height) {
  3904. return distance;
  3905. }
  3906. }
  3907. else {
  3908. if (temp > this.borderRect.y) {
  3909. return distance;
  3910. }
  3911. }
  3912. }
  3913. }
  3914. clearBallAllEft() {
  3915. let temp;
  3916. for (let index = 0; index < this.ballArr.length; index++) {
  3917. temp = this.ballArr[index];
  3918. temp.clearBallEft();
  3919. }
  3920. }
  3921. showBallRightEft() {
  3922. let gameMgr = xGame.common.gameMgr;
  3923. let temp;
  3924. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3925. if (targetArr.length <= 0)
  3926. return;
  3927. for (let index = 0; index < this.ballArr.length; index++) {
  3928. temp = this.ballArr[index];
  3929. if (targetArr.indexOf(temp.number) > -1) {
  3930. temp.showRightEft();
  3931. }
  3932. }
  3933. }
  3934. showBallWrongEft() {
  3935. let gameMgr = xGame.common.gameMgr;
  3936. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3937. if (targetArr.length <= 0)
  3938. return;
  3939. let temp;
  3940. for (let index = 0; index < this.ballArr.length; index++) {
  3941. temp = this.ballArr[index];
  3942. if (this.targetBall && this.targetBall.number == temp.number) {
  3943. if (targetArr.indexOf(temp.number) <= -1) {
  3944. temp.showWrongEft();
  3945. }
  3946. else {
  3947. temp.clearBallWrongEft();
  3948. }
  3949. }
  3950. else {
  3951. temp.clearBallWrongEft();
  3952. }
  3953. }
  3954. }
  3955. getColliPos(x, y, radius, angle) {
  3956. this.d2HelpLine.ui.x = x;
  3957. this.d2HelpLine.ui.y = y;
  3958. let dirX = x - this.rootBall.gameObj.x;
  3959. let dirY = y - this.rootBall.gameObj.y;
  3960. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3961. if (rectH <= 0)
  3962. rectH = 0;
  3963. this.d2HelpLine.ui.rect.height = 0;
  3964. this.d2HelpLine.ui.rect.height = rectH;
  3965. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3966. if (rectH < this.rootBall.gameObj.width) {
  3967. this.d2HelpLine.ui.rect.visible = false;
  3968. }
  3969. else {
  3970. this.d2HelpLine.ui.rect.visible = true;
  3971. }
  3972. this.d2HelpLine.ui.dir.visible = false;
  3973. this.d2HelpLine.ui.rootDir.visible = false;
  3974. }
  3975. getReflectLine(x, y, radius, target) {
  3976. this.d2HelpLine.ui.dir.visible = true;
  3977. let dirX = target.x - x;
  3978. let dirY = target.y - y;
  3979. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3980. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3981. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3982. this.d2HelpLine.ui.dir.height = 48;
  3983. this.d2HelpLine.ui.dir.rotation = angle;
  3984. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3985. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3986. return angle;
  3987. }
  3988. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3989. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3990. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3991. let targetX = target.gameObj.x;
  3992. let targetY = target.gameObj.y;
  3993. this.outDir.setValue(targetX - xx, targetY - yy);
  3994. this.rootDir.setValue(rtX - xx, rtY - yy);
  3995. let ver = Math.PI / 2;
  3996. let sin = Math.sin(ver);
  3997. let cos = Math.cos(ver);
  3998. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3999. let outY = this.outDir.x * sin + this.outDir.y * cos;
  4000. this.outDir.setValue(outX, outY);
  4001. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  4002. Laya.Vector2.normalize(this.outDir, this.outDir);
  4003. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  4004. if (Math.abs(result) <= 0.08) {
  4005. this.d2HelpLine.ui.rootDir.visible = false;
  4006. return;
  4007. }
  4008. if (result > 0) {
  4009. angle += 90;
  4010. }
  4011. else if (result < 0) {
  4012. angle -= 90;
  4013. }
  4014. this.d2HelpLine.ui.rootDir.visible = true;
  4015. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  4016. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  4017. this.d2HelpLine.ui.rootDir.rotation = angle;
  4018. }
  4019. delayReflectLine(obj, angle) {
  4020. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  4021. return;
  4022. }
  4023. this.isOnSameLine = false;
  4024. let startX = obj.gameObj.x;
  4025. let startY = obj.gameObj.y;
  4026. let dis = this.getBorderDot(startX, startY, angle);
  4027. if (dis == null) {
  4028. this.d2HelpLine.ui.dirDot.visible = false;
  4029. return;
  4030. }
  4031. this.d2HelpLine.ui.visible = true;
  4032. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4033. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4034. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4035. if (colliObj == null) {
  4036. this.setDelayLine(disX, disY, obj, angle);
  4037. }
  4038. else {
  4039. let radius = 16;
  4040. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4041. dis1 = Math.sqrt(dis1);
  4042. let realDis = colliObj.disHon - dis1;
  4043. let dir = colliObj.dir;
  4044. let xx = startX + dir.x * realDis;
  4045. let yy = startY + dir.y * realDis;
  4046. this.setDelayLine(xx, yy, obj, angle);
  4047. }
  4048. }
  4049. setDelayLine(x, y, obj, angle) {
  4050. let dirX = x - obj.gameObj.x;
  4051. let dirY = y - obj.gameObj.y;
  4052. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4053. if (rectH <= 0)
  4054. rectH = 0;
  4055. this.d2HelpLine.ui.dir.height = rectH;
  4056. this.d2HelpLine.ui.dirDot.visible = true;
  4057. this.d2HelpLine.ui.dirDot.x = 17;
  4058. this.d2HelpLine.ui.dirDot.y = 17;
  4059. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4060. ;
  4061. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4062. }
  4063. changePlayerView() {
  4064. if (Math.random() >= 0.7)
  4065. return;
  4066. if (!this.targetBall) {
  4067. return;
  4068. }
  4069. if (!xGame.common.gameMgr.selfTurn)
  4070. return;
  4071. switch (xGame.common.gameMode) {
  4072. case GameMode.classic:
  4073. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4074. if (this.targetBall.number != 8) {
  4075. return;
  4076. }
  4077. }
  4078. break;
  4079. case GameMode.bigMove:
  4080. return;
  4081. case GameMode.placeBall:
  4082. break;
  4083. default:
  4084. break;
  4085. }
  4086. let startX = this.targetBall.gameObj.x;
  4087. let startY = this.targetBall.gameObj.y;
  4088. let angle = this.reflectAngle;
  4089. let dis = this.getBorderDot(startX, startY, angle);
  4090. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4091. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4092. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4093. if (colliObj) {
  4094. return;
  4095. }
  4096. let offset = 40;
  4097. let posObj = xGame.common.gameMgr.posObj;
  4098. let temp;
  4099. let radius;
  4100. let tarX, tarY;
  4101. for (const key in posObj) {
  4102. temp = posObj[key];
  4103. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4104. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4105. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4106. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4107. xGame.common.showOneCamera("angle" + key);
  4108. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4109. Laya.physicsTimer.scale = 0.7;
  4110. break;
  4111. }
  4112. }
  4113. }
  4114. selectBestEnterOne(arr) {
  4115. this.aiLv = xGame.tools.random(1, 11);
  4116. this.aiLv = 10;
  4117. this.wBall = xGame.common.d2World.rootBall;
  4118. this.rootPos.x = this.wBall.gameObj.x;
  4119. this.rootPos.y = this.wBall.gameObj.y;
  4120. this.initHoleBall(arr);
  4121. return this.selectBall();
  4122. }
  4123. selectBall() {
  4124. let ball = null;
  4125. this.destRot = 0;
  4126. let ai = 110 - this.aiLv * 10;
  4127. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4128. let score = false;
  4129. if (this.scoreBall.length < 1) {
  4130. if (this.lineBall.length < 1) {
  4131. for (let i = 0; i < this.kickBall.length; i++) {
  4132. let list = [];
  4133. let bo = this.kickBall[i];
  4134. let bobj = bo.gameObj;
  4135. let rect = xGame.common.d2World.borderRect;
  4136. let mobj = this.wBall.gameObj;
  4137. let minb = bobj.y - rect.y - 20;
  4138. let minw = mobj.y - rect.y - 50;
  4139. if (minb > 0 && minw > 0) {
  4140. let dlenx = 0;
  4141. let dleny = mobj.y - rect.y;
  4142. let spx = mobj.x;
  4143. let spy = rect.y - dleny;
  4144. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4145. }
  4146. minb = rect.y + rect.height - bobj.y - 20;
  4147. minw = rect.y + rect.height - mobj.y - 50;
  4148. if (minb > 0 && minw > 0) {
  4149. let dlenx = 0;
  4150. let dleny = rect.y + rect.height - mobj.y;
  4151. let spx = mobj.x;
  4152. let spy = rect.y + rect.height + dleny;
  4153. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4154. }
  4155. minb = bobj.x - rect.x - 20;
  4156. minw = mobj.x - rect.x - 50;
  4157. if (minb > 0 && minw > 0) {
  4158. let dlenx = mobj.x - rect.x;
  4159. let dleny = 0;
  4160. let spx = rect.x - dlenx;
  4161. let spy = mobj.y;
  4162. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4163. }
  4164. minb = rect.x + rect.width - bobj.x - 20;
  4165. minw = rect.x + rect.width - mobj.x - 50;
  4166. if (minb > 0 && minw > 0) {
  4167. let dlenx = rect.x + rect.width - mobj.x;
  4168. let dleny = 0;
  4169. let spx = rect.x + rect.width + dlenx;
  4170. let spy = mobj.y;
  4171. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4172. }
  4173. list.sort(function (a, b) {
  4174. return a.order - b.order;
  4175. });
  4176. for (let i = 0; i < list.length; i++) {
  4177. let data = list[i];
  4178. let mx = mobj.x - bobj.x;
  4179. let my = mobj.y - bobj.y;
  4180. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4181. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4182. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4183. if (num > 1)
  4184. num = 1;
  4185. let cos = Math.acos(num);
  4186. if (cos > 1.57)
  4187. cos = 1.57;
  4188. else if (cos < 0.01)
  4189. cos = 0.01;
  4190. let tan = Math.tan(cos);
  4191. let dx = tan * data.dleny;
  4192. let dy = tan * data.dlenx;
  4193. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4194. if (Math.abs(bx - 667) < 40)
  4195. continue;
  4196. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4197. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4198. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4199. this.forceMax = dis * 0.08;
  4200. this.destRot += mis * 0.1;
  4201. this.setKick(bx, by);
  4202. return true;
  4203. }
  4204. }
  4205. }
  4206. }
  4207. else {
  4208. ball = xGame.common.getRandArrEle(this.lineBall);
  4209. }
  4210. }
  4211. else {
  4212. for (let i = 0; i < this.scoreBall.length; i++) {
  4213. if (i < this.scoreBall.length - 1) {
  4214. let rand = 70 + this.aiLv * 10 + i * 10;
  4215. if (xGame.tools.random(0, 100) < rand) {
  4216. ball = this.scoreBall[i];
  4217. break;
  4218. }
  4219. }
  4220. else {
  4221. ball = this.scoreBall[i];
  4222. break;
  4223. }
  4224. }
  4225. score = true;
  4226. this.selectNum++;
  4227. }
  4228. if (!ball)
  4229. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4230. let dx = ball.gameObj.x;
  4231. let dy = ball.gameObj.y;
  4232. let kickAngle = 0;
  4233. if (score) {
  4234. dx = ball.kickPos.x;
  4235. dy = ball.kickPos.y;
  4236. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4237. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4238. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4239. if (adot > 1)
  4240. adot = 1;
  4241. kickAngle = Math.acos(adot) * 57.3;
  4242. if (kickAngle > 45) {
  4243. let kdx = ball.kickPos.x - ball.gameObj.x;
  4244. let kdy = ball.kickPos.y - ball.gameObj.y;
  4245. dx = ball.kickPos.x - kdx * mis * 0.3;
  4246. dy = ball.kickPos.y - kdy * mis * 0.3;
  4247. }
  4248. else
  4249. this.destRot += mis;
  4250. }
  4251. else if (ball.poleAngle != 0) {
  4252. this.destRot += ball.poleAngle;
  4253. }
  4254. if (xGame.common.gameMode == 0) {
  4255. let af = kickAngle * 0.08;
  4256. this.forceMax = ball.hard * 0.1 + af * af;
  4257. }
  4258. this.setKick(dx, dy);
  4259. return ball;
  4260. }
  4261. initHoleBall(arr) {
  4262. this.kickBall = [];
  4263. this.lineBall = [];
  4264. this.scoreBall = [];
  4265. this.holeBall = [];
  4266. this.selectNum = 0;
  4267. this.forceNum = 0;
  4268. this.forceMax = 0;
  4269. this.turnNum = 0;
  4270. let list = arr;
  4271. let holes = xGame.common.gameMgr.holePosList;
  4272. let self = xGame.common.aiPlayer;
  4273. for (let i = 0; i < list.length; i++) {
  4274. let obj = list[i];
  4275. if (!obj)
  4276. continue;
  4277. obj.kickPos.x = 0;
  4278. obj.kickPos.y = 0;
  4279. obj.poleAngle = 0;
  4280. obj.hard = 0;
  4281. obj.borderDis = 0;
  4282. obj.kickAngle = 180;
  4283. let b = obj.gameObj;
  4284. let wbp = this.rootPos;
  4285. let bx = wbp.x - b.x;
  4286. let by = wbp.y - b.y;
  4287. obj.borderDis = xGame.tools.random(0, 100);
  4288. this.kickBall.push(obj);
  4289. if (!this.isLine(wbp, obj))
  4290. continue;
  4291. obj.kickAngle = xGame.tools.random(90, 180);
  4292. obj.kickPos.x = b.x;
  4293. obj.kickPos.y = b.y;
  4294. this.lineBall.push(obj);
  4295. let minDis = 999999;
  4296. let hole = false;
  4297. for (let j = 0; j < holes.length; j++) {
  4298. let hp = holes[j];
  4299. if (bx >= 0 && hp.x > b.x + 100)
  4300. continue;
  4301. if (bx <= 0 && hp.x < b.x - 100)
  4302. continue;
  4303. if (by < -10 && hp.y < wbp.y)
  4304. continue;
  4305. if (by > 10 && hp.y > wbp.y)
  4306. continue;
  4307. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4308. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4309. if (dis < minDis) {
  4310. let dx = b.x - this.tempDir1.x * this.ballSize;
  4311. let dy = b.y - this.tempDir1.y * this.ballSize;
  4312. this.tempDir3.x = this.tempDir1.x;
  4313. this.tempDir3.y = this.tempDir1.y;
  4314. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4315. obj.kickPos.x = dx;
  4316. obj.kickPos.y = dy;
  4317. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4318. if (num > 1)
  4319. num = 1;
  4320. obj.kickAngle = Math.acos(num) * 57.3;
  4321. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4322. dis = dis * 2;
  4323. if (Math.abs(hp.x - 600) < 100)
  4324. dis += 50;
  4325. obj.hard = dis + obj.kickAngle * 3;
  4326. hole = true;
  4327. }
  4328. }
  4329. }
  4330. }
  4331. if (hole) {
  4332. this.scoreBall.push(obj);
  4333. this.holeBall.push(obj);
  4334. }
  4335. }
  4336. this.scoreBall.sort(function (a, b) {
  4337. return a.hard - b.hard;
  4338. });
  4339. this.holeBall.sort(function (a, b) {
  4340. return a.kickAngle - b.kickAngle;
  4341. });
  4342. this.kickBall.sort(function (a, b) {
  4343. return a.borderDis - b.borderDis;
  4344. });
  4345. }
  4346. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4347. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4348. let balls = xGame.common.d2World.ballArr;
  4349. let max = xGame.tools.getDis(hx, hy, bx, by);
  4350. for (let index = 0; index < balls.length; index++) {
  4351. let obj = balls[index];
  4352. if (obj.number == 0)
  4353. continue;
  4354. if (obj.number == bn || obj.number == dn)
  4355. continue;
  4356. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4357. if (dis * dis > max)
  4358. continue;
  4359. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4360. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4361. if (num > 1)
  4362. num = 1;
  4363. if (num < 0)
  4364. continue;
  4365. let gap = Math.sin(Math.acos(num)) * dis;
  4366. if (gap < this.ballSize)
  4367. return true;
  4368. }
  4369. return false;
  4370. }
  4371. isLine(xy, ball) {
  4372. let bx = xy.x;
  4373. let by = xy.y;
  4374. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4375. let dis = ball.getDestDis(xy);
  4376. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4377. let sin = Math.sin(angle);
  4378. let cos = Math.cos(angle);
  4379. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4380. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4381. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4382. let dx = bx + this.tempDir2.x * dis;
  4383. let dy = by + this.tempDir2.y * dis;
  4384. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4385. sin = Math.sin(-angle);
  4386. cos = Math.cos(-angle);
  4387. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4388. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4389. dx = bx + this.tempDir2.x * dis;
  4390. dy = by + this.tempDir2.y * dis;
  4391. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4392. if (isr && isl)
  4393. return false;
  4394. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4395. }
  4396. return true;
  4397. }
  4398. setKick(dx, dy) {
  4399. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4400. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4401. this.tempDir1.x = 0;
  4402. this.tempDir1.y = 1;
  4403. this.tempDir2.y = -this.tempDir2.y;
  4404. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4405. if (num > 1)
  4406. num = 1;
  4407. let rot = Math.acos(num) * 57.3;
  4408. if (this.tempDir2.x < 0)
  4409. rot = 360 - rot;
  4410. this.destRot += rot;
  4411. }
  4412. }
  4413. class ui_UIGame extends fgui.GComponent {
  4414. static createInstance() {
  4415. return (fgui.UIPackage.createObject("game", "UIGame"));
  4416. }
  4417. onConstruct() {
  4418. this.c1 = this.getController("c1");
  4419. this.d3Root = (this.getChild("d3Root"));
  4420. this.clickNode = (this.getChild("clickNode"));
  4421. this.d2Root = (this.getChild("d2Root"));
  4422. this.topNode = (this.getChild("topNode"));
  4423. this.n72 = (this.getChild("n72"));
  4424. this.n40 = (this.getChild("n40"));
  4425. this.rulerNode = (this.getChild("rulerNode"));
  4426. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4427. this.n50 = (this.getChild("n50"));
  4428. this.keduNode = (this.getChild("keduNode"));
  4429. this.powerTxt = (this.getChild("powerTxt"));
  4430. this.powerNode = (this.getChild("powerNode"));
  4431. this.colorNode = (this.getChild("colorNode"));
  4432. this.powerEft = (this.getChild("powerEft"));
  4433. this.myPowerNode = (this.getChild("myPowerNode"));
  4434. this.ganNode = (this.getChild("ganNode"));
  4435. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4436. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4437. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4438. this.skillRod = (this.getChild("skillRod"));
  4439. this.border = (this.getChild("border"));
  4440. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4441. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4442. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4443. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4444. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4445. this.guanyuNode = (this.getChild("guanyuNode"));
  4446. this.helpBtn = (this.getChild("helpBtn"));
  4447. this.wordsBtn = (this.getChild("wordsBtn"));
  4448. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4449. this.returnBtn = (this.getChild("returnBtn"));
  4450. this.ballNode = (this.getChild("ballNode"));
  4451. this.whiteAni = (this.getChild("whiteAni"));
  4452. this.blackAni = (this.getChild("blackAni"));
  4453. this.selfTurn = (this.getChild("selfTurn"));
  4454. this.aiTurn = (this.getChild("aiTurn"));
  4455. this.deskNode = (this.getChild("deskNode"));
  4456. this.moveNode = (this.getChild("moveNode"));
  4457. this.selfTalk = (this.getChild("selfTalk"));
  4458. this.aiTalk = (this.getChild("aiTalk"));
  4459. this.d2Node = (this.getChild("d2Node"));
  4460. this.snowNode = (this.getChild("snowNode"));
  4461. this.guide2 = (this.getChild("guide2"));
  4462. this.guide1 = (this.getChild("guide1"));
  4463. this.guide3 = (this.getChild("guide3"));
  4464. this.guideNode = (this.getChild("guideNode"));
  4465. this.n_lxms_yd1 = (this.getChild("n_lxms_yd1"));
  4466. this.n_lxms_yd2 = (this.getChild("n_lxms_yd2"));
  4467. this.n_lxms_yd3 = (this.getChild("n_lxms_yd3"));
  4468. }
  4469. }
  4470. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4471. class ui_UIGameEnd extends fgui.GComponent {
  4472. static createInstance() {
  4473. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4474. }
  4475. onConstruct() {
  4476. this.c1 = this.getController("c1");
  4477. this.n22 = (this.getChild("n22"));
  4478. this.n2 = (this.getChild("n2"));
  4479. this.n52 = (this.getChild("n52"));
  4480. this.n53 = (this.getChild("n53"));
  4481. this.coinNode = (this.getChild("coinNode"));
  4482. this.closeNode = (this.getChild("closeNode"));
  4483. this.moneyNode = (this.getChild("moneyNode"));
  4484. this.secretary = (this.getChild("secretary"));
  4485. this.n27 = (this.getChild("n27"));
  4486. this.n29 = (this.getChild("n29"));
  4487. this.talkNode = (this.getChild("talkNode"));
  4488. this.n38 = (this.getChild("n38"));
  4489. this.n39 = (this.getChild("n39"));
  4490. this.n40 = (this.getChild("n40"));
  4491. this.awardNode = (this.getChild("awardNode"));
  4492. this.starNumNode = (this.getChild("starNumNode"));
  4493. this.n47 = (this.getChild("n47"));
  4494. this.conditionNode = (this.getChild("conditionNode"));
  4495. this.isGetAward = (this.getChild("isGetAward"));
  4496. this.leftBtn = (this.getChild("leftBtn"));
  4497. this.rightBtn = (this.getChild("rightBtn"));
  4498. this.btnNode = (this.getChild("btnNode"));
  4499. }
  4500. }
  4501. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4502. class ui_UIAddCoin extends fgui.GComponent {
  4503. static createInstance() {
  4504. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4505. }
  4506. onConstruct() {
  4507. this.n11 = (this.getChild("n11"));
  4508. this.myNode = (this.getChild("myNode"));
  4509. this.t0 = this.getTransition("t0");
  4510. }
  4511. }
  4512. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4513. class UIAddCoin extends UIBase {
  4514. constructor() {
  4515. super();
  4516. this.coinNum = 2000;
  4517. }
  4518. onConstructor() {
  4519. this.ui = ui_UIAddCoin.createInstance();
  4520. this.contentPane = this.ui;
  4521. this.isEject = false;
  4522. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4523. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4524. }
  4525. show() {
  4526. super.show();
  4527. this.ui.t0.play();
  4528. this.setGlobalFont(this.ui);
  4529. }
  4530. videoAddCoin() {
  4531. console.log('zh:qjff_AD_for_UIAddCoin');
  4532. if (Laya.Browser.onAndroid) {
  4533. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4534. if (!boo) {
  4535. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4536. return;
  4537. }
  4538. }
  4539. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4540. }
  4541. else {
  4542. console.log('zh:AD 失败,直接发放奖励');
  4543. this.qjff_AD_for_UIAddCoin();
  4544. }
  4545. }
  4546. qjff_AD_for_UIAddCoin() {
  4547. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4548. this.hide();
  4549. }
  4550. }
  4551. UIAddCoin.uiName = "UIAddCoin";
  4552. class ui_UIInvitation extends fgui.GComponent {
  4553. static createInstance() {
  4554. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4555. }
  4556. onConstruct() {
  4557. this.n14 = (this.getChild("n14"));
  4558. this.myNode = (this.getChild("myNode"));
  4559. this.t0 = this.getTransition("t0");
  4560. }
  4561. }
  4562. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4563. class UIInvitation extends UIBase {
  4564. constructor() {
  4565. super();
  4566. }
  4567. onConstructor() {
  4568. this.ui = ui_UIInvitation.createInstance();
  4569. this.contentPane = this.ui;
  4570. this.isEject = false;
  4571. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4572. }
  4573. show() {
  4574. super.show();
  4575. this.setGlobalFont(this.ui);
  4576. }
  4577. enterGame() {
  4578. xGame.common.gameMode = GameMode.classic;
  4579. DataMgr.setChallengeTimes(1);
  4580. xGame.common.passAwardCoin = 2000;
  4581. let need = xGame.common.classicNiceNeddCoin;
  4582. if (DataMgr.coinEnough(need)) {
  4583. DataMgr.setCoin(-need);
  4584. xGame.eventMgr.event(RESTART_GAME, true);
  4585. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4586. }
  4587. else {
  4588. xGame.eventMgr.event(RESTART_GAME, true);
  4589. }
  4590. this.hide();
  4591. }
  4592. hide() {
  4593. super.hide();
  4594. }
  4595. }
  4596. UIInvitation.uiName = "UIInvitation";
  4597. class ui_UIMain extends fgui.GComponent {
  4598. static createInstance() {
  4599. return (fgui.UIPackage.createObject("game", "UIMain"));
  4600. }
  4601. onConstruct() {
  4602. this.n47 = (this.getChild("n47"));
  4603. this.n10 = (this.getChild("n10"));
  4604. this.secretary = (this.getChild("secretary"));
  4605. this.moneyNode = (this.getChild("moneyNode"));
  4606. this.headNode = (this.getChild("headNode"));
  4607. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4608. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4609. this.classicBtn = (this.getChild("classicBtn"));
  4610. this.globalBtn = (this.getChild("globalBtn"));
  4611. this.n44 = (this.getChild("n44"));
  4612. this.n_dengLu = (this.getChild("n_dengLu"));
  4613. this.settingNode = (this.getChild("settingNode"));
  4614. this.drawBtn = (this.getChild("drawBtn"));
  4615. this.signBtn = (this.getChild("signBtn"));
  4616. this.shopBtn = (this.getChild("shopBtn"));
  4617. this.n45 = (this.getChild("n45"));
  4618. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4619. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4620. this.rankBtn = (this.getChild("rankBtn"));
  4621. this.n46 = (this.getChild("n46"));
  4622. this.liucheng1 = (this.getChild("liucheng1"));
  4623. this.rightBtn = (this.getChild("rightBtn"));
  4624. this.n75 = (this.getChild("n75"));
  4625. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4626. this.liucheng2 = (this.getChild("liucheng2"));
  4627. this.guideBtn = (this.getChild("guideBtn"));
  4628. this.n73 = (this.getChild("n73"));
  4629. this.wordsNode = (this.getChild("wordsNode"));
  4630. this.enterGuide = (this.getChild("enterGuide"));
  4631. this.talkNode = (this.getChild("talkNode"));
  4632. this.n83 = (this.getChild("n83"));
  4633. this.n84 = (this.getChild("n84"));
  4634. this.n_yd_challenge_1_mask = (this.getChild("n_yd_challenge_1_mask"));
  4635. this.n_yd_challenge_1_btn = (this.getChild("n_yd_challenge_1_btn"));
  4636. this.n_yd_challenge_1_hand = (this.getChild("n_yd_challenge_1_hand"));
  4637. this.n_yd_lxms_1 = (this.getChild("n_yd_lxms_1"));
  4638. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4639. }
  4640. }
  4641. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4642. class ui_UIMoyu extends fgui.GComponent {
  4643. static createInstance() {
  4644. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4645. }
  4646. onConstruct() {
  4647. this.ageTip = (this.getChild("ageTip"));
  4648. this.mainBg = (this.getChild("mainBg"));
  4649. this.xyNode = (this.getChild("xyNode"));
  4650. this.rnNode = (this.getChild("rnNode"));
  4651. this.fcmNode = (this.getChild("fcmNode"));
  4652. this.ageNode = (this.getChild("ageNode"));
  4653. this.tipNode = (this.getChild("tipNode"));
  4654. this.msgNode = (this.getChild("msgNode"));
  4655. }
  4656. }
  4657. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4658. class MoyuMgr {
  4659. static initMoyu() {
  4660. this.moyuView = new MoyuView();
  4661. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4662. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4663. this.moyuView.ui.displayObject.zOrder = 1000;
  4664. this.moyuView.init();
  4665. this.moyuView.showTip(true);
  4666. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4667. window['XApk'] = this;
  4668. }
  4669. static showAge(show) {
  4670. if (this.moyuView)
  4671. this.moyuView.showAge(show);
  4672. }
  4673. static onPlatMsg(idx) {
  4674. if (!MoyuMgr.moyuView)
  4675. return;
  4676. if (idx == '0') {
  4677. MoyuMgr.moyuView.showTip(false);
  4678. }
  4679. }
  4680. static showAgree(call) {
  4681. if (this.moyuView)
  4682. this.moyuView.showAgree(call);
  4683. else
  4684. call && call();
  4685. }
  4686. static showXy(type = 1) {
  4687. if (this.moyuView)
  4688. this.moyuView.showXy(type);
  4689. }
  4690. }
  4691. MoyuMgr.isAdvise = false;
  4692. class MoyuView {
  4693. constructor() {
  4694. this.ysxyNum = 1;
  4695. this.ysJson = null;
  4696. this.ui = ui_UIMoyu.createInstance();
  4697. }
  4698. init() {
  4699. this.ui.mainBg.visible = false;
  4700. this.ui.xyNode.visible = false;
  4701. this.ui.ageNode.visible = false;
  4702. this.ui.tipNode.visible = false;
  4703. this.ui.rnNode.visible = false;
  4704. this.ui.fcmNode.visible = false;
  4705. this.ui.ageTip.visible = false;
  4706. this.ui.msgNode.visible = false;
  4707. this.ui.visible = false;
  4708. this.ui.xyNode.xyList.setVirtual();
  4709. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4710. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4711. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4712. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4713. this.ui.xyNode.btnKnown.visible = false;
  4714. this.ui.xyNode.xy1.visible = false;
  4715. this.ui.xyNode.xy2.visible = false;
  4716. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4717. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4718. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4719. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4720. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4721. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4722. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4723. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4724. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4725. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4726. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4727. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4728. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4729. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4730. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4731. this.ysxyNum = 2;
  4732. }
  4733. }
  4734. onClick(obj) {
  4735. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4736. switch (obj) {
  4737. case this.ui.ageTip:
  4738. if (Moyu.isTTApk) {
  4739. this.ui.ageNode.visible = true;
  4740. this.ui.mainBg.visible = true;
  4741. }
  4742. break;
  4743. case this.ui.tipNode:
  4744. this.showTip(false);
  4745. break;
  4746. case this.ui.ageNode.btnAge:
  4747. this.ui.ageNode.visible = false;
  4748. this.ui.mainBg.visible = false;
  4749. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4750. this.ui.visible = false;
  4751. break;
  4752. case this.ui.xyNode.btnXy3:
  4753. case this.ui.xyNode.btnXy1:
  4754. this.loadXy(1);
  4755. break;
  4756. case this.ui.xyNode.btnXy2:
  4757. this.loadXy(2);
  4758. break;
  4759. case this.ui.xyNode.btnBack:
  4760. this.ui.xyNode.xy1.visible = true;
  4761. this.ui.xyNode.xy2.visible = false;
  4762. break;
  4763. case this.ui.xyNode.btnKnown:
  4764. this.ui.xyNode.visible = false;
  4765. this.ui.mainBg.visible = false;
  4766. this.ui.visible = false;
  4767. break;
  4768. case this.ui.rnNode.btnCheck:
  4769. this.check();
  4770. break;
  4771. case this.ui.rnNode.btnExit:
  4772. case this.ui.xyNode.btnNo:
  4773. this.ysxyNum--;
  4774. if (this.ysxyNum > 0)
  4775. this.showMsg("Refuse to quit the game once again");
  4776. else {
  4777. Moyu.userAgree(false);
  4778. Moyu.exit();
  4779. }
  4780. break;
  4781. case this.ui.xyNode.btnSure:
  4782. case this.ui.xyNode.btnYes:
  4783. DataMgr.userData.isAgree = true;
  4784. DataMgr.saveUserData();
  4785. this.onAgree();
  4786. break;
  4787. case this.ui.rnNode.btnDone:
  4788. this.ui.rnNode.visible = false;
  4789. this.ui.visible = false;
  4790. break;
  4791. case this.ui.fcmNode.btnRn:
  4792. this.showRn();
  4793. break;
  4794. }
  4795. }
  4796. showTip(show) {
  4797. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4798. return;
  4799. if (show) {
  4800. MoyuMgr.isAdvise = true;
  4801. this.ui.visible = true;
  4802. this.ui.tipNode.visible = true;
  4803. this.ui.tipNode.alpha = 1;
  4804. Laya.timer.once(1000, this, this.showTip, [false]);
  4805. }
  4806. else {
  4807. this.ui.tipNode.alpha = 1;
  4808. this.ui.tipNode.visible = true;
  4809. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4810. this.ui.tipNode.visible = false;
  4811. MoyuMgr.isAdvise = false;
  4812. }), 1000);
  4813. }
  4814. }
  4815. showAge(show, px = 0, py = 0) {
  4816. if (Moyu.platType > 10 && !Moyu.isIos) {
  4817. this.ui.ageTip.x = px;
  4818. this.ui.ageTip.y = py;
  4819. this.ui.ageTip.visible = show;
  4820. if (show)
  4821. this.ui.visible = true;
  4822. }
  4823. }
  4824. showAgree(call) {
  4825. this.agreeCall = call;
  4826. this.onAgree();
  4827. return;
  4828. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4829. this.showXy(0);
  4830. }
  4831. else
  4832. this.onAgree();
  4833. }
  4834. onAgree() {
  4835. if (!this.ui.ageNode.visible)
  4836. this.ui.visible = false;
  4837. this.ui.xyNode.visible = false;
  4838. Moyu.userAgree(true);
  4839. this.showAge(false);
  4840. this.agreeCall && this.agreeCall();
  4841. this.showRn();
  4842. }
  4843. showMsg(txt) {
  4844. this.ui.msgNode.txtMsg.text = txt;
  4845. this.ui.msgNode.visible = true;
  4846. this.ui.msgNode.alpha = 1;
  4847. this.ui.visible = true;
  4848. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4849. this.ui.msgNode.visible = false;
  4850. }), 2500, true);
  4851. }
  4852. showRn() {
  4853. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4854. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4855. this.ui.rnNode.rn1.visible = true;
  4856. this.ui.rnNode.rn2.visible = false;
  4857. this.ui.rnNode.rn3.visible = false;
  4858. this.ui.rnNode.rn4.visible = false;
  4859. this.ui.rnNode.visible = true;
  4860. this.ui.mainBg.visible = true;
  4861. this.ui.rnNode.btnDone.visible = false;
  4862. this.ui.rnNode.btnExit.visible = true;
  4863. this.ui.rnNode.btnCheck.visible = true;
  4864. this.ui.fcmNode.visible = false;
  4865. this.ui.visible = true;
  4866. return;
  4867. }
  4868. }
  4869. this.showFcm();
  4870. }
  4871. showFcm() {
  4872. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4873. Moyu.initFCM(true);
  4874. if (Moyu.gameTime < 1)
  4875. this.fcmLoop();
  4876. else if (Moyu.gameTime < 999)
  4877. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4878. }
  4879. }
  4880. fcmLoop() {
  4881. if (Moyu.gameTime < 1) {
  4882. this.ui.rnNode.visible = false;
  4883. this.ui.fcmNode.visible = true;
  4884. this.ui.mainBg.visible = true;
  4885. this.ui.visible = true;
  4886. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4887. Laya.timer.clear(this.ui, this.fcmLoop);
  4888. }
  4889. }
  4890. check() {
  4891. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4892. this.ui.rnNode.rn1.visible = false;
  4893. this.ui.rnNode.rn2.visible = false;
  4894. this.ui.rnNode.rn4.visible = true;
  4895. }
  4896. else if (this.ui.rnNode.rn4.visible) {
  4897. let name = this.ui.rnNode.inputName.text;
  4898. let code = this.ui.rnNode.inputCode.text;
  4899. if (code && code.length == 18) {
  4900. this.ui.rnNode.rn1.visible = false;
  4901. this.ui.rnNode.rn4.visible = false;
  4902. Moyu.authenticate(name, code, (res) => {
  4903. this.ui.rnNode.rn2.visible = !res;
  4904. this.ui.rnNode.rn3.visible = res;
  4905. this.ui.rnNode.btnDone.visible = res;
  4906. this.ui.rnNode.btnExit.visible = !res;
  4907. this.ui.rnNode.btnCheck.visible = !res;
  4908. if (res)
  4909. this.showFcm();
  4910. });
  4911. }
  4912. else
  4913. this.showMsg("信息填写不完整");
  4914. }
  4915. }
  4916. loadXy(type = 0) {
  4917. this.ui.xyNode.xy1.visible = false;
  4918. this.ui.xyNode.xy2.visible = true;
  4919. this.ui.xyNode.xyList.scrollToView(0);
  4920. if (type == 1) {
  4921. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4922. }
  4923. else if (type == 2) {
  4924. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4925. }
  4926. }
  4927. showXy(type = 0) {
  4928. this.xyBtn();
  4929. if (type == 0) {
  4930. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4931. this.ui.xyNode.btnSure.visible = true;
  4932. }
  4933. else {
  4934. this.ui.xyNode.btnYes.visible = true;
  4935. this.ui.xyNode.btnNo.visible = true;
  4936. }
  4937. }
  4938. else {
  4939. this.ui.xyNode.btnKnown.visible = true;
  4940. this.ui.mainBg.visible = true;
  4941. }
  4942. this.ui.xyNode.xy1.visible = true;
  4943. this.ui.xyNode.xy2.visible = false;
  4944. this.ui.xyNode.visible = true;
  4945. this.ui.visible = true;
  4946. }
  4947. xyBtn() {
  4948. this.ui.xyNode.btnSure.visible = false;
  4949. this.ui.xyNode.btnYes.visible = false;
  4950. this.ui.xyNode.btnNo.visible = false;
  4951. this.ui.xyNode.btnKnown.visible = false;
  4952. {
  4953. this.ui.xyNode.btnXy3.visible = false;
  4954. this.ui.xyNode.btnXy2.visible = true;
  4955. this.ui.xyNode.btnXy1.visible = true;
  4956. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4957. }
  4958. }
  4959. createXY(json) {
  4960. this.ysJson = json.content;
  4961. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4962. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4963. this.ui.xyNode.xy2.visible = true;
  4964. }
  4965. renderListItem(idx, cell) {
  4966. let xy = this.ysJson[idx];
  4967. cell.height = xy.line * 30;
  4968. cell.xyItem.text = xy.text;
  4969. }
  4970. onDestroy() {
  4971. this.agreeCall = null;
  4972. }
  4973. }
  4974. class SettingNode {
  4975. constructor(ui) {
  4976. this.showSetting = false;
  4977. this.openSound = true;
  4978. this.openShake = true;
  4979. this.ui = ui;
  4980. this.ui.soundBtn.onClick(this, this.switchSound);
  4981. this.ui.shakeBtn.onClick(this, this.switchShake);
  4982. this.ui.xyBtn.onClick(this, this.onXy);
  4983. this.ui.clickNode.onClick(this, this.changeSetting);
  4984. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4985. this.ui.xyBtn.visible = false;
  4986. this.ui.shakeBtn.visible = false;
  4987. }
  4988. changeSetting() {
  4989. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4990. this.showSetting = !this.showSetting;
  4991. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4992. }
  4993. switchSound() {
  4994. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4995. this.openSound = !this.openSound;
  4996. Moyu.onSetting(this.openSound, this.openShake);
  4997. xGame.soundMgr.onSetting(this.openSound);
  4998. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4999. }
  5000. switchShake() {
  5001. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5002. this.openShake = !this.openShake;
  5003. Moyu.onSetting(this.openSound, this.openShake);
  5004. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  5005. }
  5006. onXy() {
  5007. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5008. MoyuMgr.showXy(1);
  5009. }
  5010. }
  5011. class ui_UILevelDisplay extends fgui.GComponent {
  5012. static createInstance() {
  5013. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  5014. }
  5015. onConstruct() {
  5016. this.n9 = (this.getChild("n9"));
  5017. this.myNode = (this.getChild("myNode"));
  5018. this.closeNode = (this.getChild("closeNode"));
  5019. }
  5020. }
  5021. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  5022. class ui_UILevelProp extends fgui.GComponent {
  5023. static createInstance() {
  5024. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  5025. }
  5026. onConstruct() {
  5027. this.n16 = (this.getChild("n16"));
  5028. this.myNode = (this.getChild("myNode"));
  5029. this.closeBtn = (this.getChild("closeBtn"));
  5030. this.moneyNode = (this.getChild("moneyNode"));
  5031. this.t1 = this.getTransition("t1");
  5032. }
  5033. }
  5034. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  5035. class ui_ShowItem extends fgui.GComponent {
  5036. static createInstance() {
  5037. return (fgui.UIPackage.createObject("game", "ShowItem"));
  5038. }
  5039. onConstruct() {
  5040. this.myImg = (this.getChild("myImg"));
  5041. }
  5042. }
  5043. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5044. class ShowItem {
  5045. constructor() {
  5046. this.ui = ui_ShowItem.createInstance();
  5047. }
  5048. destroySelf() {
  5049. if (!this.ui.isDisposed) {
  5050. this.ui.removeFromParent();
  5051. this.ui.dispose();
  5052. }
  5053. }
  5054. setParent(parent) {
  5055. parent.addChild(this.ui);
  5056. }
  5057. setPos(x, y) {
  5058. this.ui.x = x;
  5059. this.ui.y = y;
  5060. }
  5061. setUrl(index) {
  5062. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5063. }
  5064. }
  5065. class ui_UIPower extends fgui.GComponent {
  5066. static createInstance() {
  5067. return (fgui.UIPackage.createObject("game", "UIPower"));
  5068. }
  5069. onConstruct() {
  5070. this.n11 = (this.getChild("n11"));
  5071. this.myNode = (this.getChild("myNode"));
  5072. this.t0 = this.getTransition("t0");
  5073. }
  5074. }
  5075. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5076. class UIPower extends UIBase {
  5077. constructor() {
  5078. super();
  5079. }
  5080. onConstructor() {
  5081. this.ui = ui_UIPower.createInstance();
  5082. this.contentPane = this.ui;
  5083. this.isEject = false;
  5084. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5085. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5086. }
  5087. show() {
  5088. super.show();
  5089. this.ui.t0.play();
  5090. this.setGlobalFont(this.ui);
  5091. }
  5092. videoGetPower() {
  5093. console.log('zh:qjff_AD_for_uipower');
  5094. if (Laya.Browser.onAndroid) {
  5095. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5096. if (!boo) {
  5097. console.log('zh:net error ');
  5098. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5099. return;
  5100. }
  5101. }
  5102. if (Laya.Browser.onAndroid) {
  5103. console.log('zh:android ad show ');
  5104. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5105. }
  5106. else {
  5107. console.log('zh:AD 失败,直接发放奖励');
  5108. this.qjff_AD_for_uipower();
  5109. }
  5110. }
  5111. else {
  5112. this.qjff_AD_for_uipower();
  5113. }
  5114. }
  5115. qjff_AD_for_uipower() {
  5116. console.log('zh:ADD 体力 start');
  5117. DataMgr.setPower(xGame.common.videoPower, true);
  5118. xGame.eventMgr.event(POWER_TIME);
  5119. this.hide();
  5120. }
  5121. }
  5122. UIPower.uiName = "UIPower";
  5123. class UILevelProp extends UIBase {
  5124. constructor() {
  5125. super();
  5126. this.firstPos = 385;
  5127. this.secondPos = 467;
  5128. this.showItemArr = [];
  5129. }
  5130. onConstructor() {
  5131. this.ui = ui_UILevelProp.createInstance();
  5132. this.contentPane = this.ui;
  5133. this.isEject = false;
  5134. this.addUIClick(this.ui.closeBtn, this.hideWin);
  5135. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5136. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5137. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  5138. }
  5139. show(level) {
  5140. console.log('zh:show.');
  5141. super.show();
  5142. this.ui.t1.play();
  5143. this.level = level;
  5144. this.data = cfgTable.placeballData[this.level];
  5145. this.updateSelf();
  5146. this.showPreView();
  5147. this.moneyNode.ui.c1.selectedIndex = 2;
  5148. this.moneyNode.checkPowerTime();
  5149. this.moneyNode.powerChange();
  5150. this.yinDaoForLianxi();
  5151. this.setGlobalFont(this.ui);
  5152. }
  5153. yinDaoForLianxi() {
  5154. let lianXiGuide = DataMgr.getLianXiGuide();
  5155. console.log('zh:lianXiGuide=', lianXiGuide);
  5156. if (lianXiGuide === 0) {
  5157. this.ui.myNode.n_yd_lxms_3.visible = true;
  5158. console.log('zh:yinDaoForLianxi 333 set ok');
  5159. }
  5160. else {
  5161. this.ui.myNode.n_yd_lxms_3.visible = false;
  5162. console.log('zh:无需引导33');
  5163. }
  5164. }
  5165. showPreView() {
  5166. let item;
  5167. let data;
  5168. for (let index = 0; index < this.showItemArr.length; index++) {
  5169. item = this.showItemArr[index];
  5170. item.destroySelf();
  5171. }
  5172. this.showItemArr = [];
  5173. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5174. for (const key in cfgData) {
  5175. data = cfgData[key];
  5176. item = new ShowItem();
  5177. item.setParent(this.ui.myNode.displayRoot);
  5178. item.setPos(data.x, data.y);
  5179. item.setUrl(data.value);
  5180. this.showItemArr.push(item);
  5181. }
  5182. }
  5183. updateSelf() {
  5184. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5185. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5186. if (this.data.ball == -1) {
  5187. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5188. }
  5189. else {
  5190. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5191. }
  5192. let localData = DataMgr.getPlaceBallLevel(this.level);
  5193. let getAward = localData.getAward;
  5194. let cfg = cfgTable.placeballData[this.level];
  5195. let coin = this.data.award[0];
  5196. let diamond = this.data.award[1];
  5197. if (cfg.type == PlaceBallType.challenge) {
  5198. diamond = 0;
  5199. coin = 100;
  5200. }
  5201. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5202. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5203. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5204. if (cfg.type == PlaceBallType.challenge) {
  5205. this.ui.myNode.coinNode.numTxt.text = "";
  5206. }
  5207. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5208. if (coin > 0 && diamond > 0) {
  5209. this.ui.myNode.diamondNode.x = 385;
  5210. this.ui.myNode.coinNode.x = 467;
  5211. }
  5212. else {
  5213. this.ui.myNode.diamondNode.x = 385;
  5214. this.ui.myNode.coinNode.x = 385;
  5215. }
  5216. if (!getAward) {
  5217. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5218. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5219. }
  5220. else {
  5221. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5222. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5223. }
  5224. }
  5225. startGame() {
  5226. console.log("zh:startGame");
  5227. if (DataMgr.powerEnough()) {
  5228. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5229. this.ui.myNode.startBtn.touchable = false;
  5230. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5231. console.log('zh:startGame dh ');
  5232. this.ui.myNode.startBtn.touchable = true;
  5233. DataMgr.setPower(-1);
  5234. xGame.eventMgr.event(POWER_TIME);
  5235. xGame.common.gameMode = GameMode.placeBall;
  5236. xGame.common.placeBallCurLevel = this.level;
  5237. xGame.uiMgr.Show(UIGame);
  5238. xGame.uiMgr.Hide(UILevelDisplay);
  5239. xGame.uiMgr.Hide(UIMain);
  5240. this.logEventForChallenge_level_start(this.level);
  5241. this.hideWin();
  5242. }));
  5243. console.log('zh:eeeee');
  5244. }
  5245. else {
  5246. let guide = DataMgr.getLianXiGuide();
  5247. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  5248. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  5249. DataMgr.setPower(2);
  5250. }
  5251. console.log('zh:guide = ' + guide);
  5252. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  5253. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  5254. xGame.uiMgr.Show(UIPower);
  5255. }
  5256. }
  5257. logEventForChallenge_level_start(level) {
  5258. let keyStr = 'sjmd_challenge_level_start';
  5259. let jsonStr = {
  5260. "count": 1,
  5261. "gold_balance ": DataMgr.getCoin(),
  5262. "level": level,
  5263. "diamond_balance ": DataMgr.getDiamond()
  5264. };
  5265. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5266. const d = LocalStorageManager.getItem(keyStr);
  5267. if (level > d.level) {
  5268. jsonStr.count = d.count + 1;
  5269. LocalStorageManager.setItem(keyStr, jsonStr);
  5270. }
  5271. else {
  5272. }
  5273. }
  5274. else {
  5275. LocalStorageManager.setItem(keyStr, jsonStr);
  5276. }
  5277. const reqStr = JSON.stringify(jsonStr);
  5278. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5279. }
  5280. hideWin() {
  5281. super.hide();
  5282. if (this.ui.myNode.startBtn) {
  5283. this.ui.myNode.startBtn.touchable = true;
  5284. if (this.ui.myNode.startBtn.powerEft.t0) {
  5285. this.ui.myNode.startBtn.powerEft.t0.stop();
  5286. }
  5287. }
  5288. }
  5289. }
  5290. UILevelProp.uiName = "UILevelProp";
  5291. class PutBallLevelDisplay {
  5292. constructor(ui, index) {
  5293. this.index = 0;
  5294. this.ui = ui;
  5295. this.index = index;
  5296. this.ui.onClick(this, this.clickSelf);
  5297. this.updateSelf();
  5298. this.ui.levelTxt.text = (this.index + 1) + "";
  5299. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5300. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5301. }
  5302. updateSelf() {
  5303. let level = this.index + 1;
  5304. this.data = DataMgr.getPlaceBallLevel(level);
  5305. this.ui.starNode.c1.selectedIndex = this.data.star;
  5306. let isChallenge = cfgTable.placeballData[level].type;
  5307. if (this.data.isCur) {
  5308. if (isChallenge) {
  5309. this.ui.c1.selectedIndex = 5;
  5310. }
  5311. else {
  5312. this.ui.c1.selectedIndex = 2;
  5313. }
  5314. }
  5315. else {
  5316. if (this.data.play) {
  5317. if (this.data.star == 3) {
  5318. this.ui.c1.selectedIndex = 0;
  5319. }
  5320. else {
  5321. this.ui.c1.selectedIndex = 1;
  5322. }
  5323. }
  5324. else {
  5325. if (isChallenge) {
  5326. this.ui.c1.selectedIndex = 4;
  5327. }
  5328. else {
  5329. this.ui.c1.selectedIndex = 3;
  5330. }
  5331. }
  5332. }
  5333. }
  5334. clickSelf() {
  5335. console.log("zh:lev clickSelf");
  5336. if (!this.data.play)
  5337. return;
  5338. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5339. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5340. }
  5341. }
  5342. class UILevelDisplay extends UIBase {
  5343. constructor() {
  5344. super();
  5345. }
  5346. onConstructor() {
  5347. this.ui = ui_UILevelDisplay.createInstance();
  5348. this.contentPane = this.ui;
  5349. this.isEject = false;
  5350. this.myList = this.ui.myNode.myList;
  5351. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5352. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  5353. this.levelItemArr = [];
  5354. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5355. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5356. this.myList.numItems = levelNum;
  5357. }
  5358. levelItemRender(index, target) {
  5359. let item = new PutBallLevelDisplay(target, index);
  5360. this.levelItemArr.push(item);
  5361. }
  5362. show() {
  5363. super.show();
  5364. this.updateLevel();
  5365. this.scrollToPlace();
  5366. this.yinDaoForLianxi();
  5367. this.setGlobalFont(this.ui);
  5368. }
  5369. yinDaoForLianxi() {
  5370. let lianXiGuide = DataMgr.getLianXiGuide();
  5371. console.log('zh:lianXiGuide=', lianXiGuide);
  5372. if (lianXiGuide === 0) {
  5373. this.ui.myNode.n_yd_lxms_2.visible = true;
  5374. console.log('zh:yinDaoForLianxi 222 set ok');
  5375. }
  5376. else {
  5377. this.ui.myNode.n_yd_lxms_2.visible = false;
  5378. console.log('zh:无需引导');
  5379. }
  5380. }
  5381. showLevelTipWindows() {
  5382. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5383. xGame.uiMgr.Show(UILevelProp, 1);
  5384. }
  5385. updateLevel() {
  5386. let temp;
  5387. for (let index = 0; index < this.levelItemArr.length; index++) {
  5388. temp = this.levelItemArr[index];
  5389. temp.updateSelf();
  5390. }
  5391. }
  5392. scrollToPlace() {
  5393. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5394. let passArr = DataMgr.getPlaceBallLevelList();
  5395. let offest = passArr.length;
  5396. if (offest >= maxNum - 1)
  5397. offest = maxNum - 1;
  5398. this.myList.scrollToView(offest, true, true);
  5399. }
  5400. hide() {
  5401. super.hide();
  5402. }
  5403. }
  5404. UILevelDisplay.uiName = "UILevelDisplay";
  5405. class ui_UIMatching extends fgui.GComponent {
  5406. static createInstance() {
  5407. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5408. }
  5409. onConstruct() {
  5410. this.n5 = (this.getChild("n5"));
  5411. this.n49 = (this.getChild("n49"));
  5412. this.n51 = (this.getChild("n51"));
  5413. this.n64 = (this.getChild("n64"));
  5414. this.n2 = (this.getChild("n2"));
  5415. this.n53 = (this.getChild("n53"));
  5416. this.n54 = (this.getChild("n54"));
  5417. this.n56 = (this.getChild("n56"));
  5418. this.n58 = (this.getChild("n58"));
  5419. this.n59 = (this.getChild("n59"));
  5420. this.n57 = (this.getChild("n57"));
  5421. this.n60 = (this.getChild("n60"));
  5422. this.n62 = (this.getChild("n62"));
  5423. this.awardTxt = (this.getChild("awardTxt"));
  5424. this.n61 = (this.getChild("n61"));
  5425. this.selfHead = (this.getChild("selfHead"));
  5426. this.aiHead = (this.getChild("aiHead"));
  5427. this.n82 = (this.getChild("n82"));
  5428. this.n84 = (this.getChild("n84"));
  5429. this.n83 = (this.getChild("n83"));
  5430. this.t1 = this.getTransition("t1");
  5431. this.t2 = this.getTransition("t2");
  5432. this.t3 = this.getTransition("t3");
  5433. this.t4 = this.getTransition("t4");
  5434. }
  5435. }
  5436. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5437. class UIMatching extends UIBase {
  5438. constructor() {
  5439. super();
  5440. }
  5441. onConstructor() {
  5442. this.ui = ui_UIMatching.createInstance();
  5443. this.contentPane = this.ui;
  5444. this.isEject = false;
  5445. }
  5446. show(callback) {
  5447. super.show();
  5448. PlatMgr.showBanner(true);
  5449. this.callback = callback;
  5450. let user = Moyu.getUserInfo();
  5451. if (!this.selfPot) {
  5452. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5453. }
  5454. if (!this.aiPot) {
  5455. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5456. }
  5457. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5458. this.ui.selfHead.nameTxt.text = user.nickName;
  5459. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5460. this.ui.aiHead.nameTxt.text = "???";
  5461. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5462. this.ui.selfHead.c1.selectedIndex = 0;
  5463. this.ui.aiHead.c1.selectedIndex = 0;
  5464. this.ui.selfHead.x = this.selfPot.x;
  5465. this.ui.selfHead.y = this.selfPot.y;
  5466. this.ui.aiHead.x = this.aiPot.x;
  5467. this.ui.aiHead.y = this.aiPot.y;
  5468. switch (xGame.common.gameMode) {
  5469. case GameMode.classic:
  5470. break;
  5471. case GameMode.bigMove:
  5472. this.initSkillData();
  5473. break;
  5474. default:
  5475. break;
  5476. }
  5477. this.ui.t1.play(Laya.Handler.create(this, () => {
  5478. this.ui.t2.play(Laya.Handler.create(this, () => {
  5479. switch (xGame.common.gameMode) {
  5480. case GameMode.classic:
  5481. this.waitingPeople();
  5482. break;
  5483. case GameMode.bigMove:
  5484. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5485. break;
  5486. default:
  5487. break;
  5488. }
  5489. }));
  5490. }));
  5491. this.setGlobalFont(this.ui);
  5492. }
  5493. initSkillData() {
  5494. this.skillSelectData = [];
  5495. let skillUrl = xGame.common.skillIconList;
  5496. let skillName = xGame.common.skillNameList;
  5497. let skillLevel = DataMgr.getBigSkillList();
  5498. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5499. for (let index = 0; index < 5; index++) {
  5500. let obj = {};
  5501. obj.skillImg = skillUrl[index];
  5502. obj.skillName = skillName[index];
  5503. obj.skillType = skillType[index];
  5504. obj.skillLevel = skillLevel[index];
  5505. this.skillSelectData.push(obj);
  5506. }
  5507. }
  5508. getAISkillLevel(myLevel) {
  5509. let video = xGame.common.upSkillLevel;
  5510. let aiLevel;
  5511. let temp;
  5512. if (video) {
  5513. temp = xGame.common.randomNum(-2, -1);
  5514. }
  5515. else {
  5516. if (myLevel <= 5) {
  5517. temp = xGame.common.randomNum(1, 3);
  5518. }
  5519. else if (myLevel <= 9) {
  5520. temp = xGame.common.randomNum(-2, 1);
  5521. }
  5522. else {
  5523. temp = xGame.common.randomNum(-4, 0);
  5524. }
  5525. }
  5526. aiLevel = temp + myLevel;
  5527. if (aiLevel <= 1)
  5528. aiLevel = 1;
  5529. if (aiLevel >= 10)
  5530. aiLevel = 10;
  5531. return aiLevel;
  5532. }
  5533. getAISkillType() {
  5534. return xGame.common.randomNum(1, 4);
  5535. let successTimes = DataMgr.getSkillSuccessTimes();
  5536. let info = cfgTable.aiskillData[successTimes];
  5537. if (!info) {
  5538. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5539. info = cfgTable.aiskillData[max];
  5540. }
  5541. let dataArr = info.skillselect;
  5542. let myCfg = {};
  5543. for (let index = 0; index < dataArr.length; index++) {
  5544. let temp = dataArr[index].split('-');
  5545. myCfg[temp[0]] = {};
  5546. myCfg[temp[0]].id = parseInt(temp[0]);
  5547. myCfg[temp[0]].weight = parseInt(temp[1]);
  5548. }
  5549. let aiCfg = xGame.common.initWeight(myCfg);
  5550. let curData = xGame.common.getRandomWeightData(aiCfg);
  5551. return parseInt(curData.id);
  5552. }
  5553. getAISkillData(index) {
  5554. let myLevel = this.skillSelectData[index].skillLevel;
  5555. let aiLevel = this.getAISkillLevel(myLevel);
  5556. let aiType = this.getAISkillType() - 1;
  5557. return { aiLevel, aiType } = { aiLevel, aiType };
  5558. }
  5559. skillSelectFinish(index) {
  5560. let aiInfo = this.getAISkillData(index);
  5561. xGame.common.gameMgr.selfCurSkill = index;
  5562. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5563. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5564. this.ui.selfHead.c1.selectedIndex = 1;
  5565. this.ui.aiHead.c1.selectedIndex = 1;
  5566. let myData = this.skillSelectData[index];
  5567. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5568. if (DataMgr.getGuideDefaultModel() === 1) {
  5569. let guide = DataMgr.getLianXiGuide();
  5570. if (guide == 0) {
  5571. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5572. }
  5573. else {
  5574. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5575. }
  5576. }
  5577. else {
  5578. let guide = DataMgr.getSkillGuide();
  5579. if (guide == 0) {
  5580. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5581. }
  5582. else {
  5583. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5584. }
  5585. }
  5586. let aiData = this.skillSelectData[aiInfo.aiType];
  5587. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5588. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5589. this.waitingPeople();
  5590. }
  5591. waitingPeople() {
  5592. let time = xGame.common.randomNum(1000, 3000);
  5593. time += 1000;
  5594. Laya.timer.once(time, this, () => {
  5595. this.matchingSuccess();
  5596. });
  5597. }
  5598. matchingSuccess() {
  5599. let gameUI = xGame.common.gameUI;
  5600. let name = gameUI.ui.topNode.aiNameTxt.text;
  5601. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5602. this.ui.aiHead.nameTxt.text = name;
  5603. this.ui.aiHead.headImg.url = url;
  5604. name = gameUI.ui.topNode.selfNameTxt.text;
  5605. url = gameUI.ui.topNode.selfHeadLoader.url;
  5606. this.ui.selfHead.nameTxt.text = name;
  5607. this.ui.selfHead.headImg.url = url;
  5608. this.ui.t3.play(Laya.Handler.create(this, () => {
  5609. this.callback && this.callback();
  5610. this.ui.t4.play(Laya.Handler.create(this, () => {
  5611. this.destroySelf();
  5612. }));
  5613. }));
  5614. }
  5615. destroySelf() {
  5616. this.callback = null;
  5617. this.skillSelectData = null;
  5618. this.selfPot = null;
  5619. this.aiPot = null;
  5620. if (!this.ui.isDisposed) {
  5621. this.ui.removeFromParent();
  5622. this.ui.dispose();
  5623. }
  5624. xGame.uiMgr.destroyUI(this);
  5625. }
  5626. }
  5627. UIMatching.uiName = "UIMatching";
  5628. class ui_UIRanking extends fgui.GComponent {
  5629. static createInstance() {
  5630. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5631. }
  5632. onConstruct() {
  5633. this.n26 = (this.getChild("n26"));
  5634. this.myNode = (this.getChild("myNode"));
  5635. }
  5636. }
  5637. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5638. class UIRanking extends UIBase {
  5639. constructor() {
  5640. super();
  5641. this.showSelf = true;
  5642. this.rankType = 1;
  5643. this.rankList = [];
  5644. this.topX = 10;
  5645. this.myIndex = this.topX + 1;
  5646. this.myStar = 0;
  5647. }
  5648. onConstructor() {
  5649. this.ui = ui_UIRanking.createInstance();
  5650. this.contentPane = this.ui;
  5651. this.isEject = false;
  5652. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5653. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5654. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5655. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5656. this.ui.myNode.myList.setVirtual();
  5657. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5658. }
  5659. show() {
  5660. super.show();
  5661. this.getPaiHangBangDataFormJosnFile();
  5662. this.updateSelf();
  5663. let self = Moyu.getUserInfo();
  5664. if (!self.isAuth) {
  5665. Moyu.initUser(this, () => {
  5666. DataMgr.upRankData();
  5667. });
  5668. }
  5669. this.setGlobalFont(this.ui);
  5670. }
  5671. getPaiHangBangDataFormJosnFile() {
  5672. const rankingList = cfgTable.paiHangBangData.list;
  5673. this.updateItemData(rankingList);
  5674. }
  5675. updateSelfItem() {
  5676. console.log('zh:Moyu.platType =' + Moyu.platType);
  5677. let self = Moyu.getUserInfo();
  5678. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5679. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5680. if (this.myIndex > this.topX) {
  5681. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5682. }
  5683. else {
  5684. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5685. }
  5686. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5687. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5688. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5689. }
  5690. updateItemData(data) {
  5691. this.myStar = xGame.common.getAllStarNum();
  5692. if (this.rankList.length < 2) {
  5693. this.rankList = data;
  5694. let self = Moyu.getUserInfo();
  5695. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5696. self.headIcon = self.headIcon;
  5697. for (let i = 0; i < data.length; i++) {
  5698. let data = this.rankList[i];
  5699. if (data.userId == self.userId) {
  5700. this.rankList.splice(i, 1);
  5701. break;
  5702. }
  5703. }
  5704. for (let i = 0; i < data.length; i++) {
  5705. let data = this.rankList[i];
  5706. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5707. this.myIndex = i + 1;
  5708. let user = { headIcon: self.headIcon, nickName: "myself" };
  5709. let ud = { user: user, data: {} };
  5710. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5711. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5712. if (Moyu.platType < 11) {
  5713. user.headIcon = self.headIcon;
  5714. user.nickName = self.nickName;
  5715. }
  5716. this.rankList.splice(i, 0, md);
  5717. break;
  5718. }
  5719. }
  5720. }
  5721. this.updateSelfItem();
  5722. this.ui.myNode.myList.numItems = this.rankList.length;
  5723. }
  5724. updateItemUI(index, obj) {
  5725. let data = this.rankList[index];
  5726. let userData = JSON.parse(data.userData).user;
  5727. obj.nameTxt.text = userData.nickName.toString();
  5728. obj.valueTxt.text = data.rankScore;
  5729. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5730. obj.rankTxt.text = index + 1;
  5731. switch (index) {
  5732. case 0:
  5733. this.setImg(obj, 1, 0, 0);
  5734. obj.rankTxt.color = "#FFC047";
  5735. break;
  5736. case 1:
  5737. this.setImg(obj, 0, 1, 0);
  5738. obj.rankTxt.color = "#ACACAC";
  5739. break;
  5740. case 2:
  5741. this.setImg(obj, 0, 0, 1);
  5742. obj.rankTxt.color = "#D09672";
  5743. break;
  5744. default:
  5745. this.setImg(obj, 0, 0, 0);
  5746. obj.rankTxt.color = "#496FAB";
  5747. break;
  5748. }
  5749. }
  5750. setImg(obj, a, b, c) {
  5751. obj.img1.visible = a ? true : false;
  5752. obj.img2.visible = b ? true : false;
  5753. obj.img3.visible = c ? true : false;
  5754. }
  5755. changeList(type) {
  5756. this.rankType = type;
  5757. this.updateSelf();
  5758. }
  5759. changeSelfNode() {
  5760. this.showSelf = !this.showSelf;
  5761. this.updateSelf();
  5762. }
  5763. updateSelf() {
  5764. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5765. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5766. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5767. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5768. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5769. }
  5770. }
  5771. UIRanking.uiName = "UIRanking";
  5772. class ui_UISecretary extends fgui.GComponent {
  5773. static createInstance() {
  5774. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5775. }
  5776. onConstruct() {
  5777. this.n0 = (this.getChild("n0"));
  5778. this.myNode = (this.getChild("myNode"));
  5779. this.closeBtn = (this.getChild("closeBtn"));
  5780. this.t0 = this.getTransition("t0");
  5781. }
  5782. }
  5783. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5784. class UISecretary extends UIBase {
  5785. constructor() {
  5786. super();
  5787. this.curIndex = 1;
  5788. }
  5789. onConstructor() {
  5790. this.ui = ui_UISecretary.createInstance();
  5791. this.contentPane = this.ui;
  5792. this.isEject = false;
  5793. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5794. this.nodeObj = { left: null, right: null, cur: null };
  5795. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5796. }
  5797. show() {
  5798. super.show();
  5799. this.ui.t0.play();
  5800. this.updateData();
  5801. this.setGlobalFont(this.ui);
  5802. }
  5803. addSecretarySpine(node, spineName) {
  5804. if (spineName == "mishu") {
  5805. if (this.secretarySpine1) {
  5806. node.displayObject.destroyChildren();
  5807. this.playWoman(this.secretarySpine1, node.displayObject);
  5808. }
  5809. else {
  5810. let spine1 = new SpineMgr("mishu", () => {
  5811. this.secretarySpine1 = spine1;
  5812. this.playWoman(this.secretarySpine1, node.displayObject);
  5813. });
  5814. }
  5815. }
  5816. else {
  5817. if (this.secretarySpine2) {
  5818. node.displayObject.destroyChildren();
  5819. this.playWoman(this.secretarySpine2, node.displayObject);
  5820. }
  5821. else {
  5822. let spine2 = new SpineMgr("xiaomishu2", () => {
  5823. this.secretarySpine2 = spine2;
  5824. this.playWoman(this.secretarySpine2, node.displayObject);
  5825. });
  5826. }
  5827. }
  5828. }
  5829. playWoman(node, parent) {
  5830. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5831. let yy = this.ui.myNode.gameNode3.secretary.height;
  5832. let scale = 1.5;
  5833. if (node == this.secretarySpine2) {
  5834. scale = 1.2;
  5835. }
  5836. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5837. node.play(data, 0, true, parent);
  5838. }
  5839. turnLeft() {
  5840. this.curIndex--;
  5841. if (this.curIndex < 1) {
  5842. this.curIndex = 2;
  5843. }
  5844. let left = this.nodeObj.left;
  5845. let right = this.nodeObj.right;
  5846. let cur = this.nodeObj.cur;
  5847. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5848. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5849. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5850. this.updateData();
  5851. }));
  5852. this.ui.myNode.setChildIndex(right, 2);
  5853. this.nodeObj.left = cur;
  5854. this.nodeObj.right = left;
  5855. this.nodeObj.cur = right;
  5856. }
  5857. turnRight() {
  5858. this.curIndex++;
  5859. if (this.curIndex > 2) {
  5860. this.curIndex = 1;
  5861. }
  5862. let left = this.nodeObj.left;
  5863. let right = this.nodeObj.right;
  5864. let cur = this.nodeObj.cur;
  5865. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5866. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5867. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5868. this.updateData();
  5869. }));
  5870. this.ui.myNode.setChildIndex(left, 2);
  5871. this.nodeObj.left = right;
  5872. this.nodeObj.right = cur;
  5873. this.nodeObj.cur = left;
  5874. }
  5875. updateData() {
  5876. console.log('zh: updateData FFFFFFFFFF');
  5877. let data = cfgTable.secretaryshopData;
  5878. let children = this.ui.myNode._children;
  5879. let temp;
  5880. let curData;
  5881. for (let index = 0; index < children.length; index++) {
  5882. temp = children[index];
  5883. curData = data[1];
  5884. temp.heightTxt.text = curData.height;
  5885. temp.foodTxt.text = curData.food;
  5886. temp.historyTxt.text = curData.history;
  5887. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5888. this.addSecretarySpine(temp.secretary, curData.spine);
  5889. let womanIndex = curData.id - 1;
  5890. let getWoman = DataMgr.getSecretary(womanIndex);
  5891. let curUse = DataMgr.getCurSecretary();
  5892. if (getWoman) {
  5893. if (curUse == womanIndex) {
  5894. temp.purchaseBtn.c1.selectedIndex = 1;
  5895. }
  5896. else {
  5897. temp.purchaseBtn.c1.selectedIndex = 2;
  5898. }
  5899. }
  5900. else {
  5901. temp.purchaseBtn.c1.selectedIndex = 0;
  5902. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5903. }
  5904. temp.purchaseBtn.visible = false;
  5905. }
  5906. }
  5907. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5908. console.log('zh: 点击了clickSecretary ');
  5909. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5910. if (getWoman) {
  5911. if (curUse != womanIndex) {
  5912. console.log();
  5913. DataMgr.setCurSecretary(womanIndex);
  5914. this.updateData();
  5915. }
  5916. }
  5917. else {
  5918. console.log('zh:点击购买了');
  5919. let need = needDiamond;
  5920. if (DataMgr.diamondEnough(need)) {
  5921. DataMgr.setDiamond(-need);
  5922. DataMgr.setSecretary(womanIndex, 1);
  5923. DataMgr.setCurSecretary(womanIndex);
  5924. this.updateData();
  5925. }
  5926. else {
  5927. xGame.uiMgr.Show(UIAddProp, 1);
  5928. }
  5929. }
  5930. }
  5931. closeSelf() {
  5932. this.hide();
  5933. }
  5934. }
  5935. UISecretary.uiName = "UISecretary";
  5936. class ui_UIShop extends fgui.GComponent {
  5937. static createInstance() {
  5938. return (fgui.UIPackage.createObject("game", "UIShop"));
  5939. }
  5940. onConstruct() {
  5941. this.n48 = (this.getChild("n48"));
  5942. this.n0 = (this.getChild("n0"));
  5943. this.secretary = (this.getChild("secretary"));
  5944. this.talkNode = (this.getChild("talkNode"));
  5945. this.closeNode = (this.getChild("closeNode"));
  5946. this.moneyNode = (this.getChild("moneyNode"));
  5947. this.myNode = (this.getChild("myNode"));
  5948. }
  5949. }
  5950. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5951. class ui_UIMsg extends fgui.GComponent {
  5952. static createInstance() {
  5953. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5954. }
  5955. onConstruct() {
  5956. this.tipsNode = (this.getChild("tipsNode"));
  5957. }
  5958. }
  5959. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5960. class UIMsg extends UIBase {
  5961. constructor() {
  5962. super();
  5963. }
  5964. onConstructor() {
  5965. this.ui = ui_UIMsg.createInstance();
  5966. this.contentPane = this.ui;
  5967. this.isEject = false;
  5968. this.isMuti = true;
  5969. }
  5970. show(msg, callback) {
  5971. super.show();
  5972. this.ui.tipsNode.msgTxt.text = msg;
  5973. this.ui.alpha = 1;
  5974. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5975. this.hide();
  5976. callback && callback();
  5977. }), 1000);
  5978. this.setGlobalFont(this.ui);
  5979. }
  5980. }
  5981. UIMsg.uiName = "UIMsg";
  5982. class BallRodDisplay {
  5983. constructor(ui, index) {
  5984. this.index = 0;
  5985. this.uiIndex = 0;
  5986. this.ui = ui;
  5987. this.index = index;
  5988. this.initData();
  5989. }
  5990. initData() {
  5991. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5992. let data = cfgTable.ballrodData[this.index + 1];
  5993. this.ui.nameTxt.text = data.name;
  5994. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5995. this.ui.levelNode.c1.selectedIndex = data.quality;
  5996. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5997. if (data.spine) {
  5998. this.mySpine = new SpineMgr(data.spine, () => {
  5999. let xx = 150;
  6000. let yy = 70;
  6001. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  6002. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  6003. });
  6004. }
  6005. }
  6006. updateSelf() {
  6007. let get = DataMgr.getBallRod(this.index);
  6008. if (get == null)
  6009. get = 1;
  6010. let curUse = DataMgr.getCurBallRod();
  6011. if (get) {
  6012. if (curUse == this.index) {
  6013. this.ui.purchaseBtn.c1.selectedIndex = 0;
  6014. }
  6015. else {
  6016. this.ui.purchaseBtn.c1.selectedIndex = 1;
  6017. }
  6018. }
  6019. else {
  6020. this.ui.purchaseBtn.c1.selectedIndex = 2;
  6021. }
  6022. }
  6023. buyBallRod() {
  6024. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6025. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  6026. switch (selectedIndex) {
  6027. case 0:
  6028. break;
  6029. case 1:
  6030. console.log('zh:点击了 USE THIS');
  6031. DataMgr.setCurBallRod(this.index);
  6032. let curUse = DataMgr.getCurBallRod();
  6033. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  6034. let ui = xGame.uiMgr.getUI(UIShop);
  6035. ui.updateBallRod();
  6036. break;
  6037. case 2:
  6038. let data = cfgTable.ballrodData[this.index + 1];
  6039. let need = data.price;
  6040. if (DataMgr.diamondEnough(need)) {
  6041. this.buyQiuGan(data);
  6042. DataMgr.setDiamond(-need);
  6043. DataMgr.setBallRod(this.index, 1);
  6044. DataMgr.setCurBallRod(this.index);
  6045. let ui = xGame.uiMgr.getUI(UIShop);
  6046. ui.updateBallRod();
  6047. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  6048. }
  6049. else {
  6050. xGame.uiMgr.Show(UIAddProp, 1);
  6051. }
  6052. break;
  6053. default:
  6054. break;
  6055. }
  6056. }
  6057. buyQiuGan(qgItem) {
  6058. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  6059. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6060. if (userInfo == null) {
  6061. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6062. return;
  6063. }
  6064. let reqData = xGame.httpMgr.getReqData();
  6065. let pd = JSON.parse(reqData);
  6066. pd.qiuGanData = qgItem;
  6067. reqData = JSON.stringify(pd);
  6068. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  6069. try {
  6070. console.log('zh:buySp res = ' + JSON.stringify(res));
  6071. let code = res.code;
  6072. let msg = res.msg;
  6073. if (code == 401) {
  6074. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6075. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  6076. return;
  6077. }
  6078. if (code == 200) {
  6079. xGame.uiMgr.Show(UIMsg, msg);
  6080. DataMgr.getUserZiChanInfo(false);
  6081. }
  6082. else {
  6083. xGame.uiMgr.Show(UIMsg, msg);
  6084. }
  6085. }
  6086. catch (error) {
  6087. console.log('error=' + error);
  6088. alert(error);
  6089. }
  6090. finally {
  6091. }
  6092. });
  6093. }
  6094. logEventForGouMaiGan(qiuGanName) {
  6095. const ev = {
  6096. value: qiuGanName
  6097. };
  6098. const jsonStr = JSON.stringify(ev);
  6099. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  6100. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  6101. }
  6102. }
  6103. class DaoJuDisplay {
  6104. constructor(ui, index) {
  6105. this.index = 0;
  6106. this.uiIndex = 0;
  6107. this.ggSpid = "";
  6108. this.spid = 0;
  6109. this.ui = ui;
  6110. this.index = index;
  6111. this.initData();
  6112. }
  6113. initData() {
  6114. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6115. let data = cfgTable.daoJuData[this.index + 1];
  6116. this.ui.nameTxt.text = data.spbt;
  6117. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6118. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6119. this.ggSpid = data.ggSpid;
  6120. this.spid = data.spid;
  6121. let baseUrl = "asset/sound/ogg/";
  6122. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6123. }
  6124. gotoBuy() {
  6125. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6126. if (userInfo != null) {
  6127. let token = userInfo.token;
  6128. let ggSpid = this.ggSpid;
  6129. let spid = this.spid;
  6130. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6131. console.log('zh:gotoBuy1 spid =' + spid);
  6132. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6133. return;
  6134. }
  6135. else {
  6136. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6137. }
  6138. }
  6139. gotoBuy1() {
  6140. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6141. let djItem = cfgTable.daoJuData[this.index + 1];
  6142. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6143. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6144. if (userInfo == null) {
  6145. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6146. return;
  6147. }
  6148. let reqData = xGame.httpMgr.getReqData();
  6149. let pd = JSON.parse(reqData);
  6150. pd.spItem = djItem;
  6151. reqData = JSON.stringify(pd);
  6152. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6153. try {
  6154. console.log('zh:buySp res = ' + JSON.stringify(res));
  6155. let code = res.code;
  6156. let msg = res.msg;
  6157. if (code == 401) {
  6158. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6159. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6160. return;
  6161. }
  6162. if (code == 200) {
  6163. xGame.uiMgr.Show(UIMsg, msg);
  6164. DataMgr.getUserZiChanInfo(false);
  6165. }
  6166. else {
  6167. xGame.uiMgr.Show(UIMsg, msg);
  6168. }
  6169. }
  6170. catch (error) {
  6171. console.log('error=' + error);
  6172. alert(error);
  6173. }
  6174. finally {
  6175. }
  6176. });
  6177. }
  6178. }
  6179. class UIShop extends UIBase {
  6180. constructor() {
  6181. super();
  6182. this.itemNums = 0;
  6183. this.itemNumsForDj = 0;
  6184. this.curType = "";
  6185. }
  6186. onConstructor() {
  6187. this.ui = ui_UIShop.createInstance();
  6188. this.contentPane = this.ui;
  6189. this.isEject = false;
  6190. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6191. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6192. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6193. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6194. this.addUIClick(this.ui, this.interuptSecretary);
  6195. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6196. this.ballRodArr = [];
  6197. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6198. this.ui.myNode.myList.numItems = this.itemNums;
  6199. this.loadDjdata_old();
  6200. }
  6201. loadDjdata_old() {
  6202. let fff = cfgTable.daoJuData;
  6203. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6204. this.daoJuArr = [];
  6205. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6206. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6207. }
  6208. getProductList() {
  6209. let reqData = xGame.httpMgr.getReqData();
  6210. let pd = JSON.parse(reqData);
  6211. pd.splx = "Consumable";
  6212. reqData = JSON.stringify(pd);
  6213. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6214. try {
  6215. let code = res.code;
  6216. let msg = res.msg;
  6217. if (code == 401) {
  6218. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6219. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6220. return;
  6221. }
  6222. if (code == 200) {
  6223. let data = res.data;
  6224. for (let index = 0; index < data.length; index++) {
  6225. let element = data[index];
  6226. cfgTable.daoJuData[element.spid] = element;
  6227. }
  6228. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6229. }
  6230. else {
  6231. xGame.uiMgr.Show(UIMsg, msg);
  6232. }
  6233. }
  6234. catch (error) {
  6235. console.log('error=' + error);
  6236. alert(error);
  6237. }
  6238. finally {
  6239. }
  6240. });
  6241. }
  6242. show(type) {
  6243. super.show();
  6244. this.curType = type == 0 ? "qiugan" : "daoju";
  6245. this.switchBtn("");
  6246. this.playSecretaryIdle();
  6247. this.updateBallRod();
  6248. this.setGlobalFont(this.ui);
  6249. }
  6250. test123() {
  6251. console.log('zh:test123 ');
  6252. }
  6253. switchBtn(type) {
  6254. console.log('zh:1111切換 sel type=' + type);
  6255. if (type == "") {
  6256. type = this.curType;
  6257. }
  6258. else {
  6259. if (this.curType == type) {
  6260. return;
  6261. }
  6262. else {
  6263. this.curType = type;
  6264. }
  6265. }
  6266. if (type == "qiugan") {
  6267. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6268. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6269. this.ui.myNode.c1.selectedIndex = 0;
  6270. this.ui.myNode.myList.visible = true;
  6271. this.ui.myNode.djList.visible = false;
  6272. }
  6273. else {
  6274. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6275. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6276. this.ui.myNode.c1.selectedIndex = 1;
  6277. this.ui.myNode.myList.visible = false;
  6278. this.ui.myNode.djList.visible = true;
  6279. }
  6280. }
  6281. updateBallRod() {
  6282. for (let index = 0; index < this.ballRodArr.length; index++) {
  6283. this.ballRodArr[index].updateSelf();
  6284. }
  6285. }
  6286. renderBallRod(sort, obj) {
  6287. let index = this.getIndexBySort(sort + 1) - 1;
  6288. let ballRod = new BallRodDisplay(obj, index);
  6289. this.ballRodArr.push(ballRod);
  6290. }
  6291. renderDaoJu(idx, obj) {
  6292. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6293. let b = new DaoJuDisplay(obj, index);
  6294. this.daoJuArr.push(b);
  6295. }
  6296. getIndexBySort(sort) {
  6297. let object = cfgTable.ballrodData;
  6298. for (const key in object) {
  6299. if (object[key].sort == sort) {
  6300. return parseInt(key);
  6301. }
  6302. }
  6303. }
  6304. getIndexBySortForDj(idx) {
  6305. let object = cfgTable.daoJuData;
  6306. for (const key in object) {
  6307. if (object[key].idx == idx) {
  6308. return parseInt(key);
  6309. }
  6310. }
  6311. }
  6312. playSecretaryIdle() {
  6313. let parent = this.ui.secretary.displayObject;
  6314. parent.destroyChildren();
  6315. let xx = this.ui.secretary.width / 2;
  6316. let yy = this.ui.secretary.height;
  6317. let scale = xGame.common.getSecretaryScale();
  6318. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6319. xGame.common.secretary.play(data, 0, true, parent);
  6320. }
  6321. interuptSecretary() {
  6322. Laya.timer.clearAll(this);
  6323. this.playSecretaryRandomSound();
  6324. }
  6325. playSecretaryRandomSound() {
  6326. if (this.isHide)
  6327. return;
  6328. let time = xGame.common.randomNum(45000, 60000);
  6329. Laya.timer.once(time, this, () => {
  6330. if (this.isHide)
  6331. return;
  6332. let index = xGame.common.randomNum(4, 7);
  6333. xGame.soundMgr.playSound("s_main0" + index);
  6334. let words = 1;
  6335. switch (index) {
  6336. case 4:
  6337. words = 5;
  6338. break;
  6339. case 5:
  6340. words = 3;
  6341. break;
  6342. case 6:
  6343. words = 6;
  6344. break;
  6345. case 7:
  6346. words = 7;
  6347. break;
  6348. default:
  6349. break;
  6350. }
  6351. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6352. this.playSecretaryRandomSound();
  6353. });
  6354. }
  6355. closeSelf() {
  6356. this.hide();
  6357. }
  6358. }
  6359. UIShop.uiName = "UIShop";
  6360. class ui_UISign extends fgui.GComponent {
  6361. static createInstance() {
  6362. return (fgui.UIPackage.createObject("game", "UISign"));
  6363. }
  6364. onConstruct() {
  6365. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6366. this.n6 = (this.getChild("n6"));
  6367. this.closeNode = (this.getChild("closeNode"));
  6368. this.myNode = (this.getChild("myNode"));
  6369. this.moneyNode = (this.getChild("moneyNode"));
  6370. this.secretary = (this.getChild("secretary"));
  6371. this.talkNode = (this.getChild("talkNode"));
  6372. this.tripleBtn = (this.getChild("tripleBtn"));
  6373. this.normalBtn = (this.getChild("normalBtn"));
  6374. this.tipsNode = (this.getChild("tipsNode"));
  6375. this.againBtn = (this.getChild("againBtn"));
  6376. this.t0 = this.getTransition("t0");
  6377. }
  6378. }
  6379. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6380. class SignMax {
  6381. constructor(ui) {
  6382. this.ui = ui;
  6383. }
  6384. updateSelf(index, sameDay, curDayIndex) {
  6385. let data = cfgTable.signData[index + 1];
  6386. this.ui.titleTxt.text = data.title;
  6387. let arr1 = data.award[0].split('-');
  6388. let arr2 = data.award[1].split('-');
  6389. let num1 = parseInt(arr1[1]);
  6390. let num2 = parseInt(arr2[1]);
  6391. this.ui.numTxt1.text = num1 + "";
  6392. this.ui.numTxt2.text = num2 + "";
  6393. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6394. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6395. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6396. this.ui.numTxt1.visible = false;
  6397. }
  6398. else {
  6399. this.ui.numTxt1.visible = true;
  6400. }
  6401. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6402. this.ui.numTxt2.visible = false;
  6403. }
  6404. else {
  6405. this.ui.numTxt2.visible = true;
  6406. }
  6407. if (index < curDayIndex) {
  6408. this.ui.c1.selectedIndex = 1;
  6409. }
  6410. else if (index == curDayIndex) {
  6411. if (sameDay) {
  6412. this.ui.c1.selectedIndex = 2;
  6413. }
  6414. else {
  6415. this.ui.c1.selectedIndex = 2;
  6416. }
  6417. }
  6418. else {
  6419. this.ui.c1.selectedIndex = 0;
  6420. }
  6421. }
  6422. }
  6423. class SignNormal {
  6424. constructor(ui) {
  6425. this.ui = ui;
  6426. }
  6427. updateSelf(index, sameDay, curDayIndex) {
  6428. let data = cfgTable.signData[index + 1];
  6429. this.ui.titleTxt.text = data.title;
  6430. let arr = data.award[0].split('-');
  6431. let type = parseInt(arr[0]);
  6432. let num = parseInt(arr[1]);
  6433. this.ui.numTxt.text = num + "";
  6434. if (type > 2) {
  6435. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6436. this.ui.myIcon.rotation = 0;
  6437. }
  6438. else {
  6439. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6440. this.ui.myIcon.rotation = 0;
  6441. }
  6442. if (xGame.common.signAwardContainsRod(data.award)) {
  6443. this.ui.numTxt.visible = false;
  6444. }
  6445. else {
  6446. this.ui.numTxt.visible = true;
  6447. }
  6448. if (index < curDayIndex) {
  6449. this.ui.c1.selectedIndex = 1;
  6450. }
  6451. else if (index == curDayIndex) {
  6452. if (sameDay) {
  6453. this.ui.c1.selectedIndex = 2;
  6454. }
  6455. else {
  6456. this.ui.c1.selectedIndex = 2;
  6457. }
  6458. }
  6459. else {
  6460. this.ui.c1.selectedIndex = 0;
  6461. }
  6462. }
  6463. }
  6464. class UISign extends UIBase {
  6465. constructor() {
  6466. super();
  6467. this.curDayIndex = 0;
  6468. this.starX = 0;
  6469. }
  6470. onConstructor() {
  6471. this.ui = ui_UISign.createInstance();
  6472. this.contentPane = this.ui;
  6473. this.isEject = false;
  6474. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6475. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6476. this.initSignItem();
  6477. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6478. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6479. }
  6480. show() {
  6481. super.show();
  6482. this.ui.t0.play();
  6483. this.playSecretaryIdle();
  6484. this.updateSign();
  6485. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6486. this.setGlobalFont(this.ui);
  6487. }
  6488. initSignItem() {
  6489. this.signArr = [];
  6490. for (let index = 0; index < 6; index++) {
  6491. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6492. this.signArr.push(temp);
  6493. }
  6494. this.signMax = new SignMax(this.ui.myNode.day7);
  6495. if (Moyu.isKs)
  6496. this.ui.closeNode.closeBtn.x += 100;
  6497. }
  6498. updateSign() {
  6499. let sameDay = xGame.common.judgeSameDay();
  6500. let max = 7;
  6501. this.curDayIndex = DataMgr.getSignData();
  6502. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6503. this.curDayIndex = 0;
  6504. if (!sameDay) {
  6505. this.ui.normalBtn.visible = true;
  6506. this.ui.tipsNode.visible = false;
  6507. this.ui.againBtn.visible = false;
  6508. }
  6509. else {
  6510. this.ui.normalBtn.visible = false;
  6511. let again = DataMgr.getExtraSign();
  6512. let isCurrency = false;
  6513. let index = this.curDayIndex;
  6514. if (index == 0)
  6515. index = 7;
  6516. let award = cfgTable.signData[index].award;
  6517. let num = award[0].split("-")[0];
  6518. if (num == "1" || num == "2")
  6519. isCurrency = true;
  6520. let showAgain = again == 0 && isCurrency;
  6521. this.ui.againBtn.visible = showAgain;
  6522. this.ui.tipsNode.visible = !showAgain;
  6523. }
  6524. for (let index = 0; index < this.signArr.length; index++) {
  6525. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6526. }
  6527. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6528. }
  6529. playSecretaryIdle() {
  6530. let parent = this.ui.secretary.displayObject;
  6531. parent.destroyChildren();
  6532. let xx = this.ui.secretary.width / 2;
  6533. let yy = this.ui.secretary.height;
  6534. let scale = xGame.common.getSecretaryScale();
  6535. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6536. xGame.common.secretary.play(data, 0, true, parent);
  6537. }
  6538. closeSelf() {
  6539. this.hide();
  6540. }
  6541. normalGetAward() {
  6542. let sameDay = xGame.common.judgeSameDay();
  6543. if (!sameDay) {
  6544. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6545. let temp;
  6546. let type;
  6547. let num;
  6548. let arr = [];
  6549. for (let index = 0; index < award.length; index++) {
  6550. temp = award[index].split("-");
  6551. type = parseInt(temp[0]);
  6552. num = parseInt(temp[1]);
  6553. let awardType = new AwardType();
  6554. awardType.num = num;
  6555. awardType.type = type;
  6556. arr.push(awardType);
  6557. }
  6558. xGame.common.getAward(arr, (watchVideo) => {
  6559. this.curDayIndex++;
  6560. if (this.curDayIndex > 7)
  6561. this.curDayIndex = 0;
  6562. DataMgr.setSignData(this.curDayIndex);
  6563. this.updateSignData2Server(this.curDayIndex);
  6564. DataMgr.setSignTime(new Date().getTime());
  6565. if (watchVideo) {
  6566. DataMgr.setExtraSign(1);
  6567. Moyu.sendDataEvent("signIn1");
  6568. }
  6569. this.updateSign();
  6570. });
  6571. }
  6572. }
  6573. againGetAward() {
  6574. Moyu.sendDataEvent("signIn2");
  6575. console.log('zh:qjff_AD_for_uisign');
  6576. if (Laya.Browser.onAndroid) {
  6577. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6578. if (!boo) {
  6579. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6580. return;
  6581. }
  6582. }
  6583. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6584. }
  6585. else {
  6586. console.log('zh:AD 失败,直接发放奖励');
  6587. this.qjff_AD_for_uisign();
  6588. }
  6589. }
  6590. qjff_AD_for_uisign() {
  6591. let index = this.curDayIndex;
  6592. if (index == 0)
  6593. index = 7;
  6594. let award = cfgTable.signData[index].award;
  6595. let temp;
  6596. let type;
  6597. let num;
  6598. for (let index = 0; index < award.length; index++) {
  6599. temp = award[index].split("-");
  6600. type = parseInt(temp[0]);
  6601. num = parseInt(temp[1]) * 3;
  6602. xGame.common.playObjFlyAnim(num, type);
  6603. }
  6604. DataMgr.setExtraSign(1);
  6605. this.updateSign();
  6606. }
  6607. updateSignData2Server(day) {
  6608. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6609. if (userInfo == null) {
  6610. return;
  6611. }
  6612. let reqData = xGame.httpMgr.getReqData();
  6613. let pd = JSON.parse(reqData);
  6614. pd.signData = day;
  6615. reqData = JSON.stringify(pd);
  6616. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6617. try {
  6618. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6619. let code = res.code;
  6620. let msg = res.msg;
  6621. if (code == 401) {
  6622. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6623. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6624. return;
  6625. }
  6626. if (code == 200) {
  6627. let data = res.data;
  6628. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6629. }
  6630. else {
  6631. xGame.uiMgr.Show(UIMsg, msg);
  6632. }
  6633. }
  6634. catch (error) {
  6635. console.log('error=' + error);
  6636. alert(error);
  6637. }
  6638. finally {
  6639. }
  6640. });
  6641. }
  6642. }
  6643. UISign.uiName = "UISign";
  6644. class ui_UISkill extends fgui.GComponent {
  6645. static createInstance() {
  6646. return (fgui.UIPackage.createObject("game", "UISkill"));
  6647. }
  6648. onConstruct() {
  6649. this.n48 = (this.getChild("n48"));
  6650. this.n0 = (this.getChild("n0"));
  6651. this.secretary = (this.getChild("secretary"));
  6652. this.talkNode = (this.getChild("talkNode"));
  6653. this.closeNode = (this.getChild("closeNode"));
  6654. this.moneyNode = (this.getChild("moneyNode"));
  6655. this.skillNode = (this.getChild("skillNode"));
  6656. this.guideNode = (this.getChild("guideNode"));
  6657. }
  6658. }
  6659. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6660. class SkillDisplay {
  6661. constructor(ui, data, uiIndex) {
  6662. this.starX = 0;
  6663. this.starY = 0;
  6664. this.index = 0;
  6665. this.ui = ui;
  6666. this.data = data;
  6667. this.index = uiIndex;
  6668. this.initSelf();
  6669. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6670. }
  6671. initSelf() {
  6672. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6673. this.ui.nameTxt.text = this.data.name;
  6674. this.ui.describeTxt.text = this.data.describe;
  6675. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6676. this.ui.startBtn.onClick(this, this.startGame);
  6677. this.updateSelf();
  6678. }
  6679. updateSelf() {
  6680. this.checkTry();
  6681. let level = DataMgr.getBigSkillByIndex(this.index);
  6682. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6683. }
  6684. checkTry() {
  6685. let index = this.index;
  6686. let level = DataMgr.getBigSkillByIndex(index);
  6687. if (level == null) {
  6688. DataMgr.setBigSkill(index, 1, false);
  6689. level = 1;
  6690. }
  6691. this.ui.levelTxt.text = "LV." + level;
  6692. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6693. this.ui.tryNode.visible = true;
  6694. else
  6695. this.ui.tryNode.visible = false;
  6696. }
  6697. clickAddLevel() {
  6698. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6699. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6700. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6701. if (Laya.Browser.onAndroid) {
  6702. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6703. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6704. }
  6705. else {
  6706. console.log('zh:AD 失败,直接发放奖励');
  6707. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6708. }
  6709. }
  6710. else {
  6711. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6712. }
  6713. }
  6714. qjff_AD_for_skilldisplay_clickAddLevel() {
  6715. DataMgr.setBigSkill(this.data.index, 1);
  6716. this.updateSelf();
  6717. xGame.common.upSkillLevel = true;
  6718. }
  6719. startGame() {
  6720. console.log('zh:rod skill startgame');
  6721. if (this.data.index == 3) {
  6722. alert('Coming soon!');
  6723. return;
  6724. }
  6725. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6726. let needCoin = xGame.common.bigMoveNeedCoin;
  6727. xGame.common.passAwardCoin = 2000;
  6728. let guide = 1;
  6729. if (DataMgr.getGuideDefaultModel() === 1) {
  6730. guide = DataMgr.getLianXiGuide();
  6731. if (guide == 0) {
  6732. needCoin = 0;
  6733. xGame.common.temSelfLevel = 100;
  6734. }
  6735. }
  6736. else {
  6737. guide = DataMgr.getSkillGuide();
  6738. console.log('zh:startGame guide=' + guide);
  6739. if (guide == 0) {
  6740. needCoin = 0;
  6741. xGame.common.temSelfLevel = 100;
  6742. }
  6743. }
  6744. xGame.common.temSelfLevel = 0;
  6745. if (DataMgr.coinEnough(needCoin)) {
  6746. DataMgr.setCoin(-needCoin);
  6747. xGame.common.curPlayerSkillType = this.index;
  6748. if (guide == 0)
  6749. xGame.common.curPlayerSkillType = 0;
  6750. console.log('zh: skilldisplay 1');
  6751. xGame.uiMgr.Show(UIGame);
  6752. xGame.uiMgr.Hide(UIMain);
  6753. xGame.uiMgr.Show(UIMatching, () => {
  6754. xGame.common.gameUI.ui.alpha = 1;
  6755. xGame.common.gameUI.startGame();
  6756. xGame.uiMgr.Hide(UISkill);
  6757. });
  6758. this.logEventForRod_start();
  6759. }
  6760. else {
  6761. console.log('zh: skilldisplay 2');
  6762. xGame.uiMgr.Show(UIAddProp, 0);
  6763. Moyu.sendDataEvent("AddCoinVideo");
  6764. }
  6765. }
  6766. logEventForRod_start() {
  6767. let gfmsIdx = xGame.common.curPlayerSkillType;
  6768. console.log('zh:选择的技能=' + gfmsIdx);
  6769. let gfmc = 'Skyfall Shot';
  6770. if (gfmsIdx == 0) {
  6771. gfmc = 'Skyfall Shot';
  6772. }
  6773. if (gfmsIdx == 1) {
  6774. gfmc = 'Surging break';
  6775. }
  6776. if (gfmsIdx == 2) {
  6777. gfmc = 'Frost Lock';
  6778. }
  6779. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6780. let jsonStr = {
  6781. "count": 0,
  6782. "name": gfmc
  6783. };
  6784. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6785. const d = LocalStorageManager.getItem(keyStr);
  6786. jsonStr.count = d.count + 1;
  6787. LocalStorageManager.setItem(keyStr, jsonStr);
  6788. }
  6789. else {
  6790. LocalStorageManager.setItem(keyStr, jsonStr);
  6791. }
  6792. const reqStr = JSON.stringify(jsonStr);
  6793. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6794. }
  6795. }
  6796. class UISkill extends UIBase {
  6797. constructor() {
  6798. super();
  6799. this.skillData = [];
  6800. }
  6801. onConstructor() {
  6802. this.ui = ui_UISkill.createInstance();
  6803. this.contentPane = this.ui;
  6804. this.isEject = false;
  6805. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6806. this.initSkillData();
  6807. console.log('zh:aaaaaa1111111111');
  6808. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6809. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6810. console.log('zh:aaaaaa22222222');
  6811. this.displayList = [];
  6812. this.ui.skillNode.skillList.numItems = 3;
  6813. this.addUIClick(this.ui, this.interuptSecretary);
  6814. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6815. this.ui.talkNode.visible = false;
  6816. if (Moyu.isKs)
  6817. this.ui.closeNode.closeBtn.x += 100;
  6818. }
  6819. show() {
  6820. super.show();
  6821. this.playSecretaryIdle();
  6822. this.moneyNode.ui.c1.selectedIndex = 1;
  6823. Laya.timer.clearAll(this);
  6824. xGame.soundMgr.playSound("s_start");
  6825. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6826. let guide = 0;
  6827. if (DataMgr.getGuideDefaultModel() === 2) {
  6828. guide = DataMgr.getSkillGuide();
  6829. this.ui.guideNode.visible = guide == 0;
  6830. }
  6831. let item = this.getSkillItemByUIIndex(0);
  6832. if (guide == 0) {
  6833. item.ui.c1.selectedIndex = 1;
  6834. }
  6835. else {
  6836. item.ui.c1.selectedIndex = 0;
  6837. }
  6838. if (DataMgr.getGuideDefaultModel() === 2) {
  6839. this.ui.guideNode.guideBtn.visible = guide == 0;
  6840. }
  6841. for (let index = 0; index < this.displayList.length; index++) {
  6842. this.displayList[index].checkTry();
  6843. }
  6844. this.setGlobalFont(this.ui);
  6845. }
  6846. getSkillItemByUIIndex(cur) {
  6847. for (let index = 0; index < this.displayList.length; index++) {
  6848. if (this.displayList[index].index == cur) {
  6849. return this.displayList[index];
  6850. }
  6851. }
  6852. }
  6853. enterGuideLevel() {
  6854. let item = this.getSkillItemByUIIndex(0);
  6855. item.startGame();
  6856. if (DataMgr.getNewUser())
  6857. Moyu.sendDataEvent("gameStart1");
  6858. }
  6859. initSkillData() {
  6860. this.skillData = [];
  6861. let nameList = xGame.common.skillNameList;
  6862. let iconList = xGame.common.skillIconList;
  6863. let describeList = [
  6864. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6865. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6866. "The power of frost descends—freezing the flow and taking full control of the game!"
  6867. ];
  6868. console.log('zh:initSkillData 111111111');
  6869. let data;
  6870. for (let index = 0; index < nameList.length; index++) {
  6871. data = {};
  6872. data.name = nameList[index];
  6873. data.icon = iconList[index];
  6874. data.describe = describeList[index];
  6875. data.index = index;
  6876. this.skillData.push(data);
  6877. }
  6878. }
  6879. updateSkillItem(index, target) {
  6880. if (this.displayList[index] == null) {
  6881. let uiIndex;
  6882. switch (index) {
  6883. case 0:
  6884. uiIndex = 1;
  6885. break;
  6886. case 1:
  6887. uiIndex = 0;
  6888. break;
  6889. case 2:
  6890. uiIndex = 2;
  6891. break;
  6892. case 3:
  6893. uiIndex = 3;
  6894. break;
  6895. default:
  6896. break;
  6897. }
  6898. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6899. this.displayList.push(temp);
  6900. }
  6901. }
  6902. playSecretaryIdle() {
  6903. let parent = this.ui.secretary.displayObject;
  6904. parent.destroyChildren();
  6905. let xx = this.ui.secretary.width / 2;
  6906. let yy = this.ui.secretary.height;
  6907. let scale = xGame.common.getSecretaryScale();
  6908. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6909. xGame.common.secretary.play(data, 0, true, parent);
  6910. }
  6911. returnUIMain() {
  6912. this.hide();
  6913. xGame.common.stopGirlPop(this.ui.talkNode);
  6914. xGame.uiMgr.Show(UIMain);
  6915. }
  6916. interuptSecretary() {
  6917. Laya.timer.clearAll(this);
  6918. this.playSecretaryRandomSound();
  6919. }
  6920. playSecretaryRandomSound() {
  6921. if (this.isHide)
  6922. return;
  6923. let time = xGame.common.randomNum(45000, 60000);
  6924. Laya.timer.once(time, this, () => {
  6925. if (this.isHide)
  6926. return;
  6927. let index = xGame.common.randomNum(4, 7);
  6928. xGame.soundMgr.playSound("s_main0" + index);
  6929. let words = 1;
  6930. switch (index) {
  6931. case 4:
  6932. words = 5;
  6933. break;
  6934. case 5:
  6935. words = 3;
  6936. break;
  6937. case 6:
  6938. words = 6;
  6939. break;
  6940. case 7:
  6941. words = 7;
  6942. break;
  6943. default:
  6944. break;
  6945. }
  6946. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6947. this.playSecretaryRandomSound();
  6948. });
  6949. }
  6950. }
  6951. UISkill.uiName = "UISkill";
  6952. class ui_UIModeSelection extends fgui.GComponent {
  6953. static createInstance() {
  6954. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6955. }
  6956. onConstruct() {
  6957. this.n19 = (this.getChild("n19"));
  6958. this.closeBtn = (this.getChild("closeBtn"));
  6959. this.myNode = (this.getChild("myNode"));
  6960. this.t0 = this.getTransition("t0");
  6961. }
  6962. }
  6963. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6964. class UIModeSelection extends UIBase {
  6965. constructor() {
  6966. super();
  6967. }
  6968. onConstructor() {
  6969. this.ui = ui_UIModeSelection.createInstance();
  6970. this.contentPane = this.ui;
  6971. this.isEject = false;
  6972. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6973. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6974. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6975. this.addUIClick(this.ui.closeBtn, this.hide);
  6976. this.peopleArr = [65, 990, 580];
  6977. this.peopleOffest = [5, 10, 10];
  6978. }
  6979. show(callback) {
  6980. this.updateSelf();
  6981. super.show();
  6982. this.ui.t0.play();
  6983. this.callback = callback;
  6984. this.setGlobalFont(this.ui);
  6985. }
  6986. updateSelf() {
  6987. let cfg = cfgTable.modeselectData;
  6988. for (let index = 1; index <= 3; index++) {
  6989. let node = this.ui.myNode["type" + index];
  6990. node.need.text = cfg[index].need;
  6991. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6992. node.peopleTxt.text = this.getRandPeople(index - 1);
  6993. }
  6994. }
  6995. enterGame(type) {
  6996. console.log('zh: 进入经典模式 type: ' + type);
  6997. xGame.common.classicRoomType = type;
  6998. let cfg = cfgTable.modeselectData[type];
  6999. let need = cfg.need;
  7000. xGame.common.passAwardCoin = cfg.award;
  7001. if (DataMgr.coinEnough(need)) {
  7002. DataMgr.setCoin(-need);
  7003. this.ui.myNode["type" + type].t0.play();
  7004. Laya.timer.once(200, this, () => {
  7005. this.callback && this.callback();
  7006. });
  7007. this.logEventForClassic_start();
  7008. }
  7009. else {
  7010. Moyu.sendDataEvent("AddCoinVideo");
  7011. xGame.uiMgr.Show(UIAddProp, 0);
  7012. }
  7013. }
  7014. getRandPeople(index) {
  7015. let rand = this.peopleOffest[index];
  7016. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  7017. }
  7018. logEventForClassic_start() {
  7019. let rtype = xGame.common.classicRoomType;
  7020. let msmc = '';
  7021. if (rtype == 1) {
  7022. msmc = 'beginner';
  7023. }
  7024. if (rtype == 2) {
  7025. msmc = 'expert';
  7026. }
  7027. if (rtype == 3) {
  7028. msmc = 'master';
  7029. }
  7030. let keyStr = 'sjmd_classic_start_' + rtype;
  7031. let jsonStr = {
  7032. "difficulty": msmc,
  7033. "classic_count": 1,
  7034. "difficulty_count": 1
  7035. };
  7036. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7037. const d = LocalStorageManager.getItem(keyStr);
  7038. jsonStr.classic_count = d.classic_count + 1;
  7039. jsonStr.difficulty_count = d.difficulty_count + 1;
  7040. LocalStorageManager.setItem(keyStr, jsonStr);
  7041. }
  7042. else {
  7043. LocalStorageManager.setItem(keyStr, jsonStr);
  7044. }
  7045. const reqStr = JSON.stringify(jsonStr);
  7046. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  7047. }
  7048. }
  7049. UIModeSelection.uiName = "UIModeSelection";
  7050. class ui_UIReg extends fgui.GComponent {
  7051. static createInstance() {
  7052. return (fgui.UIPackage.createObject("game", "UIReg"));
  7053. }
  7054. onConstruct() {
  7055. this.n38 = (this.getChild("n38"));
  7056. this.n51 = (this.getChild("n51"));
  7057. this.closeBtn = (this.getChild("closeBtn"));
  7058. this.lab_tip = (this.getChild("lab_tip"));
  7059. this.txt_ua = (this.getChild("txt_ua"));
  7060. this.txt_up1 = (this.getChild("txt_up1"));
  7061. this.txt_up2 = (this.getChild("txt_up2"));
  7062. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  7063. this.btn_reg = (this.getChild("btn_reg"));
  7064. }
  7065. }
  7066. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  7067. class ui_UILogin extends fgui.GComponent {
  7068. static createInstance() {
  7069. return (fgui.UIPackage.createObject("game", "UILogin"));
  7070. }
  7071. onConstruct() {
  7072. this.c1 = this.getController("c1");
  7073. this.n18 = (this.getChild("n18"));
  7074. this.n21 = (this.getChild("n21"));
  7075. this.closeBtn = (this.getChild("closeBtn"));
  7076. this.txt_ua = (this.getChild("txt_ua"));
  7077. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  7078. this.btn_login = (this.getChild("btn_login"));
  7079. this.txt_up = (this.getChild("txt_up"));
  7080. }
  7081. }
  7082. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  7083. class UILogin extends UIBase {
  7084. constructor() {
  7085. super();
  7086. this.fontStr = 'big-john-woff2-2';
  7087. try {
  7088. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7089. console.log("zh: constructor加载arial字体成功");
  7090. }
  7091. catch (error) {
  7092. console.log("zh: constructor加载arial字体失败");
  7093. }
  7094. }
  7095. onFontLoaded() {
  7096. try {
  7097. Laya.Text.defaultFont = this.fontStr;
  7098. this.ui.txt_ua.font = this.fontStr;
  7099. this.ui.txt_up.font = this.fontStr;
  7100. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7101. }
  7102. catch (error) {
  7103. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7104. }
  7105. }
  7106. onConstructor() {
  7107. this.ui = ui_UILogin.createInstance();
  7108. this.contentPane = this.ui;
  7109. this.isEject = false;
  7110. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7111. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  7112. this.addUIClick(this.ui.btn_login, this.userLogin);
  7113. }
  7114. show() {
  7115. super.show();
  7116. this.x = (Laya.stage.width - this.width) / 2;
  7117. this.y = (Laya.stage.height - this.height) / 2;
  7118. this.onFontLoaded();
  7119. }
  7120. closeSelf() {
  7121. this.hide();
  7122. }
  7123. userLogin() {
  7124. let ua = this.ui.txt_ua.text;
  7125. let up = this.ui.txt_up.text;
  7126. console.log('zh:ua font' + this.ui.txt_ua.font);
  7127. if (ua && up) {
  7128. let reqData = JSON.stringify({
  7129. username: ua.trim(),
  7130. password: up.trim(),
  7131. fromMark: 'app_game'
  7132. });
  7133. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7134. try {
  7135. console.log('zh:res = ' + JSON.stringify(res));
  7136. let code = res.code;
  7137. let msg = res.msg;
  7138. if (code == 200) {
  7139. let keyStr = keyForLoginInfo;
  7140. let jsonStr = {
  7141. "username": res.username,
  7142. "token": res.token,
  7143. "buySpids": { 1: false, 7: false }
  7144. };
  7145. LocalStorageManager.setItem(keyStr, jsonStr);
  7146. let myu = Moyu.getUserInfo();
  7147. console.log('zh:myu = ' + JSON.stringify(myu));
  7148. DataMgr.updateUserNickName(res.username);
  7149. Moyu.updateUserInfo(res.username);
  7150. xGame.uiMgr.Show(UIMsg, msg);
  7151. DataMgr.loadUserSpOrderForAd();
  7152. DataMgr.getUserZiChanInfo(false);
  7153. xGame.eventMgr.event(LOGIN_IN);
  7154. this.closeSelf();
  7155. }
  7156. else {
  7157. xGame.uiMgr.Show(UIMsg, msg);
  7158. }
  7159. }
  7160. catch (error) {
  7161. console.log('error=' + error);
  7162. alert(error);
  7163. }
  7164. finally {
  7165. }
  7166. });
  7167. }
  7168. else {
  7169. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7170. }
  7171. }
  7172. gotoRegPage() {
  7173. this.closeSelf();
  7174. xGame.uiMgr.Show(UIReg);
  7175. }
  7176. }
  7177. UILogin.uiName = "UILogin";
  7178. class UIReg extends UIBase {
  7179. constructor() {
  7180. super();
  7181. this.fontStr = 'big-john-woff2-2';
  7182. try {
  7183. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7184. console.log("zh: constructor加载arial字体成功");
  7185. }
  7186. catch (error) {
  7187. console.log("zh: constructor加载arial字体失败");
  7188. }
  7189. }
  7190. onFontLoaded() {
  7191. try {
  7192. Laya.Text.defaultFont = this.fontStr;
  7193. this.ui.txt_ua.font = this.fontStr;
  7194. this.ui.txt_up1.font = this.fontStr;
  7195. this.ui.txt_up2.font = this.fontStr;
  7196. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7197. }
  7198. catch (error) {
  7199. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7200. }
  7201. }
  7202. onConstructor() {
  7203. this.ui = ui_UIReg.createInstance();
  7204. this.contentPane = this.ui;
  7205. this.isEject = false;
  7206. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7207. this.addUIClick(this.ui.btn_reg, this.regUser);
  7208. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7209. }
  7210. show() {
  7211. super.show();
  7212. this.x = (Laya.stage.width - this.width) / 2;
  7213. this.y = (Laya.stage.height - this.height) / 2;
  7214. this.onFontLoaded();
  7215. }
  7216. closeSelf() {
  7217. this.hide();
  7218. }
  7219. regUser() {
  7220. this.ui.lab_tip.visible = false;
  7221. let ua = this.ui.txt_ua.text;
  7222. let up1 = this.ui.txt_up1.text;
  7223. let up2 = this.ui.txt_up2.text;
  7224. if (ua && up1 && up2 && up1 == up2) {
  7225. let reqData = JSON.stringify({
  7226. username: ua.trim(),
  7227. password: up1.trim(),
  7228. fromMark: 'app_game'
  7229. });
  7230. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7231. try {
  7232. console.log('zh:res = ' + JSON.stringify(res));
  7233. let code = res.code;
  7234. let msg = res.msg;
  7235. xGame.uiMgr.Show(UIMsg, msg);
  7236. if (code == 200) {
  7237. this.ui.lab_tip.color = "#FFFFFF";
  7238. xGame.uiMgr.Show(UIMsg, msg);
  7239. this.closeSelf();
  7240. }
  7241. else {
  7242. this.ui.lab_tip.color = "#FF0000";
  7243. xGame.uiMgr.Show(UIMsg, msg);
  7244. }
  7245. }
  7246. catch (error) {
  7247. console.log('error=' + error);
  7248. alert(error);
  7249. }
  7250. finally {
  7251. }
  7252. });
  7253. }
  7254. else {
  7255. if (up1 != up2) {
  7256. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7257. }
  7258. else {
  7259. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7260. }
  7261. }
  7262. }
  7263. gotoLogin() {
  7264. this.closeSelf();
  7265. xGame.uiMgr.Show(UILogin);
  7266. }
  7267. }
  7268. UIReg.uiName = "UIReg";
  7269. class ui_UIGetAward extends fgui.GComponent {
  7270. static createInstance() {
  7271. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7272. }
  7273. onConstruct() {
  7274. this.n4 = (this.getChild("n4"));
  7275. this.n0 = (this.getChild("n0"));
  7276. this.myList = (this.getChild("myList"));
  7277. this.n1 = (this.getChild("n1"));
  7278. this.eftNode = (this.getChild("eftNode"));
  7279. this.btnNode = (this.getChild("btnNode"));
  7280. this.t0 = this.getTransition("t0");
  7281. }
  7282. }
  7283. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7284. class UIGetAward extends UIBase {
  7285. constructor() {
  7286. super();
  7287. this.showTriple = true;
  7288. }
  7289. onConstructor() {
  7290. this.ui = ui_UIGetAward.createInstance();
  7291. this.contentPane = this.ui;
  7292. this.isEject = false;
  7293. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7294. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7295. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7296. }
  7297. show(arr, showTriple, callback) {
  7298. super.show();
  7299. this.ui.t0.play();
  7300. this.ui.eftNode.visible = true;
  7301. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7302. this.ui.eftNode.visible = false;
  7303. }), 1, 0, 0, 0.9);
  7304. this.awardArr = arr;
  7305. this.showTriple = showTriple;
  7306. this.callback = callback;
  7307. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7308. this.ui.myList.numItems = arr.length;
  7309. xGame.soundMgr.playSound("getaward");
  7310. this.setGlobalFont(this.ui);
  7311. }
  7312. updateSelf(index, obj) {
  7313. let temp = this.awardArr[index];
  7314. let icon = this.getIcon(temp.type);
  7315. let str = icon;
  7316. if (temp.type > 2) {
  7317. str = "s" + icon;
  7318. }
  7319. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7320. obj.myIcon.rotation = 0;
  7321. obj.numTxt.text = temp.num + "";
  7322. obj.numTxt.visible = temp.type > 2 ? false : true;
  7323. obj.nameTxt.text = this.getNameStr(temp.type);
  7324. }
  7325. renderItem(index, obj) {
  7326. this.updateSelf(index, obj);
  7327. }
  7328. tripleGetAward() {
  7329. console.log('zh:qjff_AD_for_uigetAward');
  7330. if (Laya.Browser.onAndroid) {
  7331. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7332. if (!boo) {
  7333. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7334. return;
  7335. }
  7336. }
  7337. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7338. }
  7339. else {
  7340. console.log('zh:AD 失败,直接发放奖励');
  7341. this.qjff_AD_for_uigetAward();
  7342. }
  7343. }
  7344. qjff_AD_for_uigetAward() {
  7345. this.getAward(3);
  7346. }
  7347. normalGetAward() {
  7348. if (PlatMgr.isMisVideo())
  7349. this.tripleGetAward();
  7350. else
  7351. this.getAward();
  7352. }
  7353. getAward(times = 1) {
  7354. this.hide();
  7355. for (let index = 0; index < this.awardArr.length; index++) {
  7356. this.awardArr[index].num *= times;
  7357. }
  7358. this.callback && this.callback(times != 1);
  7359. }
  7360. getIcon(type) {
  7361. switch (type) {
  7362. case Prop.diamond:
  7363. return "ty_zs";
  7364. case Prop.coin:
  7365. return "ty_jb";
  7366. case Prop.gan1:
  7367. return "qg1";
  7368. case Prop.gan2:
  7369. return "qg2";
  7370. case Prop.gan3:
  7371. return "qg3";
  7372. case Prop.gan4:
  7373. return "qg4";
  7374. default:
  7375. break;
  7376. }
  7377. }
  7378. getNameStr(type) {
  7379. switch (type) {
  7380. case Prop.diamond:
  7381. return "Diamond";
  7382. case Prop.coin:
  7383. return "Coins";
  7384. case Prop.gan1:
  7385. case Prop.gan2:
  7386. case Prop.gan3:
  7387. case Prop.gan4:
  7388. return cfgTable.ballrodData[type - 1].name;
  7389. default:
  7390. break;
  7391. }
  7392. }
  7393. }
  7394. UIGetAward.uiName = "UIGetAward";
  7395. class ui_UIRepentProp extends fgui.GComponent {
  7396. static createInstance() {
  7397. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7398. }
  7399. onConstruct() {
  7400. this.c1 = this.getController("c1");
  7401. this.n11 = (this.getChild("n11"));
  7402. this.regretNode = (this.getChild("regretNode"));
  7403. this.helpLineNode = (this.getChild("helpLineNode"));
  7404. this.t0 = this.getTransition("t0");
  7405. }
  7406. }
  7407. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7408. class UIRepentProp extends UIBase {
  7409. constructor() {
  7410. super();
  7411. this.viewType = 0;
  7412. this.regretType = 0;
  7413. }
  7414. onConstructor() {
  7415. this.ui = ui_UIRepentProp.createInstance();
  7416. this.contentPane = this.ui;
  7417. this.isEject = false;
  7418. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7419. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7420. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7421. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7422. }
  7423. show(viewType, regretType, callback) {
  7424. PlatMgr.showInsert(true);
  7425. this.viewType = viewType;
  7426. this.regretType = regretType;
  7427. this.callback = callback;
  7428. super.show();
  7429. this.ui.t0.play();
  7430. this.ui.c1.selectedIndex = this.viewType;
  7431. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7432. if (this.viewType == 0) {
  7433. let guide = DataMgr.getGuideHelpLine();
  7434. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7435. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7436. }
  7437. xGame.common.gameMgr.gamePause = true;
  7438. this.setGlobalFont(this.ui);
  7439. }
  7440. hideSelf() {
  7441. xGame.common.gameMgr.gamePause = false;
  7442. this.callback && this.callback(false);
  7443. this.hide();
  7444. }
  7445. videoRegret() {
  7446. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7447. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7448. }
  7449. else {
  7450. console.log('zh:AD 失败,直接发放奖励');
  7451. this.qjff_AD_for_UIrepentProp_videoRegret();
  7452. }
  7453. }
  7454. qjff_AD_for_UIrepentProp_videoRegret() {
  7455. this.callback && this.callback(true);
  7456. this.hideSelf();
  7457. }
  7458. videoAddHelpLine() {
  7459. let guide = DataMgr.getGuideHelpLine();
  7460. if (guide == 0) {
  7461. this.callback && this.callback(true);
  7462. this.hideSelf();
  7463. DataMgr.setGuideHelpLine();
  7464. xGame.common.gameUI.ui.guideNode.visible = false;
  7465. }
  7466. else {
  7467. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7468. if (Laya.Browser.onAndroid) {
  7469. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7470. if (!boo) {
  7471. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7472. return;
  7473. }
  7474. }
  7475. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7476. }
  7477. else {
  7478. console.log('zh:AD 失败,直接发放奖励');
  7479. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7480. }
  7481. }
  7482. }
  7483. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7484. this.callback && this.callback(true);
  7485. this.hideSelf();
  7486. }
  7487. }
  7488. UIRepentProp.uiName = "UIRepentProp";
  7489. class ui_UITips extends fgui.GComponent {
  7490. static createInstance() {
  7491. return (fgui.UIPackage.createObject("game", "UITips"));
  7492. }
  7493. onConstruct() {
  7494. this.n0 = (this.getChild("n0"));
  7495. this.myNode = (this.getChild("myNode"));
  7496. this.t0 = this.getTransition("t0");
  7497. }
  7498. }
  7499. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7500. class UITips extends UIBase {
  7501. constructor() {
  7502. super();
  7503. this.type = 0;
  7504. }
  7505. onConstructor() {
  7506. this.ui = ui_UITips.createInstance();
  7507. this.contentPane = this.ui;
  7508. this.isEject = false;
  7509. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7510. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7511. }
  7512. show(tipsTxt, womanTxt, type) {
  7513. super.show();
  7514. this.ui.t0.play();
  7515. this.ui.myNode.tipsTxt.text = tipsTxt;
  7516. this.ui.myNode.womanTxt.text = womanTxt;
  7517. PlatMgr.showInsert(true);
  7518. this.ui.myNode.c1.selectedIndex = type;
  7519. this.type = type;
  7520. switch (this.type) {
  7521. case TipsType.exitGame:
  7522. xGame.common.gameMgr.gamePause = true;
  7523. break;
  7524. case TipsType.foul:
  7525. Laya.timer.once(200, this, () => {
  7526. if (xGame.common.gameMgr) {
  7527. xGame.common.gameMgr.gamePause = true;
  7528. }
  7529. else {
  7530. console.log("zh:gameMgr is null");
  7531. }
  7532. });
  7533. break;
  7534. default:
  7535. break;
  7536. }
  7537. this.setGlobalFont(this.ui);
  7538. }
  7539. clickLeftBtn() {
  7540. this.hide();
  7541. xGame.common.gameMgr.gamePause = false;
  7542. switch (this.type) {
  7543. case TipsType.exitGame:
  7544. break;
  7545. case TipsType.foul:
  7546. break;
  7547. default:
  7548. break;
  7549. }
  7550. }
  7551. clickRightBtn() {
  7552. this.hide();
  7553. switch (this.type) {
  7554. case TipsType.exitGame:
  7555. xGame.eventMgr.event(RESET_GAME);
  7556. xGame.uiMgr.Show(UIMain);
  7557. Moyu.recordEnd(this, null);
  7558. xGame.common.longHelpLine = false;
  7559. break;
  7560. case TipsType.foul:
  7561. if (xGame.common.gameMgr) {
  7562. xGame.common.gameMgr.gamePause = false;
  7563. }
  7564. Laya.timer.clearAll(this);
  7565. break;
  7566. default:
  7567. break;
  7568. }
  7569. }
  7570. }
  7571. UITips.uiName = "UITips";
  7572. class UIMain extends UIBase {
  7573. constructor() {
  7574. super();
  7575. this.firstEnter = true;
  7576. this.moni_click_count = 0;
  7577. }
  7578. nativeCallJs(msg) {
  7579. let t = msg;
  7580. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7581. switch (t) {
  7582. case 'qjff_chouJiang':
  7583. let dui = xGame.uiMgr.getUI(UIDraw);
  7584. dui.qjff_chouJiang();
  7585. break;
  7586. case 'qjff_AD_for_uisign':
  7587. let dui2 = xGame.uiMgr.getUI(UISign);
  7588. dui2.qjff_AD_for_uisign();
  7589. break;
  7590. case 'qjff_AD_for_uitry':
  7591. let dui3 = xGame.uiMgr.getUI(UITry);
  7592. dui3.qjff_AD_for_uitry();
  7593. break;
  7594. case 'qjff_AD_for_uipower':
  7595. let dui4 = xGame.uiMgr.getUI(UIPower);
  7596. dui4.qjff_AD_for_uipower();
  7597. break;
  7598. case 'qjff_AD_for_uigetAward':
  7599. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7600. dui5.qjff_AD_for_uigetAward();
  7601. break;
  7602. case 'qjff_AD_for_uiGameEnd':
  7603. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7604. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7605. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7606. break;
  7607. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7608. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7609. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7610. break;
  7611. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7612. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7613. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7614. break;
  7615. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7616. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7617. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7618. break;
  7619. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7620. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7621. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7622. break;
  7623. case 'qjff_AD_for_UIBOX_onOpenBox':
  7624. let dui11 = xGame.uiMgr.getUI(UIBox);
  7625. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7626. break;
  7627. case 'qjff_AD_for_UIAddCoin':
  7628. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7629. dui12.qjff_AD_for_UIAddCoin();
  7630. break;
  7631. case 'app_sign_for_buyProduct_onSuccess':
  7632. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7633. DataMgr.getUserZiChanInfo(false);
  7634. break;
  7635. case '222axxxxxx':
  7636. let dui15 = xGame.uiMgr.getUI(UISign);
  7637. dui15.qjff_AD_for_uisign();
  7638. break;
  7639. case '333axsxxxxxx':
  7640. let dui16 = xGame.uiMgr.getUI(UISign);
  7641. dui16.qjff_AD_for_uisign();
  7642. break;
  7643. default:
  7644. console.log('zh:未知的方法名字' + t);
  7645. break;
  7646. }
  7647. }
  7648. onConstructor() {
  7649. console.log('zh: UIMain onConstructor');
  7650. this.ui = ui_UIMain.createInstance();
  7651. this.contentPane = this.ui;
  7652. this.isEject = false;
  7653. this.addEvent();
  7654. this.addClickSpine();
  7655. this.settingNode = new SettingNode(this.ui.settingNode);
  7656. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7657. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7658. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7659. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7660. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7661. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7662. xGame.eventMgr.on("gameConfigReadyMark", this, this.event_gameConfigReadyMark);
  7663. let curUse = DataMgr.getCurSecretary();
  7664. this.changeSecretary(curUse);
  7665. this.ui.talkNode.visible = false;
  7666. let guide = 1;
  7667. if (DataMgr.getGuideDefaultModel() === 1) {
  7668. guide = DataMgr.getLianXiGuide();
  7669. }
  7670. else {
  7671. guide = DataMgr.getSkillGuide();
  7672. }
  7673. if (xGame.common.isNewDay && guide == 1) {
  7674. xGame.common.isNewDay = false;
  7675. xGame.soundMgr.playSound("s_main01");
  7676. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7677. console.log("zh:播放小秘书每天语音");
  7678. }
  7679. this.onGetUserInfo();
  7680. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7681. DataMgr.getUserZiChanInfo(false);
  7682. }
  7683. this.ui.n83.visible = false;
  7684. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7685. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7686. let ua = d.username;
  7687. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7688. }
  7689. this.c_btn_for_user();
  7690. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7691. }
  7692. Logout() {
  7693. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7694. LocalStorageManager.removeItem(keyForLoginInfo);
  7695. this.freshUser();
  7696. }
  7697. JSBridgeUtils.instance.loginOutForApp();
  7698. this.setUserDefaultNickname();
  7699. DataMgr.setCoin2(4000);
  7700. DataMgr.setDiamond2(0);
  7701. this.setDefaultQiuGanInfo();
  7702. DataMgr.setPlaceBallLevelList("");
  7703. DataMgr.setChallengeMode_overLev(1);
  7704. this.setDefaultSignData();
  7705. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7706. DataMgr.setCurBallRod(5);
  7707. }
  7708. setDefaultSignData() {
  7709. DataMgr.setSignData(1);
  7710. DataMgr.setSignTime(new Date().getTime());
  7711. }
  7712. setDefaultQiuGanInfo() {
  7713. DataMgr.setBallRod(0, 1);
  7714. DataMgr.setBallRod(1, 0);
  7715. DataMgr.setBallRod(2, 0);
  7716. DataMgr.setBallRod(3, 0);
  7717. DataMgr.setBallRod(4, 0);
  7718. DataMgr.setBallRod(5, 1);
  7719. }
  7720. setUserDefaultNickname() {
  7721. let defUsername = "player";
  7722. this.ui.headNode.nameTxt.text = defUsername;
  7723. DataMgr.updateUserNickName(defUsername);
  7724. Moyu.updateUserInfo(defUsername);
  7725. }
  7726. gotoLogin() {
  7727. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7728. xGame.uiMgr.Show(UILogin);
  7729. }
  7730. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7731. this.Logout();
  7732. }
  7733. }
  7734. gotoRegUser() {
  7735. xGame.uiMgr.Show(UIReg);
  7736. }
  7737. showFuLiSp1() {
  7738. console.log('zh:福利1');
  7739. DataMgr.checkForShowFuLi17AndAlert(1);
  7740. }
  7741. showFuLiSp7() {
  7742. console.log('zh:福利7');
  7743. DataMgr.checkForShowFuLi17AndAlert(7);
  7744. }
  7745. c_btn_for_user() {
  7746. this.ui.n_dengLu.c1.selectedIndex = 0;
  7747. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7748. this.ui.n_dengLu.c1.selectedIndex = 1;
  7749. }
  7750. else {
  7751. this.ui.n_dengLu.c1.selectedIndex = 0;
  7752. }
  7753. }
  7754. changeSecretary(curUse) {
  7755. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7756. xGame.common.secretary && xGame.common.secretary.dispose();
  7757. this.addSecretarySpine(name);
  7758. }
  7759. addSecretarySpine(name) {
  7760. let spine = new SpineMgr(name, () => {
  7761. this.playSecretaryIdle();
  7762. });
  7763. xGame.common.secretary = spine;
  7764. }
  7765. addClickSpine() {
  7766. let clickSpine = new SpineMgr("dianji", () => {
  7767. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7768. let parent = Laya.stage;
  7769. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7770. clickSpine.play(data, 0, false, parent, (spine) => {
  7771. spine.destroy(true);
  7772. });
  7773. });
  7774. });
  7775. }
  7776. addEvent() {
  7777. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7778. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7779. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7780. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7781. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7782. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7783. this.addUIClick(this.ui, this.interuptSecretary);
  7784. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7785. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7786. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7787. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7788. this.addUIClick(this.ui.signBtn, this.openSignView);
  7789. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7790. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7791. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7792. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  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.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7821. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7822. let isGuideOver = false;
  7823. let randTime = xGame.common.randomNum(300, 800);
  7824. if (DataMgr.getGuideDefaultModel() === 1) {
  7825. let guide = DataMgr.getLianXiGuide();
  7826. if (guide == 1) {
  7827. isGuideOver = true;
  7828. this.ui.n_yd_lxms_1.visible = false;
  7829. this.firstEnter = false;
  7830. }
  7831. }
  7832. else {
  7833. let guide = DataMgr.getSkillGuide();
  7834. if (guide == 1) {
  7835. isGuideOver = true;
  7836. if (this.firstEnter) {
  7837. console.log("zh: firstEnter");
  7838. this.firstEnter = false;
  7839. randTime += 900;
  7840. }
  7841. else {
  7842. console.log("zh: no firstEnter");
  7843. }
  7844. }
  7845. }
  7846. if (isGuideOver) {
  7847. Laya.timer.once(randTime, this, () => {
  7848. });
  7849. Laya.timer.once(1000, this, () => {
  7850. console.log('zh: 1秒后 showFuLiSp7');
  7851. this.showFuLiSp7();
  7852. });
  7853. this.showTipForGuest();
  7854. }
  7855. this.setGlobalFont(this.ui);
  7856. }
  7857. event_gameConfigReadyMark() {
  7858. console.log('zh:事件触发,配置加载OK');
  7859. if (DataMgr.getGuideDefaultModel() === 1) {
  7860. this.showGuideForLianxi();
  7861. }
  7862. else {
  7863. this.showGuide();
  7864. }
  7865. }
  7866. showGuideForLianxi() {
  7867. let lianXiGuide = DataMgr.getLianXiGuide();
  7868. if (lianXiGuide == 0) {
  7869. let x = this.ui.placeBallBtn.x;
  7870. let y = this.ui.placeBallBtn.y;
  7871. this.ui.n_yd_lxms_1.visible = true;
  7872. this.ui.n_yd_challenge_1_hand.x = x + 150;
  7873. this.ui.n_yd_challenge_1_hand.y = y;
  7874. this.ui.n_yd_challenge_1_btn.x = x;
  7875. this.ui.n_yd_challenge_1_btn.y = y;
  7876. console.log('zh:yinDaoForLianxi set ok');
  7877. }
  7878. else {
  7879. this.ui.n_yd_lxms_1.visible = false;
  7880. }
  7881. }
  7882. showTipForGuest() {
  7883. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7884. if (userInfo == null) {
  7885. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7886. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7887. let woman = "this is an important notice.";
  7888. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7889. return;
  7890. }
  7891. }
  7892. checkActive(show) {
  7893. }
  7894. showGuide() {
  7895. let guide = DataMgr.getSkillGuide();
  7896. this.ui.guideBtn.visible = guide == 0;
  7897. this.ui.enterGuide.visible = false;
  7898. this.ui.secretaryGuide.visible = guide == 0;
  7899. if (guide == 0) {
  7900. console.log("zh:显示引导");
  7901. xGame.soundMgr.playSound("s_guide");
  7902. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7903. }
  7904. else {
  7905. console.log("zh:不需要显示引导");
  7906. }
  7907. }
  7908. ensureSecretary() {
  7909. console.log('zh: ensureSecretary ');
  7910. this.ui.secretaryGuide.visible = false;
  7911. this.ui.enterGuide.visible = true;
  7912. this.ui.wordsNode.t0.play();
  7913. if (DataMgr.getNewUser())
  7914. Moyu.sendDataEvent("gameReady");
  7915. }
  7916. playSecretaryIdle() {
  7917. let parent = this.ui.secretary.displayObject;
  7918. parent.destroyChildren();
  7919. let xx = this.ui.secretary.width / 2;
  7920. let yy = this.ui.secretary.height;
  7921. let scale = xGame.common.getSecretaryScale();
  7922. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7923. xGame.common.secretary.play(data, 0, true, parent);
  7924. }
  7925. startGame(type) {
  7926. if (!this.isReadyForLoadNetSource()) {
  7927. return;
  7928. }
  7929. xGame.common.gameMode = type;
  7930. Moyu.sendDataEvent("PlayGame", { type: type });
  7931. let gm = xGame.common.gameMode;
  7932. console.log('zh:进入游戏gameMode =' + gm);
  7933. switch (gm) {
  7934. case GameMode.classic:
  7935. console.log('zh:进入经典模式111111111');
  7936. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7937. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7938. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7939. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7940. console.log('zh:判断是否可以玩该模式classic =NO');
  7941. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7942. xGame.uiMgr.Show(UIMsg, tipStr);
  7943. return;
  7944. }
  7945. else {
  7946. console.log('zh:可以玩该模式classic');
  7947. this.beginGame();
  7948. }
  7949. }
  7950. else {
  7951. console.log('zh:不需要判断是否可以玩该classic');
  7952. let challengeTimes = DataMgr.getChallengeTimes();
  7953. if (challengeTimes == 0) {
  7954. xGame.uiMgr.Show(UIInvitation);
  7955. }
  7956. else {
  7957. this.beginGame();
  7958. }
  7959. }
  7960. break;
  7961. case GameMode.bigMove:
  7962. console.info('zh:bigMove check 大招');
  7963. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7964. if (DataMgr.getGuideDefaultModel() === 1) {
  7965. let lianXiGuide = DataMgr.getLianXiGuide();
  7966. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && lianXiGuide == 1) {
  7967. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7968. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7969. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7970. xGame.uiMgr.Show(UIMsg, tipStr);
  7971. return;
  7972. }
  7973. else {
  7974. console.log('zh:可以玩');
  7975. this.beginGame();
  7976. if (DataMgr.getNewUser())
  7977. Moyu.sendDataEvent("gameStart0");
  7978. }
  7979. }
  7980. else {
  7981. this.beginGame();
  7982. if (DataMgr.getNewUser())
  7983. Moyu.sendDataEvent("gameStart0");
  7984. }
  7985. }
  7986. else {
  7987. let guide = DataMgr.getSkillGuide();
  7988. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7989. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7990. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7991. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7992. xGame.uiMgr.Show(UIMsg, tipStr);
  7993. return;
  7994. }
  7995. else {
  7996. console.log('zh:可以玩');
  7997. this.beginGame();
  7998. if (DataMgr.getNewUser())
  7999. Moyu.sendDataEvent("gameStart0");
  8000. }
  8001. }
  8002. else {
  8003. this.beginGame();
  8004. if (DataMgr.getNewUser())
  8005. Moyu.sendDataEvent("gameStart0");
  8006. }
  8007. }
  8008. break;
  8009. default:
  8010. console.error('zh:未知错误!!!!');
  8011. break;
  8012. }
  8013. }
  8014. beginGame(isNice = false) {
  8015. console.log('zh:beginGame ');
  8016. let guide = 1;
  8017. if (DataMgr.getGuideDefaultModel() === 1) {
  8018. guide = DataMgr.getLianXiGuide();
  8019. }
  8020. else {
  8021. guide = DataMgr.getSkillGuide();
  8022. }
  8023. if (guide == 1) {
  8024. console.log('zh:非新手引导,showInternAd ');
  8025. JSBridgeUtils.instance.showInternAd('beginGame');
  8026. }
  8027. else {
  8028. console.log('zh:新手引导,不显示AD ');
  8029. }
  8030. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  8031. console.log('zh:beginGame 1');
  8032. if (xGame.common.gameMode == GameMode.classic) {
  8033. console.log('zh:beginGame 2');
  8034. if (isNice) {
  8035. console.log('zh:进入巅峰赛');
  8036. this.enterClassic();
  8037. }
  8038. else {
  8039. console.log('zh:beginGame 3-1');
  8040. xGame.uiMgr.Show(UIModeSelection, () => {
  8041. console.log('zh:beginGame 3-2');
  8042. this.enterClassic();
  8043. });
  8044. }
  8045. }
  8046. else if (xGame.common.gameMode == GameMode.bigMove) {
  8047. console.log('zh:beginGame 5');
  8048. this.ui.enterGuide.visible = false;
  8049. xGame.uiMgr.Show(UISkill);
  8050. }
  8051. }
  8052. enterClassic() {
  8053. console.log('zh:beginGame 7');
  8054. xGame.uiMgr.Show(UIGame);
  8055. xGame.uiMgr.Show(UIMatching, () => {
  8056. if (!this.isHide)
  8057. this.hide();
  8058. xGame.common.gameUI.ui.alpha = 1;
  8059. console.log('zh:beginGame 8');
  8060. xGame.common.gameUI.startGame();
  8061. xGame.uiMgr.Hide(UIGameEnd);
  8062. });
  8063. }
  8064. start_debug_for_moni_payOk() {
  8065. let ccc = this.moni_click_count + 1;
  8066. this.moni_click_count = ccc;
  8067. if (ccc % 5 == 0) {
  8068. console.log('zh:start_debug_for_moni_payOk');
  8069. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8070. if (userInfo != null) {
  8071. let token = userInfo.token;
  8072. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  8073. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  8074. alert('模拟支付OK');
  8075. return;
  8076. }
  8077. else {
  8078. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8079. }
  8080. }
  8081. }
  8082. startGlobal() {
  8083. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  8084. }
  8085. startWeekly() {
  8086. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  8087. }
  8088. zhouSaiMonth() {
  8089. console.log('zh: zhouSaiMonth 被调用');
  8090. }
  8091. isReadyForLoadNetSource() {
  8092. let reqCount = xGame.cfgMgr.httpReqCount;
  8093. let ok = xGame.cfgMgr.httpReqOkCount;
  8094. if (reqCount > ok) {
  8095. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  8096. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  8097. Laya.timer.once(5000, this, () => {
  8098. let retryCount = 0;
  8099. const maxRetries = 3;
  8100. const tryFetchConfig = () => {
  8101. try {
  8102. xGame.cfgMgr.getConfigFromServer();
  8103. }
  8104. catch (error) {
  8105. if (retryCount < maxRetries) {
  8106. retryCount++;
  8107. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8108. Laya.timer.once(5000, this, tryFetchConfig);
  8109. }
  8110. else {
  8111. console.error("❌ 达到最大重试次数,配置获取失败");
  8112. }
  8113. }
  8114. };
  8115. tryFetchConfig();
  8116. });
  8117. return false;
  8118. }
  8119. return true;
  8120. }
  8121. startPlaceBall() {
  8122. if (!this.isReadyForLoadNetSource()) {
  8123. return;
  8124. }
  8125. xGame.uiMgr.Show(UILevelDisplay);
  8126. }
  8127. hide() {
  8128. console.log('zh:uimain hide ...');
  8129. super.hide();
  8130. xGame.common.stopGirlPop(this.ui.talkNode);
  8131. }
  8132. onGetUserInfo(force = false) {
  8133. if (Moyu.isWx) {
  8134. let info = Moyu.getSystemInfo();
  8135. if (info)
  8136. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8137. }
  8138. else {
  8139. Moyu.initUser(this, this.freshUser, force);
  8140. }
  8141. this.freshUser();
  8142. console.log('zh:5秒后更新用户信息');
  8143. setTimeout(() => {
  8144. DataMgr.getUserZiChanInfo(true);
  8145. }, 5000);
  8146. }
  8147. event_login_in() {
  8148. console.log("zh:event_login_in被触发");
  8149. this.freshUser();
  8150. }
  8151. freshUser() {
  8152. let user = Moyu.getUserInfo();
  8153. if (!user.isAuth) {
  8154. user.headIcon = 'res/ty_touxiang.png';
  8155. }
  8156. else {
  8157. DataMgr.upRankData();
  8158. }
  8159. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8160. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8161. let keyStr = keyForLoginInfo;
  8162. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8163. const d = LocalStorageManager.getItem(keyStr);
  8164. let ua = d.username;
  8165. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8166. }
  8167. else {
  8168. }
  8169. this.c_btn_for_user();
  8170. }
  8171. interuptSecretary() {
  8172. Laya.timer.clearAll(this);
  8173. this.playSecretaryRandomSound();
  8174. }
  8175. playSecretaryRandomSound() {
  8176. if (this.isHide)
  8177. return;
  8178. let time = xGame.common.randomNum(45000, 60000);
  8179. Laya.timer.once(time, this, () => {
  8180. if (this.isHide)
  8181. return;
  8182. let index = xGame.common.randomNum(4, 7);
  8183. xGame.soundMgr.playSound("s_main0" + index);
  8184. let words = 1;
  8185. switch (index) {
  8186. case 4:
  8187. words = 5;
  8188. break;
  8189. case 5:
  8190. words = 3;
  8191. break;
  8192. case 6:
  8193. words = 6;
  8194. break;
  8195. case 7:
  8196. words = 7;
  8197. break;
  8198. default:
  8199. break;
  8200. }
  8201. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8202. this.playSecretaryRandomSound();
  8203. });
  8204. }
  8205. openSecretaryView() {
  8206. xGame.uiMgr.Show(UISecretary);
  8207. Moyu.sendDataEvent("secretary");
  8208. }
  8209. openShopView() {
  8210. xGame.uiMgr.Show(UIShop, 1);
  8211. }
  8212. openShopView0() {
  8213. xGame.uiMgr.Show(UIShop, 0);
  8214. }
  8215. openSignView() {
  8216. xGame.uiMgr.Show(UISign);
  8217. }
  8218. openDrawView() {
  8219. xGame.uiMgr.Show(UIDraw);
  8220. }
  8221. openRanking() {
  8222. console.log('zh:phb openRanking');
  8223. xGame.uiMgr.Show(UIRanking);
  8224. Moyu.sendDataEvent("rankingList");
  8225. }
  8226. }
  8227. UIMain.uiName = "UIMain";
  8228. class UIGameEnd extends UIBase {
  8229. constructor() {
  8230. super();
  8231. this.success = false;
  8232. this.awardCoinNum = 1000;
  8233. this.awardDiamondNum = 10;
  8234. }
  8235. onConstructor() {
  8236. this.ui = ui_UIGameEnd.createInstance();
  8237. this.contentPane = this.ui;
  8238. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8239. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8240. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8241. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8242. this.ui.talkNode.visible = false;
  8243. if (Moyu.isKs)
  8244. this.ui.closeNode.closeBtn.x += 100;
  8245. }
  8246. updateType() {
  8247. switch (xGame.common.gameMode) {
  8248. case GameMode.classic:
  8249. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8250. this.ui.coinNode.visible = this.success;
  8251. if (!this.success) {
  8252. Laya.timer.once(500, this, () => {
  8253. xGame.uiMgr.Show(UIAddCoin);
  8254. });
  8255. }
  8256. else {
  8257. this.logEventForClassic_win();
  8258. }
  8259. this.logEventForClassic_complete();
  8260. this.ui.isGetAward.visible = false;
  8261. this.ui.leftBtn.c1.selectedIndex = 3;
  8262. this.ui.rightBtn.c1.selectedIndex = 0;
  8263. this.moneyNode.ui.c1.selectedIndex = 1;
  8264. break;
  8265. case GameMode.bigMove:
  8266. console.log('zh:招法模式 aaaaaa bigMove');
  8267. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8268. this.ui.coinNode.visible = this.success;
  8269. if (xGame.common.gameMode == GameMode.bigMove) {
  8270. if (this.success) {
  8271. DataMgr.setSkillSuccessTimes(1, true);
  8272. DataMgr.setSkillAccTimes(1);
  8273. }
  8274. else {
  8275. DataMgr.setSkillSuccessTimes(0, false);
  8276. }
  8277. }
  8278. this.logEventForRod_complete_N();
  8279. if (!this.success) {
  8280. Laya.timer.once(500, this, () => {
  8281. xGame.uiMgr.Show(UIAddCoin);
  8282. });
  8283. }
  8284. else {
  8285. this.logEventForRod_win();
  8286. }
  8287. this.ui.isGetAward.visible = false;
  8288. this.ui.leftBtn.c1.selectedIndex = 3;
  8289. this.ui.rightBtn.c1.selectedIndex = 0;
  8290. this.moneyNode.ui.c1.selectedIndex = 1;
  8291. break;
  8292. case GameMode.placeBall:
  8293. this.ui.coinNode.visible = false;
  8294. if (this.success) {
  8295. if (xGame.common.placeBallStarNum == 3) {
  8296. this.ui.c1.selectedIndex = 2;
  8297. }
  8298. else {
  8299. this.ui.c1.selectedIndex = 3;
  8300. }
  8301. let level = xGame.common.placeBallCurLevel;
  8302. if (level > 59) {
  8303. this.logEventForChallenge_level_complete(level);
  8304. }
  8305. else {
  8306. this.logEventForChallenge_level_N(level);
  8307. }
  8308. }
  8309. else {
  8310. this.ui.c1.selectedIndex = 4;
  8311. }
  8312. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8313. if (cfg.type == PlaceBallType.challenge) {
  8314. this.ui.c1.selectedIndex = 2;
  8315. }
  8316. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8317. this.updatePlaceBallBtn();
  8318. this.updatePlaceBallStarNum();
  8319. this.updatePlaceBallAwardState();
  8320. this.moneyNode.ui.c1.selectedIndex = 2;
  8321. this.moneyNode.checkPowerTime();
  8322. this.moneyNode.powerChange();
  8323. DataMgr.upRankData();
  8324. break;
  8325. default:
  8326. break;
  8327. }
  8328. }
  8329. logEventForRod_complete_N() {
  8330. let gfmsIdx = xGame.common.curPlayerSkillType;
  8331. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8332. let gfmc = 'Skyfall Shot';
  8333. if (gfmsIdx == 0) {
  8334. gfmc = 'Skyfall Shot';
  8335. }
  8336. if (gfmsIdx == 1) {
  8337. gfmc = 'Surging break';
  8338. }
  8339. if (gfmsIdx == 2) {
  8340. gfmc = 'Frost Lock';
  8341. }
  8342. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8343. console.log('zh:logEventForRod_complete_N level = ' + level);
  8344. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8345. let jsonStr = {
  8346. "count": 0,
  8347. "name": gfmc
  8348. };
  8349. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8350. const d = LocalStorageManager.getItem(keyStr);
  8351. jsonStr.count = d.count + 1;
  8352. LocalStorageManager.setItem(keyStr, jsonStr);
  8353. }
  8354. else {
  8355. LocalStorageManager.setItem(keyStr, jsonStr);
  8356. }
  8357. const d2 = LocalStorageManager.getItem(keyStr);
  8358. let count = d2.count;
  8359. console.log('zh:logEventForRod_complete_N count = ' + count);
  8360. if (count % 5 == 0) {
  8361. const reqStr = JSON.stringify(jsonStr);
  8362. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8363. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8364. }
  8365. }
  8366. logEventForRod_win() {
  8367. console.log('zh:logEventForRod_win,胜利');
  8368. let gfmsIdx = xGame.common.curPlayerSkillType;
  8369. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8370. let gfmc = 'Skyfall Shot';
  8371. if (gfmsIdx == 0) {
  8372. gfmc = 'Skyfall Shot';
  8373. }
  8374. if (gfmsIdx == 1) {
  8375. gfmc = 'Surging break';
  8376. }
  8377. if (gfmsIdx == 2) {
  8378. gfmc = 'Frost Lock';
  8379. }
  8380. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8381. console.log('zh:logEventForRod_win level = ' + level);
  8382. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8383. let jsonStr = {
  8384. "count": 1,
  8385. "name": gfmc + ' Lev' + level
  8386. };
  8387. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8388. const d = LocalStorageManager.getItem(keyStr);
  8389. jsonStr.count = d.count + 1;
  8390. LocalStorageManager.setItem(keyStr, jsonStr);
  8391. }
  8392. else {
  8393. LocalStorageManager.setItem(keyStr, jsonStr);
  8394. }
  8395. const reqStr = JSON.stringify(jsonStr);
  8396. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8397. }
  8398. logEventForClassic_win() {
  8399. console.log('zh:logEventForClassic_win,胜利');
  8400. let rtype = xGame.common.classicRoomType;
  8401. let msmc = '';
  8402. if (rtype == 1) {
  8403. msmc = 'beginner';
  8404. }
  8405. if (rtype == 2) {
  8406. msmc = 'expert';
  8407. }
  8408. if (rtype == 3) {
  8409. msmc = 'master';
  8410. }
  8411. let keyStr = 'sjmd_classic_win_' + rtype;
  8412. let jsonStr = {
  8413. "difficulty": msmc,
  8414. "classic_count": 1,
  8415. "difficulty_count": 1
  8416. };
  8417. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8418. const d = LocalStorageManager.getItem(keyStr);
  8419. jsonStr.classic_count = d.classic_count + 1;
  8420. jsonStr.difficulty_count = d.difficulty_count + 1;
  8421. LocalStorageManager.setItem(keyStr, jsonStr);
  8422. }
  8423. else {
  8424. LocalStorageManager.setItem(keyStr, jsonStr);
  8425. }
  8426. const reqStr = JSON.stringify(jsonStr);
  8427. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8428. }
  8429. logEventForClassic_complete() {
  8430. console.log('zh:logEventForClassic_complete,胜利');
  8431. let rtype = xGame.common.classicRoomType;
  8432. let msmc = '';
  8433. if (rtype == 1) {
  8434. msmc = 'beginner';
  8435. }
  8436. if (rtype == 2) {
  8437. msmc = 'expert';
  8438. }
  8439. if (rtype == 3) {
  8440. msmc = 'master';
  8441. }
  8442. let keyStr = 'sjmd_classic_complete_' + rtype;
  8443. let jsonStr = {
  8444. "msmc": msmc,
  8445. "count": 0
  8446. };
  8447. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8448. const d = LocalStorageManager.getItem(keyStr);
  8449. jsonStr.count = d.count + 1;
  8450. LocalStorageManager.setItem(keyStr, jsonStr);
  8451. }
  8452. else {
  8453. LocalStorageManager.setItem(keyStr, jsonStr);
  8454. }
  8455. if (jsonStr.count % 5 == 0) {
  8456. const reqStr = JSON.stringify(jsonStr);
  8457. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8458. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8459. }
  8460. }
  8461. updatePlaceBallBtn() {
  8462. this.ui.leftBtn.c1.selectedIndex = 5;
  8463. if (this.success) {
  8464. this.ui.rightBtn.c1.selectedIndex = 14;
  8465. }
  8466. else {
  8467. if (xGame.common.placeBallStarNum == 3) {
  8468. this.ui.rightBtn.c1.selectedIndex = 14;
  8469. }
  8470. else {
  8471. this.ui.rightBtn.c1.selectedIndex = 1;
  8472. }
  8473. }
  8474. }
  8475. updatePlaceBallStarNum() {
  8476. let starNum = xGame.common.placeBallStarNum;
  8477. if (starNum == 0)
  8478. this.ui.starNumNode.c1.selectedIndex = 3;
  8479. else {
  8480. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8481. }
  8482. }
  8483. updatePlaceBallAwardState() {
  8484. let level = xGame.common.placeBallCurLevel;
  8485. let starNum = xGame.common.placeBallStarNum;
  8486. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8487. let data = cfgTable.placeballData[level].award;
  8488. let cfg = cfgTable.placeballData[level];
  8489. this.awardDiamondNum = data[1];
  8490. this.awardCoinNum = data[0];
  8491. if (cfg.type == PlaceBallType.challenge) {
  8492. this.awardDiamondNum = 0;
  8493. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8494. }
  8495. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8496. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8497. if (cfg.type == PlaceBallType.challenge) {
  8498. this.ui.awardNode.coinNode.visible = true;
  8499. }
  8500. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8501. this.ui.awardNode.diamondNode.x = 265;
  8502. this.ui.awardNode.coinNode.x = 354;
  8503. }
  8504. else {
  8505. this.ui.awardNode.diamondNode.x = 291;
  8506. this.ui.awardNode.coinNode.x = 291;
  8507. }
  8508. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8509. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8510. if (this.awardCoinNum == 0) {
  8511. this.ui.awardNode.coinNode.numTxt.text = "";
  8512. }
  8513. if (getAward) {
  8514. this.ui.isGetAward.visible = true;
  8515. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8516. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8517. }
  8518. else {
  8519. this.ui.isGetAward.visible = false;
  8520. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8521. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8522. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8523. }
  8524. else {
  8525. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8526. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8527. }
  8528. }
  8529. }
  8530. show(success) {
  8531. super.show();
  8532. xGame.eventMgr.event(RESET_GAME);
  8533. this.success = success;
  8534. Laya.timer.clearAll(this);
  8535. this.playSecretaryAni();
  8536. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8537. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8538. offsetTime = Math.floor(offsetTime / 1000);
  8539. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8540. this.updateType();
  8541. Laya.timer.once(200, this, () => {
  8542. this.addAward(() => {
  8543. this.updateType();
  8544. Laya.timer.once(500, this, () => {
  8545. this.showChallengeLevel();
  8546. });
  8547. });
  8548. });
  8549. if (this.success) {
  8550. JSBridgeUtils.instance.showInternAd('gameend_success');
  8551. console.log('zh:game end 成功');
  8552. xGame.soundMgr.playSound('slots_roll01');
  8553. xGame.soundMgr.playSound("s_win");
  8554. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8555. this.diyGameDataUtilForGameWin();
  8556. this.updateGamePlaceBallData2Server();
  8557. }
  8558. else {
  8559. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8560. console.log('zh:game end失败');
  8561. xGame.soundMgr.playSound('matchwin01');
  8562. xGame.soundMgr.playSound("s_lose");
  8563. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8564. }
  8565. console.log('zh:开始弹出福利框2个');
  8566. Laya.timer.once(1000, this, () => {
  8567. console.log('zh: 1秒后 showFuLiSp1');
  8568. DataMgr.checkForShowFuLi17AndAlert(1);
  8569. });
  8570. let challengeNum = DataMgr.getChallengeTimes();
  8571. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8572. DataMgr.setChallengeTimes(1);
  8573. }
  8574. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8575. DataMgr.setClassicTimes();
  8576. }
  8577. this.setGlobalFont(this.ui);
  8578. }
  8579. diyGameDataUtilForGameWin() {
  8580. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8581. switch (xGame.common.gameMode) {
  8582. case GameMode.classic:
  8583. console.log('zh:DiyGameDataUtilForGameWin 111');
  8584. case GameMode.bigMove:
  8585. console.log('zh:DiyGameDataUtilForGameWin 222');
  8586. this.restartGame();
  8587. break;
  8588. case GameMode.placeBall:
  8589. console.log('zh:DiyGameDataUtilForGameWin 333');
  8590. var level = xGame.common.placeBallCurLevel;
  8591. console.log('zh:练习模式 联系了多少LEV=' + level);
  8592. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8593. if (level > db_over_lev) {
  8594. DataMgr.setChallengeMode_overLev(level);
  8595. }
  8596. break;
  8597. default:
  8598. console.log('zh:DiyGameDataUtilForGameWin 444');
  8599. break;
  8600. }
  8601. }
  8602. updateGamePlaceBallData2Server() {
  8603. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8604. if (userInfo == null) {
  8605. return;
  8606. }
  8607. let pbdObj = DataMgr.getPlaceBallLevelList();
  8608. let reqData = xGame.httpMgr.getReqData();
  8609. let pd = JSON.parse(reqData);
  8610. pd.placeBallData = JSON.stringify(pbdObj);
  8611. reqData = JSON.stringify(pd);
  8612. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8613. try {
  8614. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8615. let code = res.code;
  8616. let msg = res.msg;
  8617. if (code == 401) {
  8618. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8619. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8620. return;
  8621. }
  8622. if (code == 200) {
  8623. let data = res.data;
  8624. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8625. }
  8626. else {
  8627. xGame.uiMgr.Show(UIMsg, msg);
  8628. }
  8629. }
  8630. catch (error) {
  8631. console.log('error=' + error);
  8632. alert(error);
  8633. }
  8634. finally {
  8635. }
  8636. });
  8637. }
  8638. showChallengeLevel() {
  8639. if (DataMgr.getChallengeTimes() != 0)
  8640. return;
  8641. let skill = DataMgr.getSkillAccTimes();
  8642. let put = DataMgr.getPlaceBallLevelList().length;
  8643. if (skill >= 3 || put >= 5) {
  8644. xGame.uiMgr.Show(UIInvitation);
  8645. this.hide();
  8646. }
  8647. }
  8648. addAward(callback) {
  8649. if (!this.success) {
  8650. callback && callback();
  8651. return;
  8652. }
  8653. switch (xGame.common.gameMode) {
  8654. case GameMode.classic:
  8655. this.awardCoinNum = xGame.common.passAwardCoin;
  8656. this.awardDiamondNum = 0;
  8657. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8658. break;
  8659. case GameMode.bigMove:
  8660. this.awardCoinNum = xGame.common.passAwardCoin;
  8661. this.awardDiamondNum = 0;
  8662. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8663. callback && callback();
  8664. break;
  8665. case GameMode.placeBall:
  8666. let level = xGame.common.placeBallCurLevel;
  8667. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8668. if (xGame.common.placeBallStarNum != 3) {
  8669. callback && callback();
  8670. return;
  8671. }
  8672. else {
  8673. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8674. if (getAward) {
  8675. callback && callback();
  8676. return;
  8677. }
  8678. }
  8679. let cfg = cfgTable.placeballData[level];
  8680. let data = cfgTable.placeballData[level].award;
  8681. this.awardCoinNum = data[0];
  8682. this.awardDiamondNum = data[1];
  8683. if (cfg.type == PlaceBallType.challenge) {
  8684. this.awardDiamondNum = 0;
  8685. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8686. }
  8687. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8688. let diamondAward;
  8689. if (this.awardDiamondNum > 0) {
  8690. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8691. xGame.common.getAward([diamondAward, coinAward], callback);
  8692. }
  8693. else {
  8694. xGame.common.getAward([coinAward], callback);
  8695. }
  8696. if (cfg.type == PlaceBallType.normal) {
  8697. DataMgr.setPlaceBallAward(level);
  8698. }
  8699. break;
  8700. default:
  8701. break;
  8702. }
  8703. }
  8704. playSecretaryAni_old() {
  8705. let parent = this.ui.secretary.displayObject;
  8706. parent.destroyChildren();
  8707. let xx = this.ui.secretary.width / 2;
  8708. let yy = this.ui.secretary.height;
  8709. let scale = xGame.common.getSecretaryScale();
  8710. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8711. if (this.success) {
  8712. let rand = Math.random() <= 0.5 ? 2 : 3;
  8713. xGame.common.secretary.play(data, rand, false, parent, () => {
  8714. xGame.common.secretary.play(data, 1, true, parent);
  8715. });
  8716. }
  8717. else {
  8718. xGame.common.secretary.play(data, 0, true, parent);
  8719. }
  8720. }
  8721. playSecretaryAni() {
  8722. let parent = this.ui.secretary.displayObject;
  8723. parent.destroyChildren();
  8724. let xx = this.ui.secretary.width / 2;
  8725. let yy = this.ui.secretary.height;
  8726. let scale = xGame.common.getSecretaryScale();
  8727. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8728. if (this.success) {
  8729. let rand = 0;
  8730. xGame.common.secretary.play(data, 0, true, parent);
  8731. }
  8732. else {
  8733. xGame.common.secretary.play(data, 0, true, parent);
  8734. }
  8735. }
  8736. restartGame() {
  8737. switch (xGame.common.gameMode) {
  8738. case GameMode.classic:
  8739. xGame.eventMgr.event(RESTART_GAME);
  8740. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8741. break;
  8742. case GameMode.bigMove:
  8743. this.hide();
  8744. xGame.eventMgr.event(RESTART_GAME);
  8745. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8746. break;
  8747. default:
  8748. break;
  8749. }
  8750. }
  8751. hide() {
  8752. super.hide();
  8753. xGame.common.stopGirlPop(this.ui.talkNode);
  8754. PlatMgr.showBanner(false);
  8755. }
  8756. returnHome() {
  8757. this.hide();
  8758. let showFailWords = !this.success;
  8759. xGame.uiMgr.Show(UIMain, showFailWords);
  8760. }
  8761. clickLeftBtn() {
  8762. switch (xGame.common.gameMode) {
  8763. case GameMode.classic:
  8764. case GameMode.bigMove:
  8765. this.returnHome();
  8766. break;
  8767. case GameMode.placeBall:
  8768. let level = xGame.common.placeBallCurLevel;
  8769. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8770. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8771. break;
  8772. default:
  8773. break;
  8774. }
  8775. }
  8776. powerStartPlaceBallLevel(level, btn) {
  8777. if (DataMgr.powerEnough()) {
  8778. btn.touchable = false;
  8779. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8780. btn.touchable = true;
  8781. DataMgr.setPower(-1);
  8782. xGame.eventMgr.event(POWER_TIME);
  8783. this.startPlaceBallLevel(level);
  8784. this.logEventForChallenge_level_start(level);
  8785. }));
  8786. }
  8787. else {
  8788. xGame.uiMgr.Show(UIPower, 0);
  8789. }
  8790. }
  8791. clickRightBtn() {
  8792. switch (xGame.common.gameMode) {
  8793. case GameMode.classic:
  8794. console.log('zh:clickRightBtn 111');
  8795. case GameMode.bigMove:
  8796. console.log('zh:clickRightBtn 222');
  8797. this.restartGame();
  8798. break;
  8799. case GameMode.placeBall:
  8800. console.log('zh:clickRightBtn 333');
  8801. let level = xGame.common.placeBallCurLevel;
  8802. let data = DataMgr.getPlaceBallLevel(level);
  8803. let curPss = data.play && !data.isCur;
  8804. if (curPss) {
  8805. console.log('zh:clickRightBtn 333-111');
  8806. console.log('zh:当前LV=' + level);
  8807. if (level == 60) {
  8808. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8809. Laya.timer.once(3000, this, () => {
  8810. this.returnHome();
  8811. });
  8812. }
  8813. else {
  8814. let lev = level + 1;
  8815. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8816. }
  8817. }
  8818. else {
  8819. console.log('zh:clickRightBtn 333-000');
  8820. Moyu.sendDataEvent("placeBallNextLevel");
  8821. console.log('zh:qjff_AD_for_uiGameEnd');
  8822. if (Laya.Browser.onAndroid) {
  8823. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8824. if (!boo) {
  8825. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8826. return;
  8827. }
  8828. }
  8829. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8830. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8831. }
  8832. else {
  8833. console.log('zh:AD 失败,直接发放奖励');
  8834. this.qjff_AD_for_uiGameEnd(level);
  8835. }
  8836. }
  8837. break;
  8838. default:
  8839. console.log('zh:clickRightBtn 444');
  8840. break;
  8841. }
  8842. }
  8843. logEventForChallenge_level_start(level) {
  8844. let keyStr = 'sjmd_challenge_level_start';
  8845. let jsonStr = {
  8846. "count": 0,
  8847. "gold_balance ": DataMgr.getCoin(),
  8848. "level": level,
  8849. "diamond_balance ": DataMgr.getDiamond()
  8850. };
  8851. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8852. const d = LocalStorageManager.getItem(keyStr);
  8853. if (level > d.level) {
  8854. jsonStr.count = d.count + 1;
  8855. LocalStorageManager.setItem(keyStr, jsonStr);
  8856. }
  8857. else {
  8858. }
  8859. }
  8860. else {
  8861. LocalStorageManager.setItem(keyStr, jsonStr);
  8862. }
  8863. const reqStr = JSON.stringify(jsonStr);
  8864. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8865. }
  8866. qjff_AD_for_uiGameEnd(level) {
  8867. DataMgr.setPlaceBallLevel(level, 1);
  8868. this.startPlaceBallLevel(level + 1);
  8869. }
  8870. startPlaceBallLevel(level) {
  8871. xGame.common.gameMode = GameMode.placeBall;
  8872. xGame.common.placeBallCurLevel = level;
  8873. xGame.uiMgr.Show(UIGame);
  8874. this.hide();
  8875. }
  8876. logEventForChallenge_level_complete(level) {
  8877. let keyStr = 'sjmd_challenge_level_complete';
  8878. let jsonStr = {
  8879. "count": 1,
  8880. "gold_balance ": DataMgr.getCoin(),
  8881. "level": level,
  8882. "diamond_balance ": DataMgr.getDiamond()
  8883. };
  8884. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8885. const d = LocalStorageManager.getItem(keyStr);
  8886. jsonStr.count = d.count + 1;
  8887. LocalStorageManager.setItem(keyStr, jsonStr);
  8888. }
  8889. else {
  8890. LocalStorageManager.setItem(keyStr, jsonStr);
  8891. }
  8892. const reqStr = JSON.stringify(jsonStr);
  8893. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8894. }
  8895. logEventForChallenge_level_N(level) {
  8896. console.log('zh:logEventForChallenge_level_N ' + level);
  8897. let keyStr = 'sjmd_challenge_level_N';
  8898. if (LocalStorageManager.hasKey(keyStr)) {
  8899. let lev = LocalStorageManager.getItem(keyStr);
  8900. if (level > lev) {
  8901. LocalStorageManager.setItem(keyStr, level);
  8902. }
  8903. if ((level) % 5 == 0) {
  8904. console.log('zh:每5关上报1次');
  8905. let sjmc = 'challenge_level_' + level;
  8906. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8907. let sjmcForFirebase = 'challenge_level_' + level;
  8908. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8909. }
  8910. else {
  8911. console.log('zh:5 no 上报');
  8912. }
  8913. }
  8914. else {
  8915. LocalStorageManager.setItem(keyStr, level);
  8916. }
  8917. }
  8918. }
  8919. UIGameEnd.uiName = "UIGameEnd";
  8920. class ui_UIVideoShare extends fgui.GComponent {
  8921. static createInstance() {
  8922. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8923. }
  8924. onConstruct() {
  8925. this.n10 = (this.getChild("n10"));
  8926. this.myNode = (this.getChild("myNode"));
  8927. this.t0 = this.getTransition("t0");
  8928. }
  8929. }
  8930. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8931. class UIVideoShare extends UIBase {
  8932. constructor() {
  8933. super();
  8934. this.success = false;
  8935. this.awardNum = 0;
  8936. this.isShared = true;
  8937. }
  8938. onConstructor() {
  8939. this.ui = ui_UIVideoShare.createInstance();
  8940. this.contentPane = this.ui;
  8941. this.isEject = false;
  8942. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8943. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8944. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8945. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8946. }
  8947. show(success) {
  8948. super.show();
  8949. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8950. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8951. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8952. this.success = success;
  8953. let time = xGame.common.randomNum(600, 1500);
  8954. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8955. if (success)
  8956. xGame.soundMgr.playSound("applause");
  8957. this.ui.t0.play();
  8958. this.checkShareState();
  8959. let times = DataMgr.getDailyVideoShareTimes();
  8960. this.awardNum = times == 0 ? 2000 : 200;
  8961. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8962. this.setGlobalFont(this.ui);
  8963. }
  8964. checkShareState() {
  8965. if (PlatMgr.forceShare == 0) {
  8966. this.ui.myNode.closeBtn.visible = true;
  8967. this.ui.myNode.tipsNode.visible = false;
  8968. this.ui.myNode.closeBtn.x = 90;
  8969. this.ui.myNode.shareBtn.x = 342;
  8970. }
  8971. else if (PlatMgr.forceShare == 1) {
  8972. this.ui.myNode.closeBtn.visible = false;
  8973. this.ui.myNode.tipsNode.visible = true;
  8974. this.ui.myNode.shareBtn.x = 218;
  8975. this.isShared = true;
  8976. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8977. }
  8978. }
  8979. checkForceShare() {
  8980. this.isShared = !this.isShared;
  8981. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8982. }
  8983. videoShare() {
  8984. if (PlatMgr.forceShare == 1) {
  8985. if (this.isShared) {
  8986. this.shareGame();
  8987. }
  8988. else {
  8989. this.hideSelf();
  8990. }
  8991. }
  8992. else {
  8993. this.shareGame();
  8994. }
  8995. }
  8996. shareGame() {
  8997. if (2 > 1) {
  8998. this.hideSelf();
  8999. return;
  9000. }
  9001. Moyu.sendDataEvent("VideoShare");
  9002. if (Moyu.canShare() > 100) {
  9003. Moyu.shareGame((success) => {
  9004. if (success) {
  9005. DataMgr.setDailyVideoShareTimes(1);
  9006. DataMgr.setCoin(this.awardNum);
  9007. }
  9008. this.hideSelf();
  9009. }, this);
  9010. }
  9011. else {
  9012. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  9013. this.hideSelf();
  9014. }
  9015. }
  9016. hideSelf() {
  9017. this.hide();
  9018. xGame.uiMgr.Show(UIGameEnd, this.success);
  9019. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  9020. xGame.common.screenImg.destroy();
  9021. xGame.common.screenImg = null;
  9022. }
  9023. }
  9024. }
  9025. UIVideoShare.uiName = "UIVideoShare";
  9026. class GameMgr {
  9027. constructor() {
  9028. this.selfCamp = "";
  9029. this.selfFoulNum = 0;
  9030. this.selfBallArr = [];
  9031. this.selfTimer = 0;
  9032. this.selfScore = 0;
  9033. this.aiCamp = "";
  9034. this.aiFoulNum = 0;
  9035. this.aiBallArr = [];
  9036. this.aiTimer = 0;
  9037. this.aiScore = 0;
  9038. this.aiSkillLevelNum = 1;
  9039. this.targertScore = 0;
  9040. this.setTime = 30;
  9041. this.selfTurnRate = 0.5;
  9042. this.accTime = 0;
  9043. this.curFoul = "";
  9044. this.maxFoulTimes = 3;
  9045. this.isFirstInGame = true;
  9046. this.firstColliObj = null;
  9047. this.inHoleBalls = [];
  9048. this.blackNum = 8;
  9049. this.success = false;
  9050. this.holePosList = [];
  9051. this.posObj = {};
  9052. this._selfTurn = false;
  9053. this.lastRootBallPos = new Laya.Vector2(311, 430);
  9054. this.ensureBallType = false;
  9055. this.isOpenBall = true;
  9056. this.finishOneShoot = true;
  9057. this.isEnd = false;
  9058. this.isChangeTurn = false;
  9059. this.isInterrupt = false;
  9060. this.aiPlayedBreakArmy = false;
  9061. this.isTouchedBall = false;
  9062. this.finishBalls = 0;
  9063. this.needBalls = 0;
  9064. this.allBallNum = 0;
  9065. this.placeBallPosData = {};
  9066. this.curHP = 0;
  9067. this.showLongView = false;
  9068. this.firstShoot = true;
  9069. this._gamePause = false;
  9070. this.trunCount = 0;
  9071. this.isBlackInHole = false;
  9072. this.isEnter = true;
  9073. xGame.eventMgr.offAll(ALL_BALL_STOP);
  9074. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  9075. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  9076. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  9077. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  9078. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  9079. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9080. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9081. }
  9082. get gamePause() {
  9083. return this._gamePause;
  9084. }
  9085. set gamePause(v) {
  9086. if (v) {
  9087. Laya.physicsTimer.pause();
  9088. }
  9089. else {
  9090. Laya.physicsTimer.resume();
  9091. }
  9092. this._gamePause = v;
  9093. }
  9094. get selfTurn() {
  9095. return this._selfTurn;
  9096. }
  9097. set selfTurn(val) {
  9098. this.trunCount++;
  9099. this._selfTurn = val;
  9100. if (val) {
  9101. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9102. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9103. }
  9104. else {
  9105. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9106. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9107. if (this.trunCount > 1)
  9108. PlatMgr.openBox();
  9109. }
  9110. }
  9111. resetGame() {
  9112. this.inHoleBalls = [];
  9113. this.isFirstInGame = true;
  9114. this.firstColliObj = null;
  9115. this.aiCamp = "";
  9116. this.selfCamp = "";
  9117. this.aiFoulNum = 0;
  9118. this.selfFoulNum = 0;
  9119. this.selfBallArr = [];
  9120. this.aiBallArr = [];
  9121. this.gamePause = false;
  9122. this.ensureBallType = false;
  9123. this.isInterrupt = false;
  9124. this.updateLeftBall();
  9125. this.clearTime();
  9126. this.aiPlayedBreakArmy = false;
  9127. this.isBlackInHole = false;
  9128. this.placeBallPosData = {};
  9129. if (xGame.common.d3World.knifeRoot) {
  9130. xGame.common.d3World.knifeRoot.destroyChildren();
  9131. }
  9132. }
  9133. gameReady() {
  9134. this.trunCount = 0;
  9135. this.firstColliObj = null;
  9136. this.isFirstInGame = true;
  9137. this.selfTurn = Math.random() <= this.selfTurnRate;
  9138. let challengeNum = DataMgr.getChallengeTimes();
  9139. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9140. this.selfTurn = true;
  9141. }
  9142. if (xGame.common.gameMode == GameMode.placeBall)
  9143. this.selfTurn = true;
  9144. let ggg = 1;
  9145. if (DataMgr.getGuideDefaultModel() === 1) {
  9146. ggg = DataMgr.getLianXiGuide();
  9147. }
  9148. else {
  9149. ggg = DataMgr.getSkillGuide();
  9150. }
  9151. if (xGame.common.gameMode == GameMode.bigMove && !ggg) {
  9152. this.selfTurn = true;
  9153. }
  9154. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9155. if (DataMgr.getGuideDefaultModel() === 1) {
  9156. this.checkGuideForPlaceBall();
  9157. }
  9158. else {
  9159. this.checkGuide();
  9160. }
  9161. if (xGame.common.uiRodMethod)
  9162. xGame.common.uiRodMethod.resetRod();
  9163. xGame.common.d2World.getHelpLine();
  9164. this.isOpenBall = true;
  9165. this.isTouchedBall = false;
  9166. xGame.common.aiPlayer.stopRun();
  9167. this.setTime = 30;
  9168. let ui = xGame.common.gameUI.ui;
  9169. switch (xGame.common.gameMode) {
  9170. case GameMode.classic:
  9171. xGame.common.aiPlayer.init();
  9172. this.blackNum = 8;
  9173. this.placeRootBall();
  9174. this.peoplePlay(9, 10);
  9175. ui.wordsBtn.visible = true;
  9176. ui.aiWordsBtn.visible = true;
  9177. xGame.common.talkMgr.changeAIState(true);
  9178. DataMgr.gameData.gameCount++;
  9179. DataMgr.saveGameData();
  9180. break;
  9181. case GameMode.bigMove:
  9182. this.blackNum = -1;
  9183. this.selfScore = 0;
  9184. this.aiScore = 0;
  9185. xGame.common.aiPlayer.init();
  9186. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9187. this.updateSelfScore();
  9188. this.updateAIScore();
  9189. this.updateTargetSroce();
  9190. this.placeRootBall();
  9191. this.peoplePlay(9, 10);
  9192. ui.wordsBtn.visible = true;
  9193. ui.aiWordsBtn.visible = true;
  9194. xGame.common.talkMgr.changeAIState(true);
  9195. if (DataMgr.getSkillGuide() < 1)
  9196. DataMgr.gameData.gameCount = 0;
  9197. else {
  9198. DataMgr.gameData.gameCount++;
  9199. DataMgr.saveGameData();
  9200. PlatMgr.openTry();
  9201. }
  9202. if (xGame.common.d3World.knifeRoot) {
  9203. xGame.common.d3World.knifeRoot.destroyChildren();
  9204. }
  9205. break;
  9206. case GameMode.placeBall:
  9207. this.blackNum = -1;
  9208. this.selfTurn = true;
  9209. this.setTime = 10000;
  9210. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9211. this.curHP = this.placeBallData.hp;
  9212. if (this.placeBallData.ball == -1)
  9213. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9214. else
  9215. this.needBalls = this.placeBallData.ball;
  9216. console.log("需要的进球数目", this.needBalls);
  9217. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9218. this.finishBalls = 0;
  9219. this.placeBallPosData = {};
  9220. this.updatePlaceBallPos();
  9221. this.updatePlaceBallState();
  9222. this.finishOneShoot = true;
  9223. xGame.common.gameUI.ui.moveNode.visible = false;
  9224. this.isOpenBall = false;
  9225. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9226. ui.wordsBtn.visible = false;
  9227. ui.aiWordsBtn.visible = false;
  9228. xGame.common.talkMgr.changeAIState(false);
  9229. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9230. PlatMgr.openBox();
  9231. });
  9232. break;
  9233. default:
  9234. break;
  9235. }
  9236. this.showLongView = false;
  9237. xGame.common.wordsMgr.comboTimes = 1;
  9238. if (DataMgr.getGuideDefaultModel() === 1) {
  9239. let guide = DataMgr.getLianXiGuide();
  9240. }
  9241. else {
  9242. let guide = DataMgr.getSkillGuide();
  9243. if (guide)
  9244. xGame.eventMgr.event(WAIT_SHOOT);
  9245. }
  9246. xGame.common.upSkillLevel = false;
  9247. xGame.common.gameStartTime = new Date().getTime();
  9248. this.firstShoot = true;
  9249. }
  9250. checkGuide() {
  9251. console.log('zh: 检查引导123');
  9252. let guide = DataMgr.getSkillGuide();
  9253. let gameUI = xGame.common.gameUI.ui;
  9254. gameUI.guide1.visible = false;
  9255. gameUI.guide2.visible = false;
  9256. gameUI.guide3.visible = false;
  9257. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9258. this.selfTurn = true;
  9259. }
  9260. else {
  9261. return;
  9262. }
  9263. let oneBall = this.getOneBall();
  9264. gameUI.guide1.visible = true;
  9265. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9266. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9267. }
  9268. checkGuideForPlaceBall() {
  9269. console.log('zh: 检查引导123 checkGuideForPlaceBall');
  9270. let gameUI = xGame.common.gameUI.ui;
  9271. let guide = DataMgr.getLianXiGuide();
  9272. console.log('zh:checkGuideForPlaceBall =', guide);
  9273. console.log('zh:xGame.common.gameMode=' + xGame.common.gameMode);
  9274. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  9275. gameUI.n_lxms_yd1.visible = true;
  9276. let oneBall = this.getOneBallForPlaceBall();
  9277. gameUI.n_lxms_yd1.fingerNode.x = oneBall.gameObj.x + 30;
  9278. gameUI.n_lxms_yd1.fingerNode.y = oneBall.gameObj.y + 15;
  9279. }
  9280. else {
  9281. gameUI.n_lxms_yd1.visible = false;
  9282. return;
  9283. }
  9284. }
  9285. getOneBall() {
  9286. let arr = xGame.common.d2World.ballArr;
  9287. for (let index = 0; index < arr.length; index++) {
  9288. if (arr[index].number == 0)
  9289. continue;
  9290. return arr[index];
  9291. }
  9292. }
  9293. getOneBallForPlaceBall() {
  9294. let arr = xGame.common.d2World.ballArr;
  9295. return arr[2];
  9296. }
  9297. updateSelfScore() {
  9298. let ui = xGame.common.gameUI.ui.topNode;
  9299. ui.selfScoreTxt.text = this.selfScore + "";
  9300. }
  9301. updateAIScore() {
  9302. let ui = xGame.common.gameUI.ui.topNode;
  9303. ui.aiScoreTxt.text = this.aiScore + "";
  9304. }
  9305. updateTargetSroce() {
  9306. let ui = xGame.common.gameUI.ui.topNode;
  9307. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9308. }
  9309. updateLeftBall() {
  9310. let topUI = xGame.common.gameUI.ui.topNode;
  9311. topUI.selfBallList.numItems = this.selfBallArr.length;
  9312. topUI.aiBallList.numItems = this.aiBallArr.length;
  9313. }
  9314. ballShoot() {
  9315. this.clearTime();
  9316. this.finishOneShoot = false;
  9317. xGame.common.gameUI.ui.moveNode.visible = false;
  9318. if (xGame.common.gameUI.ui.guideNode.visible) {
  9319. xGame.common.gameUI.ui.guideNode.visible = false;
  9320. }
  9321. if (this.firstShoot) {
  9322. this.firstShoot = false;
  9323. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9324. }
  9325. }
  9326. ensureCamp(number) {
  9327. this.ensureBallType = true;
  9328. this.isOpenBall = false;
  9329. if (xGame.common.gameMode != GameMode.classic)
  9330. return;
  9331. let full = [1, 2, 3, 4, 5, 6, 7];
  9332. let flower = [9, 10, 11, 12, 13, 14, 15];
  9333. let sayWords = "";
  9334. if (this.selfTurn) {
  9335. if (number <= 7) {
  9336. this.selfCamp = ballCamp.full;
  9337. this.selfBallArr = full;
  9338. this.aiCamp = ballCamp.flower;
  9339. this.aiBallArr = flower;
  9340. sayWords = cfgTable.wordsData[3].msg;
  9341. }
  9342. else {
  9343. this.selfCamp = ballCamp.flower;
  9344. this.selfBallArr = flower;
  9345. this.aiCamp = ballCamp.full;
  9346. this.aiBallArr = full;
  9347. sayWords = cfgTable.wordsData[4].msg;
  9348. }
  9349. }
  9350. else {
  9351. if (number <= 7) {
  9352. this.selfCamp = ballCamp.flower;
  9353. this.selfBallArr = flower;
  9354. this.aiCamp = ballCamp.full;
  9355. this.aiBallArr = full;
  9356. sayWords = cfgTable.wordsData[2].msg;
  9357. }
  9358. else {
  9359. this.selfCamp = ballCamp.full;
  9360. this.selfBallArr = full;
  9361. this.aiCamp = ballCamp.flower;
  9362. this.aiBallArr = flower;
  9363. sayWords = cfgTable.wordsData[1].msg;
  9364. }
  9365. }
  9366. this.updateLeftBall();
  9367. xGame.uiMgr.Show(UIMsg, sayWords);
  9368. }
  9369. updatePlaceBallState() {
  9370. let ui = xGame.common.gameUI.ui;
  9371. switch (this.placeBallData.type) {
  9372. case PlaceBallType.normal:
  9373. let normal = ui.placeNormalNode;
  9374. normal.hpTxt.text = this.curHP + "";
  9375. this.updatePlaceBallStar(normal);
  9376. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9377. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9378. break;
  9379. case PlaceBallType.challenge:
  9380. let challenge = ui.placeChallengeNode;
  9381. challenge.hpTxt.text = "Shots:" + this.curHP;
  9382. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9383. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9384. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9385. break;
  9386. default:
  9387. break;
  9388. }
  9389. }
  9390. playSubHpAni() {
  9391. let ui = xGame.common.gameUI.ui;
  9392. switch (this.placeBallData.type) {
  9393. case PlaceBallType.normal:
  9394. let normal = ui.placeNormalNode;
  9395. normal.hpTxt.visible = false;
  9396. normal.starAni.c1.selectedIndex = 1;
  9397. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9398. normal.hpTxt.visible = true;
  9399. normal.starAni.c1.selectedIndex = 0;
  9400. }));
  9401. break;
  9402. default:
  9403. break;
  9404. }
  9405. }
  9406. getEndStarNum() {
  9407. let num;
  9408. let level = xGame.common.placeBallCurLevel;
  9409. if (this.curHP == this.placeBallData.hp) {
  9410. num = 3;
  9411. }
  9412. else if (this.curHP <= 1) {
  9413. num = 1;
  9414. }
  9415. else {
  9416. num = 2;
  9417. }
  9418. if (!this.success) {
  9419. num = 0;
  9420. }
  9421. else {
  9422. DataMgr.setPlaceBallLevel(level, num);
  9423. }
  9424. let myType = cfgTable.placeballData[level].type;
  9425. if (this.success && myType == 1) {
  9426. num = 3;
  9427. }
  9428. xGame.common.placeBallStarNum = num;
  9429. }
  9430. updatePlaceBallStar(node) {
  9431. let star = 0;
  9432. if (this.curHP == this.placeBallData.hp) {
  9433. star = 3;
  9434. }
  9435. else if (this.curHP >= 2) {
  9436. star = 2;
  9437. }
  9438. else if (this.curHP == 1) {
  9439. star = 1;
  9440. }
  9441. else {
  9442. star = 0;
  9443. }
  9444. let temp;
  9445. for (let index = 1; index <= 3; index++) {
  9446. temp = node["star" + index];
  9447. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9448. }
  9449. node.myProgress.value = (star / 3) * 100;
  9450. }
  9451. openRegretView(isFoul, GoalNum, challenge = false) {
  9452. let regretType = -1;
  9453. if (isFoul) {
  9454. regretType = 1;
  9455. }
  9456. else {
  9457. if (GoalNum <= 0) {
  9458. regretType = 0;
  9459. }
  9460. }
  9461. if (challenge) {
  9462. regretType = 1;
  9463. }
  9464. if (regretType != -1) {
  9465. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9466. if (success) {
  9467. this.curHP++;
  9468. this.updatePlaceBallState();
  9469. this.setPlaceBallAllPos();
  9470. xGame.common.gameUI.ui.moveNode.visible = false;
  9471. }
  9472. else {
  9473. if (this.curHP <= 0) {
  9474. this.success = false;
  9475. this.gameEnd();
  9476. }
  9477. this.playSubHpAni();
  9478. }
  9479. this.updatePlaceBallState();
  9480. this.updatePlaceBallPos();
  9481. });
  9482. }
  9483. }
  9484. setPlaceBallAllPos() {
  9485. let allBall = xGame.common.d2World.ballArr;
  9486. let cfgArr = this.placeBallPosData;
  9487. let temp;
  9488. let obj;
  9489. for (let index = 0; index < allBall.length; index++) {
  9490. temp = allBall[index];
  9491. if (temp.destroyed)
  9492. continue;
  9493. obj = cfgArr[temp.myUNID];
  9494. if (obj && obj.src && !obj.src.destroyed) {
  9495. temp.gameObj.x = obj.posX;
  9496. temp.gameObj.y = obj.posY;
  9497. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9498. }
  9499. }
  9500. xGame.common.d2World.getHelpLine();
  9501. }
  9502. updatePlaceBallPos() {
  9503. let arr = xGame.common.d2World.ballArr;
  9504. let temp;
  9505. for (let index = 0; index < arr.length; index++) {
  9506. temp = arr[index];
  9507. if (!this.placeBallPosData[temp.myUNID]) {
  9508. this.placeBallPosData[temp.myUNID] = {
  9509. src: temp,
  9510. posX: temp.gameObj.x,
  9511. posY: temp.gameObj.y
  9512. };
  9513. }
  9514. else {
  9515. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9516. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9517. }
  9518. }
  9519. let check;
  9520. for (const key in this.placeBallPosData) {
  9521. check = this.placeBallPosData[key];
  9522. if (check.src.destroyed) {
  9523. delete this.placeBallPosData[key];
  9524. }
  9525. }
  9526. }
  9527. gameRun(type) {
  9528. if (this.gamePause)
  9529. return;
  9530. this.curFoul = this.getFoulType();
  9531. if (type) {
  9532. xGame.common.d2World.d2Gan.shoot();
  9533. xGame.common.gameUI.forceCancel();
  9534. this.curFoul = type;
  9535. }
  9536. this.isEnd = false;
  9537. this.isChangeTurn = true;
  9538. if (xGame.common.gameMode == GameMode.classic) {
  9539. this.judgeClassic(this.curFoul);
  9540. this.checkClassicWords(() => {
  9541. xGame.common.destroyClassicEmotion();
  9542. if (this.isEnd) {
  9543. if (this.isBlackInHole) {
  9544. xGame.common.gameUI.ui.blackAni.visible = true;
  9545. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9546. xGame.common.gameUI.ui.blackAni.visible = false;
  9547. this.gameEnd();
  9548. }));
  9549. }
  9550. else {
  9551. this.gameEnd();
  9552. }
  9553. }
  9554. else {
  9555. this.waitShoot();
  9556. xGame.eventMgr.event(WAIT_SHOOT);
  9557. }
  9558. });
  9559. }
  9560. else if (xGame.common.gameMode == GameMode.bigMove) {
  9561. xGame.common.aiPlayer.stopRun();
  9562. let scoreArr = this.getScore(this.curFoul);
  9563. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9564. this.isEnd = true;
  9565. }
  9566. this.checkBigSkillWords(() => {
  9567. if (this.isEnd) {
  9568. this.gameEnd();
  9569. }
  9570. else {
  9571. this.waitShoot();
  9572. xGame.eventMgr.event(WAIT_SHOOT);
  9573. }
  9574. });
  9575. }
  9576. else if (xGame.common.gameMode == GameMode.placeBall) {
  9577. xGame.common.destroyAwardSpine();
  9578. let isFoul = this.curFoul == FoulType.rootHole;
  9579. let GoalNum = this.inHoleBalls.length;
  9580. if (this.inHoleBalls.indexOf(0) > -1)
  9581. GoalNum -= 1;
  9582. if (isFoul) {
  9583. this.placeRootBall();
  9584. }
  9585. console.log("neeballs", this.needBalls);
  9586. console.log("当前完成的goalNum", GoalNum);
  9587. this.finishBalls += GoalNum;
  9588. console.log("当前完成的finishballs", this.finishBalls);
  9589. let need = this.needBalls;
  9590. if (this.placeBallData.type == PlaceBallType.challenge) {
  9591. need += 100;
  9592. }
  9593. if (this.finishBalls >= need) {
  9594. this.success = true;
  9595. this.gameEnd();
  9596. }
  9597. else {
  9598. switch (this.placeBallData.type) {
  9599. case PlaceBallType.normal:
  9600. if (!isFoul && GoalNum > 0) {
  9601. this.updatePlaceBallPos();
  9602. this.updatePlaceBallState();
  9603. }
  9604. else {
  9605. this.curHP--;
  9606. this.openRegretView(isFoul, GoalNum);
  9607. }
  9608. this.waitShoot();
  9609. xGame.eventMgr.event(WAIT_SHOOT);
  9610. break;
  9611. case PlaceBallType.challenge:
  9612. this.curHP--;
  9613. this.updatePlaceBallState();
  9614. if (isFoul) {
  9615. this.openRegretView(isFoul, GoalNum, true);
  9616. }
  9617. else {
  9618. this.updatePlaceBallPos();
  9619. if (this.curHP <= 0) {
  9620. this.success = true;
  9621. this.gameEnd();
  9622. }
  9623. }
  9624. this.waitShoot();
  9625. xGame.eventMgr.event(WAIT_SHOOT);
  9626. break;
  9627. default:
  9628. break;
  9629. }
  9630. }
  9631. }
  9632. }
  9633. checkClassicWords(callback) {
  9634. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9635. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9636. let type = this.getClassicWordsType();
  9637. if (condition && type != -1) {
  9638. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9639. xGame.soundMgr.playSound(str);
  9640. xGame.common.wordsMgr.playClassicWords(type, callback);
  9641. }
  9642. else {
  9643. Laya.timer.once(300, this, () => {
  9644. callback && callback();
  9645. });
  9646. }
  9647. }
  9648. getClassicWordsType() {
  9649. let d2world = xGame.common.d2World;
  9650. let type = -1;
  9651. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9652. type = ClassicWordsType.perfectShow;
  9653. return type;
  9654. }
  9655. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9656. type = ClassicWordsType.directShoot;
  9657. return type;
  9658. }
  9659. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9660. type = ClassicWordsType.anotherShoot;
  9661. return type;
  9662. }
  9663. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9664. type = ClassicWordsType.bigPower;
  9665. return type;
  9666. }
  9667. let minSpeed = 1;
  9668. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9669. type = ClassicWordsType.hardShoot;
  9670. return type;
  9671. }
  9672. if (this.inHoleBalls.length > 0) {
  9673. type = ClassicWordsType.directShoot;
  9674. return type;
  9675. }
  9676. return type;
  9677. }
  9678. checkBigSkillWords(callback) {
  9679. if (this.curFoul == FoulType.timeOut) {
  9680. callback && callback();
  9681. }
  9682. else {
  9683. let playSkill = false;
  9684. if (this.selfTurn) {
  9685. playSkill = true;
  9686. }
  9687. else {
  9688. if (!this.aiPlayedBreakArmy) {
  9689. this.aiPlayedBreakArmy = true;
  9690. playSkill = true;
  9691. }
  9692. if (this.aiCurSkill != SkillType.breakArmy) {
  9693. playSkill = true;
  9694. }
  9695. }
  9696. if (xGame.common.skillMgr.playedLastSkill) {
  9697. xGame.common.skillMgr.playedLastSkill = false;
  9698. playSkill = false;
  9699. }
  9700. if (playSkill) {
  9701. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9702. let selfExtra = 0;
  9703. let aiExtra = 0;
  9704. if (this.selfTurn)
  9705. selfExtra += extraScore;
  9706. else
  9707. aiExtra += extraScore;
  9708. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9709. this.isEnd = true;
  9710. }
  9711. this.playBigSkillTimes(callback);
  9712. });
  9713. }
  9714. else {
  9715. this.playBigSkillTimes(callback);
  9716. }
  9717. }
  9718. }
  9719. playBigSkillTimes(callback) {
  9720. let length = this.inHoleBalls.length;
  9721. if (this.inHoleBalls.indexOf(0) > -1) {
  9722. length = this.inHoleBalls.length - 1;
  9723. }
  9724. if (length <= 0) {
  9725. callback && callback();
  9726. return;
  9727. }
  9728. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9729. callback && callback();
  9730. });
  9731. }
  9732. playSkillTips() {
  9733. let levelNum = 0;
  9734. let curType;
  9735. if (this.selfTurn) {
  9736. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9737. curType = this.selfCurSkill;
  9738. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9739. levelNum += 5;
  9740. }
  9741. }
  9742. else {
  9743. levelNum = this.aiSkillLevelNum;
  9744. curType = this.aiCurSkill;
  9745. }
  9746. let str = ``;
  9747. switch (curType) {
  9748. case SkillType.highSpace:
  9749. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9750. break;
  9751. case SkillType.breakArmy:
  9752. str = `You pocketed ${levelNum} extra balls`;
  9753. break;
  9754. case SkillType.ice:
  9755. str = `${levelNum * 2} extra balls were frozen`;
  9756. break;
  9757. case SkillType.fireworks:
  9758. str = `${levelNum} extra balls exploded `;
  9759. break;
  9760. case SkillType.GuanYu:
  9761. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9762. break;
  9763. default:
  9764. break;
  9765. }
  9766. xGame.uiMgr.Show(UIMsg, str);
  9767. }
  9768. getFoulType() {
  9769. let foulType = "";
  9770. if (this.firstColliObj == null) {
  9771. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9772. return FoulType.rootHole;
  9773. }
  9774. return FoulType.notTouch;
  9775. }
  9776. else {
  9777. if (this.selfTurn) {
  9778. if (this.selfBallArr.length > 0) {
  9779. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9780. foulType = FoulType.wrongTouch;
  9781. }
  9782. }
  9783. else {
  9784. if (this.ensureBallType) {
  9785. }
  9786. else {
  9787. if (this.firstColliObj == this.blackNum) {
  9788. foulType = FoulType.wrongTouch;
  9789. }
  9790. }
  9791. }
  9792. }
  9793. else {
  9794. if (this.aiBallArr.length > 0) {
  9795. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9796. foulType = FoulType.wrongTouch;
  9797. }
  9798. }
  9799. else {
  9800. if (this.ensureBallType) {
  9801. }
  9802. else {
  9803. if (this.firstColliObj == this.blackNum) {
  9804. foulType = FoulType.wrongTouch;
  9805. }
  9806. }
  9807. }
  9808. }
  9809. if (this.inHoleBalls.length <= 0) {
  9810. return foulType;
  9811. }
  9812. let temp;
  9813. if (this.inHoleBalls.indexOf(0) > -1) {
  9814. foulType = FoulType.rootHole;
  9815. }
  9816. else {
  9817. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9818. temp = this.inHoleBalls[index];
  9819. if (this.selfTurn) {
  9820. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9821. foulType = FoulType.wrongHole;
  9822. break;
  9823. }
  9824. }
  9825. else {
  9826. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9827. foulType = FoulType.wrongHole;
  9828. break;
  9829. }
  9830. }
  9831. }
  9832. }
  9833. let foo;
  9834. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9835. temp = this.inHoleBalls[index];
  9836. foo = this.selfBallArr.indexOf(temp);
  9837. if (foo > -1) {
  9838. this.selfBallArr.splice(foo, 1);
  9839. }
  9840. foo = this.aiBallArr.indexOf(temp);
  9841. if (foo > -1) {
  9842. this.aiBallArr.splice(foo, 1);
  9843. }
  9844. }
  9845. this.updateLeftBall();
  9846. }
  9847. return foulType;
  9848. }
  9849. judgeGameEndByBlack(arr) {
  9850. if (this.selfTurn) {
  9851. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9852. this.selfFoulNum = this.maxFoulTimes;
  9853. return true;
  9854. }
  9855. }
  9856. else {
  9857. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9858. this.aiFoulNum = this.maxFoulTimes;
  9859. return true;
  9860. }
  9861. }
  9862. }
  9863. judgeClassic(type) {
  9864. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9865. xGame.common.aiPlayer.stopRun();
  9866. if (this.judgeNormalSuccess()) {
  9867. this.isEnd = true;
  9868. return;
  9869. }
  9870. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9871. if (this.selfTurn) {
  9872. if (isFoul) {
  9873. this.selfFoulNum++;
  9874. }
  9875. if (this.selfFoulNum >= this.maxFoulTimes) {
  9876. this.success = false;
  9877. this.isEnd = true;
  9878. return;
  9879. }
  9880. }
  9881. else {
  9882. if (isFoul)
  9883. this.aiFoulNum++;
  9884. if (this.aiFoulNum >= this.maxFoulTimes) {
  9885. this.success = true;
  9886. this.isEnd = true;
  9887. return;
  9888. }
  9889. }
  9890. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9891. this.isChangeTurn = false;
  9892. }
  9893. else {
  9894. this.isInterrupt = true;
  9895. }
  9896. }
  9897. waitShoot() {
  9898. if (xGame.common.gameMode == GameMode.classic) {
  9899. switch (this.curFoul) {
  9900. case FoulType.timeOut:
  9901. case FoulType.rootHole:
  9902. this.selfTurn = !this.selfTurn;
  9903. this.peoplePlay(5, 6, true);
  9904. break;
  9905. case FoulType.notTouch:
  9906. this.selfTurn = !this.selfTurn;
  9907. this.peoplePlay(7, 7);
  9908. break;
  9909. case FoulType.wrongHole:
  9910. this.selfTurn = !this.selfTurn;
  9911. this.peoplePlay(11, 11);
  9912. break;
  9913. default:
  9914. if (this.inHoleBalls.length > 0) {
  9915. this.peoplePlay(0, 0, false, false);
  9916. }
  9917. else {
  9918. this.selfTurn = !this.selfTurn;
  9919. this.peoplePlay(7, 7);
  9920. }
  9921. break;
  9922. }
  9923. }
  9924. else if (xGame.common.gameMode == GameMode.bigMove) {
  9925. if (this.curFoul == FoulType.timeOut) {
  9926. this.selfTurn = !this.selfTurn;
  9927. this.peoplePlay(14, 15);
  9928. this.placeRootBall();
  9929. }
  9930. else {
  9931. this.selfTurn = !this.selfTurn;
  9932. if (this.curFoul == FoulType.rootHole) {
  9933. this.peoplePlay(12, 13);
  9934. this.placeRootBall();
  9935. }
  9936. else {
  9937. this.peoplePlay(0, 0, false, false);
  9938. }
  9939. }
  9940. }
  9941. else if (xGame.common.gameMode == GameMode.placeBall) {
  9942. this.finishOneShoot = true;
  9943. }
  9944. this.gameResult();
  9945. }
  9946. gameResult() {
  9947. this.firstColliObj = null;
  9948. this.inHoleBalls = [];
  9949. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9950. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9951. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9952. if (xGame.common.uiRodMethod)
  9953. xGame.common.uiRodMethod.resetRod();
  9954. xGame.common.d2World.rootBall.showSelf();
  9955. this.clearIceSkill();
  9956. if (this.selfTurn) {
  9957. PlatMgr.gameInsert();
  9958. }
  9959. xGame.common.d3World.knifeRoot.destroyChildren();
  9960. if (this.selfTurn) {
  9961. xGame.common.gameUI.showHelpLineGuide();
  9962. xGame.common.gameUI.setTurnAlpha(true);
  9963. }
  9964. else {
  9965. xGame.common.gameUI.setTurnAlpha(false);
  9966. }
  9967. }
  9968. getScore(type) {
  9969. let selfAdd = 0;
  9970. let aiAdd = 0;
  9971. if (type == FoulType.timeOut) {
  9972. if (this.selfTurn)
  9973. aiAdd += 3;
  9974. else
  9975. selfAdd += 3;
  9976. }
  9977. else {
  9978. if (this.inHoleBalls.length > 0) {
  9979. if (this.selfTurn) {
  9980. if (type == FoulType.rootHole) {
  9981. aiAdd += 3;
  9982. if (this.inHoleBalls.length - 1 > 0) {
  9983. selfAdd += this.inHoleBalls.length - 1;
  9984. }
  9985. }
  9986. else {
  9987. selfAdd += this.inHoleBalls.length;
  9988. }
  9989. }
  9990. else {
  9991. if (type == FoulType.rootHole) {
  9992. selfAdd += 3;
  9993. if (this.inHoleBalls.length - 1 > 0) {
  9994. aiAdd += this.inHoleBalls.length - 1;
  9995. }
  9996. }
  9997. else {
  9998. aiAdd += this.inHoleBalls.length;
  9999. }
  10000. }
  10001. }
  10002. }
  10003. return [selfAdd, aiAdd];
  10004. }
  10005. judgeScoreEnd(selfAdd, aiAdd) {
  10006. this.selfScore += selfAdd;
  10007. this.aiScore += aiAdd;
  10008. this.updateAIScore();
  10009. this.updateSelfScore();
  10010. if (this.selfScore >= this.targertScore) {
  10011. this.success = true;
  10012. return true;
  10013. }
  10014. if (this.aiScore >= this.targertScore) {
  10015. this.success = false;
  10016. return true;
  10017. }
  10018. let ballArr = xGame.common.d2World.ballArr;
  10019. if (ballArr.length == 1 && ballArr[0].number == 0) {
  10020. if (this.selfScore > this.aiScore) {
  10021. this.success = true;
  10022. return true;
  10023. }
  10024. else if (this.selfScore < this.aiScore) {
  10025. this.success = false;
  10026. return true;
  10027. }
  10028. else {
  10029. if (this.selfTurn) {
  10030. this.success = false;
  10031. }
  10032. else {
  10033. this.success = true;
  10034. }
  10035. return true;
  10036. }
  10037. }
  10038. }
  10039. clearIceSkill() {
  10040. let arr = xGame.common.d2World.ballArr;
  10041. let temp;
  10042. if (this.selfTurn) {
  10043. if (this.selfCurSkill == SkillType.ice) {
  10044. for (let index = 0; index < arr.length; index++) {
  10045. temp = arr[index];
  10046. if (temp.ballFunc == "ice") {
  10047. temp.setBallFunc("normal", "self");
  10048. }
  10049. }
  10050. }
  10051. }
  10052. else {
  10053. if (this.aiCurSkill == SkillType.ice) {
  10054. for (let index = 0; index < arr.length; index++) {
  10055. temp = arr[index];
  10056. if (temp.ballFunc == "ice") {
  10057. temp.setBallFunc("normal", "ai");
  10058. }
  10059. }
  10060. }
  10061. }
  10062. }
  10063. judgeNormalSuccess() {
  10064. if (this.selfTurn) {
  10065. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  10066. this.success = true;
  10067. return true;
  10068. }
  10069. }
  10070. else {
  10071. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  10072. this.success = false;
  10073. return true;
  10074. }
  10075. }
  10076. }
  10077. gameEnd() {
  10078. if (Moyu.isTT) {
  10079. xGame.common.screenImg = getScreenImg();
  10080. }
  10081. console.log("游戏结束", this.success);
  10082. xGame.common.aiPlayer.stopRun();
  10083. if (xGame.common.gameMode == GameMode.placeBall) {
  10084. this.getEndStarNum();
  10085. this.updatePlaceBallState();
  10086. }
  10087. this.isEnter = false;
  10088. Moyu.recordEnd(this, () => {
  10089. if (this.isEnter)
  10090. return;
  10091. this.isEnter = true;
  10092. console.log("进入录结束回调");
  10093. this.enterNext();
  10094. });
  10095. Laya.timer.once(1000, this, () => {
  10096. if (this.isEnter)
  10097. return;
  10098. this.isEnter = true;
  10099. this.enterNext();
  10100. });
  10101. xGame.common.longHelpLine = false;
  10102. }
  10103. enterNext() {
  10104. Laya.timer.clearAll(this);
  10105. if (Moyu.canShare() > 100 || Moyu.isKs) {
  10106. xGame.uiMgr.Show(UIVideoShare, this.success);
  10107. }
  10108. else {
  10109. xGame.uiMgr.Show(UIGameEnd, this.success);
  10110. }
  10111. }
  10112. aiLeave() {
  10113. let ui = xGame.common.gameUI.ui;
  10114. ui.topNode.aiNameTxt.text = "offline";
  10115. }
  10116. aiGameEnd(suc) {
  10117. this.success = suc;
  10118. xGame.common.aiPlayer.stopRun();
  10119. if (this.success) {
  10120. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10121. Laya.timer.once(1000, this, () => {
  10122. this.clearTime();
  10123. this.gameEnd();
  10124. });
  10125. }
  10126. }
  10127. openTimer() {
  10128. let src = xGame.common.gameUI;
  10129. if (this.selfTurn) {
  10130. src.ui.topNode.selfProgress.visible = true;
  10131. src.ui.topNode.aiProgress.visible = false;
  10132. this.curTimer = src.ui.topNode.selfProgress;
  10133. }
  10134. else {
  10135. src.ui.topNode.selfProgress.visible = false;
  10136. src.ui.topNode.aiProgress.visible = true;
  10137. this.curTimer = src.ui.topNode.aiProgress;
  10138. }
  10139. this.accTime = 0;
  10140. Laya.timer.clearAll(this);
  10141. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10142. this.curTimer.value = 100;
  10143. }
  10144. updateTime(dt) {
  10145. if (this.gamePause)
  10146. return;
  10147. this.accTime += dt;
  10148. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10149. if (this.accTime >= this.setTime) {
  10150. this.clearTime();
  10151. console.log("时钟进入了gameRun");
  10152. this.gameRun(FoulType.timeOut);
  10153. }
  10154. }
  10155. clearTime() {
  10156. let src = xGame.common.gameUI;
  10157. src.ui.topNode.selfProgress.visible = false;
  10158. src.ui.topNode.aiProgress.visible = false;
  10159. Laya.timer.clearAll(this);
  10160. }
  10161. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10162. let ui = xGame.common.gameUI.ui;
  10163. let selfMsg, aiMsg;
  10164. if (sayWords) {
  10165. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10166. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10167. if (Foul) {
  10168. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10169. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10170. this.placeRootBall();
  10171. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10172. if (this.curFoul == FoulType.rootHole) {
  10173. if (!DataMgr.getRootBallFoul()) {
  10174. DataMgr.setRootBallFoul();
  10175. aiMsg = "";
  10176. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10177. let woman = "Boss, pay attention next time~";
  10178. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10179. }
  10180. }
  10181. else if (this.curFoul == FoulType.timeOut) {
  10182. if (!DataMgr.getTimeoutFoul()) {
  10183. DataMgr.setTimeoutFoul();
  10184. aiMsg = "";
  10185. let tips = "Game timeout, 3 fouls, this game failed.";
  10186. let woman = "Boss, pay attention to the timeline~";
  10187. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10188. }
  10189. }
  10190. }
  10191. }
  10192. }
  10193. if (this.selfTurn) {
  10194. if (sayWords) {
  10195. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10196. ui.selfTurn.visible = true;
  10197. ui.aiTurn.visible = false;
  10198. ui.selfTurn.t0.play();
  10199. Moyu.vibration();
  10200. });
  10201. }
  10202. }
  10203. else {
  10204. let aiNum = xGame.tools.random(1, 11);
  10205. let challengeNum = DataMgr.getChallengeTimes();
  10206. let delay = false;
  10207. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10208. aiNum = 9;
  10209. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10210. aiNum = 3;
  10211. if (challengeNum == 3) {
  10212. if (!this.showLongView) {
  10213. this.showLongView = true;
  10214. delay = true;
  10215. }
  10216. }
  10217. }
  10218. }
  10219. if (delay) {
  10220. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10221. if (success) {
  10222. xGame.common.longHelpLine = true;
  10223. xGame.common.d2World.getHelpLine();
  10224. }
  10225. else {
  10226. aiNum = 10;
  10227. }
  10228. xGame.common.aiPlayer.setAiLevel(aiNum);
  10229. if (sayWords) {
  10230. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10231. xGame.common.aiPlayer.runAI();
  10232. ui.selfTurn.visible = false;
  10233. ui.aiTurn.visible = true;
  10234. ui.aiTurn.t0.play();
  10235. });
  10236. }
  10237. else {
  10238. xGame.common.aiPlayer.runAI();
  10239. }
  10240. this.openTimer();
  10241. this.finishOneShoot = true;
  10242. if (this.selfTurn) {
  10243. ui.topNode.selfKuang.visible = true;
  10244. ui.topNode.aiKuang.visible = false;
  10245. ui.topNode.selfTips.visible = true;
  10246. ui.topNode.aiTips.visible = false;
  10247. }
  10248. else {
  10249. ui.topNode.selfKuang.visible = false;
  10250. ui.topNode.aiKuang.visible = true;
  10251. ui.topNode.selfTips.visible = false;
  10252. ui.topNode.aiTips.visible = true;
  10253. }
  10254. });
  10255. return;
  10256. }
  10257. if (xGame.common.gameMode == GameMode.classic) {
  10258. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10259. if (cfg) {
  10260. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10261. aiNum = aiLevel;
  10262. }
  10263. }
  10264. xGame.common.aiPlayer.setAiLevel(aiNum);
  10265. if (sayWords) {
  10266. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10267. xGame.common.aiPlayer.runAI();
  10268. ui.selfTurn.visible = false;
  10269. ui.aiTurn.visible = true;
  10270. ui.aiTurn.t0.play();
  10271. });
  10272. }
  10273. else {
  10274. xGame.common.aiPlayer.runAI();
  10275. }
  10276. }
  10277. this.openTimer();
  10278. this.finishOneShoot = true;
  10279. if (this.selfTurn) {
  10280. ui.topNode.selfKuang.visible = true;
  10281. ui.topNode.aiKuang.visible = false;
  10282. ui.topNode.selfTips.visible = true;
  10283. ui.topNode.aiTips.visible = false;
  10284. }
  10285. else {
  10286. ui.topNode.selfKuang.visible = false;
  10287. ui.topNode.aiKuang.visible = true;
  10288. ui.topNode.selfTips.visible = false;
  10289. ui.topNode.aiTips.visible = true;
  10290. }
  10291. }
  10292. placeRootBall() {
  10293. let rootBall = xGame.common.d2World.rootBall;
  10294. if (!rootBall)
  10295. return;
  10296. rootBall.gameObj.x = this.lastRootBallPos.x;
  10297. rootBall.gameObj.y = this.lastRootBallPos.y;
  10298. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10299. let moveNode = xGame.common.gameUI.ui.moveNode;
  10300. moveNode.visible = true;
  10301. moveNode.x = this.lastRootBallPos.x;
  10302. moveNode.y = this.lastRootBallPos.y;
  10303. if (!this.selfTurn) {
  10304. xGame.common.aiPlayer.resetRoot();
  10305. }
  10306. }
  10307. }
  10308. class ui_guanyuAni extends fgui.GComponent {
  10309. static createInstance() {
  10310. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10311. }
  10312. onConstruct() {
  10313. this.n0 = (this.getChild("n0"));
  10314. }
  10315. }
  10316. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10317. class UIFireworks extends UIBase {
  10318. constructor() {
  10319. super();
  10320. }
  10321. onConstructor() {
  10322. this.isEject = false;
  10323. }
  10324. show(callback) {
  10325. super.show();
  10326. }
  10327. }
  10328. UIFireworks.uiName = "UIFireworks";
  10329. class ui_UIGuanYu extends fgui.GComponent {
  10330. static createInstance() {
  10331. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10332. }
  10333. onConstruct() {
  10334. this.n2 = (this.getChild("n2"));
  10335. this.n1 = (this.getChild("n1"));
  10336. this.n3 = (this.getChild("n3"));
  10337. this.n4 = (this.getChild("n4"));
  10338. this.n5 = (this.getChild("n5"));
  10339. this.n6 = (this.getChild("n6"));
  10340. this.n8 = (this.getChild("n8"));
  10341. this.n7 = (this.getChild("n7"));
  10342. this.t0 = this.getTransition("t0");
  10343. }
  10344. }
  10345. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10346. class UIGuanYu extends UIBase {
  10347. constructor() {
  10348. super();
  10349. }
  10350. onConstructor() {
  10351. this.ui = ui_UIGuanYu.createInstance();
  10352. this.contentPane = this.ui;
  10353. this.isEject = false;
  10354. }
  10355. show(callback) {
  10356. super.show();
  10357. this.ui.t0.play(Laya.Handler.create(this, () => {
  10358. callback && callback();
  10359. this.hide();
  10360. }));
  10361. this.setGlobalFont(this.ui);
  10362. }
  10363. }
  10364. UIGuanYu.uiName = "UIGuanYu";
  10365. class SkillMgr {
  10366. constructor() {
  10367. this.leveNum = 0;
  10368. this.extraScore = 0;
  10369. this.selfTurn = false;
  10370. this.playedLastSkill = false;
  10371. this.tweenArr = [];
  10372. this._finishNum = 0;
  10373. this._curFinish = 0;
  10374. this._rootX = 0;
  10375. this._rootY = 0;
  10376. this.knifeTimes = 0;
  10377. this.knifeV2 = new Laya.Vector2();
  10378. this.knifeV3 = new Laya.Vector3();
  10379. this.rtStarX = 0;
  10380. this.rtStarY = 0;
  10381. this.addBigSkillSpine();
  10382. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10383. }
  10384. addBigSkillSpine() {
  10385. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10386. console.log("extra2 success");
  10387. });
  10388. }
  10389. runBigSkill(callback) {
  10390. this.tweenArr = [];
  10391. this.callback = callback;
  10392. this.judgeSkill();
  10393. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10394. let guide = 1;
  10395. if (DataMgr.getGuideDefaultModel() === 1) {
  10396. guide = DataMgr.getLianXiGuide();
  10397. }
  10398. else {
  10399. guide = DataMgr.getSkillGuide();
  10400. }
  10401. if (!xGame.common.gameMgr.selfTurn) {
  10402. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10403. }
  10404. else {
  10405. if (xGame.common.temSelfLevel != 0) {
  10406. this.leveNum = xGame.common.temSelfLevel;
  10407. }
  10408. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10409. this.leveNum += 5;
  10410. }
  10411. }
  10412. if (guide == 0) {
  10413. DataMgr.setSkillGuide(1);
  10414. DataMgr.setLianXiGuide(1);
  10415. if (DataMgr.getNewUser()) {
  10416. Moyu.sendDataEvent("gameFirstPlay");
  10417. DataMgr.setNewUser();
  10418. }
  10419. }
  10420. this.playSpineAni(() => {
  10421. switch (this.curSkill) {
  10422. case SkillType.highSpace:
  10423. this.runHighSpace();
  10424. break;
  10425. case SkillType.breakArmy:
  10426. this.runBreakArmy();
  10427. break;
  10428. case SkillType.ice:
  10429. this.runIce();
  10430. break;
  10431. case SkillType.fireworks:
  10432. this.runFireworks();
  10433. break;
  10434. case SkillType.GuanYu:
  10435. this.runGuanYu();
  10436. break;
  10437. default:
  10438. break;
  10439. }
  10440. });
  10441. }
  10442. judgeSkill() {
  10443. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10444. let gameMgr = xGame.common.gameMgr;
  10445. let type;
  10446. for (let index = 0; index < typeArr.length; index++) {
  10447. type = typeArr[index];
  10448. if (gameMgr.selfTurn) {
  10449. if (gameMgr.selfCurSkill == type) {
  10450. this.selfTurn = true;
  10451. this.curSkill = type;
  10452. return;
  10453. }
  10454. }
  10455. else {
  10456. if (gameMgr.aiCurSkill == type) {
  10457. this.selfTurn = false;
  10458. this.curSkill = type;
  10459. return;
  10460. }
  10461. }
  10462. }
  10463. }
  10464. playSpineAni(callback) {
  10465. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10466. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10467. parent.destroyChildren();
  10468. let aniIndex = 0;
  10469. let skillSpine;
  10470. switch (this.curSkill) {
  10471. case SkillType.highSpace:
  10472. aniIndex = 1;
  10473. xGame.soundMgr.playSound("skill01");
  10474. skillSpine = this.skillSpine2;
  10475. data.scaleX = 0.5;
  10476. data.scaleY = 0.5;
  10477. skillSpine.play(data, 1, false, parent, () => {
  10478. callback && callback();
  10479. });
  10480. break;
  10481. case SkillType.breakArmy:
  10482. aniIndex = 2;
  10483. xGame.soundMgr.playSound("skill02");
  10484. skillSpine = this.skillSpine2;
  10485. data.scaleX = 0.5;
  10486. data.scaleY = 0.5;
  10487. skillSpine.play(data, 2, false, parent, () => {
  10488. callback && callback();
  10489. });
  10490. break;
  10491. case SkillType.ice:
  10492. aniIndex = 0;
  10493. xGame.soundMgr.playSound("skill03");
  10494. skillSpine = this.skillSpine2;
  10495. data.scaleX = 0.5;
  10496. data.scaleY = 0.5;
  10497. skillSpine.play(data, 0, false, parent, () => {
  10498. callback && callback();
  10499. });
  10500. break;
  10501. case SkillType.fireworks:
  10502. xGame.soundMgr.playSound("skill_04_01");
  10503. xGame.soundMgr.playSound("skill04");
  10504. xGame.uiMgr.Show(UIFireworks, callback);
  10505. break;
  10506. case SkillType.GuanYu:
  10507. xGame.soundMgr.playSound("skill05_1");
  10508. xGame.soundMgr.playSound("skill05");
  10509. xGame.uiMgr.Show(UIGuanYu, callback);
  10510. break;
  10511. default:
  10512. break;
  10513. }
  10514. }
  10515. getAllBallArr() {
  10516. let arr = xGame.common.d2World.ballArr;
  10517. let outArr = [];
  10518. for (let index = 0; index < arr.length; index++) {
  10519. if (arr[index] instanceof D2RootBallSrc)
  10520. continue;
  10521. if (arr[index].ballFunc == "ice")
  10522. continue;
  10523. if (arr[index].destroyed)
  10524. continue;
  10525. outArr.push(arr[index]);
  10526. }
  10527. return outArr;
  10528. }
  10529. getOneArr(deletObj) {
  10530. let allArr = this.getAllBallArr();
  10531. let temp;
  10532. for (let index = 0; index < allArr.length; index++) {
  10533. temp = allArr[index];
  10534. if (temp.id == deletObj.id) {
  10535. allArr.splice(index, 1);
  10536. break;
  10537. }
  10538. }
  10539. return allArr;
  10540. }
  10541. getNearBallBag(ball) {
  10542. let ui = xGame.common.gameUI.ui;
  10543. let circleArr = [];
  10544. for (let index = 1; index <= 6; index++) {
  10545. circleArr.push(ui.border["circle" + index]);
  10546. }
  10547. let outIndex = 0;
  10548. let temp;
  10549. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10550. ;
  10551. let dis = 0;
  10552. for (let index = 1; index < circleArr.length; index++) {
  10553. temp = circleArr[index];
  10554. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10555. if (dis < min) {
  10556. min = dis;
  10557. outIndex = index;
  10558. }
  10559. }
  10560. return [circleArr[outIndex], outIndex];
  10561. }
  10562. ballFlyToBag(ballArr, time = 300) {
  10563. let temp;
  10564. let hole;
  10565. this._finishNum = ballArr.length;
  10566. this._curFinish = 0;
  10567. let holeObj = {};
  10568. let holeCfg = {
  10569. "1": 0,
  10570. "2": 0,
  10571. "3": 0,
  10572. "4": 0,
  10573. "5": 0,
  10574. "6": 0
  10575. };
  10576. for (let index = 0; index < ballArr.length; index++) {
  10577. temp = ballArr[index];
  10578. temp.outColli.isSensor = true;
  10579. temp.innerColli.isSensor = true;
  10580. temp.isRunSkillAni = true;
  10581. let holeArr = this.getNearBallBag(temp);
  10582. hole = holeArr[0];
  10583. holeObj[index] = holeArr[1];
  10584. temp.d3BallSrc.scaleXYZ = 0.5;
  10585. this.tweenArr.push(temp.d3BallSrc, temp);
  10586. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10587. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10588. }));
  10589. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10590. let mIndex = holeObj[this._curFinish];
  10591. let isDone = holeCfg[mIndex];
  10592. if (isDone) {
  10593. ballArr[this._curFinish].checkWrongBall(false);
  10594. }
  10595. else {
  10596. holeCfg[mIndex] = 1;
  10597. ballArr[this._curFinish].checkWrongBall();
  10598. }
  10599. this._curFinish++;
  10600. if (this._curFinish >= this._finishNum) {
  10601. if (this.curSkill == SkillType.highSpace) {
  10602. }
  10603. else if (this.curSkill == SkillType.breakArmy) {
  10604. let rootBall = xGame.common.d2World.rootBall;
  10605. rootBall.gameObj.x = this._rootX;
  10606. rootBall.gameObj.y = this._rootY;
  10607. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10608. xGame.common.d2World.d2Gan.ui.visible = true;
  10609. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10610. xGame.common.d2World.getHelpLine();
  10611. this.callback && this.callback(this.extraScore);
  10612. }
  10613. }
  10614. }));
  10615. }
  10616. }
  10617. runHighSpace() {
  10618. let rootBall = xGame.common.d2World.rootBall;
  10619. rootBall.showSelf();
  10620. let d3Src = rootBall.d3BallSrc;
  10621. let allArr = this.getAllBallArr();
  10622. if (allArr.length <= 0) {
  10623. this.callback && this.callback(0);
  10624. return;
  10625. }
  10626. let selectBall = xGame.common.d2World.targetBall;
  10627. let wrong = selectBall && selectBall.destroyed;
  10628. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10629. selectBall = xGame.common.getRandArrEle(allArr);
  10630. }
  10631. let targetD3Src = selectBall.d3BallSrc;
  10632. xGame.common.d2World.d2Gan.ui.visible = false;
  10633. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10634. d3Src.scaleXYZ = 0.5;
  10635. this.tweenArr.push(d3Src);
  10636. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10637. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10638. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10639. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10640. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10641. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10642. let outArr = [selectBall];
  10643. let other = this.leveNum - 1;
  10644. if (other > 0) {
  10645. let nearArr = this.getOneArr(selectBall);
  10646. if (nearArr.length > 0) {
  10647. xGame.common.botherArr(nearArr);
  10648. if (other >= nearArr.length)
  10649. other = nearArr.length;
  10650. for (let index = 0; index < other; index++) {
  10651. outArr.push(nearArr[index]);
  10652. }
  10653. }
  10654. }
  10655. xGame.common.extraMoveNum = other + 1;
  10656. this.extraScore = other + 1;
  10657. this._rootX = selectBall.gameObj.x;
  10658. this._rootY = selectBall.gameObj.y;
  10659. rootBall.gameObj.x = this._rootX;
  10660. rootBall.gameObj.y = this._rootY;
  10661. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10662. Laya.Tween.clearAll(d3Src);
  10663. this.addRandomForce(outArr);
  10664. }));
  10665. }));
  10666. }
  10667. addRandomForce(outArr) {
  10668. if (outArr.length > 0) {
  10669. xGame.common.d2World.openCheckStill = true;
  10670. this.playedLastSkill = true;
  10671. }
  10672. let temp;
  10673. for (let index = 0; index < outArr.length; index++) {
  10674. let angle = xGame.common.randomNum(0, 360);
  10675. let linearPercent = xGame.common.randomNum(65, 100);
  10676. temp = outArr[index];
  10677. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10678. }
  10679. }
  10680. setLinearSpeed(angle, rigy, linearPercent) {
  10681. let sin = Math.sin(angle * Math.PI / 180);
  10682. let cos = Math.cos(angle * Math.PI / 180);
  10683. let maxSpeed = 4;
  10684. let speed = new Laya.Vector2();
  10685. speed.x = maxSpeed * linearPercent * sin;
  10686. speed.y = -maxSpeed * linearPercent * cos;
  10687. rigy.applyLinearImpulseToCenter(speed);
  10688. }
  10689. runBreakArmy() {
  10690. xGame.common.d2World.d2Gan.ui.visible = false;
  10691. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10692. let gameUI = xGame.common.gameUI.ui;
  10693. gameUI.skillRod.visible = true;
  10694. gameUI.skillRod.rotation = 110;
  10695. let outArr = this.getAllBallArr();
  10696. if (outArr.length <= 0) {
  10697. gameUI.skillRod.visible = false;
  10698. this.callback && this.callback(0);
  10699. return;
  10700. }
  10701. xGame.common.botherArr(outArr);
  10702. if (this.leveNum >= outArr.length)
  10703. this.leveNum = outArr.length;
  10704. let deleteNum = outArr.length - this.leveNum;
  10705. outArr.splice(0, deleteNum);
  10706. this.extraScore = this.leveNum;
  10707. let potX = gameUI.skillRod.x;
  10708. let potY = gameUI.skillRod.y;
  10709. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10710. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10711. let disArr = [];
  10712. for (let index = 0; index < outArr.length; index++) {
  10713. let obj = outArr[index];
  10714. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10715. dis = Math.pow(dis, 0.5);
  10716. disArr.push(dis);
  10717. }
  10718. this.tweenArr.push(gameUI.skillRod);
  10719. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10720. })).update = Laya.Handler.create(this, (e, t, c) => {
  10721. let angle = gameUI.skillRod.rotation;
  10722. let xx;
  10723. let yy;
  10724. let temp;
  10725. for (let index = 0; index < outArr.length; index++) {
  10726. temp = outArr[index];
  10727. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10728. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10729. yy -= 20;
  10730. temp.gameObj.x = xx;
  10731. temp.gameObj.y = yy;
  10732. temp.d3BallSrc.setTransPos(xx, yy);
  10733. }
  10734. if (angle <= 60) {
  10735. Laya.Tween.clearAll(gameUI.skillRod);
  10736. this.ballFlyToBag(outArr, 150);
  10737. gameUI.skillRod.visible = false;
  10738. }
  10739. }, null, false);
  10740. }
  10741. runIce() {
  10742. let ballArr = xGame.common.d2World.ballArr;
  10743. this.leveNum *= 2;
  10744. if (this.leveNum >= ballArr.length - 1)
  10745. this.leveNum = ballArr.length - 1;
  10746. let tempArr = [];
  10747. let outArr = [];
  10748. for (let index = 0; index < ballArr.length; index++) {
  10749. if (ballArr[index] instanceof D2RootBallSrc)
  10750. continue;
  10751. tempArr.push(ballArr[index]);
  10752. }
  10753. if (tempArr.length <= 0) {
  10754. this.callback && this.callback(0);
  10755. return;
  10756. }
  10757. xGame.common.botherArr(tempArr);
  10758. for (let index = 0; index < this.leveNum; index++) {
  10759. outArr.push(tempArr[index]);
  10760. }
  10761. this.extraScore = this.leveNum;
  10762. let temp;
  10763. for (let index = 0; index < outArr.length; index++) {
  10764. temp = outArr[index];
  10765. temp.d3BallSrc.playIceEft();
  10766. }
  10767. Laya.timer.once(2000, this, () => {
  10768. for (let index = 0; index < outArr.length; index++) {
  10769. temp = outArr[index];
  10770. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10771. temp.setBallFunc("ice", str);
  10772. }
  10773. this.callback && this.callback(0);
  10774. });
  10775. }
  10776. runFireworks() {
  10777. let allArr = this.getAllBallArr();
  10778. if (allArr.length <= 0) {
  10779. this.callback && this.callback(0);
  10780. return;
  10781. }
  10782. xGame.common.d2World.d2Gan.ui.visible = false;
  10783. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10784. let outArr = [];
  10785. let other = this.leveNum;
  10786. if (other > 0) {
  10787. if (allArr.length > 0) {
  10788. xGame.common.botherArr(allArr);
  10789. if (other >= allArr.length)
  10790. other = allArr.length;
  10791. for (let index = 0; index < other; index++) {
  10792. outArr.push(allArr[index]);
  10793. }
  10794. }
  10795. }
  10796. xGame.common.extraMoveNum = other;
  10797. this.extraScore = other;
  10798. this.addRandmomFireworks(outArr);
  10799. }
  10800. addRandmomFireworks(outArr) {
  10801. Laya.timer.once(1100, this, () => {
  10802. if (outArr.length > 0) {
  10803. xGame.common.d2World.openCheckStill = true;
  10804. this.playedLastSkill = true;
  10805. }
  10806. });
  10807. xGame.soundMgr.playSound("skill_04_02");
  10808. let temp;
  10809. let delay = -200;
  10810. for (let index = 0; index < outArr.length; index++) {
  10811. temp = outArr[index];
  10812. delay += 200;
  10813. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10814. let angle = xGame.common.randomNum(0, 360);
  10815. angle = this.getFireworksAngle(obj);
  10816. let linearPercent = xGame.common.randomNum(45, 80);
  10817. if (!obj.destroyed)
  10818. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10819. });
  10820. }
  10821. }
  10822. getFireworksAngle(obj) {
  10823. let rootBall = xGame.common.d2World.rootBall;
  10824. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10825. }
  10826. resetGame() {
  10827. Laya.timer.clearAll(this);
  10828. if (this.tweenArr) {
  10829. for (let index = 0; index < this.tweenArr.length; index++) {
  10830. Laya.Tween.clearAll(this.tweenArr[index]);
  10831. }
  10832. }
  10833. this.tweenArr = null;
  10834. }
  10835. runGuanYu() {
  10836. xGame.common.d2World.d2Gan.ui.visible = false;
  10837. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10838. let rootBall = xGame.common.d2World.rootBall;
  10839. if (rootBall.isInHole) {
  10840. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10841. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10842. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10843. rootBall.showSelf();
  10844. }
  10845. this.rtStarX = rootBall.gameObj.x;
  10846. this.rtStarY = rootBall.gameObj.y;
  10847. this.knifeTimes = 0;
  10848. this.playedLastSkill = true;
  10849. rootBall.forceRun = true;
  10850. rootBall.rigy.type = "static";
  10851. xGame.common.d2World.openCheckStill = true;
  10852. this.guanyuRandomKnife();
  10853. }
  10854. guanyuRandomKnife() {
  10855. let rootBall = xGame.common.d2World.rootBall;
  10856. let dir = this.getRandDir();
  10857. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10858. console.log("当前angle", angle);
  10859. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10860. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10861. let dis = 324;
  10862. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10863. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10864. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10865. this.rtStarX = rootBall.gameObj.x;
  10866. this.rtStarY = rootBall.gameObj.y;
  10867. this.knifeTimes++;
  10868. let skillLevel;
  10869. if (xGame.common.gameMgr.selfTurn) {
  10870. skillLevel = DataMgr.getBigSkillByIndex(4);
  10871. }
  10872. else {
  10873. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10874. }
  10875. if (!skillLevel)
  10876. skillLevel = 1;
  10877. skillLevel += 2;
  10878. if (this.knifeTimes < skillLevel) {
  10879. Laya.timer.once(400, this, () => {
  10880. this.guanyuRandomKnife();
  10881. });
  10882. }
  10883. else {
  10884. rootBall.forceRun = false;
  10885. rootBall.rigy.type = "dynamic";
  10886. xGame.common.extraMoveNum = skillLevel;
  10887. }
  10888. }));
  10889. }
  10890. getRandDir() {
  10891. let rootBall = xGame.common.d2World.rootBall;
  10892. let allBall = this.getAllBallArr();
  10893. let target = xGame.common.getRandArrEle(allBall);
  10894. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10895. return this.knifeV2;
  10896. }
  10897. cloneKnife(x, y, rotation) {
  10898. let parent = xGame.common.d3World.knifeRoot;
  10899. let prefab = xGame.common.d3World.knife;
  10900. let clone = prefab.clone();
  10901. parent.addChild(clone);
  10902. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10903. clone.transform.localPositionX = this.knifeV3.x;
  10904. clone.transform.localPositionY = 0;
  10905. clone.transform.localPositionZ = this.knifeV3.z;
  10906. clone.transform.localRotationEulerX = 0;
  10907. clone.transform.localRotationEulerY = rotation;
  10908. clone.transform.localRotationEulerZ = 0;
  10909. clone.active = true;
  10910. return clone;
  10911. }
  10912. cloneGuanYuEft(x, y, angle) {
  10913. return;
  10914. let parent = xGame.common.gameUI.ui.guanyuNode;
  10915. let eft = new ui_guanyuAni();
  10916. eft.parent = parent;
  10917. eft.x = x;
  10918. eft.y = y;
  10919. eft.rotation = angle;
  10920. }
  10921. }
  10922. class ui_UIWordsList extends fgui.GComponent {
  10923. static createInstance() {
  10924. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10925. }
  10926. onConstruct() {
  10927. this.c1 = this.getController("c1");
  10928. this.n74 = (this.getChild("n74"));
  10929. this.clickNode = (this.getChild("clickNode"));
  10930. this.myNode = (this.getChild("myNode"));
  10931. this.n68 = (this.getChild("n68"));
  10932. this.n66 = (this.getChild("n66"));
  10933. this.n55 = (this.getChild("n55"));
  10934. this.wordsBtn = (this.getChild("wordsBtn"));
  10935. this.emotionBtn = (this.getChild("emotionBtn"));
  10936. this.mybggg = (this.getChild("mybggg"));
  10937. this.wordsList = (this.getChild("wordsList"));
  10938. this.emotionList = (this.getChild("emotionList"));
  10939. this.myRoot = (this.getChild("myRoot"));
  10940. }
  10941. }
  10942. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10943. class EmotionDisplay {
  10944. constructor(index, ui) {
  10945. this.ui = ui;
  10946. this.index = index;
  10947. this.ui.onClick(this, this.clickSelf);
  10948. this.updateSelf();
  10949. }
  10950. updateSelf() {
  10951. let data = cfgTable.emotionData[this.index + 1];
  10952. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10953. }
  10954. clickSelf() {
  10955. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10956. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10957. xGame.common.talkMgr.closeTalkView();
  10958. }
  10959. }
  10960. class WordsDisplay {
  10961. constructor(index, ui) {
  10962. this.ui = ui;
  10963. this.index = index;
  10964. this.ui.onClick(this, this.clickSelf);
  10965. this.updateSelf();
  10966. }
  10967. updateSelf() {
  10968. let data = cfgTable.talkwordsData[this.index + 1];
  10969. this.ui.txt.text = data.msg;
  10970. }
  10971. clickSelf() {
  10972. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10973. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10974. xGame.common.talkMgr.closeTalkView();
  10975. }
  10976. }
  10977. class UIWordsList extends UIBase {
  10978. constructor() {
  10979. super();
  10980. }
  10981. onConstructor() {
  10982. this.ui = ui_UIWordsList.createInstance();
  10983. this.contentPane = this.ui;
  10984. this.isEject = false;
  10985. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10986. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10987. this.addUIClick(this.ui.clickNode, this.hide);
  10988. this.initTalkList();
  10989. this.initEmotionList();
  10990. }
  10991. show() {
  10992. super.show();
  10993. this.setGlobalFont(this.ui);
  10994. }
  10995. initTalkList() {
  10996. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10997. let data = cfgTable.talkwordsData;
  10998. let length = Object.keys(data).length;
  10999. this.ui.wordsList.numItems = length;
  11000. }
  11001. initEmotionList() {
  11002. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  11003. let data = cfgTable.emotionData;
  11004. let length = Object.keys(data).length;
  11005. this.ui.emotionList.numItems = length;
  11006. }
  11007. renderTalkItem(index, obj) {
  11008. let temp = new WordsDisplay(index, obj);
  11009. }
  11010. renderEmotionItem(index, obj) {
  11011. let temp = new EmotionDisplay(index, obj);
  11012. }
  11013. openTalkList() {
  11014. this.ui.c1.selectedIndex = 0;
  11015. }
  11016. openEmotionList() {
  11017. this.ui.c1.selectedIndex = 1;
  11018. }
  11019. }
  11020. UIWordsList.uiName = "UIWordsList";
  11021. class TalkMgr {
  11022. constructor() {
  11023. this.aiSpeak = true;
  11024. this.emotionList = [];
  11025. this.talkList = [];
  11026. this.addEvent();
  11027. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11028. this.emotionList = [];
  11029. this.talkList = [];
  11030. for (let k in cfgTable.emotionData) {
  11031. this.emotionList.push(cfgTable.emotionData[k].id);
  11032. }
  11033. for (let k in cfgTable.talkwordsData) {
  11034. this.talkList.push(cfgTable.talkwordsData[k].id);
  11035. }
  11036. }
  11037. addEvent() {
  11038. let ui = xGame.common.gameUI.ui;
  11039. ui.wordsBtn.visible = true;
  11040. ui.wordsBtn.onClick(this, this.openTalkView);
  11041. ui.aiWordsBtn.visible = true;
  11042. ui.aiWordsBtn.onClick(this, this.clickAIState);
  11043. }
  11044. openTalkView() {
  11045. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11046. xGame.uiMgr.Show(UIWordsList);
  11047. }
  11048. closeTalkView() {
  11049. xGame.uiMgr.Hide(UIWordsList);
  11050. }
  11051. clickAIState() {
  11052. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11053. this.aiSpeak = !this.aiSpeak;
  11054. this.changeAIState(this.aiSpeak);
  11055. }
  11056. changeAIState(speak) {
  11057. this.aiSpeak = speak;
  11058. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  11059. if (speak) {
  11060. btn.c1.selectedIndex = 0;
  11061. }
  11062. else {
  11063. btn.c1.selectedIndex = 1;
  11064. }
  11065. }
  11066. showSelfTalk(wordsId) {
  11067. let ui = xGame.common.gameUI.ui;
  11068. ui.selfTalk.visible = true;
  11069. ui.selfTalk.myNode.c1.selectedIndex = 1;
  11070. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11071. ui.selfTalk.t0.play();
  11072. }
  11073. showSelfEmotion(emotionId) {
  11074. let ui = xGame.common.gameUI.ui;
  11075. ui.selfTalk.visible = true;
  11076. ui.selfTalk.myNode.c1.selectedIndex = 0;
  11077. this.selfSpine && this.selfSpine.dispose();
  11078. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11079. let spineData = cfgTable.emotionData[emotionId].spine;
  11080. this.selfSpine = new SpineMgr(spineData, () => {
  11081. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  11082. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  11083. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11084. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  11085. });
  11086. ui.selfTalk.t0.play();
  11087. }
  11088. showAITalk(wordsId) {
  11089. if (!this.aiSpeak)
  11090. return;
  11091. if (DataMgr.gameData.gameCount < 2)
  11092. return;
  11093. if (wordsId < 1)
  11094. wordsId = this.getRandTalk();
  11095. let ui = xGame.common.gameUI.ui;
  11096. ui.aiTalk.visible = true;
  11097. ui.aiTalk.myNode.c1.selectedIndex = 1;
  11098. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11099. ui.aiTalk.t0.play();
  11100. }
  11101. getRandTalk() {
  11102. let rand = xGame.tools.random(0, this.talkList.length);
  11103. return this.emotionList[rand];
  11104. }
  11105. getRandEmotion() {
  11106. let rand = xGame.tools.random(0, this.emotionList.length);
  11107. return this.emotionList[rand];
  11108. }
  11109. showAIEmotion(emotionId) {
  11110. if (!this.aiSpeak)
  11111. return;
  11112. if (DataMgr.gameData.gameCount < 2)
  11113. return;
  11114. if (emotionId < 1)
  11115. emotionId = this.getRandEmotion();
  11116. let ui = xGame.common.gameUI.ui;
  11117. ui.aiTalk.visible = true;
  11118. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11119. this.aiSpine && this.aiSpine.dispose();
  11120. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11121. let spineData = cfgTable.emotionData[emotionId].spine;
  11122. this.aiSpine = new SpineMgr(spineData, () => {
  11123. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11124. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11125. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11126. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11127. });
  11128. ui.aiTalk.t0.play();
  11129. }
  11130. resetGame() {
  11131. let ui = xGame.common.gameUI.ui;
  11132. ui.aiTalk.visible = false;
  11133. ui.selfTalk.visible = false;
  11134. this.aiSpine && this.aiSpine.dispose();
  11135. this.selfSpine && this.selfSpine.dispose();
  11136. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11137. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11138. this.closeTalkView();
  11139. }
  11140. }
  11141. class WordsMgr {
  11142. constructor() {
  11143. this.comboTimes = 1;
  11144. this.skillTimes = 0;
  11145. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11146. this.comboSpine = new SpineMgr("yxz_liangan");
  11147. this.skillSpine = new SpineMgr("yiganxqiu");
  11148. this.scoreSpine = new SpineMgr("defen");
  11149. }
  11150. setClassicCombo(isInterrupt) {
  11151. if (isInterrupt) {
  11152. this.comboTimes = 0;
  11153. }
  11154. }
  11155. playClassicWords(type, callback) {
  11156. this.callback = callback;
  11157. let aniIndex = type;
  11158. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11159. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11160. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11161. mySpine.destroy(true);
  11162. this.playClassicTimes();
  11163. });
  11164. }
  11165. playClassicTimes() {
  11166. this.comboTimes++;
  11167. if (this.comboTimes <= 1) {
  11168. this.callback && this.callback();
  11169. }
  11170. else {
  11171. let aniIndex = this.comboTimes - 1;
  11172. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11173. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11174. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11175. mySpine.destroy(true);
  11176. this.callback && this.callback();
  11177. });
  11178. }
  11179. }
  11180. playBigSkillTimes(times, callback) {
  11181. if (times <= 0) {
  11182. callback && callback();
  11183. return;
  11184. }
  11185. this.callback = callback;
  11186. let pre = "sz_0";
  11187. let aniIndex = 0;
  11188. this.getWordsImg(times, pre, () => {
  11189. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11190. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11191. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11192. let r1 = ``;
  11193. let r2 = ``;
  11194. if (times <= 9) {
  11195. r1 = `res/d2Res/${pre}${times}.png`;
  11196. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11197. aniIndex = 0;
  11198. }
  11199. else {
  11200. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11201. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11202. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11203. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11204. aniIndex = 1;
  11205. }
  11206. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11207. mySpine.destroy(true);
  11208. xGame.common.gameMgr.playSkillTips();
  11209. this.playScore(times);
  11210. xGame.common.playRandomMutiBallBigSkillSound();
  11211. }, mySpine);
  11212. });
  11213. }
  11214. playScore(score) {
  11215. let pre = "sz_";
  11216. let aniIndex = 0;
  11217. this.getWordsImg(score, pre, () => {
  11218. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11219. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11220. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11221. let r1 = ``;
  11222. let r2 = ``;
  11223. if (score <= 9) {
  11224. r1 = `res/d2Res/${pre}${score}.png`;
  11225. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11226. aniIndex = 0;
  11227. }
  11228. else {
  11229. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11230. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11231. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11232. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11233. aniIndex = 1;
  11234. }
  11235. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11236. mySpine.destroy(true);
  11237. this.callback && this.callback();
  11238. }, mySpine);
  11239. });
  11240. }
  11241. getWordsImg(number, pre = "", callback) {
  11242. let arr = [];
  11243. if (number <= 9) {
  11244. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11245. }
  11246. else {
  11247. 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 });
  11248. }
  11249. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11250. callback && callback();
  11251. }));
  11252. }
  11253. }
  11254. class ui_UIRodMethod extends fgui.GComponent {
  11255. static createInstance() {
  11256. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11257. }
  11258. onConstruct() {
  11259. this.n24 = (this.getChild("n24"));
  11260. this.white = (this.getChild("white"));
  11261. this.dot = (this.getChild("dot"));
  11262. this.sureBtn = (this.getChild("sureBtn"));
  11263. this.n20 = (this.getChild("n20"));
  11264. this.n21 = (this.getChild("n21"));
  11265. this.n22 = (this.getChild("n22"));
  11266. this.n23 = (this.getChild("n23"));
  11267. this.n5 = (this.getChild("n5"));
  11268. this.n14 = (this.getChild("n14"));
  11269. this.t0 = this.getTransition("t0");
  11270. }
  11271. }
  11272. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11273. class UIRodMethod extends UIBase {
  11274. constructor() {
  11275. super();
  11276. this.isPressd = false;
  11277. }
  11278. onConstructor() {
  11279. this.ui = ui_UIRodMethod.createInstance();
  11280. this.contentPane = this.ui;
  11281. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11282. this.moveDir = new Laya.Vector2();
  11283. this.moveDest = new Laya.Vector2();
  11284. this.centerPos = new Laya.Vector2();
  11285. xGame.common.uiRodMethod = this;
  11286. }
  11287. show() {
  11288. super.show();
  11289. xGame.common.gameMgr.gamePause = true;
  11290. this.openPressDotEvent();
  11291. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11292. this.centerPos.x = this.ui.white.x;
  11293. this.centerPos.y = this.ui.white.y;
  11294. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11295. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11296. this.setDot();
  11297. this.setGlobalFont(this.ui);
  11298. }
  11299. setDot() {
  11300. this.ui.dot.x = this.moveDest.x;
  11301. this.ui.dot.y = this.moveDest.y;
  11302. }
  11303. closeSelf() {
  11304. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11305. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11306. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11307. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11308. xGame.common.gameMgr.gamePause = false;
  11309. this.hide();
  11310. }
  11311. openPressDotEvent() {
  11312. this.closePressDotEvent();
  11313. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11314. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11315. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11316. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11317. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11318. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11319. }
  11320. closePressDotEvent() {
  11321. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11322. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11323. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11324. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11325. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11326. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11327. }
  11328. onDown(e) {
  11329. if (e.type == Laya.Event.MOUSE_DOWN)
  11330. this.isPressd = true;
  11331. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11332. this.isPressd = false;
  11333. if (!this.isPressd)
  11334. return;
  11335. this.moveDest.x = e.stageX;
  11336. this.moveDest.y = e.stageY;
  11337. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11338. if (dis > 6724) {
  11339. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11340. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11341. }
  11342. this.setDot();
  11343. }
  11344. resetRod() {
  11345. this.ui.dot.x = this.ui.white.x;
  11346. this.ui.dot.y = this.ui.white.y;
  11347. this.gameRod.dot.x = this.gameRod.bg.x;
  11348. this.gameRod.dot.y = this.gameRod.bg.y;
  11349. xGame.common.rodOffest.x = 0;
  11350. xGame.common.rodOffest.y = 0;
  11351. }
  11352. }
  11353. UIRodMethod.uiName = "UIRodMethod";
  11354. class UIGame extends UIBase {
  11355. constructor() {
  11356. super();
  11357. this.powerNum = 0;
  11358. this.isD3Inited = false;
  11359. this.isPrePlay = false;
  11360. this.isMoveRod = false;
  11361. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11362. this.rulerDis = 20;
  11363. this.rulerOffset = 0;
  11364. }
  11365. onConstructor() {
  11366. this.ui = ui_UIGame.createInstance();
  11367. this.contentPane = this.ui;
  11368. this.ui.x += xGame.common.sysOffestNum;
  11369. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11370. this.isEject = false;
  11371. xGame.common.gameUI = this;
  11372. this.initSelf();
  11373. }
  11374. isTurnSelf() {
  11375. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11376. return true;
  11377. }
  11378. }
  11379. initSelf() {
  11380. let topUI = this.ui.topNode;
  11381. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11382. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11383. this.barInfo = {};
  11384. this.barInfo.curY = 0;
  11385. this.barInfo.height = this.ui.powerNode.height;
  11386. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11387. this.barInfo.powerStartY = this.ui.powerNode.y;
  11388. xGame.common.aiPlayer = new AIPlayer();
  11389. xGame.common.gameMgr = new GameMgr();
  11390. xGame.common.skillMgr = new SkillMgr();
  11391. xGame.common.wordsMgr = new WordsMgr();
  11392. xGame.common.talkMgr = new TalkMgr();
  11393. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11394. });
  11395. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11396. });
  11397. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11398. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11399. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11400. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11401. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11402. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11403. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11404. }
  11405. getGanZiImg() {
  11406. let index = DataMgr.getCurBallRod();
  11407. let data = cfgTable.ballrodData[index + 1];
  11408. let gan_url = xGame.common.getGameIconUrl(data.img);
  11409. this.ui.powerNode.showImg.url = gan_url;
  11410. }
  11411. returnHome() {
  11412. let tips = "Are you sure to exit the game?";
  11413. let woman = "Boss, why don't you play for a while longer?";
  11414. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11415. }
  11416. addRodMethodClick() {
  11417. if (this.isTurnSelf()) {
  11418. xGame.uiMgr.Show(UIRodMethod);
  11419. }
  11420. }
  11421. clickHelpLineBtn(force = false) {
  11422. if (!this.isTurnSelf())
  11423. return;
  11424. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11425. if (success) {
  11426. xGame.common.longHelpLine = true;
  11427. xGame.common.d2World.getHelpLine();
  11428. Moyu.sendDataEvent("guideNum");
  11429. }
  11430. else {
  11431. }
  11432. });
  11433. }
  11434. renderSelfDisplayBalls(index, target) {
  11435. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11436. target.myImg.url = xGame.common.getGameIconUrl(str);
  11437. }
  11438. renderAIDisplayBalls(index, target) {
  11439. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11440. target.myImg.url = xGame.common.getGameIconUrl(str);
  11441. ;
  11442. }
  11443. updateMode() {
  11444. if (xGame.common.gameMode == GameMode.classic) {
  11445. this.ui.topNode.scoreNode.visible = false;
  11446. }
  11447. else if (xGame.common.gameMode == GameMode.bigMove) {
  11448. this.ui.topNode.scoreNode.visible = true;
  11449. }
  11450. }
  11451. show() {
  11452. super.show();
  11453. this.ui.alpha = 0;
  11454. this.updateSelf();
  11455. xGame.common.gameMgr.gamePause = false;
  11456. xGame.common.gameUI.ui.blackAni.visible = false;
  11457. xGame.common.gameUI.ui.whiteAni.visible = false;
  11458. this.ui.powerEft.visible = false;
  11459. this.ui.colorNode.visible = false;
  11460. this.updateHead();
  11461. let curUse = DataMgr.getCurBallRod();
  11462. this.getGanZiImg();
  11463. if (DataMgr.getGuideDefaultModel() === 1) {
  11464. Laya.timer.once(3000, this, () => {
  11465. this.yinDaoForLianxi();
  11466. });
  11467. }
  11468. else {
  11469. }
  11470. this.setGlobalFont(this.ui);
  11471. }
  11472. yinDaoForLianxi() {
  11473. let lianXiGuide = DataMgr.getLianXiGuide();
  11474. console.log('zh:lianXiGuide=', lianXiGuide);
  11475. if (lianXiGuide === 0) {
  11476. this.ui.n_lxms_yd1.visible = true;
  11477. console.log('zh:yinDaoForLianxi 111 set ok');
  11478. }
  11479. else {
  11480. this.ui.n_lxms_yd1.visible = false;
  11481. console.log('zh:无需引导11');
  11482. }
  11483. }
  11484. updateSelf() {
  11485. if (xGame.common.gameMode == GameMode.classic) {
  11486. this.ui.c1.selectedIndex = 0;
  11487. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11488. this.ui.topNode.middleNode.visible = true;
  11489. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11490. }
  11491. else if (xGame.common.gameMode == GameMode.bigMove) {
  11492. this.ui.c1.selectedIndex = 0;
  11493. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11494. this.ui.topNode.middleNode.visible = false;
  11495. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11496. let rand = xGame.common.randomNum(1, max);
  11497. let guide = DataMgr.getSkillGuide();
  11498. if (guide == 0)
  11499. rand = 1;
  11500. xGame.common.bigMoveLevelIndex = rand;
  11501. }
  11502. else if (xGame.common.gameMode == GameMode.placeBall) {
  11503. console.log('zh:练习模式...');
  11504. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11505. this.ui.c1.selectedIndex = 1 + data.type;
  11506. this.ui.alpha = 1;
  11507. this.startGame();
  11508. }
  11509. this.updateMode();
  11510. this.initD3world();
  11511. this.initD2world();
  11512. }
  11513. startGame() {
  11514. this.ui.snowNode.visible = Math.random() <= 0.1;
  11515. this.ui.d2Node.visible = false;
  11516. xGame.common.d3World.d3Hand.gameObj.active = false;
  11517. xGame.common.d3World.tableSrc.init();
  11518. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11519. this.cameraViewChange(() => {
  11520. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11521. switch (xGame.common.gameMode) {
  11522. case GameMode.classic:
  11523. xGame.common.d3World.d3Hand.gameObj.active = true;
  11524. this.playPutBallD3Ani();
  11525. break;
  11526. case GameMode.bigMove:
  11527. this.enterGame();
  11528. Laya.timer.once(500, this, () => {
  11529. this.ui.topNode.middleNode.visible = true;
  11530. this.ui.topNode.middleNode.t0.play();
  11531. });
  11532. break;
  11533. case GameMode.placeBall:
  11534. this.enterGame();
  11535. break;
  11536. default:
  11537. break;
  11538. }
  11539. });
  11540. PlatMgr.showBanner(false);
  11541. }
  11542. enterGame() {
  11543. this.ui.d2Node.visible = true;
  11544. xGame.common.d3World.d3Hand.gameObj.active = false;
  11545. xGame.common.showOneCamera("mainCamera");
  11546. Moyu.recordGame(30, true);
  11547. if (!this.isPrePlay) {
  11548. this.isPrePlay = true;
  11549. xGame.common.d3World.prePlayEft();
  11550. }
  11551. xGame.common.gameMgr.gameReady();
  11552. this.openAllEvent();
  11553. this.ui.snowNode.visible = false;
  11554. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11555. this.ui.helpBtn.visible = condition;
  11556. }
  11557. showHelpLineGuide() {
  11558. let longGuide = DataMgr.getGuideHelpLine();
  11559. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11560. this.ui.helpBtn.visible = true;
  11561. this.ui.guideNode.visible = true;
  11562. }
  11563. }
  11564. setTurnAlpha(alpha) {
  11565. this.ui.keduNode.alpha = alpha;
  11566. this.ui.ganNode.alpha = alpha;
  11567. this.ui.rodMethodNode.alpha = alpha;
  11568. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11569. }
  11570. cameraViewChange(callback) {
  11571. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11572. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11573. xGame.common.showOneCamera("visitAngle");
  11574. cameraSrc.localRotationEulerY = 180;
  11575. cameraSrc.localRotationEulerZ = 0;
  11576. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11577. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11578. callback && callback();
  11579. }));
  11580. }));
  11581. }
  11582. playPutBallD3Ani() {
  11583. xGame.common.showOneCamera("mainCamera");
  11584. let handSrc = xGame.common.d3World.d3Hand;
  11585. handSrc.gameObj.active = true;
  11586. handSrc.transform.localPositionZ = 3;
  11587. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11588. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11589. handSrc.gameObj.active = false;
  11590. this.enterGame();
  11591. }), 400);
  11592. }));
  11593. }
  11594. updateHead() {
  11595. let user = Moyu.getUserInfo();
  11596. this.ui.topNode.selfNameTxt.text = user.nickName;
  11597. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11598. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11599. let guide = 1;
  11600. if (DataMgr.getGuideDefaultModel() === 1) {
  11601. guide = DataMgr.getLianXiGuide();
  11602. }
  11603. else {
  11604. guide = DataMgr.getSkillGuide();
  11605. }
  11606. if (guide < 1) {
  11607. this.ui.topNode.aiNameTxt.text = 'billiards';
  11608. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11609. }
  11610. else {
  11611. this.ui.topNode.aiNameTxt.text = aiData.name;
  11612. let randNo = Math.floor(Math.random() * 10) + 1;
  11613. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11614. }
  11615. }
  11616. initD2world() {
  11617. let node = this.ui.d2Root.displayObject;
  11618. let src = node.getComponent(D2World);
  11619. if (!src) {
  11620. xGame.common.d2World = node.addComponent(D2World);
  11621. }
  11622. xGame.common.d2World.initSelf();
  11623. }
  11624. initD3world() {
  11625. if (this.isD3Inited)
  11626. return;
  11627. this.isD3Inited = true;
  11628. let scene3D = xGame.common.d3Scene;
  11629. this.ui.d3Root.displayObject.addChild(scene3D);
  11630. scene3D.active = true;
  11631. xGame.common.d3World.tableSrc.setBorderPos();
  11632. }
  11633. onRootMove(e) {
  11634. let rootBall = xGame.common.d2World.rootBall;
  11635. this.ui.moveNode.x = e.x;
  11636. this.ui.moveNode.y = e.y;
  11637. rootBall.gameObj.x = e.x;
  11638. rootBall.gameObj.y = e.y;
  11639. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11640. }
  11641. aiRootMove(move) {
  11642. if (move)
  11643. this.hideBallUI();
  11644. else {
  11645. this.showBallUI();
  11646. xGame.common.d2World.getHelpLine();
  11647. }
  11648. }
  11649. aiForce(type, force = 0) {
  11650. this.pressTarget = PressType.powerNode;
  11651. if (type == 1)
  11652. this.onEventUp({ force: true });
  11653. else if (type == 2)
  11654. this.onEventMove({ stageY: force, force: true });
  11655. }
  11656. onEventPress(e) {
  11657. if (e.stopPropagation)
  11658. e.stopPropagation();
  11659. if (!this.isTurnSelf())
  11660. return;
  11661. let target = e.target;
  11662. switch (target) {
  11663. case this.ui.myPowerNode.displayObject:
  11664. this.pressTarget = PressType.powerNode;
  11665. this.barInfo.curY = e.stageY;
  11666. this.updateBarInfo();
  11667. break;
  11668. case this.ui.moveNode.displayObject:
  11669. this.pressTarget = PressType.moveNode;
  11670. this.hideBallUI();
  11671. this.eventObj.curX = this.ui.moveNode.x;
  11672. this.eventObj.curY = this.ui.moveNode.y;
  11673. this.ui.moveNode.finger.visible = false;
  11674. this.eventObj.lastX = e.stageX;
  11675. this.eventObj.lastY = e.stageY;
  11676. break;
  11677. case this.ui.rulerClickNode.displayObject:
  11678. this.pressTarget = PressType.rulerNode;
  11679. this.eventObj.lastY = e.stageY;
  11680. break;
  11681. case this.ui.d2Root.displayObject:
  11682. this.pressTarget = PressType.d2Root;
  11683. this.eventObj.lastX = e.stageX;
  11684. this.eventObj.lastY = e.stageY;
  11685. this.eventObj.starX = e.stageX;
  11686. this.eventObj.starY = e.stageY;
  11687. this.eventObj.curX = 0;
  11688. this.eventObj.curY = 0;
  11689. xGame.common.d2World.d2Gan.setGanLastInfo();
  11690. this.rulerOffset = 0;
  11691. break;
  11692. default:
  11693. break;
  11694. }
  11695. }
  11696. onEventMove(e) {
  11697. if (e.stopPropagation)
  11698. e.stopPropagation();
  11699. if (e && e.force) {
  11700. }
  11701. else {
  11702. if (!this.isTurnSelf())
  11703. return;
  11704. }
  11705. switch (this.pressTarget) {
  11706. case PressType.powerNode:
  11707. this.barInfo.curY = e.stageY;
  11708. this.updateBarInfo();
  11709. this.isMoveRod = true;
  11710. break;
  11711. case PressType.moveNode:
  11712. let rootBall = xGame.common.d2World.rootBall;
  11713. let radius = rootBall.gameObj.width / 2;
  11714. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11715. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11716. let border = xGame.common.d2World.borderRect;
  11717. if (curX <= border.x + radius)
  11718. curX = border.x + radius;
  11719. else if (curX >= border.x + border.width - radius)
  11720. curX = border.x + border.width - radius;
  11721. if (curY <= border.y + radius)
  11722. curY = border.y + radius;
  11723. else if (curY >= border.y + border.height - radius)
  11724. curY = border.y + border.height - radius;
  11725. if (xGame.common.gameMgr.isOpenBall) {
  11726. if (curX >= border.x + border.openBallW - radius)
  11727. curX = border.x + border.openBallW - radius;
  11728. }
  11729. this.ui.moveNode.x = curX;
  11730. this.ui.moveNode.y = curY;
  11731. rootBall.gameObj.x = curX;
  11732. rootBall.gameObj.y = curY;
  11733. rootBall.d3BallSrc.setTransPos(curX, curY);
  11734. this.isMoveRod = true;
  11735. break;
  11736. case PressType.rulerNode:
  11737. let yy = e.stageY - this.eventObj.lastY;
  11738. this.eventObj.lastY = e.stageY;
  11739. let ruler1 = this.ui.rulerNode.img1;
  11740. let ruler2 = this.ui.rulerNode.img2;
  11741. ruler1.y += yy;
  11742. ruler2.y += yy;
  11743. this.rulerOffset += yy;
  11744. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11745. this.rulerOffset = 0;
  11746. xGame.soundMgr.playSound("inch", 1, 10);
  11747. }
  11748. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11749. let h = ruler1.height;
  11750. if (DataMgr.getGuideDefaultModel() === 1) {
  11751. this.checkGuideForLxms();
  11752. }
  11753. else {
  11754. this.checkGuide();
  11755. }
  11756. this.isMoveRod = true;
  11757. if (ruler1.y >= h) {
  11758. ruler1.y = -h;
  11759. ruler2.y = 0;
  11760. return;
  11761. }
  11762. else if (ruler1.y <= -h) {
  11763. ruler1.y = h;
  11764. ruler2.y = 0;
  11765. return;
  11766. }
  11767. if (ruler2.y >= h) {
  11768. ruler2.y = -h;
  11769. ruler1.y = 0;
  11770. return;
  11771. }
  11772. else if (ruler2.y <= -h) {
  11773. ruler2.y = h;
  11774. ruler1.y = 0;
  11775. return;
  11776. }
  11777. break;
  11778. case PressType.d2Root:
  11779. this.eventObj.curX = e.stageX;
  11780. this.eventObj.curY = e.stageY;
  11781. let offset = this.checkRodMoveDir();
  11782. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11783. this.eventObj.lastX = e.stageX;
  11784. this.eventObj.lastY = e.stageY;
  11785. break;
  11786. default:
  11787. break;
  11788. }
  11789. }
  11790. onEventUp(e) {
  11791. if (e.stopPropagation)
  11792. e.stopPropagation();
  11793. if (e && e.force) {
  11794. }
  11795. else {
  11796. if (!this.isTurnSelf())
  11797. return;
  11798. }
  11799. switch (this.pressTarget) {
  11800. case PressType.powerNode:
  11801. this.ui.powerNode.value = 0;
  11802. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11803. this.ui.powerTxt.text = "";
  11804. if (this.powerNum > 0) {
  11805. xGame.eventMgr.event(BALL_SHOOT);
  11806. xGame.common.d2World.shoot(this.powerNum);
  11807. xGame.common.d2World.d2Gan.shoot();
  11808. xGame.common.d2World.d2HelpLine.shoot();
  11809. if (DataMgr.getGuideDefaultModel() === 1) {
  11810. this.finishGuideForLxms();
  11811. }
  11812. else {
  11813. this.finishGuide();
  11814. }
  11815. this.ui.powerEft.visible = false;
  11816. this.ui.colorNode.visible = false;
  11817. let ganStr = "";
  11818. if (this.powerNum <= 30) {
  11819. ganStr = "gan_30";
  11820. }
  11821. else if (this.powerNum <= 60) {
  11822. ganStr = "gan_50";
  11823. }
  11824. else {
  11825. ganStr = "gan_80";
  11826. }
  11827. xGame.soundMgr.playSound(ganStr);
  11828. }
  11829. break;
  11830. case PressType.moveNode:
  11831. let rootBall = xGame.common.d2World.rootBall;
  11832. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11833. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11834. let isIntersect = this.judgeBallIntersect();
  11835. if (isIntersect) {
  11836. this.ui.moveNode.x = lastX;
  11837. this.ui.moveNode.y = lastY;
  11838. rootBall.gameObj.x = lastX;
  11839. rootBall.gameObj.y = lastY;
  11840. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11841. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11842. }
  11843. else {
  11844. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11845. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11846. }
  11847. this.showBallUI();
  11848. this.ui.moveNode.finger.visible = true;
  11849. xGame.common.d2World.getHelpLine();
  11850. break;
  11851. case PressType.rulerNode:
  11852. break;
  11853. case PressType.d2Root:
  11854. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11855. if (dis <= 25) {
  11856. this.moveToClickDot(e);
  11857. }
  11858. break;
  11859. default:
  11860. break;
  11861. }
  11862. this.pressTarget = -1;
  11863. }
  11864. checkGuide() {
  11865. let guide = DataMgr.getSkillGuide();
  11866. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11867. xGame.common.guideStep++;
  11868. xGame.common.gameUI.ui.guide2.visible = false;
  11869. xGame.common.gameUI.ui.guide3.visible = true;
  11870. }
  11871. }
  11872. checkGuideForLxms() {
  11873. let guide = DataMgr.getLianXiGuide();
  11874. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  11875. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  11876. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11877. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  11878. xGame.common.guideStepForLianXi = 3;
  11879. }
  11880. }
  11881. finishGuide() {
  11882. let guide = DataMgr.getSkillGuide();
  11883. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11884. xGame.common.guideStep = 10;
  11885. this.closeAllGuide();
  11886. console.log('zh: 新手引导完毕');
  11887. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11888. }
  11889. }
  11890. finishGuideForLxms() {
  11891. let guide = DataMgr.getLianXiGuide();
  11892. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  11893. xGame.common.guideStepForLianXi = 3;
  11894. DataMgr.setLianXiGuide(1);
  11895. this.closeAllGuideForLxms();
  11896. console.log('zh: lxms新手引导完毕');
  11897. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11898. }
  11899. }
  11900. closeAllGuide() {
  11901. xGame.common.gameUI.ui.guide1.visible = false;
  11902. xGame.common.gameUI.ui.guide2.visible = false;
  11903. xGame.common.gameUI.ui.guide3.visible = false;
  11904. }
  11905. closeAllGuideForLxms() {
  11906. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  11907. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11908. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  11909. }
  11910. updateBarInfo() {
  11911. let star = this.ui.powerNode.y;
  11912. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11913. if (rate >= 1)
  11914. rate = 1;
  11915. if (rate <= 0)
  11916. rate = 0;
  11917. this.powerNum = Math.ceil(rate * 100);
  11918. this.ui.powerNode.value = this.powerNum;
  11919. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11920. this.ui.colorNode.value = this.powerNum;
  11921. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11922. this.ui.powerEft.visible = this.powerNum != 0;
  11923. this.ui.colorNode.visible = this.powerNum != 0;
  11924. this.ui.powerTxt.text = this.powerNum + "";
  11925. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11926. }
  11927. forceCancel() {
  11928. this.ui.powerNode.value = 0;
  11929. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11930. this.ui.powerTxt.text = "";
  11931. }
  11932. checkRodMoveDir() {
  11933. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11934. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11935. if (tempX >= 0 && tempY <= 0) {
  11936. return this.checkDir();
  11937. }
  11938. else if (tempX < 0 && tempY < 0) {
  11939. return this.checkDir(1, -1);
  11940. }
  11941. else if (tempX < 0 && tempY > 0) {
  11942. return this.checkDir(-1, -1);
  11943. }
  11944. else {
  11945. return this.checkDir(-1, 1);
  11946. }
  11947. }
  11948. checkDir(flagX = 1, flagY = 1) {
  11949. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11950. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11951. if (offsetY == 0) {
  11952. return offsetX * flagX;
  11953. }
  11954. if (offsetX == 0) {
  11955. return offsetY * flagY;
  11956. }
  11957. let angle = offsetY / offsetX;
  11958. if (Math.abs(angle) >= 1) {
  11959. return offsetY * flagY;
  11960. }
  11961. else {
  11962. return offsetX * flagX;
  11963. }
  11964. }
  11965. judgeBallIntersect() {
  11966. let rootBall = xGame.common.d2World.rootBall;
  11967. let ballArr = xGame.common.d2World.ballArr;
  11968. let radius = rootBall.gameObj.width / 2;
  11969. let temp;
  11970. let isIntersect = false;
  11971. for (let index = 0; index < ballArr.length; index++) {
  11972. temp = ballArr[index];
  11973. if (temp.number == rootBall.number)
  11974. continue;
  11975. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11976. if (isIntersect) {
  11977. break;
  11978. }
  11979. }
  11980. return isIntersect;
  11981. }
  11982. hideBallUI() {
  11983. let d2Gan = xGame.common.d2World.d2Gan;
  11984. if (!d2Gan.ui.isDisposed)
  11985. d2Gan.ui.visible = false;
  11986. let d2Help = xGame.common.d2World.d2HelpLine;
  11987. if (!d2Help.ui.isDisposed)
  11988. d2Help.ui.visible = false;
  11989. let rootBall = xGame.common.d2World.rootBall;
  11990. if (!rootBall.destroyed) {
  11991. rootBall.gameObj.active = false;
  11992. }
  11993. }
  11994. showBallUI() {
  11995. let d2Gan = xGame.common.d2World.d2Gan;
  11996. if (!d2Gan.ui.isDisposed)
  11997. d2Gan.ui.visible = true;
  11998. let d2Help = xGame.common.d2World.d2HelpLine;
  11999. if (!d2Help.ui.isDisposed)
  12000. d2Help.ui.visible = true;
  12001. let rootBall = xGame.common.d2World.rootBall;
  12002. if (!rootBall.destroyed) {
  12003. rootBall.gameObj.active = true;
  12004. }
  12005. }
  12006. moveToClickDot(e) {
  12007. if (!this.isMoveRod && !xGame.common.clickedBall) {
  12008. let root = xGame.common.d2World.rootBall.gameObj;
  12009. let xx = e.stageX - xGame.common.sysOffestNum;
  12010. let yy = e.stageY;
  12011. let x = xx - root.x;
  12012. let y = yy - root.y;
  12013. let angle = xGame.common.getfguiRotation(x, y);
  12014. xGame.common.d2World.d2Gan.ui.rotation = angle;
  12015. xGame.common.d2World.getHelpLine();
  12016. }
  12017. this.isMoveRod = false;
  12018. xGame.common.clickedBall = false;
  12019. }
  12020. openAllEvent() {
  12021. this.closeAllEvent();
  12022. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12023. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12024. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12025. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12026. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  12027. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  12028. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  12029. }
  12030. closeAllEvent() {
  12031. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12032. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12033. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12034. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  12035. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  12036. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  12037. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  12038. }
  12039. resetGame() {
  12040. this.closeAllEvent();
  12041. this.hideBallUI();
  12042. xGame.common.gameMgr.gamePause = true;
  12043. }
  12044. }
  12045. UIGame.uiName = "UIGame";
  12046. class UIAddProp extends UIBase {
  12047. constructor() {
  12048. super();
  12049. this.curType = "";
  12050. }
  12051. onConstructor() {
  12052. this.ui = ui_UIAddProp.createInstance();
  12053. this.contentPane = this.ui;
  12054. this.isEject = false;
  12055. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  12056. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  12057. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  12058. this.updateUI();
  12059. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  12060. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  12061. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  12062. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  12063. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  12064. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  12065. }
  12066. show(type) {
  12067. super.show();
  12068. this.curType = type == 0 ? "coin" : "diamond";
  12069. this.switchBtn("");
  12070. this.ui.t0.play();
  12071. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  12072. PlatMgr.showInsert(true);
  12073. this.setGlobalFont(this.ui);
  12074. }
  12075. closeSelf() {
  12076. this.hide();
  12077. }
  12078. updateUI() {
  12079. let data = cfgTable.moneyData;
  12080. let temp;
  12081. let obj;
  12082. for (const key in data) {
  12083. temp = data[key];
  12084. obj = this.ui.myNode["node" + key];
  12085. if (parseInt(key) <= 2) {
  12086. obj.diamondTxt.text = "+" + temp.num;
  12087. }
  12088. else {
  12089. obj.coinTxt.text = temp.num;
  12090. obj.diamondTxt.text = temp.get.split('_')[1];
  12091. }
  12092. }
  12093. this.updateDiamondShare();
  12094. }
  12095. updateDiamondShare() {
  12096. let data = DataMgr.getShareDiamondTimes();
  12097. if (data >= xGame.common.maxShareDiamondTimes) {
  12098. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  12099. this.ui.myNode.node1.touchable = false;
  12100. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12101. }
  12102. else {
  12103. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  12104. this.ui.myNode.node1.touchable = true;
  12105. }
  12106. }
  12107. switchBtn(type) {
  12108. if (type == "")
  12109. type = this.curType;
  12110. else {
  12111. if (this.curType == type) {
  12112. return;
  12113. }
  12114. else {
  12115. this.curType = type;
  12116. }
  12117. }
  12118. if (type == "coin") {
  12119. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  12120. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  12121. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  12122. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  12123. this.ui.myNode.c1.selectedIndex = 0;
  12124. }
  12125. else {
  12126. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  12127. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  12128. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  12129. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  12130. this.ui.myNode.c1.selectedIndex = 1;
  12131. }
  12132. }
  12133. convertCoin(index) {
  12134. let data = cfgTable.moneyData[index];
  12135. let coinNum = data.num;
  12136. let str = data.get.split('_')[1];
  12137. let needDiamond = parseInt(str);
  12138. if (DataMgr.diamondEnough(needDiamond)) {
  12139. DataMgr.setDiamond(-needDiamond);
  12140. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  12141. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12142. }
  12143. else {
  12144. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12145. this.switchBtn("diamond");
  12146. }
  12147. }
  12148. videoGetDiamond() {
  12149. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12150. if (Laya.Browser.onAndroid) {
  12151. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12152. if (!boo) {
  12153. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12154. return;
  12155. }
  12156. }
  12157. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12158. }
  12159. else {
  12160. console.log('zh:AD 失败,直接发放奖励');
  12161. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12162. }
  12163. }
  12164. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12165. let num = cfgTable.moneyData[2].num;
  12166. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12167. this.closeSelf();
  12168. }
  12169. videoGetCoin() {
  12170. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12171. if (Laya.Browser.onAndroid) {
  12172. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12173. if (!boo) {
  12174. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12175. return;
  12176. }
  12177. }
  12178. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12179. }
  12180. else {
  12181. console.log('zh:AD 失败,直接发放奖励');
  12182. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12183. }
  12184. }
  12185. qjff_AD_for_uiAddProp_videoGetCoin() {
  12186. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12187. this.closeSelf();
  12188. }
  12189. shareGetDiamond() {
  12190. let times = DataMgr.getShareDiamondTimes();
  12191. if (times >= xGame.common.maxShareDiamondTimes) {
  12192. console.log('zh: 233333333333 maxShareDiamondTimes');
  12193. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12194. }
  12195. else {
  12196. console.log('zh:33333333333333ad');
  12197. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12198. if (Laya.Browser.onAndroid) {
  12199. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12200. if (!boo) {
  12201. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12202. return;
  12203. }
  12204. }
  12205. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12206. }
  12207. else {
  12208. console.log('zh:AD 失败,直接发放奖励');
  12209. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12210. }
  12211. }
  12212. }
  12213. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12214. let diamond = xGame.common.randomNum(50, 100);
  12215. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12216. DataMgr.setShareDiamondTimes(1);
  12217. this.updateDiamondShare();
  12218. }
  12219. openPutBallView() {
  12220. let end = xGame.uiMgr.getUI(UIGameEnd);
  12221. let skill = xGame.uiMgr.getUI(UISkill);
  12222. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12223. let uigame = xGame.uiMgr.getUI(UIGame);
  12224. if (end && !end.isHide) {
  12225. xGame.uiMgr.Hide(UIGameEnd);
  12226. xGame.uiMgr.Show(UIMain);
  12227. }
  12228. if (skill && !skill.isHide)
  12229. xGame.uiMgr.Hide(UISkill);
  12230. if (uigame && !uigame.isHide)
  12231. xGame.uiMgr.Hide(UIGame);
  12232. if (level && !level.isHide) {
  12233. }
  12234. else {
  12235. xGame.uiMgr.Show(UILevelDisplay);
  12236. }
  12237. this.closeSelf();
  12238. }
  12239. }
  12240. UIAddProp.uiName = "UIAddProp";
  12241. class MoneyNode {
  12242. constructor(ui) {
  12243. this.leftTime = 0;
  12244. this.ui = ui;
  12245. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12246. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12247. this.ui.addPowerBtn.onClick(this, this.addPower);
  12248. this.ui.c1.selectedIndex = 1;
  12249. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12250. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12251. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12252. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12253. this.coinChange();
  12254. this.diamondChange();
  12255. this.powerChange();
  12256. }
  12257. addPower() {
  12258. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12259. xGame.uiMgr.Show(UIPower);
  12260. }
  12261. powerChange() {
  12262. let powerNum = DataMgr.getPower();
  12263. this.ui.powerTxt.text = powerNum + "";
  12264. }
  12265. checkPowerTime() {
  12266. let cur = new Date().getTime();
  12267. let last = DataMgr.getPowerTime();
  12268. if (last == 0) {
  12269. last = cur;
  12270. DataMgr.setPowerTime(cur);
  12271. }
  12272. let power = DataMgr.getPower();
  12273. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12274. Laya.timer.clearAll(this);
  12275. if (power >= xGame.common.natureMaxPower) {
  12276. this.ui.powerTimeTxt.text = "";
  12277. DataMgr.setPowerTime(cur);
  12278. return;
  12279. }
  12280. if (power + offset >= xGame.common.natureMaxPower) {
  12281. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12282. this.ui.powerTimeTxt.text = "";
  12283. DataMgr.setPowerTime(cur);
  12284. }
  12285. else {
  12286. if (offset > 0) {
  12287. DataMgr.setPower(offset);
  12288. DataMgr.setPowerTime(cur);
  12289. }
  12290. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12291. this.leftTime = xGame.common.powerRecoverNum - time;
  12292. if (this.leftTime <= 0)
  12293. this.leftTime = 0;
  12294. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12295. Laya.timer.loop(1000, this, this.updatePowerTime);
  12296. }
  12297. }
  12298. updatePowerTime() {
  12299. this.leftTime -= 1;
  12300. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12301. if (this.leftTime <= 0) {
  12302. this.checkPowerTime();
  12303. }
  12304. }
  12305. coinChange() {
  12306. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12307. }
  12308. diamondChange() {
  12309. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12310. }
  12311. addCoin() {
  12312. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12313. Moyu.sendDataEvent("AddCoinBtn");
  12314. xGame.uiMgr.Show(UIAddProp, 0);
  12315. }
  12316. addDiamond() {
  12317. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12318. Moyu.sendDataEvent("AddDiamondBtn");
  12319. xGame.uiMgr.Show(UIAddProp, 1);
  12320. }
  12321. }
  12322. class UIDraw extends UIBase {
  12323. constructor() {
  12324. super();
  12325. this.curKey = 0;
  12326. }
  12327. onConstructor() {
  12328. this.ui = ui_UIDraw.createInstance();
  12329. this.contentPane = this.ui;
  12330. this.isEject = false;
  12331. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12332. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12333. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12334. this.initDraw();
  12335. this.initUI();
  12336. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12337. }
  12338. show() {
  12339. super.show();
  12340. this.ui.t0.play();
  12341. this.playSecretaryIdle();
  12342. this.updateDraw();
  12343. this.checkFree();
  12344. if (PlatMgr.bannerDelay > 0) {
  12345. this.ui.closeNode.closeBtn.visible = false;
  12346. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12347. this.ui.closeNode.closeBtn.visible = true;
  12348. });
  12349. }
  12350. PlatMgr.showRateBanner();
  12351. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12352. this.setGlobalFont(this.ui);
  12353. }
  12354. hide() {
  12355. Laya.timer.clearAll(this);
  12356. super.hide();
  12357. }
  12358. checkFree() {
  12359. let isFree = DataMgr.getDailyfreeDrawTimes();
  12360. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12361. }
  12362. initDraw() {
  12363. this.drawObj = [];
  12364. let data = cfgTable.drawData;
  12365. let temp;
  12366. let weight = 0;
  12367. for (const key in data) {
  12368. temp = data[key];
  12369. weight += temp.weight;
  12370. this.drawObj.push(weight);
  12371. }
  12372. this.allWeight = weight;
  12373. }
  12374. initUI() {
  12375. let data = cfgTable.drawData;
  12376. let temp;
  12377. let img;
  12378. let txt;
  12379. for (const key in data) {
  12380. temp = data[key];
  12381. img = this.ui.myNode.rotNode["img" + key];
  12382. txt = this.ui.myNode.rotNode["txt" + key];
  12383. img.url = xGame.common.getGameIconUrl(temp.icon);
  12384. txt.visible = true;
  12385. if (temp.award > 2) {
  12386. img.rotation = 0;
  12387. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12388. }
  12389. else {
  12390. img.rotation = temp.rotation;
  12391. txt.text = temp.num;
  12392. }
  12393. }
  12394. }
  12395. getCurkey() {
  12396. let rand = Math.random() * this.allWeight;
  12397. let temp;
  12398. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12399. temp = this.drawObj[index];
  12400. if (index == 0) {
  12401. if (rand < temp) {
  12402. return index + 1;
  12403. }
  12404. }
  12405. else {
  12406. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12407. return index + 1;
  12408. }
  12409. }
  12410. }
  12411. return 2;
  12412. }
  12413. startDraw() {
  12414. console.log('zh:开始抽奖');
  12415. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12416. if (freeTimes > 0) {
  12417. console.log('zh:freeTimes=' + freeTimes);
  12418. this.beginDraw();
  12419. DataMgr.setDailyfreeDrawTimes(0);
  12420. this.checkFree();
  12421. }
  12422. else {
  12423. if (Laya.Browser.onAndroid) {
  12424. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12425. if (!boo) {
  12426. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12427. return;
  12428. }
  12429. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12430. }
  12431. else {
  12432. console.log('zh:AD 失败,直接发放奖励');
  12433. this.qjff_chouJiang();
  12434. }
  12435. }
  12436. else {
  12437. this.qjff_chouJiang();
  12438. }
  12439. }
  12440. }
  12441. qjff_chouJiang() {
  12442. this.beginDraw();
  12443. }
  12444. beginDraw() {
  12445. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12446. this.ui.drawBtn.touchable = false;
  12447. this.curKey = this.getCurkey();
  12448. console.log("zh:当前key", this.curKey);
  12449. let cell = 60;
  12450. let lap = 3;
  12451. let angle = cell * (this.curKey - 1) + lap * 360;
  12452. let target = this.ui.myNode.rotNode;
  12453. target.rotation = 0;
  12454. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12455. console.log("zh:旋转完成");
  12456. this.ui.drawBtn.touchable = true;
  12457. this.getAward();
  12458. }));
  12459. }
  12460. getAward() {
  12461. let data = cfgTable.drawData[this.curKey];
  12462. let temp = new AwardType();
  12463. temp.type = data.award;
  12464. temp.num = data.num;
  12465. xGame.common.getAward([temp], () => {
  12466. DataMgr.setDrawTimes(1);
  12467. this.updateDraw();
  12468. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12469. });
  12470. }
  12471. updateDraw() {
  12472. let drawTimes = DataMgr.getDrawTimes();
  12473. let awardTimes = DataMgr.getDrawAwardTimes();
  12474. if (Math.floor(drawTimes / 3) > awardTimes) {
  12475. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12476. this.ui.extraNode.boxBtn.touchable = true;
  12477. this.ui.extraNode.tipsTxt.text = "3/3";
  12478. this.ui.extraNode.barNode.width = 265;
  12479. this.getExtraAward();
  12480. }
  12481. else {
  12482. this.ui.extraNode.boxBtn.t0.stop();
  12483. this.ui.extraNode.boxBtn.touchable = false;
  12484. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12485. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12486. }
  12487. let data = cfgTable.drawData[1];
  12488. if (awardTimes == 0) {
  12489. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12490. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12491. this.ui.myNode.rotNode.img1.rotation = 0;
  12492. }
  12493. else {
  12494. let award = data.nextid;
  12495. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12496. this.ui.myNode.rotNode.txt1.text = award[1];
  12497. this.ui.myNode.rotNode.img1.rotation = 0;
  12498. }
  12499. }
  12500. getExtraAward() {
  12501. let drawTimes = DataMgr.getDrawTimes();
  12502. let awardTimes = DataMgr.getDrawAwardTimes();
  12503. let data = cfgTable.drawData[1];
  12504. let award = new AwardType();
  12505. if (awardTimes == 0) {
  12506. award.num = data.num;
  12507. award.type = data.award;
  12508. xGame.common.getAward([award], () => {
  12509. let all = Math.floor(drawTimes / 3);
  12510. DataMgr.setDrawAwardTimes(all);
  12511. this.updateDraw();
  12512. });
  12513. }
  12514. else {
  12515. award.num = parseInt(data.nextid[1]);
  12516. award.type = parseInt(data.nextid[0]);
  12517. xGame.common.getAward([award], () => {
  12518. let all = Math.floor(drawTimes / 3);
  12519. DataMgr.setDrawAwardTimes(all);
  12520. this.updateDraw();
  12521. });
  12522. }
  12523. }
  12524. closeSelf() {
  12525. this.hide();
  12526. }
  12527. playSecretaryIdle() {
  12528. let parent = this.ui.secretary.displayObject;
  12529. parent.destroyChildren();
  12530. let xx = this.ui.secretary.width / 2;
  12531. let yy = this.ui.secretary.height;
  12532. let scale = xGame.common.getSecretaryScale();
  12533. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12534. xGame.common.secretary.play(data, 0, true, parent);
  12535. }
  12536. }
  12537. UIDraw.uiName = "UIDraw";
  12538. class ui_UIFlyEft extends fgui.GComponent {
  12539. static createInstance() {
  12540. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12541. }
  12542. onConstruct() {
  12543. this.n0 = (this.getChild("n0"));
  12544. this.n1 = (this.getChild("n1"));
  12545. this.n2 = (this.getChild("n2"));
  12546. this.n3 = (this.getChild("n3"));
  12547. this.n4 = (this.getChild("n4"));
  12548. this.n5 = (this.getChild("n5"));
  12549. this.n6 = (this.getChild("n6"));
  12550. this.n7 = (this.getChild("n7"));
  12551. this.iconNode = (this.getChild("iconNode"));
  12552. this.txt = (this.getChild("txt"));
  12553. this.txtNode = (this.getChild("txtNode"));
  12554. }
  12555. }
  12556. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12557. class UIFlyEft extends UIBase {
  12558. constructor() {
  12559. super();
  12560. this.max = 8;
  12561. this.delay = 0;
  12562. }
  12563. onConstructor() {
  12564. this.ui = ui_UIFlyEft.createInstance();
  12565. this.contentPane = this.ui;
  12566. this.isEject = false;
  12567. this.isMuti = true;
  12568. this.ui.x += xGame.common.sysOffestNum;
  12569. }
  12570. getArrPos() {
  12571. if (this.iconPos && this.iconPos.length > 0)
  12572. return;
  12573. this.iconPos = [];
  12574. let temp;
  12575. for (let index = 0; index < this.max; index++) {
  12576. temp = this.ui["n" + index];
  12577. this.iconPos.push([temp.x, temp.y]);
  12578. }
  12579. }
  12580. show(stPos, edPos, num, type, callback) {
  12581. super.show();
  12582. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12583. this.getArrPos();
  12584. this.updateUI(type);
  12585. this.updatePos();
  12586. this.runFly(edPos, callback);
  12587. this.runWorlds(stPos, num);
  12588. this.setGlobalFont(this.ui);
  12589. }
  12590. updateUI(type) {
  12591. let temp;
  12592. let str;
  12593. for (let index = 0; index < this.max; index++) {
  12594. temp = this.ui["n" + index];
  12595. str = this.getIconStr(type);
  12596. temp.url = xGame.common.getGameIconUrl(str);
  12597. }
  12598. }
  12599. getIconStr(type) {
  12600. switch (type) {
  12601. case Prop.diamond:
  12602. return "ty_zs";
  12603. case Prop.coin:
  12604. return "ty_jb";
  12605. default:
  12606. break;
  12607. }
  12608. }
  12609. updatePos() {
  12610. let temp;
  12611. for (let index = 0; index < this.max; index++) {
  12612. temp = this.ui["n" + index];
  12613. temp.x = this.iconPos[index][0];
  12614. temp.y = this.iconPos[index][1];
  12615. }
  12616. }
  12617. runFly(endPos, callback) {
  12618. let all = 0;
  12619. let temp;
  12620. for (let index = 0; index < this.max; index++) {
  12621. temp = this.ui["n" + index];
  12622. temp.visible = true;
  12623. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12624. temp.visible = false;
  12625. all++;
  12626. if (all >= this.max) {
  12627. callback && callback();
  12628. }
  12629. }), 20 * index);
  12630. }
  12631. }
  12632. runWorlds(stPos, num) {
  12633. let str = "+" + num;
  12634. this.ui.txt.text = str;
  12635. let starX = stPos.x;
  12636. let starY = stPos.y + 50;
  12637. this.ui.txt.x = starX;
  12638. this.ui.txt.y = starY;
  12639. this.ui.txt.visible = true;
  12640. this.ui.txt.alpha = 1;
  12641. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12642. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12643. this.ui.txt.visible = false;
  12644. this.hide();
  12645. }));
  12646. }));
  12647. }
  12648. }
  12649. UIFlyEft.uiName = "UIFlyEft";
  12650. class Common {
  12651. constructor() {
  12652. this.convertNum = 0.025;
  12653. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12654. this.scaleV3One = new Laya.Vector3();
  12655. this.scaleV3Two = new Laya.Vector3();
  12656. this.posV4 = new Laya.Vector4();
  12657. this.showDebug = false;
  12658. this.openGuide = true;
  12659. this.rodOffest = new Laya.Vector2(0, 0);
  12660. this.rodAngle = 0;
  12661. this.gameMode = GameMode.classic;
  12662. this.bigMoveLevelIndex = 1;
  12663. this.bigMoveNeedCoin = 1000;
  12664. this.classicNiceNeddCoin = 1000;
  12665. this.passAwardCoin = 2000;
  12666. this.classicRoomType = 1;
  12667. this.maxPower = 20;
  12668. this.natureMaxPower = 5;
  12669. this.videoPower = 2;
  12670. this.powerRecoverNum = 900;
  12671. this.curPlayerSkillType = 0;
  12672. this.isNewDay = false;
  12673. this.clickedBall = false;
  12674. this.placeBallCurLevel = 0;
  12675. this.placeBallStarNum = 0;
  12676. this.longHelpLine = false;
  12677. this.maxShareDiamondTimes = 3;
  12678. this.guideStep = 0;
  12679. this.guideStepForLianXi = 0;
  12680. this.temSelfLevel = 0;
  12681. this.extraMoveNum = 0;
  12682. this.curRankID = 0;
  12683. this.rankID = {
  12684. normalStar: 12000,
  12685. wxStar: 12001
  12686. };
  12687. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12688. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12689. this.btnClickStr = "buttonclick";
  12690. this.maxSkillLevel = 10;
  12691. this.upSkillLevel = false;
  12692. this.gameStartTime = 0;
  12693. this._sysOffestNum = 0;
  12694. this.angleV2 = new Laya.Vector2();
  12695. this.rootV = new Laya.Vector2(0, 1);
  12696. this.tempDir1 = new Laya.Vector2();
  12697. this.tempDir2 = new Laya.Vector2();
  12698. this.ballSize = 33;
  12699. this.stPos = new Laya.Point();
  12700. this.edPos = new Laya.Point();
  12701. Common._instance = this;
  12702. window["common"] = this;
  12703. }
  12704. static getInstance() {
  12705. if (!this._instance) {
  12706. this._instance = new Common();
  12707. }
  12708. return this._instance;
  12709. }
  12710. get sysOffestNum() {
  12711. if (this._sysOffestNum == 0) {
  12712. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12713. }
  12714. return this._sysOffestNum;
  12715. }
  12716. testShader() {
  12717. let test = new LightShader();
  12718. test.texture = "res/d3Res/ballTexture/ball1.png";
  12719. Laya.stage.addChild(test);
  12720. }
  12721. playScale(node) {
  12722. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12723. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12724. }));
  12725. }));
  12726. }
  12727. setGroup(colli, ...group) {
  12728. let out = 0;
  12729. for (let index = 0; index < group.length; index++) {
  12730. if (index == 0) {
  12731. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12732. }
  12733. else {
  12734. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12735. }
  12736. }
  12737. colli.collisionGroup = out;
  12738. }
  12739. setCanGroupWith(colli, ...group) {
  12740. let out = 0;
  12741. for (let index = 0; index < group.length; index++) {
  12742. if (index == 0) {
  12743. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12744. }
  12745. else {
  12746. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12747. }
  12748. }
  12749. colli.canCollideWith = out;
  12750. }
  12751. loadPrefab(name, callback) {
  12752. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12753. let prefab = new Laya.Prefab();
  12754. prefab.json = obj;
  12755. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12756. callback && callback(img);
  12757. }));
  12758. }
  12759. pos2to3Convert(x, y, d3Pos) {
  12760. x = x + this.sysOffestNum;
  12761. d3Pos.setValue(x, y, 0);
  12762. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12763. if (success) {
  12764. }
  12765. else {
  12766. console.error("转换出错了。。。。。。。。");
  12767. }
  12768. }
  12769. scale2to3Convert(num) {
  12770. this.scaleV3One.setValue(0, 0, 0);
  12771. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12772. this.scaleV3Two.setValue(0, num, 0);
  12773. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12774. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12775. return outNum;
  12776. }
  12777. pos3to2Convert(d3Pos) {
  12778. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12779. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12780. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12781. d3Pos.x -= this.sysOffestNum;
  12782. }
  12783. scale3to2Convert(num) {
  12784. let scale = this.scale2to3Convert(1);
  12785. let d2Out = num / scale;
  12786. return d2Out;
  12787. }
  12788. getCollider(type, restitution = 0.9, density = 10) {
  12789. let colli;
  12790. if (type == "box")
  12791. colli = new Laya.BoxCollider();
  12792. else
  12793. colli = new Laya.CircleCollider();
  12794. colli.friction = 0;
  12795. colli.restitution = restitution;
  12796. colli.density = density;
  12797. return colli;
  12798. }
  12799. getRigbody() {
  12800. let rigy = new Laya.RigidBody();
  12801. rigy.bullet = true;
  12802. rigy.allowRotation = false;
  12803. rigy.allowSleep = false;
  12804. rigy.gravityScale = 0;
  12805. return rigy;
  12806. }
  12807. getfguiRotation(x, y) {
  12808. this.angleV2.setValue(x, y);
  12809. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12810. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12811. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12812. angle = -angle;
  12813. }
  12814. return 180 + angle;
  12815. }
  12816. getAngle(x, y) {
  12817. this.angleV2.setValue(x, y);
  12818. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12819. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12820. return angle;
  12821. }
  12822. randomNum(a, b) {
  12823. return a + Math.floor((b - a + 1) * Math.random());
  12824. }
  12825. getRandArrEle(arr) {
  12826. return arr[Math.floor(arr.length * Math.random())];
  12827. }
  12828. getSign(val) {
  12829. return val >= 0 ? 1 : -1;
  12830. }
  12831. botherArr(arr) {
  12832. let times = arr.length + 2;
  12833. let length = arr.length;
  12834. let a;
  12835. let b;
  12836. let temp;
  12837. for (let index = 0; index < times; index++) {
  12838. a = Math.floor(Math.random() * length);
  12839. b = Math.floor(Math.random() * length);
  12840. temp = arr[a];
  12841. arr[a] = arr[b];
  12842. arr[b] = temp;
  12843. }
  12844. }
  12845. getGameIconUrl(id) {
  12846. return "ui://game/" + id;
  12847. }
  12848. getComponentUrl(id) {
  12849. return "ui://game/" + id;
  12850. }
  12851. getAnimation() {
  12852. }
  12853. judgeSkillType(type = SkillType.highSpace) {
  12854. if (this.gameMode == GameMode.classic)
  12855. return;
  12856. let gameMgr = this.gameMgr;
  12857. if (gameMgr.selfTurn) {
  12858. if (gameMgr.selfCurSkill == type) {
  12859. return true;
  12860. }
  12861. }
  12862. else {
  12863. if (gameMgr.aiCurSkill == type) {
  12864. return true;
  12865. }
  12866. }
  12867. }
  12868. ballColliHole(collider) {
  12869. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12870. xGame.common.gameMgr.isFirstInGame = false;
  12871. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12872. }
  12873. collider.owner.mySrc.checkWrongBall();
  12874. }
  12875. getArrMaxEle(arr) {
  12876. let max = -Infinity;
  12877. for (let index = 0; index < arr.length; index++) {
  12878. max = Math.max(arr[index], max);
  12879. }
  12880. return max;
  12881. }
  12882. getArrMinEle(arr) {
  12883. let min = Infinity;
  12884. for (let index = 0; index < arr.length; index++) {
  12885. min = Math.min(arr[index], min);
  12886. }
  12887. return min;
  12888. }
  12889. playRandomMutiBallBigSkillSound() {
  12890. if (Math.random() <= 0.5)
  12891. return;
  12892. let rand = this.randomNum(1, 6);
  12893. let str = "ganfa0" + rand;
  12894. xGame.soundMgr.playSound(str);
  12895. }
  12896. showOneCamera(type) {
  12897. let object = xGame.common.d3World.cameraObj;
  12898. for (const key in object) {
  12899. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12900. object[key].init();
  12901. object[key].owner.active = key == type;
  12902. }
  12903. }
  12904. }
  12905. checkBallOverBorder(x, y) {
  12906. let radius = 17;
  12907. let condition = this._checkBorder(x + radius, y) ||
  12908. this._checkBorder(x - radius, y) ||
  12909. this._checkBorder(x, y + radius) ||
  12910. this._checkBorder(x, y - radius);
  12911. if (condition) {
  12912. return true;
  12913. }
  12914. }
  12915. _checkBorder(x, y) {
  12916. let borderRect = this.d2World.borderRect;
  12917. let xOffest = 20;
  12918. let yOffest = 20;
  12919. if (y <= borderRect.y - yOffest) {
  12920. return true;
  12921. }
  12922. if (y >= borderRect.y + borderRect.height + yOffest) {
  12923. return true;
  12924. }
  12925. if (x <= borderRect.x - xOffest) {
  12926. return true;
  12927. }
  12928. if (x >= borderRect.x + borderRect.width + xOffest) {
  12929. return true;
  12930. }
  12931. }
  12932. initWeight(cfg) {
  12933. let allCfgData = { data: {}, allWeightNum: 0 };
  12934. let weightCfg = allCfgData.data;
  12935. let weight = 0;
  12936. for (const key in cfg) {
  12937. weightCfg[key] = {};
  12938. weightCfg[key].id = cfg[key].id;
  12939. weightCfg[key].minWeight = weight;
  12940. weight += cfg[key].weight;
  12941. weightCfg[key].maxWeight = weight;
  12942. }
  12943. allCfgData.allWeightNum = weight;
  12944. return allCfgData;
  12945. }
  12946. getRandomWeightData(cfg) {
  12947. let weightCfg = cfg.data;
  12948. let allWeightNum = cfg.allWeightNum;
  12949. let rand = Math.floor(Math.random() * allWeightNum);
  12950. for (const key in weightCfg) {
  12951. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12952. return weightCfg[key];
  12953. }
  12954. }
  12955. return weightCfg[1];
  12956. }
  12957. showGirlTalkPop(wordsIndex, node, msgNode) {
  12958. node.visible = true;
  12959. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12960. node.t0.play(Laya.Handler.create(this, () => {
  12961. node.visible = false;
  12962. }));
  12963. }
  12964. stopGirlPop(node) {
  12965. node.t0.stop();
  12966. node.visible = false;
  12967. }
  12968. createHead(loader, url, size = 107) {
  12969. if (Laya.Browser.name == "Browser") {
  12970. loader.url = url;
  12971. return;
  12972. }
  12973. else {
  12974. console.log('zh:url=', url);
  12975. loader.url = url;
  12976. }
  12977. }
  12978. addTestCoin(num) {
  12979. DataMgr.setCoin(num);
  12980. }
  12981. addTestDiamond(num) {
  12982. DataMgr.setDiamond(num);
  12983. }
  12984. addTestSkill() {
  12985. DataMgr.setBigSkill(0, 99);
  12986. DataMgr.setBigSkill(1, 99);
  12987. DataMgr.setBigSkill(2, 99);
  12988. }
  12989. playClassicEmotion(number, x, y) {
  12990. if (this.gameMode == GameMode.bigMove)
  12991. return;
  12992. let randIndex = this.randomNum(0, 2);
  12993. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12994. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12995. if (this.gameMgr.selfTurn) {
  12996. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12997. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12998. }
  12999. else {
  13000. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  13001. }
  13002. else {
  13003. if (number == this.gameMgr.blackNum) {
  13004. if (this.gameMgr.selfBallArr.length == 0) {
  13005. this.classicEmotionSpine.play(data, randIndex, false, parent);
  13006. }
  13007. else {
  13008. }
  13009. }
  13010. else {
  13011. this.classicEmotionSpine.play(data, randIndex, false, parent);
  13012. }
  13013. }
  13014. }
  13015. }
  13016. else {
  13017. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  13018. this.classicEmotionSpine.play(data, randIndex, false, parent);
  13019. }
  13020. else {
  13021. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  13022. }
  13023. else {
  13024. if (number == this.gameMgr.blackNum) {
  13025. if (this.gameMgr.aiBallArr.length == 0) {
  13026. this.classicEmotionSpine.play(data, randIndex, false, parent);
  13027. }
  13028. else {
  13029. }
  13030. }
  13031. else {
  13032. this.classicEmotionSpine.play(data, randIndex, false, parent);
  13033. }
  13034. }
  13035. }
  13036. }
  13037. }
  13038. playHappySound(number) {
  13039. if (this.gameMode != GameMode.classic)
  13040. return;
  13041. if (number == 8)
  13042. return;
  13043. let play = false;
  13044. if (this.gameMgr.selfTurn) {
  13045. if (this.gameMgr.ensureBallType) {
  13046. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  13047. play = true;
  13048. }
  13049. }
  13050. else {
  13051. play = true;
  13052. }
  13053. }
  13054. else {
  13055. if (this.gameMgr.ensureBallType) {
  13056. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  13057. play = true;
  13058. }
  13059. }
  13060. else {
  13061. play = true;
  13062. }
  13063. }
  13064. if (play)
  13065. xGame.soundMgr.playSound("applause");
  13066. }
  13067. destroyClassicEmotion() {
  13068. if (this.gameMode == GameMode.bigMove)
  13069. return;
  13070. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  13071. parent.destroyChildren();
  13072. }
  13073. playAwardSpine(x, y) {
  13074. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  13075. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  13076. this.awardSpine.play(data, 0, false, parent);
  13077. }
  13078. destroyAwardSpine() {
  13079. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  13080. parent.destroyChildren();
  13081. }
  13082. isBlock(bx, by, hx, hy, except = null) {
  13083. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  13084. let balls = xGame.common.d2World.ballArr;
  13085. let outArr = [];
  13086. for (let index = 0; index < balls.length; index++) {
  13087. let obj = balls[index];
  13088. if (obj.number == 0)
  13089. continue;
  13090. if (obj == except)
  13091. continue;
  13092. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  13093. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  13094. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  13095. if (num >= 1)
  13096. num = 1;
  13097. if (num < 0)
  13098. continue;
  13099. let gap = Math.sin(Math.acos(num)) * dis;
  13100. if (gap < this.ballSize) {
  13101. outArr.push({
  13102. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  13103. disHon: Math.cos(Math.acos(num)) * dis,
  13104. disVer: Math.sin(Math.acos(num)) * dis,
  13105. src: balls[index],
  13106. dir: this.tempDir1
  13107. });
  13108. }
  13109. }
  13110. if (outArr.length > 0) {
  13111. outArr.sort((a, b) => { return a.dis - b.dis; });
  13112. return outArr[0];
  13113. }
  13114. }
  13115. AngleBetween(vector1, vector2) {
  13116. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  13117. return rad * (180 / Math.PI);
  13118. }
  13119. getSecretaryScale() {
  13120. if (this.secretary.spineName == "mishu") {
  13121. return 1.28;
  13122. }
  13123. else {
  13124. return 1.024;
  13125. }
  13126. }
  13127. signAwardContainsRod(arr) {
  13128. let temp;
  13129. for (let index = 0; index < arr.length; index++) {
  13130. temp = arr[index].split('-')[0];
  13131. if (parseInt(temp) > 2) {
  13132. return true;
  13133. }
  13134. }
  13135. }
  13136. judgeSameDay() {
  13137. let lastTime = DataMgr.getSignTime();
  13138. let curTime = new Date().getTime();
  13139. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  13140. return true;
  13141. }
  13142. return false;
  13143. }
  13144. getAward(arr, callback) {
  13145. let showTriple = arr[0].type <= 2;
  13146. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  13147. let temp;
  13148. for (let index = 0; index < arr.length; index++) {
  13149. temp = arr[index];
  13150. switch (temp.type) {
  13151. case 1:
  13152. this.playObjFlyAnim(temp.num, temp.type);
  13153. break;
  13154. case 2:
  13155. this.playObjFlyAnim(temp.num, temp.type);
  13156. break;
  13157. case 3:
  13158. case 4:
  13159. case 5:
  13160. case 6:
  13161. DataMgr.setBallRod(temp.type - 2, 1);
  13162. DataMgr.setCurBallRod(temp.type - 2);
  13163. break;
  13164. default:
  13165. break;
  13166. }
  13167. }
  13168. callback && callback(watchVideo);
  13169. });
  13170. }
  13171. getMoneyNode() {
  13172. let moneyNode;
  13173. let sign = xGame.uiMgr.getUI(UISign);
  13174. let draw = xGame.uiMgr.getUI(UIDraw);
  13175. let end = xGame.uiMgr.getUI(UIGameEnd);
  13176. let skill = xGame.uiMgr.getUI(UISkill);
  13177. if (sign && !sign.isHide)
  13178. moneyNode = sign.ui.moneyNode;
  13179. if (draw && !draw.isHide)
  13180. moneyNode = draw.ui.moneyNode;
  13181. if (end && !end.isHide)
  13182. moneyNode = end.ui.moneyNode;
  13183. if (skill && !skill.isHide)
  13184. moneyNode = skill.ui.moneyNode;
  13185. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13186. let main = xGame.uiMgr.getUI(UIMain);
  13187. if (condition1 && main && !main.isHide) {
  13188. moneyNode = main.ui.moneyNode;
  13189. }
  13190. return moneyNode;
  13191. }
  13192. playObjFlyAnim(num, type, callback = null) {
  13193. this.stPos.x = Laya.stage.width / 2;
  13194. this.stPos.y = Laya.stage.height / 2;
  13195. let moneyNode = this.getMoneyNode();
  13196. switch (type) {
  13197. case Prop.diamond:
  13198. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13199. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13200. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13201. this.edPos.x /= 2;
  13202. this.edPos.y /= 2;
  13203. break;
  13204. case Prop.coin:
  13205. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13206. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13207. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13208. this.edPos.x /= 2;
  13209. this.edPos.y /= 2;
  13210. break;
  13211. default:
  13212. break;
  13213. }
  13214. xGame.soundMgr.playSound("coinbag");
  13215. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13216. switch (type) {
  13217. case Prop.diamond:
  13218. DataMgr.setDiamond(num);
  13219. break;
  13220. case Prop.coin:
  13221. DataMgr.setCoin(num);
  13222. break;
  13223. default:
  13224. break;
  13225. }
  13226. callback && callback();
  13227. });
  13228. }
  13229. autoPopUIView() {
  13230. let arr = [];
  13231. let sign = this.judgeSameDay() ? false : true;
  13232. if (sign)
  13233. arr.push("sign");
  13234. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13235. if (draw)
  13236. arr.push("draw");
  13237. if (arr.length <= 0)
  13238. return;
  13239. let str = this.getRandArrEle(arr);
  13240. switch (str) {
  13241. case "sign":
  13242. xGame.uiMgr.Show(UISign);
  13243. break;
  13244. case "draw":
  13245. xGame.uiMgr.Show(UIDraw);
  13246. break;
  13247. default:
  13248. break;
  13249. }
  13250. }
  13251. getMSTime(time) {
  13252. let min = Math.floor(time / 60);
  13253. let sec = Math.floor((time - min * 60));
  13254. if (sec < 10)
  13255. sec = "0" + sec;
  13256. if (min < 10)
  13257. min = "0" + min;
  13258. return `${min}:${sec}`;
  13259. }
  13260. testPower() {
  13261. DataMgr.setPower(0, false);
  13262. }
  13263. getAllStarNum() {
  13264. let data = DataMgr.getPlaceBallLevelList();
  13265. let out = 0;
  13266. for (let index = 0; index < data.length; index++) {
  13267. out += data[index].star;
  13268. }
  13269. return out;
  13270. }
  13271. recoverCameraView() {
  13272. Laya.timer.once(900, this, () => {
  13273. xGame.common.showOneCamera("mainCamera");
  13274. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13275. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13276. xGame.common.gameUI.ui.border.alpha = 0;
  13277. if (Laya.physicsTimer.scale < 1) {
  13278. Laya.physicsTimer.scale = 1;
  13279. }
  13280. }
  13281. });
  13282. }
  13283. getClassicLevel() {
  13284. let successTimes = DataMgr.getClassicTimes();
  13285. let needKey = "";
  13286. let lastKey = "";
  13287. let cfg = cfgTable.classictimesData;
  13288. let data;
  13289. for (const key in cfg) {
  13290. data = cfg[key];
  13291. if (successTimes <= data.times) {
  13292. needKey = key;
  13293. }
  13294. lastKey = key;
  13295. }
  13296. if (needKey == "")
  13297. needKey = lastKey;
  13298. return cfg[needKey];
  13299. }
  13300. }
  13301. Common._instance = null;
  13302. class ui_Component92 extends fgui.GComponent {
  13303. static createInstance() {
  13304. return (fgui.UIPackage.createObject("game", "Component92"));
  13305. }
  13306. onConstruct() {
  13307. this.n0 = (this.getChild("n0"));
  13308. }
  13309. }
  13310. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13311. class ui_Component129 extends fgui.GProgressBar {
  13312. static createInstance() {
  13313. return (fgui.UIPackage.createObject("game", "Component129"));
  13314. }
  13315. onConstruct() {
  13316. this.bar_v = (this.getChild("bar_v"));
  13317. this.n84 = (this.getChild("n84"));
  13318. }
  13319. }
  13320. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13321. class ui_Component130 extends fgui.GComponent {
  13322. static createInstance() {
  13323. return (fgui.UIPackage.createObject("game", "Component130"));
  13324. }
  13325. onConstruct() {
  13326. this.ani = (this.getChild("ani"));
  13327. this.t0 = this.getTransition("t0");
  13328. }
  13329. }
  13330. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13331. class ui_powerEft extends fgui.GComponent {
  13332. static createInstance() {
  13333. return (fgui.UIPackage.createObject("game", "powerEft"));
  13334. }
  13335. onConstruct() {
  13336. this.ani = (this.getChild("ani"));
  13337. this.n88 = (this.getChild("n88"));
  13338. this.n89 = (this.getChild("n89"));
  13339. }
  13340. }
  13341. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13342. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13343. static createInstance() {
  13344. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13345. }
  13346. onConstruct() {
  13347. this.c1 = this.getController("c1");
  13348. this.n2 = (this.getChild("n2"));
  13349. this.n22 = (this.getChild("n22"));
  13350. this.n23 = (this.getChild("n23"));
  13351. this.n15 = (this.getChild("n15"));
  13352. this.challenge = (this.getChild("challenge"));
  13353. this.n17 = (this.getChild("n17"));
  13354. this.n3 = (this.getChild("n3"));
  13355. this.starNode = (this.getChild("starNode"));
  13356. this.levelTxt = (this.getChild("levelTxt"));
  13357. this.n14 = (this.getChild("n14"));
  13358. this.n19 = (this.getChild("n19"));
  13359. this.n20 = (this.getChild("n20"));
  13360. this.n21 = (this.getChild("n21"));
  13361. this.special = (this.getChild("special"));
  13362. }
  13363. }
  13364. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13365. class ui_Component79 extends fgui.GComponent {
  13366. static createInstance() {
  13367. return (fgui.UIPackage.createObject("game", "Component79"));
  13368. }
  13369. onConstruct() {
  13370. this.c1 = this.getController("c1");
  13371. this.n7 = (this.getChild("n7"));
  13372. this.n8 = (this.getChild("n8"));
  13373. this.n9 = (this.getChild("n9"));
  13374. this.n10 = (this.getChild("n10"));
  13375. this.n11 = (this.getChild("n11"));
  13376. this.n12 = (this.getChild("n12"));
  13377. }
  13378. }
  13379. ui_Component79.URL = "ui://isxx5ak7avag477";
  13380. class ui_Component80 extends fgui.GComponent {
  13381. static createInstance() {
  13382. return (fgui.UIPackage.createObject("game", "Component80"));
  13383. }
  13384. onConstruct() {
  13385. this.n0 = (this.getChild("n0"));
  13386. this.n1 = (this.getChild("n1"));
  13387. this.myList = (this.getChild("myList"));
  13388. this.guide2 = (this.getChild("guide2"));
  13389. this.yd = (this.getChild("yd"));
  13390. this.yd_zzq_btn = (this.getChild("yd_zzq_btn"));
  13391. this.n_yd_lxms_2 = (this.getChild("n_yd_lxms_2"));
  13392. this.t0 = this.getTransition("t0");
  13393. }
  13394. }
  13395. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13396. class ui_SignNormal extends fgui.GComponent {
  13397. static createInstance() {
  13398. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13399. }
  13400. onConstruct() {
  13401. this.c1 = this.getController("c1");
  13402. this.n7 = (this.getChild("n7"));
  13403. this.n15 = (this.getChild("n15"));
  13404. this.titleTxt = (this.getChild("titleTxt"));
  13405. this.n8 = (this.getChild("n8"));
  13406. this.myIcon = (this.getChild("myIcon"));
  13407. this.numTxt = (this.getChild("numTxt"));
  13408. this.n12 = (this.getChild("n12"));
  13409. this.n13 = (this.getChild("n13"));
  13410. this.n17 = (this.getChild("n17"));
  13411. this.n14 = (this.getChild("n14"));
  13412. }
  13413. }
  13414. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13415. class ui_Button_reg extends fgui.GButton {
  13416. static createInstance() {
  13417. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13418. }
  13419. onConstruct() {
  13420. this.button = this.getController("button");
  13421. this.n6 = (this.getChild("n6"));
  13422. }
  13423. }
  13424. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13425. class ui_screenNode extends fgui.GComponent {
  13426. static createInstance() {
  13427. return (fgui.UIPackage.createObject("game", "screenNode"));
  13428. }
  13429. onConstruct() {
  13430. this.n9 = (this.getChild("n9"));
  13431. this.screenImg = (this.getChild("screenImg"));
  13432. }
  13433. }
  13434. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13435. class ui_GetAwrad_com1 extends fgui.GComponent {
  13436. static createInstance() {
  13437. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13438. }
  13439. onConstruct() {
  13440. this.n38 = (this.getChild("n38"));
  13441. this.n39 = (this.getChild("n39"));
  13442. this.n40 = (this.getChild("n40"));
  13443. this.t0 = this.getTransition("t0");
  13444. this.t1 = this.getTransition("t1");
  13445. }
  13446. }
  13447. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13448. class ui_GetAwrad_com2 extends fgui.GComponent {
  13449. static createInstance() {
  13450. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13451. }
  13452. onConstruct() {
  13453. this.n39 = (this.getChild("n39"));
  13454. this.n40 = (this.getChild("n40"));
  13455. this.t0 = this.getTransition("t0");
  13456. }
  13457. }
  13458. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13459. class ui_Component128 extends fgui.GComponent {
  13460. static createInstance() {
  13461. return (fgui.UIPackage.createObject("game", "Component128"));
  13462. }
  13463. onConstruct() {
  13464. this.n38 = (this.getChild("n38"));
  13465. this.n40 = (this.getChild("n40"));
  13466. }
  13467. }
  13468. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13469. class ui_Component100_1 extends fgui.GComponent {
  13470. static createInstance() {
  13471. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13472. }
  13473. onConstruct() {
  13474. this.myNode = (this.getChild("myNode"));
  13475. this.t0 = this.getTransition("t0");
  13476. }
  13477. }
  13478. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13479. class ui_Component142 extends fgui.GComponent {
  13480. static createInstance() {
  13481. return (fgui.UIPackage.createObject("game", "Component142"));
  13482. }
  13483. onConstruct() {
  13484. this.n41 = (this.getChild("n41"));
  13485. this.n42 = (this.getChild("n42"));
  13486. }
  13487. }
  13488. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13489. class ui_main_guang extends fgui.GComponent {
  13490. static createInstance() {
  13491. return (fgui.UIPackage.createObject("game", "main_guang"));
  13492. }
  13493. onConstruct() {
  13494. this.n1 = (this.getChild("n1"));
  13495. this.n2 = (this.getChild("n2"));
  13496. this.n3 = (this.getChild("n3"));
  13497. this.n4 = (this.getChild("n4"));
  13498. this.n5 = (this.getChild("n5"));
  13499. this.n6 = (this.getChild("n6"));
  13500. this.n8 = (this.getChild("n8"));
  13501. this.t0 = this.getTransition("t0");
  13502. }
  13503. }
  13504. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13505. class ui_try_com1 extends fgui.GComponent {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "try_com1"));
  13508. }
  13509. onConstruct() {
  13510. this.c1 = this.getController("c1");
  13511. this.n0 = (this.getChild("n0"));
  13512. this.n2 = (this.getChild("n2"));
  13513. this.cancelBtn = (this.getChild("cancelBtn"));
  13514. this.videoBtn = (this.getChild("videoBtn"));
  13515. this.n9 = (this.getChild("n9"));
  13516. this.n24 = (this.getChild("n24"));
  13517. this.titleTxt = (this.getChild("titleTxt"));
  13518. this.n32 = (this.getChild("n32"));
  13519. this.n29 = (this.getChild("n29"));
  13520. this.n36 = (this.getChild("n36"));
  13521. this.txtTime = (this.getChild("txtTime"));
  13522. this.t0 = this.getTransition("t0");
  13523. }
  13524. }
  13525. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13526. class ui_try_com2 extends fgui.GComponent {
  13527. static createInstance() {
  13528. return (fgui.UIPackage.createObject("game", "try_com2"));
  13529. }
  13530. onConstruct() {
  13531. this.skillicon = (this.getChild("skillicon"));
  13532. this.n35 = (this.getChild("n35"));
  13533. this.n31 = (this.getChild("n31"));
  13534. this.n32 = (this.getChild("n32"));
  13535. this.n33 = (this.getChild("n33"));
  13536. this.n34 = (this.getChild("n34"));
  13537. }
  13538. }
  13539. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13540. class ui_try_com3 extends fgui.GComponent {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "try_com3"));
  13543. }
  13544. onConstruct() {
  13545. this.n33 = (this.getChild("n33"));
  13546. this.n34 = (this.getChild("n34"));
  13547. this.n35 = (this.getChild("n35"));
  13548. this.t0 = this.getTransition("t0");
  13549. }
  13550. }
  13551. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13552. class ui_huihe1 extends fgui.GComponent {
  13553. static createInstance() {
  13554. return (fgui.UIPackage.createObject("game", "huihe1"));
  13555. }
  13556. onConstruct() {
  13557. this.n0 = (this.getChild("n0"));
  13558. this.n1 = (this.getChild("n1"));
  13559. this.t0 = this.getTransition("t0");
  13560. }
  13561. }
  13562. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13563. class ui_huihe2 extends fgui.GComponent {
  13564. static createInstance() {
  13565. return (fgui.UIPackage.createObject("game", "huihe2"));
  13566. }
  13567. onConstruct() {
  13568. this.n0 = (this.getChild("n0"));
  13569. this.n1 = (this.getChild("n1"));
  13570. this.t0 = this.getTransition("t0");
  13571. }
  13572. }
  13573. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13574. class ui_Component143 extends fgui.GComponent {
  13575. static createInstance() {
  13576. return (fgui.UIPackage.createObject("game", "Component143"));
  13577. }
  13578. onConstruct() {
  13579. this.n3 = (this.getChild("n3"));
  13580. this.n4 = (this.getChild("n4"));
  13581. this.n5 = (this.getChild("n5"));
  13582. this.n6 = (this.getChild("n6"));
  13583. this.n7 = (this.getChild("n7"));
  13584. this.n8 = (this.getChild("n8"));
  13585. this.n9 = (this.getChild("n9"));
  13586. this.n10 = (this.getChild("n10"));
  13587. this.t0 = this.getTransition("t0");
  13588. }
  13589. }
  13590. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13591. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13592. static createInstance() {
  13593. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13594. }
  13595. onConstruct() {
  13596. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13597. }
  13598. }
  13599. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13600. class ui_dh_jingbi2 extends fgui.GComponent {
  13601. static createInstance() {
  13602. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13603. }
  13604. onConstruct() {
  13605. this.n0 = (this.getChild("n0"));
  13606. this.n1 = (this.getChild("n1"));
  13607. this.n2 = (this.getChild("n2"));
  13608. this.n3 = (this.getChild("n3"));
  13609. this.n4 = (this.getChild("n4"));
  13610. this.n5 = (this.getChild("n5"));
  13611. this.n6 = (this.getChild("n6"));
  13612. this.n8 = (this.getChild("n8"));
  13613. this.n10 = (this.getChild("n10"));
  13614. this.t0 = this.getTransition("t0");
  13615. }
  13616. }
  13617. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13618. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13619. static createInstance() {
  13620. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13621. }
  13622. onConstruct() {
  13623. this.n1 = (this.getChild("n1"));
  13624. this.n4 = (this.getChild("n4"));
  13625. this.t0 = this.getTransition("t0");
  13626. }
  13627. }
  13628. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13629. class ui_dh_jingbi3 extends fgui.GComponent {
  13630. static createInstance() {
  13631. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13632. }
  13633. onConstruct() {
  13634. this.n0 = (this.getChild("n0"));
  13635. this.n1 = (this.getChild("n1"));
  13636. this.n2 = (this.getChild("n2"));
  13637. this.n3 = (this.getChild("n3"));
  13638. this.n4 = (this.getChild("n4"));
  13639. this.n5 = (this.getChild("n5"));
  13640. this.n6 = (this.getChild("n6"));
  13641. this.n8 = (this.getChild("n8"));
  13642. this.n10 = (this.getChild("n10"));
  13643. this.t0 = this.getTransition("t0");
  13644. }
  13645. }
  13646. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13647. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13648. static createInstance() {
  13649. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13650. }
  13651. onConstruct() {
  13652. this.n3 = (this.getChild("n3"));
  13653. this.n1 = (this.getChild("n1"));
  13654. this.t0 = this.getTransition("t0");
  13655. }
  13656. }
  13657. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13658. class ui_hb_jinbi1 extends fgui.GButton {
  13659. static createInstance() {
  13660. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13661. }
  13662. onConstruct() {
  13663. this.n20 = (this.getChild("n20"));
  13664. this.n25 = (this.getChild("n25"));
  13665. this.coinTxt = (this.getChild("coinTxt"));
  13666. this.n28 = (this.getChild("n28"));
  13667. this.n32 = (this.getChild("n32"));
  13668. this.n38 = (this.getChild("n38"));
  13669. this.n45 = (this.getChild("n45"));
  13670. this.getTips = (this.getChild("getTips"));
  13671. this.n39 = (this.getChild("n39"));
  13672. this.diamondTxt = (this.getChild("diamondTxt"));
  13673. this.n41 = (this.getChild("n41"));
  13674. this.n42 = (this.getChild("n42"));
  13675. this.n46 = (this.getChild("n46"));
  13676. this.n47 = (this.getChild("n47"));
  13677. this.n48 = (this.getChild("n48"));
  13678. this.t0 = this.getTransition("t0");
  13679. }
  13680. }
  13681. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13682. class ui_hb_jinbi2 extends fgui.GButton {
  13683. static createInstance() {
  13684. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13685. }
  13686. onConstruct() {
  13687. this.n20 = (this.getChild("n20"));
  13688. this.n25 = (this.getChild("n25"));
  13689. this.coinTxt = (this.getChild("coinTxt"));
  13690. this.n28 = (this.getChild("n28"));
  13691. this.n32 = (this.getChild("n32"));
  13692. this.n38 = (this.getChild("n38"));
  13693. this.n39 = (this.getChild("n39"));
  13694. this.diamondTxt = (this.getChild("diamondTxt"));
  13695. this.n41 = (this.getChild("n41"));
  13696. this.n42 = (this.getChild("n42"));
  13697. this.n43 = (this.getChild("n43"));
  13698. this.n44 = (this.getChild("n44"));
  13699. this.n45 = (this.getChild("n45"));
  13700. this.t0 = this.getTransition("t0");
  13701. }
  13702. }
  13703. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13704. class ui_hb_jinbi3 extends fgui.GButton {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13707. }
  13708. onConstruct() {
  13709. this.n20 = (this.getChild("n20"));
  13710. this.n25 = (this.getChild("n25"));
  13711. this.coinTxt = (this.getChild("coinTxt"));
  13712. this.n28 = (this.getChild("n28"));
  13713. this.n32 = (this.getChild("n32"));
  13714. this.n38 = (this.getChild("n38"));
  13715. this.n39 = (this.getChild("n39"));
  13716. this.diamondTxt = (this.getChild("diamondTxt"));
  13717. this.n41 = (this.getChild("n41"));
  13718. this.n42 = (this.getChild("n42"));
  13719. this.n43 = (this.getChild("n43"));
  13720. this.n44 = (this.getChild("n44"));
  13721. this.n45 = (this.getChild("n45"));
  13722. this.t0 = this.getTransition("t0");
  13723. }
  13724. }
  13725. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13726. class ui_Component104 extends fgui.GComponent {
  13727. static createInstance() {
  13728. return (fgui.UIPackage.createObject("game", "Component104"));
  13729. }
  13730. onConstruct() {
  13731. this.c1 = this.getController("c1");
  13732. this.n12 = (this.getChild("n12"));
  13733. this.coinBtn = (this.getChild("coinBtn"));
  13734. this.diamondBtn = (this.getChild("diamondBtn"));
  13735. this.node3 = (this.getChild("node3"));
  13736. this.node4 = (this.getChild("node4"));
  13737. this.node5 = (this.getChild("node5"));
  13738. this.node1 = (this.getChild("node1"));
  13739. this.node2 = (this.getChild("node2"));
  13740. this.node6 = (this.getChild("node6"));
  13741. this.t0 = this.getTransition("t0");
  13742. }
  13743. }
  13744. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13745. class ui_Component105 extends fgui.GButton {
  13746. static createInstance() {
  13747. return (fgui.UIPackage.createObject("game", "Component105"));
  13748. }
  13749. onConstruct() {
  13750. this.c1 = this.getController("c1");
  13751. this.n49 = (this.getChild("n49"));
  13752. this.n18 = (this.getChild("n18"));
  13753. this.n46 = (this.getChild("n46"));
  13754. this.n48 = (this.getChild("n48"));
  13755. }
  13756. }
  13757. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13758. class ui_Component106 extends fgui.GButton {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "Component106"));
  13761. }
  13762. onConstruct() {
  13763. this.c1 = this.getController("c1");
  13764. this.n49 = (this.getChild("n49"));
  13765. this.n18 = (this.getChild("n18"));
  13766. this.n46 = (this.getChild("n46"));
  13767. this.n48 = (this.getChild("n48"));
  13768. }
  13769. }
  13770. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13771. class ui_hb_zs1 extends fgui.GButton {
  13772. static createInstance() {
  13773. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13774. }
  13775. onConstruct() {
  13776. this.c1 = this.getController("c1");
  13777. this.n20 = (this.getChild("n20"));
  13778. this.n21 = (this.getChild("n21"));
  13779. this.n26 = (this.getChild("n26"));
  13780. this.n27 = (this.getChild("n27"));
  13781. this.shareTxt = (this.getChild("shareTxt"));
  13782. this.n32 = (this.getChild("n32"));
  13783. this.n38 = (this.getChild("n38"));
  13784. this.n39 = (this.getChild("n39"));
  13785. this.n44 = (this.getChild("n44"));
  13786. this.diamondTxt = (this.getChild("diamondTxt"));
  13787. this.n41 = (this.getChild("n41"));
  13788. this.n45 = (this.getChild("n45"));
  13789. this.n47 = (this.getChild("n47"));
  13790. this.n48 = (this.getChild("n48"));
  13791. this.randTxt = (this.getChild("randTxt"));
  13792. this.n50 = (this.getChild("n50"));
  13793. this.t0 = this.getTransition("t0");
  13794. }
  13795. }
  13796. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13797. class ui_dh_zs1 extends fgui.GComponent {
  13798. static createInstance() {
  13799. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13800. }
  13801. onConstruct() {
  13802. this.n10 = (this.getChild("n10"));
  13803. this.n9 = (this.getChild("n9"));
  13804. this.n1 = (this.getChild("n1"));
  13805. this.n2 = (this.getChild("n2"));
  13806. this.n3 = (this.getChild("n3"));
  13807. this.n4 = (this.getChild("n4"));
  13808. this.n5 = (this.getChild("n5"));
  13809. this.n6 = (this.getChild("n6"));
  13810. this.n8 = (this.getChild("n8"));
  13811. this.n11 = (this.getChild("n11"));
  13812. this.t0 = this.getTransition("t0");
  13813. }
  13814. }
  13815. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13816. class ui_dh_zs1_1 extends fgui.GComponent {
  13817. static createInstance() {
  13818. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13819. }
  13820. onConstruct() {
  13821. this.n3 = (this.getChild("n3"));
  13822. this.n1 = (this.getChild("n1"));
  13823. this.t0 = this.getTransition("t0");
  13824. }
  13825. }
  13826. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13827. class ui_hb_zs2 extends fgui.GButton {
  13828. static createInstance() {
  13829. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13830. }
  13831. onConstruct() {
  13832. this.n20 = (this.getChild("n20"));
  13833. this.n21 = (this.getChild("n21"));
  13834. this.n26 = (this.getChild("n26"));
  13835. this.n27 = (this.getChild("n27"));
  13836. this.n32 = (this.getChild("n32"));
  13837. this.n38 = (this.getChild("n38"));
  13838. this.n39 = (this.getChild("n39"));
  13839. this.n44 = (this.getChild("n44"));
  13840. this.diamondTxt = (this.getChild("diamondTxt"));
  13841. this.n41 = (this.getChild("n41"));
  13842. this.n45 = (this.getChild("n45"));
  13843. this.t0 = this.getTransition("t0");
  13844. }
  13845. }
  13846. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13847. class ui_hb_zs3 extends fgui.GButton {
  13848. static createInstance() {
  13849. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13850. }
  13851. onConstruct() {
  13852. this.n20 = (this.getChild("n20"));
  13853. this.n21 = (this.getChild("n21"));
  13854. this.n26 = (this.getChild("n26"));
  13855. this.n27 = (this.getChild("n27"));
  13856. this.n32 = (this.getChild("n32"));
  13857. this.n38 = (this.getChild("n38"));
  13858. this.n47 = (this.getChild("n47"));
  13859. this.t0 = this.getTransition("t0");
  13860. }
  13861. }
  13862. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13863. class ui_dh_zs2 extends fgui.GComponent {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13866. }
  13867. onConstruct() {
  13868. this.n10 = (this.getChild("n10"));
  13869. this.n9 = (this.getChild("n9"));
  13870. this.n1 = (this.getChild("n1"));
  13871. this.n2 = (this.getChild("n2"));
  13872. this.n3 = (this.getChild("n3"));
  13873. this.n4 = (this.getChild("n4"));
  13874. this.n5 = (this.getChild("n5"));
  13875. this.n6 = (this.getChild("n6"));
  13876. this.n8 = (this.getChild("n8"));
  13877. this.n11 = (this.getChild("n11"));
  13878. this.t0 = this.getTransition("t0");
  13879. }
  13880. }
  13881. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13882. class ui_dh_zs2_1 extends fgui.GComponent {
  13883. static createInstance() {
  13884. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13885. }
  13886. onConstruct() {
  13887. this.n3 = (this.getChild("n3"));
  13888. this.n1 = (this.getChild("n1"));
  13889. this.t0 = this.getTransition("t0");
  13890. }
  13891. }
  13892. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13893. class ui_dh_zs3 extends fgui.GComponent {
  13894. static createInstance() {
  13895. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13896. }
  13897. onConstruct() {
  13898. this.n10 = (this.getChild("n10"));
  13899. this.n9 = (this.getChild("n9"));
  13900. this.n1 = (this.getChild("n1"));
  13901. this.n2 = (this.getChild("n2"));
  13902. this.n3 = (this.getChild("n3"));
  13903. this.n4 = (this.getChild("n4"));
  13904. this.n5 = (this.getChild("n5"));
  13905. this.n6 = (this.getChild("n6"));
  13906. this.n8 = (this.getChild("n8"));
  13907. this.n11 = (this.getChild("n11"));
  13908. this.t0 = this.getTransition("t0");
  13909. }
  13910. }
  13911. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13912. class ui_dh_zs3_1 extends fgui.GComponent {
  13913. static createInstance() {
  13914. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13915. }
  13916. onConstruct() {
  13917. this.n3 = (this.getChild("n3"));
  13918. this.n1 = (this.getChild("n1"));
  13919. this.t0 = this.getTransition("t0");
  13920. }
  13921. }
  13922. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13923. class ui_Component107 extends fgui.GComponent {
  13924. static createInstance() {
  13925. return (fgui.UIPackage.createObject("game", "Component107"));
  13926. }
  13927. onConstruct() {
  13928. this.n18 = (this.getChild("n18"));
  13929. this.n19 = (this.getChild("n19"));
  13930. this.n20 = (this.getChild("n20"));
  13931. this.n21 = (this.getChild("n21"));
  13932. this.n22 = (this.getChild("n22"));
  13933. this.levelTxt = (this.getChild("levelTxt"));
  13934. this.t0 = this.getTransition("t0");
  13935. }
  13936. }
  13937. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13938. class ui_box_com1 extends fgui.GComponent {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "box_com1"));
  13941. }
  13942. onConstruct() {
  13943. this.n14 = (this.getChild("n14"));
  13944. this.n6 = (this.getChild("n6"));
  13945. this.t0 = this.getTransition("t0");
  13946. }
  13947. }
  13948. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13949. class ui_box_com2 extends fgui.GProgressBar {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "box_com2"));
  13952. }
  13953. onConstruct() {
  13954. this.bg0 = (this.getChild("bg0"));
  13955. this.bg = (this.getChild("bg"));
  13956. this.bar = (this.getChild("bar"));
  13957. this.n7 = (this.getChild("n7"));
  13958. this.n8 = (this.getChild("n8"));
  13959. this.n10 = (this.getChild("n10"));
  13960. this.n11 = (this.getChild("n11"));
  13961. this.n12 = (this.getChild("n12"));
  13962. }
  13963. }
  13964. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13965. class ui_box_com4 extends fgui.GComponent {
  13966. static createInstance() {
  13967. return (fgui.UIPackage.createObject("game", "box_com4"));
  13968. }
  13969. onConstruct() {
  13970. this.n8 = (this.getChild("n8"));
  13971. this.t0 = this.getTransition("t0");
  13972. }
  13973. }
  13974. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13975. class ui_box_com3 extends fgui.GComponent {
  13976. static createInstance() {
  13977. return (fgui.UIPackage.createObject("game", "box_com3"));
  13978. }
  13979. onConstruct() {
  13980. this.n2 = (this.getChild("n2"));
  13981. this.n3 = (this.getChild("n3"));
  13982. this.n4 = (this.getChild("n4"));
  13983. this.n5 = (this.getChild("n5"));
  13984. this.t0 = this.getTransition("t0");
  13985. this.t1 = this.getTransition("t1");
  13986. }
  13987. }
  13988. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13989. class ui_Component97 extends fgui.GComponent {
  13990. static createInstance() {
  13991. return (fgui.UIPackage.createObject("game", "Component97"));
  13992. }
  13993. onConstruct() {
  13994. this.c1 = this.getController("c1");
  13995. this.n46 = (this.getChild("n46"));
  13996. this.diamondNode = (this.getChild("diamondNode"));
  13997. this.coinNode = (this.getChild("coinNode"));
  13998. this.t0 = this.getTransition("t0");
  13999. }
  14000. }
  14001. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  14002. class ui_Component98 extends fgui.GButton {
  14003. static createInstance() {
  14004. return (fgui.UIPackage.createObject("game", "Component98"));
  14005. }
  14006. onConstruct() {
  14007. this.n8 = (this.getChild("n8"));
  14008. this.n40 = (this.getChild("n40"));
  14009. }
  14010. }
  14011. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  14012. class ui_Component28_11 extends fgui.GButton {
  14013. static createInstance() {
  14014. return (fgui.UIPackage.createObject("game", "Component28_11"));
  14015. }
  14016. onConstruct() {
  14017. this.c1 = this.getController("c1");
  14018. this.n12 = (this.getChild("n12"));
  14019. this.n17 = (this.getChild("n17"));
  14020. this.n13 = (this.getChild("n13"));
  14021. this.diamondTxt = (this.getChild("diamondTxt"));
  14022. this.n15 = (this.getChild("n15"));
  14023. this.n16 = (this.getChild("n16"));
  14024. }
  14025. }
  14026. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  14027. class ui_Component58_11 extends fgui.GComponent {
  14028. static createInstance() {
  14029. return (fgui.UIPackage.createObject("game", "Component58_11"));
  14030. }
  14031. onConstruct() {
  14032. this.c1 = this.getController("c1");
  14033. this.n23 = (this.getChild("n23"));
  14034. this.n41 = (this.getChild("n41"));
  14035. this.n_qiuGan = (this.getChild("n_qiuGan"));
  14036. this.n_daoju = (this.getChild("n_daoju"));
  14037. this.myList = (this.getChild("myList"));
  14038. this.djList = (this.getChild("djList"));
  14039. this.t0 = this.getTransition("t0");
  14040. }
  14041. }
  14042. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  14043. class ui_Component100 extends fgui.GComponent {
  14044. static createInstance() {
  14045. return (fgui.UIPackage.createObject("game", "Component100"));
  14046. }
  14047. onConstruct() {
  14048. this.c1 = this.getController("c1");
  14049. this.n75 = (this.getChild("n75"));
  14050. this.n76 = (this.getChild("n76"));
  14051. this.n80 = (this.getChild("n80"));
  14052. this.txt = (this.getChild("txt"));
  14053. this.spineRoot = (this.getChild("spineRoot"));
  14054. }
  14055. }
  14056. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  14057. class ui_Component101 extends fgui.GComponent {
  14058. static createInstance() {
  14059. return (fgui.UIPackage.createObject("game", "Component101"));
  14060. }
  14061. onConstruct() {
  14062. this.c1 = this.getController("c1");
  14063. this.n36 = (this.getChild("n36"));
  14064. this.n35 = (this.getChild("n35"));
  14065. this.n33 = (this.getChild("n33"));
  14066. this.n34 = (this.getChild("n34"));
  14067. }
  14068. }
  14069. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  14070. class ui_Component53 extends fgui.GComponent {
  14071. static createInstance() {
  14072. return (fgui.UIPackage.createObject("game", "Component53"));
  14073. }
  14074. onConstruct() {
  14075. this.n0 = (this.getChild("n0"));
  14076. this.n1 = (this.getChild("n1"));
  14077. this.n2 = (this.getChild("n2"));
  14078. this.n3 = (this.getChild("n3"));
  14079. this.n4 = (this.getChild("n4"));
  14080. this.n5 = (this.getChild("n5"));
  14081. this.n6 = (this.getChild("n6"));
  14082. this.n7 = (this.getChild("n7"));
  14083. this.n8 = (this.getChild("n8"));
  14084. this.n9 = (this.getChild("n9"));
  14085. this.n10 = (this.getChild("n10"));
  14086. this.n11 = (this.getChild("n11"));
  14087. this.n12 = (this.getChild("n12"));
  14088. this.n13 = (this.getChild("n13"));
  14089. this.n14 = (this.getChild("n14"));
  14090. this.n15 = (this.getChild("n15"));
  14091. this.n16 = (this.getChild("n16"));
  14092. this.n19 = (this.getChild("n19"));
  14093. this.n20 = (this.getChild("n20"));
  14094. this.n21 = (this.getChild("n21"));
  14095. this.n22 = (this.getChild("n22"));
  14096. this.n23 = (this.getChild("n23"));
  14097. this.n24 = (this.getChild("n24"));
  14098. this.n25 = (this.getChild("n25"));
  14099. this.n26 = (this.getChild("n26"));
  14100. this.n27 = (this.getChild("n27"));
  14101. this.n28 = (this.getChild("n28"));
  14102. this.n29 = (this.getChild("n29"));
  14103. this.n30 = (this.getChild("n30"));
  14104. this.n31 = (this.getChild("n31"));
  14105. this.n32 = (this.getChild("n32"));
  14106. this.n33 = (this.getChild("n33"));
  14107. this.n34 = (this.getChild("n34"));
  14108. this.n35 = (this.getChild("n35"));
  14109. this.t0 = this.getTransition("t0");
  14110. }
  14111. }
  14112. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  14113. class ui_Component58 extends fgui.GComponent {
  14114. static createInstance() {
  14115. return (fgui.UIPackage.createObject("game", "Component58"));
  14116. }
  14117. onConstruct() {
  14118. this.n23 = (this.getChild("n23"));
  14119. this.n41 = (this.getChild("n41"));
  14120. this.n8 = (this.getChild("n8"));
  14121. this.skillList = (this.getChild("skillList"));
  14122. this.t0 = this.getTransition("t0");
  14123. }
  14124. }
  14125. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  14126. class ui_Component59 extends fgui.GComponent {
  14127. static createInstance() {
  14128. return (fgui.UIPackage.createObject("game", "Component59"));
  14129. }
  14130. onConstruct() {
  14131. this.n3 = (this.getChild("n3"));
  14132. this.msgTxt = (this.getChild("msgTxt"));
  14133. this.t0 = this.getTransition("t0");
  14134. }
  14135. }
  14136. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  14137. class ui_Component_lc2 extends fgui.GComponent {
  14138. static createInstance() {
  14139. return (fgui.UIPackage.createObject("game", "Component_lc2"));
  14140. }
  14141. onConstruct() {
  14142. this.n0 = (this.getChild("n0"));
  14143. this.n1_bai = (this.getChild("n1_bai"));
  14144. }
  14145. }
  14146. ui_Component_lc2.URL = "ui://isxx5ak7ggd1v5ay";
  14147. class ui_Component_shou2 extends fgui.GComponent {
  14148. static createInstance() {
  14149. return (fgui.UIPackage.createObject("game", "Component_shou2"));
  14150. }
  14151. onConstruct() {
  14152. this.n57 = (this.getChild("n57"));
  14153. this.n54 = (this.getChild("n54"));
  14154. this.n55 = (this.getChild("n55"));
  14155. this.n56 = (this.getChild("n56"));
  14156. this.t1 = this.getTransition("t1");
  14157. }
  14158. }
  14159. ui_Component_shou2.URL = "ui://isxx5ak7ggd1v5b0";
  14160. class ui_RulerNode extends fgui.GComponent {
  14161. static createInstance() {
  14162. return (fgui.UIPackage.createObject("game", "RulerNode"));
  14163. }
  14164. onConstruct() {
  14165. this.n6 = (this.getChild("n6"));
  14166. this.n4 = (this.getChild("n4"));
  14167. this.img1 = (this.getChild("img1"));
  14168. this.img2 = (this.getChild("img2"));
  14169. }
  14170. }
  14171. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  14172. class ui_Component108 extends fgui.GComponent {
  14173. static createInstance() {
  14174. return (fgui.UIPackage.createObject("game", "Component108"));
  14175. }
  14176. onConstruct() {
  14177. this.n19 = (this.getChild("n19"));
  14178. this.t0 = this.getTransition("t0");
  14179. }
  14180. }
  14181. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14182. class ui_Component63 extends fgui.GComponent {
  14183. static createInstance() {
  14184. return (fgui.UIPackage.createObject("game", "Component63"));
  14185. }
  14186. onConstruct() {
  14187. this.n66 = (this.getChild("n66"));
  14188. this.n56 = (this.getChild("n56"));
  14189. this.n63 = (this.getChild("n63"));
  14190. this.n65 = (this.getChild("n65"));
  14191. this.t0 = this.getTransition("t0");
  14192. }
  14193. }
  14194. ui_Component63.URL = "ui://isxx5ak7h657452";
  14195. class ui_topNode extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "topNode"));
  14198. }
  14199. onConstruct() {
  14200. this.selfProgress = (this.getChild("selfProgress"));
  14201. this.aiProgress = (this.getChild("aiProgress"));
  14202. this.selfKuang = (this.getChild("selfKuang"));
  14203. this.aiKuang = (this.getChild("aiKuang"));
  14204. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14205. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14206. this.n33 = (this.getChild("n33"));
  14207. this.n34 = (this.getChild("n34"));
  14208. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14209. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14210. this.selfBallList = (this.getChild("selfBallList"));
  14211. this.aiBallList = (this.getChild("aiBallList"));
  14212. this.middleNode = (this.getChild("middleNode"));
  14213. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14214. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14215. this.scoreNode = (this.getChild("scoreNode"));
  14216. this.selfTips = (this.getChild("selfTips"));
  14217. this.aiTips = (this.getChild("aiTips"));
  14218. }
  14219. }
  14220. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14221. class ui_selfProgress extends fgui.GProgressBar {
  14222. static createInstance() {
  14223. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14224. }
  14225. onConstruct() {
  14226. this.n3 = (this.getChild("n3"));
  14227. this.bar = (this.getChild("bar"));
  14228. }
  14229. }
  14230. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14231. class ui_aiProgress extends fgui.GProgressBar {
  14232. static createInstance() {
  14233. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14234. }
  14235. onConstruct() {
  14236. this.n3 = (this.getChild("n3"));
  14237. this.bar = (this.getChild("bar"));
  14238. }
  14239. }
  14240. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14241. class ui_ballDisplay extends fgui.GComponent {
  14242. static createInstance() {
  14243. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14244. }
  14245. onConstruct() {
  14246. this.myImg = (this.getChild("myImg"));
  14247. }
  14248. }
  14249. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14250. class ui_moveNode extends fgui.GComponent {
  14251. static createInstance() {
  14252. return (fgui.UIPackage.createObject("game", "moveNode"));
  14253. }
  14254. onConstruct() {
  14255. this.n8 = (this.getChild("n8"));
  14256. this.finger = (this.getChild("finger"));
  14257. }
  14258. }
  14259. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14260. class ui_cancelBtn extends fgui.GButton {
  14261. static createInstance() {
  14262. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14263. }
  14264. onConstruct() {
  14265. this.c1 = this.getController("c1");
  14266. this.n0 = (this.getChild("n0"));
  14267. this.n1 = (this.getChild("n1"));
  14268. }
  14269. }
  14270. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14271. class ui_shareBtn extends fgui.GButton {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14274. }
  14275. onConstruct() {
  14276. this.c1 = this.getController("c1");
  14277. this.n2 = (this.getChild("n2"));
  14278. this.n1 = (this.getChild("n1"));
  14279. this.n3 = (this.getChild("n3"));
  14280. this.n4 = (this.getChild("n4"));
  14281. this.n5 = (this.getChild("n5"));
  14282. this.n6 = (this.getChild("n6"));
  14283. }
  14284. }
  14285. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14286. class ui_share2Btn extends fgui.GButton {
  14287. static createInstance() {
  14288. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14289. }
  14290. onConstruct() {
  14291. this.n3 = (this.getChild("n3"));
  14292. }
  14293. }
  14294. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14295. class ui_rodMethodNode extends fgui.GComponent {
  14296. static createInstance() {
  14297. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14298. }
  14299. onConstruct() {
  14300. this.bg = (this.getChild("bg"));
  14301. this.dot = (this.getChild("dot"));
  14302. }
  14303. }
  14304. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14305. class ui_sureBtn extends fgui.GButton {
  14306. static createInstance() {
  14307. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14308. }
  14309. onConstruct() {
  14310. this.n2 = (this.getChild("n2"));
  14311. this.n1 = (this.getChild("n1"));
  14312. }
  14313. }
  14314. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14315. class ui_Component18 extends fgui.GComponent {
  14316. static createInstance() {
  14317. return (fgui.UIPackage.createObject("game", "Component18"));
  14318. }
  14319. onConstruct() {
  14320. this.c1 = this.getController("c1");
  14321. this.nameTxt = (this.getChild("nameTxt"));
  14322. this.headImg = (this.getChild("headImg"));
  14323. this.n24 = (this.getChild("n24"));
  14324. this.skillImg = (this.getChild("skillImg"));
  14325. this.skillTxt = (this.getChild("skillTxt"));
  14326. }
  14327. }
  14328. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14329. class ui_Component45 extends fgui.GComponent {
  14330. static createInstance() {
  14331. return (fgui.UIPackage.createObject("game", "Component45"));
  14332. }
  14333. onConstruct() {
  14334. this.c1 = this.getController("c1");
  14335. this.n40 = (this.getChild("n40"));
  14336. this.n41 = (this.getChild("n41"));
  14337. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14338. this.n42 = (this.getChild("n42"));
  14339. this.awardTxt = (this.getChild("awardTxt"));
  14340. this.n44 = (this.getChild("n44"));
  14341. this.t0 = this.getTransition("t0");
  14342. }
  14343. }
  14344. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14345. class ui_emotionDisplay extends fgui.GButton {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14348. }
  14349. onConstruct() {
  14350. this.myIcon = (this.getChild("myIcon"));
  14351. }
  14352. }
  14353. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14354. class ui_Component49 extends fgui.GButton {
  14355. static createInstance() {
  14356. return (fgui.UIPackage.createObject("game", "Component49"));
  14357. }
  14358. onConstruct() {
  14359. this.n69 = (this.getChild("n69"));
  14360. this.n56 = (this.getChild("n56"));
  14361. }
  14362. }
  14363. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14364. class ui_Component50 extends fgui.GButton {
  14365. static createInstance() {
  14366. return (fgui.UIPackage.createObject("game", "Component50"));
  14367. }
  14368. onConstruct() {
  14369. this.n54 = (this.getChild("n54"));
  14370. this.n65 = (this.getChild("n65"));
  14371. }
  14372. }
  14373. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14374. class ui_Component51 extends fgui.GButton {
  14375. static createInstance() {
  14376. return (fgui.UIPackage.createObject("game", "Component51"));
  14377. }
  14378. onConstruct() {
  14379. this.c1 = this.getController("c1");
  14380. this.n51 = (this.getChild("n51"));
  14381. this.n54 = (this.getChild("n54"));
  14382. }
  14383. }
  14384. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14385. class ui_Button5 extends fgui.GButton {
  14386. static createInstance() {
  14387. return (fgui.UIPackage.createObject("game", "Button5"));
  14388. }
  14389. onConstruct() {
  14390. this.c1 = this.getController("c1");
  14391. this.n0 = (this.getChild("n0"));
  14392. this.n2 = (this.getChild("n2"));
  14393. }
  14394. }
  14395. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14396. class ui_Component124 extends fgui.GComponent {
  14397. static createInstance() {
  14398. return (fgui.UIPackage.createObject("game", "Component124"));
  14399. }
  14400. onConstruct() {
  14401. this.n22 = (this.getChild("n22"));
  14402. this.shareNode = (this.getChild("shareNode"));
  14403. }
  14404. }
  14405. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14406. class ui_Component125 extends fgui.GComponent {
  14407. static createInstance() {
  14408. return (fgui.UIPackage.createObject("game", "Component125"));
  14409. }
  14410. onConstruct() {
  14411. this.n29 = (this.getChild("n29"));
  14412. this.coinTxt = (this.getChild("coinTxt"));
  14413. }
  14414. }
  14415. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14416. class ui_Component52 extends fgui.GButton {
  14417. static createInstance() {
  14418. return (fgui.UIPackage.createObject("game", "Component52"));
  14419. }
  14420. onConstruct() {
  14421. this.n35 = (this.getChild("n35"));
  14422. this.n36 = (this.getChild("n36"));
  14423. }
  14424. }
  14425. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14426. class ui_Component_denglu extends fgui.GComponent {
  14427. static createInstance() {
  14428. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14429. }
  14430. onConstruct() {
  14431. this.c1 = this.getController("c1");
  14432. this.n102 = (this.getChild("n102"));
  14433. this.n103 = (this.getChild("n103"));
  14434. }
  14435. }
  14436. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14437. class ui_UIFuli1 extends fgui.GComponent {
  14438. static createInstance() {
  14439. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14440. }
  14441. onConstruct() {
  14442. this.n1 = (this.getChild("n1"));
  14443. this.n2 = (this.getChild("n2"));
  14444. }
  14445. }
  14446. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14447. class ui_Component_fl_1 extends fgui.GComponent {
  14448. static createInstance() {
  14449. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14450. }
  14451. onConstruct() {
  14452. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14453. this.txt_price = (this.getChild("txt_price"));
  14454. this.n_no = (this.getChild("n_no"));
  14455. this.n_buy = (this.getChild("n_buy"));
  14456. }
  14457. }
  14458. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14459. class ui_Component_fl_2 extends fgui.GComponent {
  14460. static createInstance() {
  14461. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14462. }
  14463. onConstruct() {
  14464. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14465. this.txt_price = (this.getChild("txt_price"));
  14466. this.n_no = (this.getChild("n_no"));
  14467. this.n_buy = (this.getChild("n_buy"));
  14468. }
  14469. }
  14470. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14471. class ui_UIFuli2 extends fgui.GComponent {
  14472. static createInstance() {
  14473. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14474. }
  14475. onConstruct() {
  14476. this.n1 = (this.getChild("n1"));
  14477. this.n2 = (this.getChild("n2"));
  14478. }
  14479. }
  14480. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14481. class ui_drawBtn extends fgui.GButton {
  14482. static createInstance() {
  14483. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14484. }
  14485. onConstruct() {
  14486. this.c1 = this.getController("c1");
  14487. this.n2 = (this.getChild("n2"));
  14488. this.n1 = (this.getChild("n1"));
  14489. this.n5 = (this.getChild("n5"));
  14490. }
  14491. }
  14492. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14493. class ui_Component43 extends fgui.GButton {
  14494. static createInstance() {
  14495. return (fgui.UIPackage.createObject("game", "Component43"));
  14496. }
  14497. onConstruct() {
  14498. this.n49 = (this.getChild("n49"));
  14499. }
  14500. }
  14501. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14502. class ui_wordsDisplay extends fgui.GComponent {
  14503. static createInstance() {
  14504. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14505. }
  14506. onConstruct() {
  14507. this.txt = (this.getChild("txt"));
  14508. this.n63 = (this.getChild("n63"));
  14509. }
  14510. }
  14511. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14512. class ui_Component_phb extends fgui.GComponent {
  14513. static createInstance() {
  14514. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14515. }
  14516. onConstruct() {
  14517. this.n3 = (this.getChild("n3"));
  14518. this.n4 = (this.getChild("n4"));
  14519. }
  14520. }
  14521. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14522. class ui_Component3 extends fgui.GComponent {
  14523. static createInstance() {
  14524. return (fgui.UIPackage.createObject("game", "Component3"));
  14525. }
  14526. onConstruct() {
  14527. this.n26 = (this.getChild("n26"));
  14528. this.n24 = (this.getChild("n24"));
  14529. this.nameTxt = (this.getChild("nameTxt"));
  14530. this.headRoot = (this.getChild("headRoot"));
  14531. }
  14532. }
  14533. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14534. class ui_Component4 extends fgui.GComponent {
  14535. static createInstance() {
  14536. return (fgui.UIPackage.createObject("game", "Component4"));
  14537. }
  14538. onConstruct() {
  14539. this.headImg = (this.getChild("headImg"));
  14540. }
  14541. }
  14542. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14543. class ui_Component7 extends fgui.GButton {
  14544. static createInstance() {
  14545. return (fgui.UIPackage.createObject("game", "Component7"));
  14546. }
  14547. onConstruct() {
  14548. this.n17 = (this.getChild("n17"));
  14549. }
  14550. }
  14551. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14552. class ui_Component8 extends fgui.GButton {
  14553. static createInstance() {
  14554. return (fgui.UIPackage.createObject("game", "Component8"));
  14555. }
  14556. onConstruct() {
  14557. this.n19 = (this.getChild("n19"));
  14558. }
  14559. }
  14560. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14561. class ui_Component10 extends fgui.GButton {
  14562. static createInstance() {
  14563. return (fgui.UIPackage.createObject("game", "Component10"));
  14564. }
  14565. onConstruct() {
  14566. this.c1 = this.getController("c1");
  14567. this.n40 = (this.getChild("n40"));
  14568. }
  14569. }
  14570. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14571. class ui_Component11 extends fgui.GButton {
  14572. static createInstance() {
  14573. return (fgui.UIPackage.createObject("game", "Component11"));
  14574. }
  14575. onConstruct() {
  14576. this.n34 = (this.getChild("n34"));
  14577. }
  14578. }
  14579. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14580. class ui_Component12 extends fgui.GButton {
  14581. static createInstance() {
  14582. return (fgui.UIPackage.createObject("game", "Component12"));
  14583. }
  14584. onConstruct() {
  14585. this.n35 = (this.getChild("n35"));
  14586. }
  14587. }
  14588. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14589. class ui_Component13 extends fgui.GButton {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("game", "Component13"));
  14592. }
  14593. onConstruct() {
  14594. this.n27 = (this.getChild("n27"));
  14595. this.n36 = (this.getChild("n36"));
  14596. }
  14597. }
  14598. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14599. class ui_dh_js_tuowei extends fgui.GComponent {
  14600. static createInstance() {
  14601. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14602. }
  14603. onConstruct() {
  14604. this.n19 = (this.getChild("n19"));
  14605. this.n18 = (this.getChild("n18"));
  14606. this.n0 = (this.getChild("n0"));
  14607. this.n3 = (this.getChild("n3"));
  14608. this.n4 = (this.getChild("n4"));
  14609. this.n5 = (this.getChild("n5"));
  14610. this.n6 = (this.getChild("n6"));
  14611. this.n8 = (this.getChild("n8"));
  14612. this.n9 = (this.getChild("n9"));
  14613. this.n10 = (this.getChild("n10"));
  14614. this.n11 = (this.getChild("n11"));
  14615. this.n12 = (this.getChild("n12"));
  14616. this.n13 = (this.getChild("n13"));
  14617. this.n14 = (this.getChild("n14"));
  14618. this.n15 = (this.getChild("n15"));
  14619. this.n20 = (this.getChild("n20"));
  14620. this.t0 = this.getTransition("t0");
  14621. this.t1 = this.getTransition("t1");
  14622. }
  14623. }
  14624. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14625. class ui_dh_js_tw_g extends fgui.GComponent {
  14626. static createInstance() {
  14627. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14628. }
  14629. onConstruct() {
  14630. this.n0 = (this.getChild("n0"));
  14631. this.n1 = (this.getChild("n1"));
  14632. this.t0 = this.getTransition("t0");
  14633. }
  14634. }
  14635. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14636. class ui_dh_js_xingxing extends fgui.GComponent {
  14637. static createInstance() {
  14638. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14639. }
  14640. onConstruct() {
  14641. this.n1 = (this.getChild("n1"));
  14642. this.n2 = (this.getChild("n2"));
  14643. this.n3 = (this.getChild("n3"));
  14644. this.n4 = (this.getChild("n4"));
  14645. this.n0 = (this.getChild("n0"));
  14646. this.t2 = this.getTransition("t2");
  14647. this.t1 = this.getTransition("t1");
  14648. }
  14649. }
  14650. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14651. class ui_dh_zy_jiazai extends fgui.GComponent {
  14652. static createInstance() {
  14653. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14654. }
  14655. onConstruct() {
  14656. this.c1 = this.getController("c1");
  14657. this.n0 = (this.getChild("n0"));
  14658. this.n1 = (this.getChild("n1"));
  14659. this.n2 = (this.getChild("n2"));
  14660. this.n4 = (this.getChild("n4"));
  14661. this.n5 = (this.getChild("n5"));
  14662. this.n6 = (this.getChild("n6"));
  14663. this.n8 = (this.getChild("n8"));
  14664. this.n7 = (this.getChild("n7"));
  14665. this.t0 = this.getTransition("t0");
  14666. }
  14667. }
  14668. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14669. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14670. static createInstance() {
  14671. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14672. }
  14673. onConstruct() {
  14674. this.c1 = this.getController("c1");
  14675. this.n3 = (this.getChild("n3"));
  14676. this.n5 = (this.getChild("n5"));
  14677. this.n4 = (this.getChild("n4"));
  14678. this.n0 = (this.getChild("n0"));
  14679. this.n1 = (this.getChild("n1"));
  14680. this.n2 = (this.getChild("n2"));
  14681. }
  14682. }
  14683. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14684. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14685. static createInstance() {
  14686. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14687. }
  14688. onConstruct() {
  14689. this.n19 = (this.getChild("n19"));
  14690. this.n21 = (this.getChild("n21"));
  14691. this.n0 = (this.getChild("n0"));
  14692. this.n3 = (this.getChild("n3"));
  14693. this.n4 = (this.getChild("n4"));
  14694. this.n5 = (this.getChild("n5"));
  14695. this.n6 = (this.getChild("n6"));
  14696. this.n8 = (this.getChild("n8"));
  14697. this.n9 = (this.getChild("n9"));
  14698. this.n10 = (this.getChild("n10"));
  14699. this.n11 = (this.getChild("n11"));
  14700. this.n12 = (this.getChild("n12"));
  14701. this.n13 = (this.getChild("n13"));
  14702. this.n14 = (this.getChild("n14"));
  14703. this.n15 = (this.getChild("n15"));
  14704. this.n23 = (this.getChild("n23"));
  14705. this.t0 = this.getTransition("t0");
  14706. this.t1 = this.getTransition("t1");
  14707. }
  14708. }
  14709. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14710. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14711. static createInstance() {
  14712. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14713. }
  14714. onConstruct() {
  14715. this.n1 = (this.getChild("n1"));
  14716. this.n2 = (this.getChild("n2"));
  14717. this.t0 = this.getTransition("t0");
  14718. }
  14719. }
  14720. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14721. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14722. static createInstance() {
  14723. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14724. }
  14725. onConstruct() {
  14726. this.n4 = (this.getChild("n4"));
  14727. this.n2 = (this.getChild("n2"));
  14728. this.n3 = (this.getChild("n3"));
  14729. this.idle = this.getTransition("idle");
  14730. this.attack = this.getTransition("attack");
  14731. }
  14732. }
  14733. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14734. class ui_special extends fgui.GComponent {
  14735. static createInstance() {
  14736. return (fgui.UIPackage.createObject("game", "special"));
  14737. }
  14738. onConstruct() {
  14739. this.n18 = (this.getChild("n18"));
  14740. this.n19 = (this.getChild("n19"));
  14741. this.n20 = (this.getChild("n20"));
  14742. this.n21 = (this.getChild("n21"));
  14743. this.n22 = (this.getChild("n22"));
  14744. this.levelTxt = (this.getChild("levelTxt"));
  14745. this.n24 = (this.getChild("n24"));
  14746. this.n25 = (this.getChild("n25"));
  14747. this.t0 = this.getTransition("t0");
  14748. }
  14749. }
  14750. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14751. class ui_Component145 extends fgui.GComponent {
  14752. static createInstance() {
  14753. return (fgui.UIPackage.createObject("game", "Component145"));
  14754. }
  14755. onConstruct() {
  14756. this.guanyuNode = (this.getChild("guanyuNode"));
  14757. }
  14758. }
  14759. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14760. class ui_longBtn extends fgui.GButton {
  14761. static createInstance() {
  14762. return (fgui.UIPackage.createObject("game", "longBtn"));
  14763. }
  14764. onConstruct() {
  14765. this.c1 = this.getController("c1");
  14766. this.n2 = (this.getChild("n2"));
  14767. this.n1 = (this.getChild("n1"));
  14768. this.n4 = (this.getChild("n4"));
  14769. }
  14770. }
  14771. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14772. class ui_Component146 extends fgui.GComponent {
  14773. static createInstance() {
  14774. return (fgui.UIPackage.createObject("game", "Component146"));
  14775. }
  14776. onConstruct() {
  14777. this.n89 = (this.getChild("n89"));
  14778. this.n90 = (this.getChild("n90"));
  14779. this.guideBtn = (this.getChild("guideBtn"));
  14780. }
  14781. }
  14782. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14783. class ui_Component146_11 extends fgui.GComponent {
  14784. static createInstance() {
  14785. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14786. }
  14787. onConstruct() {
  14788. this.n89 = (this.getChild("n89"));
  14789. this.n90 = (this.getChild("n90"));
  14790. this.guideBtn = (this.getChild("guideBtn"));
  14791. }
  14792. }
  14793. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14794. class ui_Component111_1 extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14797. }
  14798. onConstruct() {
  14799. this.n68 = (this.getChild("n68"));
  14800. this.myMask = (this.getChild("myMask"));
  14801. }
  14802. }
  14803. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14804. class ui_Component64_1 extends fgui.GComponent {
  14805. static createInstance() {
  14806. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14807. }
  14808. onConstruct() {
  14809. this.n57 = (this.getChild("n57"));
  14810. this.n54 = (this.getChild("n54"));
  14811. this.n55 = (this.getChild("n55"));
  14812. this.n56 = (this.getChild("n56"));
  14813. this.t1 = this.getTransition("t1");
  14814. }
  14815. }
  14816. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14817. class ui_ModeSelection_com123 extends fgui.GComponent {
  14818. static createInstance() {
  14819. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14820. }
  14821. onConstruct() {
  14822. this.type1 = (this.getChild("type1"));
  14823. this.type2 = (this.getChild("type2"));
  14824. this.type3 = (this.getChild("type3"));
  14825. this.n38 = (this.getChild("n38"));
  14826. this.t0 = this.getTransition("t0");
  14827. }
  14828. }
  14829. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14830. class ui_Component132_2 extends fgui.GComponent {
  14831. static createInstance() {
  14832. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14833. }
  14834. onConstruct() {
  14835. this.n25 = (this.getChild("n25"));
  14836. this.n26 = (this.getChild("n26"));
  14837. this.n27 = (this.getChild("n27"));
  14838. this.t0 = this.getTransition("t0");
  14839. }
  14840. }
  14841. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14842. class ui_UIPower$1 extends fgui.GComponent {
  14843. static createInstance() {
  14844. return (fgui.UIPackage.createObject("game", "UIPower"));
  14845. }
  14846. onConstruct() {
  14847. this.n11 = (this.getChild("n11"));
  14848. this.myNode = (this.getChild("myNode"));
  14849. this.t0 = this.getTransition("t0");
  14850. }
  14851. }
  14852. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14853. class ui_Component133 extends fgui.GComponent {
  14854. static createInstance() {
  14855. return (fgui.UIPackage.createObject("game", "Component133"));
  14856. }
  14857. onConstruct() {
  14858. this.n29 = (this.getChild("n29"));
  14859. this.n30 = (this.getChild("n30"));
  14860. }
  14861. }
  14862. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14863. class ui_Component134 extends fgui.GComponent {
  14864. static createInstance() {
  14865. return (fgui.UIPackage.createObject("game", "Component134"));
  14866. }
  14867. onConstruct() {
  14868. this.n30 = (this.getChild("n30"));
  14869. this.n31 = (this.getChild("n31"));
  14870. this.t0 = this.getTransition("t0");
  14871. }
  14872. }
  14873. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14874. class ui_Component135 extends fgui.GComponent {
  14875. static createInstance() {
  14876. return (fgui.UIPackage.createObject("game", "Component135"));
  14877. }
  14878. onConstruct() {
  14879. this.n30 = (this.getChild("n30"));
  14880. this.t0 = this.getTransition("t0");
  14881. }
  14882. }
  14883. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14884. class ui_Component137 extends fgui.GComponent {
  14885. static createInstance() {
  14886. return (fgui.UIPackage.createObject("game", "Component137"));
  14887. }
  14888. onConstruct() {
  14889. this.n28 = (this.getChild("n28"));
  14890. this.n29 = (this.getChild("n29"));
  14891. this.n30 = (this.getChild("n30"));
  14892. this.n32 = (this.getChild("n32"));
  14893. }
  14894. }
  14895. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14896. class ui_dh_zuanshi extends fgui.GButton {
  14897. static createInstance() {
  14898. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14899. }
  14900. onConstruct() {
  14901. this.n1 = (this.getChild("n1"));
  14902. this.n2 = (this.getChild("n2"));
  14903. this.n0 = (this.getChild("n0"));
  14904. this.n3 = (this.getChild("n3"));
  14905. this.n4 = (this.getChild("n4"));
  14906. }
  14907. }
  14908. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14909. class ui_Component138 extends fgui.GComponent {
  14910. static createInstance() {
  14911. return (fgui.UIPackage.createObject("game", "Component138"));
  14912. }
  14913. onConstruct() {
  14914. this.n1 = (this.getChild("n1"));
  14915. this.n2 = (this.getChild("n2"));
  14916. this.t0 = this.getTransition("t0");
  14917. }
  14918. }
  14919. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14920. class ui_Component139 extends fgui.GComponent {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("game", "Component139"));
  14923. }
  14924. onConstruct() {
  14925. this.n0 = (this.getChild("n0"));
  14926. this.t0 = this.getTransition("t0");
  14927. }
  14928. }
  14929. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14930. class ui_Component140 extends fgui.GComponent {
  14931. static createInstance() {
  14932. return (fgui.UIPackage.createObject("game", "Component140"));
  14933. }
  14934. onConstruct() {
  14935. this.n2 = (this.getChild("n2"));
  14936. this.n3 = (this.getChild("n3"));
  14937. this.t0 = this.getTransition("t0");
  14938. }
  14939. }
  14940. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14941. class ui_Component141 extends fgui.GComponent {
  14942. static createInstance() {
  14943. return (fgui.UIPackage.createObject("game", "Component141"));
  14944. }
  14945. onConstruct() {
  14946. this.n0 = (this.getChild("n0"));
  14947. this.t0 = this.getTransition("t0");
  14948. }
  14949. }
  14950. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14951. class ui_powerNode extends fgui.GProgressBar {
  14952. static createInstance() {
  14953. return (fgui.UIPackage.createObject("game", "powerNode"));
  14954. }
  14955. onConstruct() {
  14956. this.n2 = (this.getChild("n2"));
  14957. this.bar_v = (this.getChild("bar_v"));
  14958. this.showImg = (this.getChild("showImg"));
  14959. this.n12 = (this.getChild("n12"));
  14960. }
  14961. }
  14962. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14963. class ui_dh_jingbi1 extends fgui.GComponent {
  14964. static createInstance() {
  14965. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14966. }
  14967. onConstruct() {
  14968. this.n0 = (this.getChild("n0"));
  14969. this.n1 = (this.getChild("n1"));
  14970. this.n2 = (this.getChild("n2"));
  14971. this.n3 = (this.getChild("n3"));
  14972. this.n4 = (this.getChild("n4"));
  14973. this.n5 = (this.getChild("n5"));
  14974. this.n6 = (this.getChild("n6"));
  14975. this.n8 = (this.getChild("n8"));
  14976. this.t0 = this.getTransition("t0");
  14977. }
  14978. }
  14979. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14980. class ui_Component94 extends fgui.GButton {
  14981. static createInstance() {
  14982. return (fgui.UIPackage.createObject("game", "Component94"));
  14983. }
  14984. onConstruct() {
  14985. this.n77 = (this.getChild("n77"));
  14986. }
  14987. }
  14988. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14989. class ui_Component95 extends fgui.GButton {
  14990. static createInstance() {
  14991. return (fgui.UIPackage.createObject("game", "Component95"));
  14992. }
  14993. onConstruct() {
  14994. this.n77 = (this.getChild("n77"));
  14995. }
  14996. }
  14997. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14998. class ui_Component126 extends fgui.GComponent {
  14999. static createInstance() {
  15000. return (fgui.UIPackage.createObject("game", "Component126"));
  15001. }
  15002. onConstruct() {
  15003. this.c1 = this.getController("c1");
  15004. this.normalBtn = (this.getChild("normalBtn"));
  15005. this.tripleBtn = (this.getChild("tripleBtn"));
  15006. }
  15007. }
  15008. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  15009. class ui_Component60 extends fgui.GComponent {
  15010. static createInstance() {
  15011. return (fgui.UIPackage.createObject("game", "Component60"));
  15012. }
  15013. onConstruct() {
  15014. this.c1 = this.getController("c1");
  15015. this.n48 = (this.getChild("n48"));
  15016. this.womanTxt = (this.getChild("womanTxt"));
  15017. this.t0 = this.getTransition("t0");
  15018. }
  15019. }
  15020. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  15021. class ui_Button_h extends fgui.GButton {
  15022. static createInstance() {
  15023. return (fgui.UIPackage.createObject("game", "Button_h"));
  15024. }
  15025. onConstruct() {
  15026. this.button = this.getController("button");
  15027. this.n0 = (this.getChild("n0"));
  15028. }
  15029. }
  15030. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  15031. class ui_Button_lv extends fgui.GButton {
  15032. static createInstance() {
  15033. return (fgui.UIPackage.createObject("game", "Button_lv"));
  15034. }
  15035. onConstruct() {
  15036. this.button = this.getController("button");
  15037. this.n0 = (this.getChild("n0"));
  15038. }
  15039. }
  15040. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  15041. class ui_Component98_3 extends fgui.GButton {
  15042. static createInstance() {
  15043. return (fgui.UIPackage.createObject("game", "Component98_3"));
  15044. }
  15045. onConstruct() {
  15046. this.c1 = this.getController("c1");
  15047. this.n8 = (this.getChild("n8"));
  15048. this.n41 = (this.getChild("n41"));
  15049. this.n40 = (this.getChild("n40"));
  15050. }
  15051. }
  15052. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  15053. class ui_ModeSelection_com1 extends fgui.GButton {
  15054. static createInstance() {
  15055. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  15056. }
  15057. onConstruct() {
  15058. this.n34 = (this.getChild("n34"));
  15059. this.n36 = (this.getChild("n36"));
  15060. this.n22 = (this.getChild("n22"));
  15061. this.n20 = (this.getChild("n20"));
  15062. this.n23 = (this.getChild("n23"));
  15063. this.n24 = (this.getChild("n24"));
  15064. this.n26 = (this.getChild("n26"));
  15065. this.n33 = (this.getChild("n33"));
  15066. this.coinImg = (this.getChild("coinImg"));
  15067. this.need = (this.getChild("need"));
  15068. this.n35 = (this.getChild("n35"));
  15069. this.n29 = (this.getChild("n29"));
  15070. this.tipsTxt = (this.getChild("tipsTxt"));
  15071. this.n30 = (this.getChild("n30"));
  15072. this.peopleTxt = (this.getChild("peopleTxt"));
  15073. this.t0 = this.getTransition("t0");
  15074. }
  15075. }
  15076. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  15077. class ui_ModeSelection_com2 extends fgui.GButton {
  15078. static createInstance() {
  15079. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  15080. }
  15081. onConstruct() {
  15082. this.n36 = (this.getChild("n36"));
  15083. this.n34 = (this.getChild("n34"));
  15084. this.n22 = (this.getChild("n22"));
  15085. this.n20 = (this.getChild("n20"));
  15086. this.n23 = (this.getChild("n23"));
  15087. this.n24 = (this.getChild("n24"));
  15088. this.n26 = (this.getChild("n26"));
  15089. this.n33 = (this.getChild("n33"));
  15090. this.coinImg = (this.getChild("coinImg"));
  15091. this.need = (this.getChild("need"));
  15092. this.n35 = (this.getChild("n35"));
  15093. this.n29 = (this.getChild("n29"));
  15094. this.tipsTxt = (this.getChild("tipsTxt"));
  15095. this.n30 = (this.getChild("n30"));
  15096. this.peopleTxt = (this.getChild("peopleTxt"));
  15097. this.t0 = this.getTransition("t0");
  15098. }
  15099. }
  15100. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  15101. class ui_ModeSelection_com3 extends fgui.GButton {
  15102. static createInstance() {
  15103. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  15104. }
  15105. onConstruct() {
  15106. this.n34 = (this.getChild("n34"));
  15107. this.n36 = (this.getChild("n36"));
  15108. this.n22 = (this.getChild("n22"));
  15109. this.n20 = (this.getChild("n20"));
  15110. this.n23 = (this.getChild("n23"));
  15111. this.n24 = (this.getChild("n24"));
  15112. this.n26 = (this.getChild("n26"));
  15113. this.n33 = (this.getChild("n33"));
  15114. this.coinImg = (this.getChild("coinImg"));
  15115. this.need = (this.getChild("need"));
  15116. this.n35 = (this.getChild("n35"));
  15117. this.n29 = (this.getChild("n29"));
  15118. this.tipsTxt = (this.getChild("tipsTxt"));
  15119. this.n30 = (this.getChild("n30"));
  15120. this.peopleTxt = (this.getChild("peopleTxt"));
  15121. this.t0 = this.getTransition("t0");
  15122. }
  15123. }
  15124. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  15125. class ui_Invitation_com1 extends fgui.GComponent {
  15126. static createInstance() {
  15127. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  15128. }
  15129. onConstruct() {
  15130. this.n14 = (this.getChild("n14"));
  15131. this.n13 = (this.getChild("n13"));
  15132. this.n3 = (this.getChild("n3"));
  15133. this.n1 = (this.getChild("n1"));
  15134. this.n6 = (this.getChild("n6"));
  15135. this.n7 = (this.getChild("n7"));
  15136. this.enterBtn = (this.getChild("enterBtn"));
  15137. this.n11 = (this.getChild("n11"));
  15138. this.n12 = (this.getChild("n12"));
  15139. this.n15 = (this.getChild("n15"));
  15140. this.t0 = this.getTransition("t0");
  15141. this.t1 = this.getTransition("t1");
  15142. }
  15143. }
  15144. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  15145. class ui_Component87_1 extends fgui.GComponent {
  15146. static createInstance() {
  15147. return (fgui.UIPackage.createObject("game", "Component87_1"));
  15148. }
  15149. onConstruct() {
  15150. this.n74 = (this.getChild("n74"));
  15151. this.n73 = (this.getChild("n73"));
  15152. this.ballTxt = (this.getChild("ballTxt"));
  15153. this.n76 = (this.getChild("n76"));
  15154. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15155. this.levelTxt = (this.getChild("levelTxt"));
  15156. this.n87 = (this.getChild("n87"));
  15157. this.n84 = (this.getChild("n84"));
  15158. this.hpTxt = (this.getChild("hpTxt"));
  15159. this.n89 = (this.getChild("n89"));
  15160. this.tipsTxt = (this.getChild("tipsTxt"));
  15161. }
  15162. }
  15163. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  15164. class ui_Component_lc3 extends fgui.GComponent {
  15165. static createInstance() {
  15166. return (fgui.UIPackage.createObject("game", "Component_lc3"));
  15167. }
  15168. onConstruct() {
  15169. this.n0 = (this.getChild("n0"));
  15170. this.n2 = (this.getChild("n2"));
  15171. this.n1_bai = (this.getChild("n1_bai"));
  15172. }
  15173. }
  15174. ui_Component_lc3.URL = "ui://isxx5ak7lvbnv5b1";
  15175. class ui_Component_shou3 extends fgui.GComponent {
  15176. static createInstance() {
  15177. return (fgui.UIPackage.createObject("game", "Component_shou3"));
  15178. }
  15179. onConstruct() {
  15180. this.n57 = (this.getChild("n57"));
  15181. this.n54 = (this.getChild("n54"));
  15182. this.n55 = (this.getChild("n55"));
  15183. this.n56 = (this.getChild("n56"));
  15184. this.t1 = this.getTransition("t1");
  15185. }
  15186. }
  15187. ui_Component_shou3.URL = "ui://isxx5ak7lvbnv5b2";
  15188. class ui_sqg1 extends fgui.GComponent {
  15189. static createInstance() {
  15190. return (fgui.UIPackage.createObject("game", "sqg1"));
  15191. }
  15192. onConstruct() {
  15193. this.n1 = (this.getChild("n1"));
  15194. this.n0 = (this.getChild("n0"));
  15195. }
  15196. }
  15197. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  15198. class ui_sqg2 extends fgui.GComponent {
  15199. static createInstance() {
  15200. return (fgui.UIPackage.createObject("game", "sqg2"));
  15201. }
  15202. onConstruct() {
  15203. this.n1 = (this.getChild("n1"));
  15204. this.n0 = (this.getChild("n0"));
  15205. }
  15206. }
  15207. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15208. class ui_sqg3 extends fgui.GComponent {
  15209. static createInstance() {
  15210. return (fgui.UIPackage.createObject("game", "sqg3"));
  15211. }
  15212. onConstruct() {
  15213. this.n1 = (this.getChild("n1"));
  15214. this.n0 = (this.getChild("n0"));
  15215. }
  15216. }
  15217. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15218. class ui_sqg4 extends fgui.GComponent {
  15219. static createInstance() {
  15220. return (fgui.UIPackage.createObject("game", "sqg4"));
  15221. }
  15222. onConstruct() {
  15223. this.n1 = (this.getChild("n1"));
  15224. this.n0 = (this.getChild("n0"));
  15225. }
  15226. }
  15227. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15228. class ui_Component36 extends fgui.GButton {
  15229. static createInstance() {
  15230. return (fgui.UIPackage.createObject("game", "Component36"));
  15231. }
  15232. onConstruct() {
  15233. this.c1 = this.getController("c1");
  15234. this.n53 = (this.getChild("n53"));
  15235. this.n56 = (this.getChild("n56"));
  15236. }
  15237. }
  15238. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15239. class ui_Component37 extends fgui.GButton {
  15240. static createInstance() {
  15241. return (fgui.UIPackage.createObject("game", "Component37"));
  15242. }
  15243. onConstruct() {
  15244. this.c1 = this.getController("c1");
  15245. this.n52 = (this.getChild("n52"));
  15246. this.n54 = (this.getChild("n54"));
  15247. }
  15248. }
  15249. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15250. class ui_UISetting extends fgui.GComponent {
  15251. static createInstance() {
  15252. return (fgui.UIPackage.createObject("game", "UISetting"));
  15253. }
  15254. onConstruct() {
  15255. this.c1 = this.getController("c1");
  15256. this.n4 = (this.getChild("n4"));
  15257. this.soundBtn = (this.getChild("soundBtn"));
  15258. this.shakeBtn = (this.getChild("shakeBtn"));
  15259. this.clickNode = (this.getChild("clickNode"));
  15260. this.xyBtn = (this.getChild("xyBtn"));
  15261. }
  15262. }
  15263. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15264. class ui_Component39 extends fgui.GComponent {
  15265. static createInstance() {
  15266. return (fgui.UIPackage.createObject("game", "Component39"));
  15267. }
  15268. onConstruct() {
  15269. this.n5 = (this.getChild("n5"));
  15270. this.n6 = (this.getChild("n6"));
  15271. this.n7 = (this.getChild("n7"));
  15272. this.t0 = this.getTransition("t0");
  15273. }
  15274. }
  15275. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15276. class ui_Component40 extends fgui.GButton {
  15277. static createInstance() {
  15278. return (fgui.UIPackage.createObject("game", "Component40"));
  15279. }
  15280. onConstruct() {
  15281. this.n46 = (this.getChild("n46"));
  15282. this.n47 = (this.getChild("n47"));
  15283. }
  15284. }
  15285. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15286. class ui_Component41 extends fgui.GComponent {
  15287. static createInstance() {
  15288. return (fgui.UIPackage.createObject("game", "Component41"));
  15289. }
  15290. onConstruct() {
  15291. this.c1 = this.getController("c1");
  15292. this.n0 = (this.getChild("n0"));
  15293. this.titleTxt = (this.getChild("titleTxt"));
  15294. this.n2 = (this.getChild("n2"));
  15295. this.msgTips = (this.getChild("msgTips"));
  15296. this.numTxt = (this.getChild("numTxt"));
  15297. this.n18 = (this.getChild("n18"));
  15298. this.cancelBtn = (this.getChild("cancelBtn"));
  15299. this.videoBtn = (this.getChild("videoBtn"));
  15300. this.n10 = (this.getChild("n10"));
  15301. }
  15302. }
  15303. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15304. class ui_Component42 extends fgui.GComponent {
  15305. static createInstance() {
  15306. return (fgui.UIPackage.createObject("game", "Component42"));
  15307. }
  15308. onConstruct() {
  15309. this.c1 = this.getController("c1");
  15310. this.n1 = (this.getChild("n1"));
  15311. this.n2 = (this.getChild("n2"));
  15312. this.n3 = (this.getChild("n3"));
  15313. this.tipsTxt = (this.getChild("tipsTxt"));
  15314. this.cancelBtn = (this.getChild("cancelBtn"));
  15315. this.sureBtn = (this.getChild("sureBtn"));
  15316. this.n11 = (this.getChild("n11"));
  15317. this.n13 = (this.getChild("n13"));
  15318. this.n14 = (this.getChild("n14"));
  15319. this.womanTxt = (this.getChild("womanTxt"));
  15320. this.t0 = this.getTransition("t0");
  15321. }
  15322. }
  15323. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15324. class ui_dh_js_shengli extends fgui.GComponent {
  15325. static createInstance() {
  15326. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15327. }
  15328. onConstruct() {
  15329. this.n3 = (this.getChild("n3"));
  15330. this.n4 = (this.getChild("n4"));
  15331. this.n1 = (this.getChild("n1"));
  15332. this.n2 = (this.getChild("n2"));
  15333. this.n5 = (this.getChild("n5"));
  15334. this.n6 = (this.getChild("n6"));
  15335. this.n7 = (this.getChild("n7"));
  15336. this.n8 = (this.getChild("n8"));
  15337. this.attack = this.getTransition("attack");
  15338. this.idle = this.getTransition("idle");
  15339. }
  15340. }
  15341. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15342. class ui_dh_js_shengli_g extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15345. }
  15346. onConstruct() {
  15347. this.n3 = (this.getChild("n3"));
  15348. this.n1 = (this.getChild("n1"));
  15349. this.t0 = this.getTransition("t0");
  15350. }
  15351. }
  15352. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15353. class ui_dh_js_shibai extends fgui.GComponent {
  15354. static createInstance() {
  15355. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15356. }
  15357. onConstruct() {
  15358. this.n0 = (this.getChild("n0"));
  15359. this.n1 = (this.getChild("n1"));
  15360. this.n2 = (this.getChild("n2"));
  15361. this.n3 = (this.getChild("n3"));
  15362. this.idle = this.getTransition("idle");
  15363. this.attack = this.getTransition("attack");
  15364. }
  15365. }
  15366. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15367. class ui_dh_zy_ganfa extends fgui.GButton {
  15368. static createInstance() {
  15369. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15370. }
  15371. onConstruct() {
  15372. this.n0 = (this.getChild("n0"));
  15373. }
  15374. }
  15375. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15376. class ui_dh_zy_sc_guang extends fgui.GButton {
  15377. static createInstance() {
  15378. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15379. }
  15380. onConstruct() {
  15381. this.n0 = (this.getChild("n0"));
  15382. this.n2 = (this.getChild("n2"));
  15383. }
  15384. }
  15385. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15386. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15387. static createInstance() {
  15388. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15389. }
  15390. onConstruct() {
  15391. this.n0 = (this.getChild("n0"));
  15392. this.n3 = (this.getChild("n3"));
  15393. }
  15394. }
  15395. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15396. class ui_dh_zy_wanfa extends fgui.GButton {
  15397. static createInstance() {
  15398. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15399. }
  15400. onConstruct() {
  15401. this.n0 = (this.getChild("n0"));
  15402. }
  15403. }
  15404. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15405. class ui_Button_login extends fgui.GButton {
  15406. static createInstance() {
  15407. return (fgui.UIPackage.createObject("game", "Button_login"));
  15408. }
  15409. onConstruct() {
  15410. this.button = this.getController("button");
  15411. this.n5 = (this.getChild("n5"));
  15412. }
  15413. }
  15414. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15415. class ui_Component53_1 extends fgui.GComponent {
  15416. static createInstance() {
  15417. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15418. }
  15419. onConstruct() {
  15420. this.n0 = (this.getChild("n0"));
  15421. this.n1 = (this.getChild("n1"));
  15422. this.n2 = (this.getChild("n2"));
  15423. this.n3 = (this.getChild("n3"));
  15424. this.n4 = (this.getChild("n4"));
  15425. this.n5 = (this.getChild("n5"));
  15426. this.n6 = (this.getChild("n6"));
  15427. this.n7 = (this.getChild("n7"));
  15428. this.n8 = (this.getChild("n8"));
  15429. this.n9 = (this.getChild("n9"));
  15430. this.n10 = (this.getChild("n10"));
  15431. this.n11 = (this.getChild("n11"));
  15432. this.n12 = (this.getChild("n12"));
  15433. this.n13 = (this.getChild("n13"));
  15434. this.n14 = (this.getChild("n14"));
  15435. this.n15 = (this.getChild("n15"));
  15436. this.n16 = (this.getChild("n16"));
  15437. this.n19 = (this.getChild("n19"));
  15438. this.n20 = (this.getChild("n20"));
  15439. this.n21 = (this.getChild("n21"));
  15440. this.n22 = (this.getChild("n22"));
  15441. this.n23 = (this.getChild("n23"));
  15442. this.n24 = (this.getChild("n24"));
  15443. this.n25 = (this.getChild("n25"));
  15444. this.n26 = (this.getChild("n26"));
  15445. this.n27 = (this.getChild("n27"));
  15446. this.n28 = (this.getChild("n28"));
  15447. this.n29 = (this.getChild("n29"));
  15448. this.n30 = (this.getChild("n30"));
  15449. this.n31 = (this.getChild("n31"));
  15450. this.n32 = (this.getChild("n32"));
  15451. this.n33 = (this.getChild("n33"));
  15452. this.n34 = (this.getChild("n34"));
  15453. this.n35 = (this.getChild("n35"));
  15454. this.t0 = this.getTransition("t0");
  15455. }
  15456. }
  15457. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15458. class ui_Component30 extends fgui.GComponent {
  15459. static createInstance() {
  15460. return (fgui.UIPackage.createObject("game", "Component30"));
  15461. }
  15462. onConstruct() {
  15463. this.c1 = this.getController("c1");
  15464. this.n46 = (this.getChild("n46"));
  15465. this.n47 = (this.getChild("n47"));
  15466. this.numTxt = (this.getChild("numTxt"));
  15467. this.n50 = (this.getChild("n50"));
  15468. this.n53 = (this.getChild("n53"));
  15469. this.n54 = (this.getChild("n54"));
  15470. this.n55 = (this.getChild("n55"));
  15471. this.n56 = (this.getChild("n56"));
  15472. }
  15473. }
  15474. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15475. class ui_Component30_1 extends fgui.GComponent {
  15476. static createInstance() {
  15477. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15478. }
  15479. onConstruct() {
  15480. this.c1 = this.getController("c1");
  15481. this.n46 = (this.getChild("n46"));
  15482. this.n47 = (this.getChild("n47"));
  15483. this.numTxt = (this.getChild("numTxt"));
  15484. this.n50 = (this.getChild("n50"));
  15485. this.n51 = (this.getChild("n51"));
  15486. this.n52 = (this.getChild("n52"));
  15487. this.n53 = (this.getChild("n53"));
  15488. this.n54 = (this.getChild("n54"));
  15489. }
  15490. }
  15491. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15492. class ui_Component31 extends fgui.GComponent {
  15493. static createInstance() {
  15494. return (fgui.UIPackage.createObject("game", "Component31"));
  15495. }
  15496. onConstruct() {
  15497. this.n55 = (this.getChild("n55"));
  15498. this.n54 = (this.getChild("n54"));
  15499. this.conditionTxt = (this.getChild("conditionTxt"));
  15500. this.n57 = (this.getChild("n57"));
  15501. this.t0 = this.getTransition("t0");
  15502. }
  15503. }
  15504. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15505. class ui_Component32 extends fgui.GComponent {
  15506. static createInstance() {
  15507. return (fgui.UIPackage.createObject("game", "Component32"));
  15508. }
  15509. onConstruct() {
  15510. this.n5 = (this.getChild("n5"));
  15511. this.n6 = (this.getChild("n6"));
  15512. this.n7 = (this.getChild("n7"));
  15513. this.t0 = this.getTransition("t0");
  15514. }
  15515. }
  15516. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15517. class ui_AwardItem extends fgui.GComponent {
  15518. static createInstance() {
  15519. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15520. }
  15521. onConstruct() {
  15522. this.n9 = (this.getChild("n9"));
  15523. this.myIcon = (this.getChild("myIcon"));
  15524. this.numTxt = (this.getChild("numTxt"));
  15525. this.nameTxt = (this.getChild("nameTxt"));
  15526. this.n16 = (this.getChild("n16"));
  15527. this.n17 = (this.getChild("n17"));
  15528. }
  15529. }
  15530. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15531. class ui_ranking_com1 extends fgui.GButton {
  15532. static createInstance() {
  15533. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15534. }
  15535. onConstruct() {
  15536. this.c1 = this.getController("c1");
  15537. this.n49 = (this.getChild("n49"));
  15538. this.n18 = (this.getChild("n18"));
  15539. this.n46 = (this.getChild("n46"));
  15540. this.n48 = (this.getChild("n48"));
  15541. this.n50 = (this.getChild("n50"));
  15542. }
  15543. }
  15544. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15545. class ui_ranking_com2 extends fgui.GButton {
  15546. static createInstance() {
  15547. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15548. }
  15549. onConstruct() {
  15550. this.c1 = this.getController("c1");
  15551. this.n49 = (this.getChild("n49"));
  15552. this.n18 = (this.getChild("n18"));
  15553. this.n46 = (this.getChild("n46"));
  15554. this.n48 = (this.getChild("n48"));
  15555. this.n50 = (this.getChild("n50"));
  15556. }
  15557. }
  15558. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15559. class ui_ranking_com3 extends fgui.GComponent {
  15560. static createInstance() {
  15561. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15562. }
  15563. onConstruct() {
  15564. this.n17 = (this.getChild("n17"));
  15565. this.myIcon = (this.getChild("myIcon"));
  15566. }
  15567. }
  15568. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15569. class ui_ranking_com4 extends fgui.GComponent {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15572. }
  15573. onConstruct() {
  15574. this.n16 = (this.getChild("n16"));
  15575. this.head = (this.getChild("head"));
  15576. }
  15577. }
  15578. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15579. class ui_ranking_com5 extends fgui.GComponent {
  15580. static createInstance() {
  15581. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15582. }
  15583. onConstruct() {
  15584. this.c1 = this.getController("c1");
  15585. this.c2 = this.getController("c2");
  15586. this.n2 = (this.getChild("n2"));
  15587. this.n3 = (this.getChild("n3"));
  15588. this.levelBtn = (this.getChild("levelBtn"));
  15589. this.starBtn = (this.getChild("starBtn"));
  15590. this.n23 = (this.getChild("n23"));
  15591. this.n24 = (this.getChild("n24"));
  15592. this.n25 = (this.getChild("n25"));
  15593. this.myList = (this.getChild("myList"));
  15594. this.selfNode = (this.getChild("selfNode"));
  15595. this.n9 = (this.getChild("n9"));
  15596. this.n12 = (this.getChild("n12"));
  15597. this.n13 = (this.getChild("n13"));
  15598. this.n14 = (this.getChild("n14"));
  15599. this.n39 = (this.getChild("n39"));
  15600. this.n41 = (this.getChild("n41"));
  15601. this.n42 = (this.getChild("n42"));
  15602. this.n45 = (this.getChild("n45"));
  15603. this.changeBtn = (this.getChild("changeBtn"));
  15604. this.closeBtn = (this.getChild("closeBtn"));
  15605. this.t0 = this.getTransition("t0");
  15606. }
  15607. }
  15608. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15609. class ui_RankItem extends fgui.GComponent {
  15610. static createInstance() {
  15611. return (fgui.UIPackage.createObject("game", "RankItem"));
  15612. }
  15613. onConstruct() {
  15614. this.n10 = (this.getChild("n10"));
  15615. this.n11 = (this.getChild("n11"));
  15616. this.rankTxt = (this.getChild("rankTxt"));
  15617. this.headNode = (this.getChild("headNode"));
  15618. this.nameTxt = (this.getChild("nameTxt"));
  15619. this.n19 = (this.getChild("n19"));
  15620. this.valueTxt = (this.getChild("valueTxt"));
  15621. this.img1 = (this.getChild("img1"));
  15622. this.img2 = (this.getChild("img2"));
  15623. this.img3 = (this.getChild("img3"));
  15624. }
  15625. }
  15626. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15627. class ui_ranking_com9 extends fgui.GComponent {
  15628. static createInstance() {
  15629. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15630. }
  15631. onConstruct() {
  15632. this.c1 = this.getController("c1");
  15633. this.n27 = (this.getChild("n27"));
  15634. this.n28 = (this.getChild("n28"));
  15635. this.headNode = (this.getChild("headNode"));
  15636. this.rankTxt = (this.getChild("rankTxt"));
  15637. this.nameTxt = (this.getChild("nameTxt"));
  15638. this.n34 = (this.getChild("n34"));
  15639. this.valueTxt = (this.getChild("valueTxt"));
  15640. this.n36 = (this.getChild("n36"));
  15641. this.n37 = (this.getChild("n37"));
  15642. this.n38 = (this.getChild("n38"));
  15643. this.n39 = (this.getChild("n39"));
  15644. this.n40 = (this.getChild("n40"));
  15645. }
  15646. }
  15647. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15648. class ui_ranking_com10 extends fgui.GComponent {
  15649. static createInstance() {
  15650. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15651. }
  15652. onConstruct() {
  15653. this.n23 = (this.getChild("n23"));
  15654. this.n24 = (this.getChild("n24"));
  15655. }
  15656. }
  15657. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15658. class ui_ranking_com11 extends fgui.GComponent {
  15659. static createInstance() {
  15660. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15661. }
  15662. onConstruct() {
  15663. this.n24 = (this.getChild("n24"));
  15664. this.n25 = (this.getChild("n25"));
  15665. this.t0 = this.getTransition("t0");
  15666. }
  15667. }
  15668. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15669. class ui_ranking_com13 extends fgui.GButton {
  15670. static createInstance() {
  15671. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15672. }
  15673. onConstruct() {
  15674. this.c1 = this.getController("c1");
  15675. this.n44 = (this.getChild("n44"));
  15676. this.n45 = (this.getChild("n45"));
  15677. this.n46 = (this.getChild("n46"));
  15678. }
  15679. }
  15680. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15681. class ui_Component122 extends fgui.GComponent {
  15682. static createInstance() {
  15683. return (fgui.UIPackage.createObject("game", "Component122"));
  15684. }
  15685. onConstruct() {
  15686. this.gameNode3 = (this.getChild("gameNode3"));
  15687. }
  15688. }
  15689. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15690. class ui_skillItem extends fgui.GComponent {
  15691. static createInstance() {
  15692. return (fgui.UIPackage.createObject("game", "skillItem"));
  15693. }
  15694. onConstruct() {
  15695. this.c1 = this.getController("c1");
  15696. this.n31 = (this.getChild("n31"));
  15697. this.n6 = (this.getChild("n6"));
  15698. this.skillImg = (this.getChild("skillImg"));
  15699. this.nameTxt = (this.getChild("nameTxt"));
  15700. this.levelTxt = (this.getChild("levelTxt"));
  15701. this.n28 = (this.getChild("n28"));
  15702. this.describeTxt = (this.getChild("describeTxt"));
  15703. this.n32 = (this.getChild("n32"));
  15704. this.mutiBtn = (this.getChild("mutiBtn"));
  15705. this.tryNode = (this.getChild("tryNode"));
  15706. this.normalBtn = (this.getChild("normalBtn"));
  15707. this.startBtn = (this.getChild("startBtn"));
  15708. this.n42 = (this.getChild("n42"));
  15709. this.n43 = (this.getChild("n43"));
  15710. this.n44 = (this.getChild("n44"));
  15711. }
  15712. }
  15713. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15714. class ui_Component26 extends fgui.GButton {
  15715. static createInstance() {
  15716. return (fgui.UIPackage.createObject("game", "Component26"));
  15717. }
  15718. onConstruct() {
  15719. this.n11 = (this.getChild("n11"));
  15720. this.n30 = (this.getChild("n30"));
  15721. this.n34 = (this.getChild("n34"));
  15722. }
  15723. }
  15724. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15725. class ui_Component28 extends fgui.GButton {
  15726. static createInstance() {
  15727. return (fgui.UIPackage.createObject("game", "Component28"));
  15728. }
  15729. onConstruct() {
  15730. this.n12 = (this.getChild("n12"));
  15731. this.n31 = (this.getChild("n31"));
  15732. this.curTxt = (this.getChild("curTxt"));
  15733. this.n33 = (this.getChild("n33"));
  15734. }
  15735. }
  15736. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15737. class ui_Component1302 extends fgui.GComponent {
  15738. static createInstance() {
  15739. return (fgui.UIPackage.createObject("game", "Component1302"));
  15740. }
  15741. onConstruct() {
  15742. this.n2 = (this.getChild("n2"));
  15743. this.n3 = (this.getChild("n3"));
  15744. }
  15745. }
  15746. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15747. class ui_Component113 extends fgui.GComponent {
  15748. static createInstance() {
  15749. return (fgui.UIPackage.createObject("game", "Component113"));
  15750. }
  15751. onConstruct() {
  15752. this.n85 = (this.getChild("n85"));
  15753. this.n86 = (this.getChild("n86"));
  15754. this.n77 = (this.getChild("n77"));
  15755. this.n79 = (this.getChild("n79"));
  15756. this.n80 = (this.getChild("n80"));
  15757. this.n81 = (this.getChild("n81"));
  15758. this.n82 = (this.getChild("n82"));
  15759. this.n84 = (this.getChild("n84"));
  15760. this.n87 = (this.getChild("n87"));
  15761. this.t0 = this.getTransition("t0");
  15762. }
  15763. }
  15764. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15765. class ui_Component114 extends fgui.GComponent {
  15766. static createInstance() {
  15767. return (fgui.UIPackage.createObject("game", "Component114"));
  15768. }
  15769. onConstruct() {
  15770. this.n77 = (this.getChild("n77"));
  15771. this.t0 = this.getTransition("t0");
  15772. }
  15773. }
  15774. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15775. class ui_Component115 extends fgui.GComponent {
  15776. static createInstance() {
  15777. return (fgui.UIPackage.createObject("game", "Component115"));
  15778. }
  15779. onConstruct() {
  15780. this.n83 = (this.getChild("n83"));
  15781. this.fingerNode = (this.getChild("fingerNode"));
  15782. this.n84 = (this.getChild("n84"));
  15783. }
  15784. }
  15785. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15786. class ui_Component117 extends fgui.GComponent {
  15787. static createInstance() {
  15788. return (fgui.UIPackage.createObject("game", "Component117"));
  15789. }
  15790. onConstruct() {
  15791. this.n87 = (this.getChild("n87"));
  15792. this.n88 = (this.getChild("n88"));
  15793. this.n84 = (this.getChild("n84"));
  15794. this.n85 = (this.getChild("n85"));
  15795. this.n86 = (this.getChild("n86"));
  15796. this.t0 = this.getTransition("t0");
  15797. }
  15798. }
  15799. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15800. class ui_Component98_1 extends fgui.GButton {
  15801. static createInstance() {
  15802. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15803. }
  15804. onConstruct() {
  15805. this.c1 = this.getController("c1");
  15806. this.n8 = (this.getChild("n8"));
  15807. this.n41 = (this.getChild("n41"));
  15808. this.n40 = (this.getChild("n40"));
  15809. }
  15810. }
  15811. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15812. class ui_Component61 extends fgui.GComponent {
  15813. static createInstance() {
  15814. return (fgui.UIPackage.createObject("game", "Component61"));
  15815. }
  15816. onConstruct() {
  15817. this.n14 = (this.getChild("n14"));
  15818. this.n6 = (this.getChild("n6"));
  15819. this.t0 = this.getTransition("t0");
  15820. }
  15821. }
  15822. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15823. class ui_Component62 extends fgui.GComponent {
  15824. static createInstance() {
  15825. return (fgui.UIPackage.createObject("game", "Component62"));
  15826. }
  15827. onConstruct() {
  15828. this.n66 = (this.getChild("n66"));
  15829. this.n56 = (this.getChild("n56"));
  15830. this.n63 = (this.getChild("n63"));
  15831. this.n65 = (this.getChild("n65"));
  15832. this.t0 = this.getTransition("t0");
  15833. }
  15834. }
  15835. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15836. class ui_d3Root extends fgui.GComponent {
  15837. static createInstance() {
  15838. return (fgui.UIPackage.createObject("game", "d3Root"));
  15839. }
  15840. onConstruct() {
  15841. }
  15842. }
  15843. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15844. class ui_d2Root extends fgui.GComponent {
  15845. static createInstance() {
  15846. return (fgui.UIPackage.createObject("game", "d2Root"));
  15847. }
  15848. onConstruct() {
  15849. }
  15850. }
  15851. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15852. class ui_ballNode extends fgui.GComponent {
  15853. static createInstance() {
  15854. return (fgui.UIPackage.createObject("game", "ballNode"));
  15855. }
  15856. onConstruct() {
  15857. }
  15858. }
  15859. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15860. class ui_border extends fgui.GComponent {
  15861. static createInstance() {
  15862. return (fgui.UIPackage.createObject("game", "border"));
  15863. }
  15864. onConstruct() {
  15865. this.bar1 = (this.getChild("bar1"));
  15866. this.bar2 = (this.getChild("bar2"));
  15867. this.bar3 = (this.getChild("bar3"));
  15868. this.bar4 = (this.getChild("bar4"));
  15869. this.bar5 = (this.getChild("bar5"));
  15870. this.bar6 = (this.getChild("bar6"));
  15871. this.circle1 = (this.getChild("circle1"));
  15872. this.circle2 = (this.getChild("circle2"));
  15873. this.circle3 = (this.getChild("circle3"));
  15874. this.circle4 = (this.getChild("circle4"));
  15875. this.circle5 = (this.getChild("circle5"));
  15876. this.circle6 = (this.getChild("circle6"));
  15877. this.n28 = (this.getChild("n28"));
  15878. }
  15879. }
  15880. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15881. class ui_btn_buy extends fgui.GButton {
  15882. static createInstance() {
  15883. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15884. }
  15885. onConstruct() {
  15886. this.button = this.getController("button");
  15887. this.n0 = (this.getChild("n0"));
  15888. this.n1 = (this.getChild("n1"));
  15889. this.n2 = (this.getChild("n2"));
  15890. }
  15891. }
  15892. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15893. class ui_Component41_2 extends fgui.GComponent {
  15894. static createInstance() {
  15895. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15896. }
  15897. onConstruct() {
  15898. this.c1 = this.getController("c1");
  15899. this.n0 = (this.getChild("n0"));
  15900. this.n2 = (this.getChild("n2"));
  15901. this.n19 = (this.getChild("n19"));
  15902. this.cancelBtn = (this.getChild("cancelBtn"));
  15903. this.videoBtn = (this.getChild("videoBtn"));
  15904. this.n9 = (this.getChild("n9"));
  15905. this.n22 = (this.getChild("n22"));
  15906. this.tipsTxt = (this.getChild("tipsTxt"));
  15907. this.n23 = (this.getChild("n23"));
  15908. this.n24 = (this.getChild("n24"));
  15909. this.n26 = (this.getChild("n26"));
  15910. this.n27 = (this.getChild("n27"));
  15911. this.titleTxt = (this.getChild("titleTxt"));
  15912. }
  15913. }
  15914. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15915. class ui_Component41_1 extends fgui.GComponent {
  15916. static createInstance() {
  15917. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15918. }
  15919. onConstruct() {
  15920. this.c1 = this.getController("c1");
  15921. this.n0 = (this.getChild("n0"));
  15922. this.n2 = (this.getChild("n2"));
  15923. this.cancelBtn = (this.getChild("cancelBtn"));
  15924. this.videoBtn = (this.getChild("videoBtn"));
  15925. this.n27 = (this.getChild("n27"));
  15926. this.n30 = (this.getChild("n30"));
  15927. this.n31 = (this.getChild("n31"));
  15928. this.n32 = (this.getChild("n32"));
  15929. this.n33 = (this.getChild("n33"));
  15930. this.n34 = (this.getChild("n34"));
  15931. this.n35 = (this.getChild("n35"));
  15932. this.n36 = (this.getChild("n36"));
  15933. this.n1 = (this.getChild("n1"));
  15934. this.n37 = (this.getChild("n37"));
  15935. this.t0 = this.getTransition("t0");
  15936. this.t1 = this.getTransition("t1");
  15937. this.t2 = this.getTransition("t2");
  15938. this.t3 = this.getTransition("t3");
  15939. }
  15940. }
  15941. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15942. class ui_againBtn extends fgui.GButton {
  15943. static createInstance() {
  15944. return (fgui.UIPackage.createObject("game", "againBtn"));
  15945. }
  15946. onConstruct() {
  15947. this.n2 = (this.getChild("n2"));
  15948. this.n1 = (this.getChild("n1"));
  15949. this.n5 = (this.getChild("n5"));
  15950. }
  15951. }
  15952. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15953. class ui_Component118 extends fgui.GButton {
  15954. static createInstance() {
  15955. return (fgui.UIPackage.createObject("game", "Component118"));
  15956. }
  15957. onConstruct() {
  15958. this.c1 = this.getController("c1");
  15959. this.n14 = (this.getChild("n14"));
  15960. this.n9 = (this.getChild("n9"));
  15961. this.n10 = (this.getChild("n10"));
  15962. this.diamondTxt = (this.getChild("diamondTxt"));
  15963. this.n13 = (this.getChild("n13"));
  15964. this.n15 = (this.getChild("n15"));
  15965. }
  15966. }
  15967. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15968. class ui_Component119 extends fgui.GComponent {
  15969. static createInstance() {
  15970. return (fgui.UIPackage.createObject("game", "Component119"));
  15971. }
  15972. onConstruct() {
  15973. this.n1 = (this.getChild("n1"));
  15974. this.n2 = (this.getChild("n2"));
  15975. this.n13 = (this.getChild("n13"));
  15976. this.n6 = (this.getChild("n6"));
  15977. this.screenNode = (this.getChild("screenNode"));
  15978. this.n15 = (this.getChild("n15"));
  15979. this.closeBtn = (this.getChild("closeBtn"));
  15980. this.share2Btn = (this.getChild("share2Btn"));
  15981. this.shareBtn = (this.getChild("shareBtn"));
  15982. this.tipsNode = (this.getChild("tipsNode"));
  15983. this.awardNode = (this.getChild("awardNode"));
  15984. }
  15985. }
  15986. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15987. class ui_Component_yd1 extends fgui.GComponent {
  15988. static createInstance() {
  15989. return (fgui.UIPackage.createObject("game", "Component_yd1"));
  15990. }
  15991. onConstruct() {
  15992. this.n83 = (this.getChild("n83"));
  15993. this.fingerNode = (this.getChild("fingerNode"));
  15994. this.n84 = (this.getChild("n84"));
  15995. }
  15996. }
  15997. ui_Component_yd1.URL = "ui://isxx5ak7uc2qv5b3";
  15998. class ui_Component_yd2 extends fgui.GComponent {
  15999. static createInstance() {
  16000. return (fgui.UIPackage.createObject("game", "Component_yd2"));
  16001. }
  16002. onConstruct() {
  16003. this.n85 = (this.getChild("n85"));
  16004. this.n86 = (this.getChild("n86"));
  16005. this.n77 = (this.getChild("n77"));
  16006. this.n79 = (this.getChild("n79"));
  16007. this.n80 = (this.getChild("n80"));
  16008. this.n81 = (this.getChild("n81"));
  16009. this.n82 = (this.getChild("n82"));
  16010. this.n84 = (this.getChild("n84"));
  16011. this.n87 = (this.getChild("n87"));
  16012. this.t0 = this.getTransition("t0");
  16013. }
  16014. }
  16015. ui_Component_yd2.URL = "ui://isxx5ak7uc2qv5b5";
  16016. class ui_Component_yd3 extends fgui.GComponent {
  16017. static createInstance() {
  16018. return (fgui.UIPackage.createObject("game", "Component_yd3"));
  16019. }
  16020. onConstruct() {
  16021. this.n87 = (this.getChild("n87"));
  16022. this.n88 = (this.getChild("n88"));
  16023. this.n84 = (this.getChild("n84"));
  16024. this.n85 = (this.getChild("n85"));
  16025. this.n86 = (this.getChild("n86"));
  16026. this.t0 = this.getTransition("t0");
  16027. }
  16028. }
  16029. ui_Component_yd3.URL = "ui://isxx5ak7uc2qv5b6";
  16030. class ui_daoJuDisplay extends fgui.GComponent {
  16031. static createInstance() {
  16032. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  16033. }
  16034. onConstruct() {
  16035. this.n6 = (this.getChild("n6"));
  16036. this.n_jiaGe = (this.getChild("n_jiaGe"));
  16037. this.n_zuanShi = (this.getChild("n_zuanShi"));
  16038. this.btn_buy = (this.getChild("btn_buy"));
  16039. this.nameTxt = (this.getChild("nameTxt"));
  16040. this.zsImg = (this.getChild("zsImg"));
  16041. }
  16042. }
  16043. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  16044. class ui_Component132_1 extends fgui.GComponent {
  16045. static createInstance() {
  16046. return (fgui.UIPackage.createObject("game", "Component132_1"));
  16047. }
  16048. onConstruct() {
  16049. this.n25 = (this.getChild("n25"));
  16050. this.n26 = (this.getChild("n26"));
  16051. this.n27 = (this.getChild("n27"));
  16052. this.t0 = this.getTransition("t0");
  16053. }
  16054. }
  16055. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  16056. class ui_Component_lc_challenge1 extends fgui.GComponent {
  16057. static createInstance() {
  16058. return (fgui.UIPackage.createObject("game", "Component_lc_challenge1"));
  16059. }
  16060. onConstruct() {
  16061. this.n0 = (this.getChild("n0"));
  16062. this.n1_bai = (this.getChild("n1_bai"));
  16063. }
  16064. }
  16065. ui_Component_lc_challenge1.URL = "ui://isxx5ak7um3xv5as";
  16066. class ui_Component_shou extends fgui.GComponent {
  16067. static createInstance() {
  16068. return (fgui.UIPackage.createObject("game", "Component_shou"));
  16069. }
  16070. onConstruct() {
  16071. this.n57 = (this.getChild("n57"));
  16072. this.n54 = (this.getChild("n54"));
  16073. this.n55 = (this.getChild("n55"));
  16074. this.n56 = (this.getChild("n56"));
  16075. this.t1 = this.getTransition("t1");
  16076. }
  16077. }
  16078. ui_Component_shou.URL = "ui://isxx5ak7um3xv5aw";
  16079. class ui_SecretaryDisplay extends fgui.GComponent {
  16080. static createInstance() {
  16081. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  16082. }
  16083. onConstruct() {
  16084. this.n2 = (this.getChild("n2"));
  16085. this.levelTxt = (this.getChild("levelTxt"));
  16086. this.n4 = (this.getChild("n4"));
  16087. this.secretary = (this.getChild("secretary"));
  16088. this.purchaseBtn = (this.getChild("purchaseBtn"));
  16089. this.n16 = (this.getChild("n16"));
  16090. this.n37 = (this.getChild("n37"));
  16091. this.n41 = (this.getChild("n41"));
  16092. this.n14 = (this.getChild("n14"));
  16093. this.n17 = (this.getChild("n17"));
  16094. this.heightTxt = (this.getChild("heightTxt"));
  16095. this.n46 = (this.getChild("n46"));
  16096. this.n36 = (this.getChild("n36"));
  16097. this.n38 = (this.getChild("n38"));
  16098. this.foodTxt = (this.getChild("foodTxt"));
  16099. this.n47 = (this.getChild("n47"));
  16100. this.n40 = (this.getChild("n40"));
  16101. this.n42 = (this.getChild("n42"));
  16102. this.historyTxt = (this.getChild("historyTxt"));
  16103. this.n48 = (this.getChild("n48"));
  16104. this.nameImg = (this.getChild("nameImg"));
  16105. this.n12 = (this.getChild("n12"));
  16106. this.n49 = (this.getChild("n49"));
  16107. this.t0 = this.getTransition("t0");
  16108. }
  16109. }
  16110. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  16111. class ui_BallRodDisplay extends fgui.GComponent {
  16112. static createInstance() {
  16113. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  16114. }
  16115. onConstruct() {
  16116. this.c1 = this.getController("c1");
  16117. this.n31 = (this.getChild("n31"));
  16118. this.n6 = (this.getChild("n6"));
  16119. this.nameTxt = (this.getChild("nameTxt"));
  16120. this.rodImg = (this.getChild("rodImg"));
  16121. this.eftRod = (this.getChild("eftRod"));
  16122. this.levelNode = (this.getChild("levelNode"));
  16123. this.purchaseBtn = (this.getChild("purchaseBtn"));
  16124. }
  16125. }
  16126. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  16127. class ui_Component111_11 extends fgui.GComponent {
  16128. static createInstance() {
  16129. return (fgui.UIPackage.createObject("game", "Component111_11"));
  16130. }
  16131. onConstruct() {
  16132. this.n68 = (this.getChild("n68"));
  16133. this.n69 = (this.getChild("n69"));
  16134. }
  16135. }
  16136. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  16137. class ui_Component112 extends fgui.GComponent {
  16138. static createInstance() {
  16139. return (fgui.UIPackage.createObject("game", "Component112"));
  16140. }
  16141. onConstruct() {
  16142. this.n68 = (this.getChild("n68"));
  16143. this.myMask = (this.getChild("myMask"));
  16144. }
  16145. }
  16146. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  16147. class ui_Component111 extends fgui.GComponent {
  16148. static createInstance() {
  16149. return (fgui.UIPackage.createObject("game", "Component111"));
  16150. }
  16151. onConstruct() {
  16152. this.n68 = (this.getChild("n68"));
  16153. this.myMask = (this.getChild("myMask"));
  16154. }
  16155. }
  16156. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  16157. class ui_Component144 extends fgui.GButton {
  16158. static createInstance() {
  16159. return (fgui.UIPackage.createObject("game", "Component144"));
  16160. }
  16161. onConstruct() {
  16162. this.n8 = (this.getChild("n8"));
  16163. }
  16164. }
  16165. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  16166. class ui_Sign_com2 extends fgui.GComponent {
  16167. static createInstance() {
  16168. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  16169. }
  16170. onConstruct() {
  16171. this.n0 = (this.getChild("n0"));
  16172. this.n1 = (this.getChild("n1"));
  16173. this.t0 = this.getTransition("t0");
  16174. }
  16175. }
  16176. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  16177. class ui_Sign_guang extends fgui.GComponent {
  16178. static createInstance() {
  16179. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  16180. }
  16181. onConstruct() {
  16182. this.n1 = (this.getChild("n1"));
  16183. this.n2 = (this.getChild("n2"));
  16184. this.n3 = (this.getChild("n3"));
  16185. this.n4 = (this.getChild("n4"));
  16186. this.n5 = (this.getChild("n5"));
  16187. this.n6 = (this.getChild("n6"));
  16188. this.n8 = (this.getChild("n8"));
  16189. }
  16190. }
  16191. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  16192. class ui_SignMax extends fgui.GComponent {
  16193. static createInstance() {
  16194. return (fgui.UIPackage.createObject("game", "SignMax"));
  16195. }
  16196. onConstruct() {
  16197. this.c1 = this.getController("c1");
  16198. this.n7 = (this.getChild("n7"));
  16199. this.n15 = (this.getChild("n15"));
  16200. this.n8 = (this.getChild("n8"));
  16201. this.titleTxt = (this.getChild("titleTxt"));
  16202. this.myIcon1 = (this.getChild("myIcon1"));
  16203. this.numTxt1 = (this.getChild("numTxt1"));
  16204. this.myIcon2 = (this.getChild("myIcon2"));
  16205. this.n20 = (this.getChild("n20"));
  16206. this.n17 = (this.getChild("n17"));
  16207. this.numTxt2 = (this.getChild("numTxt2"));
  16208. this.n12 = (this.getChild("n12"));
  16209. this.n13 = (this.getChild("n13"));
  16210. this.n21 = (this.getChild("n21"));
  16211. this.n14 = (this.getChild("n14"));
  16212. }
  16213. }
  16214. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  16215. class ui_Sign_com2_1 extends fgui.GComponent {
  16216. static createInstance() {
  16217. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  16218. }
  16219. onConstruct() {
  16220. this.n0 = (this.getChild("n0"));
  16221. this.n1 = (this.getChild("n1"));
  16222. this.t0 = this.getTransition("t0");
  16223. }
  16224. }
  16225. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  16226. class ui_Sign_com5 extends fgui.GComponent {
  16227. static createInstance() {
  16228. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  16229. }
  16230. onConstruct() {
  16231. this.n3 = (this.getChild("n3"));
  16232. this.n29 = (this.getChild("n29"));
  16233. this.n4 = (this.getChild("n4"));
  16234. this.day1 = (this.getChild("day1"));
  16235. this.day2 = (this.getChild("day2"));
  16236. this.day3 = (this.getChild("day3"));
  16237. this.day4 = (this.getChild("day4"));
  16238. this.day5 = (this.getChild("day5"));
  16239. this.day6 = (this.getChild("day6"));
  16240. this.day7 = (this.getChild("day7"));
  16241. this.t0 = this.getTransition("t0");
  16242. }
  16243. }
  16244. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  16245. class ui_Sign_com8 extends fgui.GComponent {
  16246. static createInstance() {
  16247. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  16248. }
  16249. onConstruct() {
  16250. this.n48 = (this.getChild("n48"));
  16251. this.womanTxt = (this.getChild("womanTxt"));
  16252. this.t0 = this.getTransition("t0");
  16253. }
  16254. }
  16255. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  16256. class ui_Sign_com6 extends fgui.GComponent {
  16257. static createInstance() {
  16258. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  16259. }
  16260. onConstruct() {
  16261. this.n2 = (this.getChild("n2"));
  16262. this.n3 = (this.getChild("n3"));
  16263. this.t0 = this.getTransition("t0");
  16264. }
  16265. }
  16266. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  16267. class ui_Sign_com7 extends fgui.GComponent {
  16268. static createInstance() {
  16269. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16270. }
  16271. onConstruct() {
  16272. this.n29 = (this.getChild("n29"));
  16273. this.n2 = (this.getChild("n2"));
  16274. }
  16275. }
  16276. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16277. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16278. static createInstance() {
  16279. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16280. }
  16281. onConstruct() {
  16282. this.n5 = (this.getChild("n5"));
  16283. this.n4 = (this.getChild("n4"));
  16284. this.t0 = this.getTransition("t0");
  16285. }
  16286. }
  16287. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16288. class ui_UITurntable_com2 extends fgui.GComponent {
  16289. static createInstance() {
  16290. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16291. }
  16292. onConstruct() {
  16293. this.c1 = this.getController("c1");
  16294. this.n4 = (this.getChild("n4"));
  16295. this.n6 = (this.getChild("n6"));
  16296. this.n10 = (this.getChild("n10"));
  16297. this.n11 = (this.getChild("n11"));
  16298. this.n12 = (this.getChild("n12"));
  16299. this.n13 = (this.getChild("n13"));
  16300. this.n14 = (this.getChild("n14"));
  16301. this.n15 = (this.getChild("n15"));
  16302. this.n16 = (this.getChild("n16"));
  16303. this.n17 = (this.getChild("n17"));
  16304. this.n18 = (this.getChild("n18"));
  16305. this.n19 = (this.getChild("n19"));
  16306. this.n20 = (this.getChild("n20"));
  16307. this.n21 = (this.getChild("n21"));
  16308. this.n22 = (this.getChild("n22"));
  16309. this.n23 = (this.getChild("n23"));
  16310. this.n24 = (this.getChild("n24"));
  16311. this.n25 = (this.getChild("n25"));
  16312. this.n26 = (this.getChild("n26"));
  16313. this.n27 = (this.getChild("n27"));
  16314. this.n28 = (this.getChild("n28"));
  16315. this.n29 = (this.getChild("n29"));
  16316. this.n30 = (this.getChild("n30"));
  16317. this.n31 = (this.getChild("n31"));
  16318. this.n32 = (this.getChild("n32"));
  16319. this.n33 = (this.getChild("n33"));
  16320. }
  16321. }
  16322. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16323. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16324. static createInstance() {
  16325. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16326. }
  16327. onConstruct() {
  16328. this.n5 = (this.getChild("n5"));
  16329. this.n4 = (this.getChild("n4"));
  16330. this.t0 = this.getTransition("t0");
  16331. }
  16332. }
  16333. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16334. class ui_UITurntable_com5 extends fgui.GComponent {
  16335. static createInstance() {
  16336. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16337. }
  16338. onConstruct() {
  16339. this.flashNode = (this.getChild("flashNode"));
  16340. this.rotNode = (this.getChild("rotNode"));
  16341. this.n3 = (this.getChild("n3"));
  16342. this.n21 = (this.getChild("n21"));
  16343. this.t0 = this.getTransition("t0");
  16344. }
  16345. }
  16346. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16347. class ui_UITurntable_com7 extends fgui.GComponent {
  16348. static createInstance() {
  16349. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16350. }
  16351. onConstruct() {
  16352. this.n2 = (this.getChild("n2"));
  16353. this.n35 = (this.getChild("n35"));
  16354. this.img1 = (this.getChild("img1"));
  16355. this.img2 = (this.getChild("img2"));
  16356. this.img3 = (this.getChild("img3"));
  16357. this.img4 = (this.getChild("img4"));
  16358. this.img6 = (this.getChild("img6"));
  16359. this.img5 = (this.getChild("img5"));
  16360. this.txt1 = (this.getChild("txt1"));
  16361. this.txt2 = (this.getChild("txt2"));
  16362. this.txt3 = (this.getChild("txt3"));
  16363. this.txt4 = (this.getChild("txt4"));
  16364. this.txt5 = (this.getChild("txt5"));
  16365. this.txt6 = (this.getChild("txt6"));
  16366. }
  16367. }
  16368. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16369. class ui_UITurntable_com9 extends fgui.GComponent {
  16370. static createInstance() {
  16371. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16372. }
  16373. onConstruct() {
  16374. this.n38 = (this.getChild("n38"));
  16375. this.n39 = (this.getChild("n39"));
  16376. }
  16377. }
  16378. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16379. class ui_UITurntable_com10 extends fgui.GComponent {
  16380. static createInstance() {
  16381. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16382. }
  16383. onConstruct() {
  16384. this.n39 = (this.getChild("n39"));
  16385. this.n40 = (this.getChild("n40"));
  16386. this.t0 = this.getTransition("t0");
  16387. }
  16388. }
  16389. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16390. class ui_UITurntable_com11 extends fgui.GComponent {
  16391. static createInstance() {
  16392. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16393. }
  16394. onConstruct() {
  16395. this.n38 = (this.getChild("n38"));
  16396. this.n39 = (this.getChild("n39"));
  16397. this.n40 = (this.getChild("n40"));
  16398. this.t0 = this.getTransition("t0");
  16399. }
  16400. }
  16401. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16402. class ui_UITurntable_com12 extends fgui.GComponent {
  16403. static createInstance() {
  16404. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16405. }
  16406. onConstruct() {
  16407. this.n43 = (this.getChild("n43"));
  16408. this.barNode = (this.getChild("barNode"));
  16409. this.tipsTxt = (this.getChild("tipsTxt"));
  16410. this.n45 = (this.getChild("n45"));
  16411. this.boxBtn = (this.getChild("boxBtn"));
  16412. }
  16413. }
  16414. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16415. class ui_UITurntable_com1 extends fgui.GButton {
  16416. static createInstance() {
  16417. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16418. }
  16419. onConstruct() {
  16420. this.n41 = (this.getChild("n41"));
  16421. this.n42 = (this.getChild("n42"));
  16422. this.t0 = this.getTransition("t0");
  16423. }
  16424. }
  16425. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16426. class ui_UITurntable_com3 extends fgui.GComponent {
  16427. static createInstance() {
  16428. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16429. }
  16430. onConstruct() {
  16431. this.n48 = (this.getChild("n48"));
  16432. this.womanTxt = (this.getChild("womanTxt"));
  16433. this.t0 = this.getTransition("t0");
  16434. }
  16435. }
  16436. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16437. class ui_cancelBtn2 extends fgui.GButton {
  16438. static createInstance() {
  16439. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16440. }
  16441. onConstruct() {
  16442. this.c1 = this.getController("c1");
  16443. this.n0 = (this.getChild("n0"));
  16444. this.n1 = (this.getChild("n1"));
  16445. this.n2 = (this.getChild("n2"));
  16446. this.n3 = (this.getChild("n3"));
  16447. this.n4 = (this.getChild("n4"));
  16448. this.n5 = (this.getChild("n5"));
  16449. this.n6 = (this.getChild("n6"));
  16450. this.n7 = (this.getChild("n7"));
  16451. this.n8 = (this.getChild("n8"));
  16452. this.powerEft = (this.getChild("powerEft"));
  16453. }
  16454. }
  16455. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16456. class ui_shareBtn2 extends fgui.GButton {
  16457. static createInstance() {
  16458. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16459. }
  16460. onConstruct() {
  16461. this.c1 = this.getController("c1");
  16462. this.n2 = (this.getChild("n2"));
  16463. this.n24 = (this.getChild("n24"));
  16464. this.n1 = (this.getChild("n1"));
  16465. this.n3 = (this.getChild("n3"));
  16466. this.n23 = (this.getChild("n23"));
  16467. this.n4 = (this.getChild("n4"));
  16468. this.n5 = (this.getChild("n5"));
  16469. this.n6 = (this.getChild("n6"));
  16470. this.n20 = (this.getChild("n20"));
  16471. this.n21 = (this.getChild("n21"));
  16472. this.n22 = (this.getChild("n22"));
  16473. this.powerEft = (this.getChild("powerEft"));
  16474. }
  16475. }
  16476. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16477. class ui_UIMoney extends fgui.GComponent {
  16478. static createInstance() {
  16479. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16480. }
  16481. onConstruct() {
  16482. this.c1 = this.getController("c1");
  16483. this.n4 = (this.getChild("n4"));
  16484. this.coinImg = (this.getChild("coinImg"));
  16485. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16486. this.coinTxt = (this.getChild("coinTxt"));
  16487. this.n7 = (this.getChild("n7"));
  16488. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16489. this.diamondTxt = (this.getChild("diamondTxt"));
  16490. this.diamondImg = (this.getChild("diamondImg"));
  16491. this.n12 = (this.getChild("n12"));
  16492. this.powerImg = (this.getChild("powerImg"));
  16493. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16494. this.powerTxt = (this.getChild("powerTxt"));
  16495. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16496. }
  16497. }
  16498. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16499. class ui_backBtn extends fgui.GButton {
  16500. static createInstance() {
  16501. return (fgui.UIPackage.createObject("game", "backBtn"));
  16502. }
  16503. onConstruct() {
  16504. this.n0 = (this.getChild("n0"));
  16505. this.t0 = this.getTransition("t0");
  16506. this.t1 = this.getTransition("t1");
  16507. }
  16508. }
  16509. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16510. class ui_MoneyBtn extends fgui.GButton {
  16511. static createInstance() {
  16512. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16513. }
  16514. onConstruct() {
  16515. this.button = this.getController("button");
  16516. this.n0 = (this.getChild("n0"));
  16517. }
  16518. }
  16519. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16520. class ui_UIMoneyBtn extends fgui.GComponent {
  16521. static createInstance() {
  16522. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16523. }
  16524. onConstruct() {
  16525. this.n1 = (this.getChild("n1"));
  16526. this.closeBtn = (this.getChild("closeBtn"));
  16527. }
  16528. }
  16529. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16530. class ui_Component64 extends fgui.GComponent {
  16531. static createInstance() {
  16532. return (fgui.UIPackage.createObject("game", "Component64"));
  16533. }
  16534. onConstruct() {
  16535. this.n57 = (this.getChild("n57"));
  16536. this.n54 = (this.getChild("n54"));
  16537. this.n55 = (this.getChild("n55"));
  16538. this.n56 = (this.getChild("n56"));
  16539. this.t1 = this.getTransition("t1");
  16540. }
  16541. }
  16542. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16543. class ui_Component41_3 extends fgui.GComponent {
  16544. static createInstance() {
  16545. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16546. }
  16547. onConstruct() {
  16548. this.c1 = this.getController("c1");
  16549. this.n0 = (this.getChild("n0"));
  16550. this.n2 = (this.getChild("n2"));
  16551. this.cancelBtn = (this.getChild("cancelBtn"));
  16552. this.videoBtn = (this.getChild("videoBtn"));
  16553. this.n9 = (this.getChild("n9"));
  16554. this.n24 = (this.getChild("n24"));
  16555. this.n27 = (this.getChild("n27"));
  16556. this.titleTxt = (this.getChild("titleTxt"));
  16557. this.n28 = (this.getChild("n28"));
  16558. this.t0 = this.getTransition("t0");
  16559. }
  16560. }
  16561. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16562. class ui_dh_zs_4 extends fgui.GComponent {
  16563. static createInstance() {
  16564. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16565. }
  16566. onConstruct() {
  16567. this.n1 = (this.getChild("n1"));
  16568. this.n2 = (this.getChild("n2"));
  16569. this.n3 = (this.getChild("n3"));
  16570. this.n4 = (this.getChild("n4"));
  16571. this.n5 = (this.getChild("n5"));
  16572. this.n6 = (this.getChild("n6"));
  16573. this.n8 = (this.getChild("n8"));
  16574. this.t0 = this.getTransition("t0");
  16575. }
  16576. }
  16577. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16578. class ui_Component71_1 extends fgui.GButton {
  16579. static createInstance() {
  16580. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16581. }
  16582. onConstruct() {
  16583. this.n17 = (this.getChild("n17"));
  16584. this.t0 = this.getTransition("t0");
  16585. }
  16586. }
  16587. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16588. class ui_Component83 extends fgui.GComponent {
  16589. static createInstance() {
  16590. return (fgui.UIPackage.createObject("game", "Component83"));
  16591. }
  16592. onConstruct() {
  16593. this.c1 = this.getController("c1");
  16594. this.n17 = (this.getChild("n17"));
  16595. this.n19 = (this.getChild("n19"));
  16596. this.n20 = (this.getChild("n20"));
  16597. }
  16598. }
  16599. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16600. class ui_Component84 extends fgui.GComponent {
  16601. static createInstance() {
  16602. return (fgui.UIPackage.createObject("game", "Component84"));
  16603. }
  16604. onConstruct() {
  16605. this.c1 = this.getController("c1");
  16606. this.n4 = (this.getChild("n4"));
  16607. this.n22 = (this.getChild("n22"));
  16608. this.n23 = (this.getChild("n23"));
  16609. this.numTxt = (this.getChild("numTxt"));
  16610. this.n25 = (this.getChild("n25"));
  16611. this.n26 = (this.getChild("n26"));
  16612. }
  16613. }
  16614. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16615. class ui_Component84_1 extends fgui.GComponent {
  16616. static createInstance() {
  16617. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16618. }
  16619. onConstruct() {
  16620. this.c1 = this.getController("c1");
  16621. this.n4 = (this.getChild("n4"));
  16622. this.n22 = (this.getChild("n22"));
  16623. this.n23 = (this.getChild("n23"));
  16624. this.numTxt = (this.getChild("numTxt"));
  16625. this.n25 = (this.getChild("n25"));
  16626. this.n26 = (this.getChild("n26"));
  16627. }
  16628. }
  16629. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16630. class ui_Component85 extends fgui.GComponent {
  16631. static createInstance() {
  16632. return (fgui.UIPackage.createObject("game", "Component85"));
  16633. }
  16634. onConstruct() {
  16635. this.n1 = (this.getChild("n1"));
  16636. this.n6 = (this.getChild("n6"));
  16637. this.n2 = (this.getChild("n2"));
  16638. this.n3 = (this.getChild("n3"));
  16639. this.levelTxt = (this.getChild("levelTxt"));
  16640. this.n10 = (this.getChild("n10"));
  16641. this.n11 = (this.getChild("n11"));
  16642. this.n12 = (this.getChild("n12"));
  16643. this.n13 = (this.getChild("n13"));
  16644. this.n14 = (this.getChild("n14"));
  16645. this.modeNode = (this.getChild("modeNode"));
  16646. this.n18 = (this.getChild("n18"));
  16647. this.conditionTxt = (this.getChild("conditionTxt"));
  16648. this.diamondNode = (this.getChild("diamondNode"));
  16649. this.coinNode = (this.getChild("coinNode"));
  16650. this.startBtn = (this.getChild("startBtn"));
  16651. this.n28 = (this.getChild("n28"));
  16652. this.displayRoot = (this.getChild("displayRoot"));
  16653. this.n32 = (this.getChild("n32"));
  16654. this.n33 = (this.getChild("n33"));
  16655. this.n_yd_zzq_btn3 = (this.getChild("n_yd_zzq_btn3"));
  16656. this.n_yd_lxms_3 = (this.getChild("n_yd_lxms_3"));
  16657. this.t0 = this.getTransition("t0");
  16658. }
  16659. }
  16660. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16661. class ui_Component86 extends fgui.GButton {
  16662. static createInstance() {
  16663. return (fgui.UIPackage.createObject("game", "Component86"));
  16664. }
  16665. onConstruct() {
  16666. this.n15 = (this.getChild("n15"));
  16667. this.t0 = this.getTransition("t0");
  16668. }
  16669. }
  16670. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16671. class ui_Component87 extends fgui.GComponent {
  16672. static createInstance() {
  16673. return (fgui.UIPackage.createObject("game", "Component87"));
  16674. }
  16675. onConstruct() {
  16676. this.n66 = (this.getChild("n66"));
  16677. this.myProgress = (this.getChild("myProgress"));
  16678. this.starAni = (this.getChild("starAni"));
  16679. this.hpTxt = (this.getChild("hpTxt"));
  16680. this.n74 = (this.getChild("n74"));
  16681. this.n73 = (this.getChild("n73"));
  16682. this.ballTxt = (this.getChild("ballTxt"));
  16683. this.n76 = (this.getChild("n76"));
  16684. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16685. this.levelTxt = (this.getChild("levelTxt"));
  16686. this.star1 = (this.getChild("star1"));
  16687. this.star2 = (this.getChild("star2"));
  16688. this.star3 = (this.getChild("star3"));
  16689. }
  16690. }
  16691. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16692. class ui_Component88 extends fgui.GProgressBar {
  16693. static createInstance() {
  16694. return (fgui.UIPackage.createObject("game", "Component88"));
  16695. }
  16696. onConstruct() {
  16697. this.n68 = (this.getChild("n68"));
  16698. this.bar = (this.getChild("bar"));
  16699. }
  16700. }
  16701. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16702. class ui_Component89 extends fgui.GComponent {
  16703. static createInstance() {
  16704. return (fgui.UIPackage.createObject("game", "Component89"));
  16705. }
  16706. onConstruct() {
  16707. this.c1 = this.getController("c1");
  16708. this.n71 = (this.getChild("n71"));
  16709. this.n72 = (this.getChild("n72"));
  16710. }
  16711. }
  16712. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16713. class ui_Component90 extends fgui.GComponent {
  16714. static createInstance() {
  16715. return (fgui.UIPackage.createObject("game", "Component90"));
  16716. }
  16717. onConstruct() {
  16718. this.c1 = this.getController("c1");
  16719. this.n64 = (this.getChild("n64"));
  16720. this.n65 = (this.getChild("n65"));
  16721. this.n66 = (this.getChild("n66"));
  16722. this.t0 = this.getTransition("t0");
  16723. }
  16724. }
  16725. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16726. class ui_Component127 extends fgui.GButton {
  16727. static createInstance() {
  16728. return (fgui.UIPackage.createObject("game", "Component127"));
  16729. }
  16730. onConstruct() {
  16731. this.n5 = (this.getChild("n5"));
  16732. }
  16733. }
  16734. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16735. class gameBinder {
  16736. static bindAll() {
  16737. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16738. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16739. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16740. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16741. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16742. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16743. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16744. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16745. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16746. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16747. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16748. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16749. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16750. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16751. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16752. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16753. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16754. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16755. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16756. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16757. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16758. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16759. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16760. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16761. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16762. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16763. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16764. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16765. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16766. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16767. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16768. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16769. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16770. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16771. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16772. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16773. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16774. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16775. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16776. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16777. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16778. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16779. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16780. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16781. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16782. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16783. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16784. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16785. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16786. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16787. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16788. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16789. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16790. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16791. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16792. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16793. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16794. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16795. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16796. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16797. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16798. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16799. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16800. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16801. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16802. fgui.UIObjectFactory.setExtension(ui_Component_lc2.URL, ui_Component_lc2);
  16803. fgui.UIObjectFactory.setExtension(ui_Component_shou2.URL, ui_Component_shou2);
  16804. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16805. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16806. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16807. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16808. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16809. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16810. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16811. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16812. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16813. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16814. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16815. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16816. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16817. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16818. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16819. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16820. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16821. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16822. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16823. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16824. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16825. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16826. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16827. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16828. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16829. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16830. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16831. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16832. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16833. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16834. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16835. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16836. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16837. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16838. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16839. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16840. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16841. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16842. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16843. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16844. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16845. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16846. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16847. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16848. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16849. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16850. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16851. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16852. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16853. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16854. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16855. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16856. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16857. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16858. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16859. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16860. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16861. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16862. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16863. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16864. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16865. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16866. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16867. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16868. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16869. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16870. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16871. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16872. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16873. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16874. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16875. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16876. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16877. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16878. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16879. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16880. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16881. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16882. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16883. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16884. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16885. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16886. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16887. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16888. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16889. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16890. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16891. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16892. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16893. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16894. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16895. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16896. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16897. fgui.UIObjectFactory.setExtension(ui_Component_lc3.URL, ui_Component_lc3);
  16898. fgui.UIObjectFactory.setExtension(ui_Component_shou3.URL, ui_Component_shou3);
  16899. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16900. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16901. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16902. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16903. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16904. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16905. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16906. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16907. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16908. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16909. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16910. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16911. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16912. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16913. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16914. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16915. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16916. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16917. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16918. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16919. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16920. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16921. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16922. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16923. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16924. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16925. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16926. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16927. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16928. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16929. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16930. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16931. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16932. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16933. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16934. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16935. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16936. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16937. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16938. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16939. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16940. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16941. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16942. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16943. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16944. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16945. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16946. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16947. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16948. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16949. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16950. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16951. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16952. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16953. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16954. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16955. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16956. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16957. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16958. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16959. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16960. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16961. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16962. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16963. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16964. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16965. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16966. fgui.UIObjectFactory.setExtension(ui_Component_yd1.URL, ui_Component_yd1);
  16967. fgui.UIObjectFactory.setExtension(ui_Component_yd2.URL, ui_Component_yd2);
  16968. fgui.UIObjectFactory.setExtension(ui_Component_yd3.URL, ui_Component_yd3);
  16969. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16970. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16971. fgui.UIObjectFactory.setExtension(ui_Component_lc_challenge1.URL, ui_Component_lc_challenge1);
  16972. fgui.UIObjectFactory.setExtension(ui_Component_shou.URL, ui_Component_shou);
  16973. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16974. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16975. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16976. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16977. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16978. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16979. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16980. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16981. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16982. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16983. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16984. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16985. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16986. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16987. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16988. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16989. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16990. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16991. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16992. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16993. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16994. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16995. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16996. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16997. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16998. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16999. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  17000. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  17001. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  17002. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  17003. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  17004. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  17005. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  17006. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  17007. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  17008. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  17009. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  17010. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  17011. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  17012. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  17013. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  17014. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  17015. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  17016. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  17017. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  17018. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  17019. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  17020. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  17021. }
  17022. }
  17023. class ui_btn6 extends fgui.GButton {
  17024. static createInstance() {
  17025. return (fgui.UIPackage.createObject("loading", "btn6"));
  17026. }
  17027. onConstruct() {
  17028. this.n6 = (this.getChild("n6"));
  17029. this.n1 = (this.getChild("n1"));
  17030. }
  17031. }
  17032. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  17033. class ui_xyItem extends fgui.GComponent {
  17034. static createInstance() {
  17035. return (fgui.UIPackage.createObject("loading", "xyItem"));
  17036. }
  17037. onConstruct() {
  17038. this.xyItem = (this.getChild("xyItem"));
  17039. }
  17040. }
  17041. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  17042. class ui_loadinfo extends fgui.GProgressBar {
  17043. static createInstance() {
  17044. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  17045. }
  17046. onConstruct() {
  17047. this.bg = (this.getChild("bg"));
  17048. this.bar = (this.getChild("bar"));
  17049. this.title = (this.getChild("title"));
  17050. this.ani = (this.getChild("ani"));
  17051. }
  17052. }
  17053. ui_loadinfo.URL = "ui://37nctnhwis36c";
  17054. class ui_xyNode extends fgui.GComponent {
  17055. static createInstance() {
  17056. return (fgui.UIPackage.createObject("loading", "xyNode"));
  17057. }
  17058. onConstruct() {
  17059. this.n0 = (this.getChild("n0"));
  17060. this.btnYes = (this.getChild("btnYes"));
  17061. this.btnNo = (this.getChild("btnNo"));
  17062. this.btnKnown = (this.getChild("btnKnown"));
  17063. this.btnSure = (this.getChild("btnSure"));
  17064. this.txtWelcom = (this.getChild("txtWelcom"));
  17065. this.txtXy = (this.getChild("txtXy"));
  17066. this.n75 = (this.getChild("n75"));
  17067. this.btnXy1 = (this.getChild("btnXy1"));
  17068. this.btnXy3 = (this.getChild("btnXy3"));
  17069. this.btnXy2 = (this.getChild("btnXy2"));
  17070. this.n74 = (this.getChild("n74"));
  17071. this.xy1 = (this.getChild("xy1"));
  17072. this.txtTitle = (this.getChild("txtTitle"));
  17073. this.btnBack = (this.getChild("btnBack"));
  17074. this.xyList = (this.getChild("xyList"));
  17075. this.xy2 = (this.getChild("xy2"));
  17076. this.xyNode = (this.getChild("xyNode"));
  17077. }
  17078. }
  17079. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  17080. class ui_ageNode extends fgui.GComponent {
  17081. static createInstance() {
  17082. return (fgui.UIPackage.createObject("loading", "ageNode"));
  17083. }
  17084. onConstruct() {
  17085. this.n3 = (this.getChild("n3"));
  17086. this.n7 = (this.getChild("n7"));
  17087. this.n4 = (this.getChild("n4"));
  17088. this.btnAge = (this.getChild("btnAge"));
  17089. this.ageNode = (this.getChild("ageNode"));
  17090. }
  17091. }
  17092. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  17093. class ui_rnNode extends fgui.GComponent {
  17094. static createInstance() {
  17095. return (fgui.UIPackage.createObject("loading", "rnNode"));
  17096. }
  17097. onConstruct() {
  17098. this.n28 = (this.getChild("n28"));
  17099. this.n30 = (this.getChild("n30"));
  17100. this.n33 = (this.getChild("n33"));
  17101. this.rn1 = (this.getChild("rn1"));
  17102. this.n40 = (this.getChild("n40"));
  17103. this.n41 = (this.getChild("n41"));
  17104. this.rn3 = (this.getChild("rn3"));
  17105. this.n37 = (this.getChild("n37"));
  17106. this.n39 = (this.getChild("n39"));
  17107. this.rn2 = (this.getChild("rn2"));
  17108. this.n47 = (this.getChild("n47"));
  17109. this.n49 = (this.getChild("n49"));
  17110. this.n44 = (this.getChild("n44"));
  17111. this.inputCode = (this.getChild("inputCode"));
  17112. this.inputName = (this.getChild("inputName"));
  17113. this.n48 = (this.getChild("n48"));
  17114. this.n50 = (this.getChild("n50"));
  17115. this.rn4 = (this.getChild("rn4"));
  17116. this.btnCheck = (this.getChild("btnCheck"));
  17117. this.btnExit = (this.getChild("btnExit"));
  17118. this.btnDone = (this.getChild("btnDone"));
  17119. this.rnNode = (this.getChild("rnNode"));
  17120. }
  17121. }
  17122. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  17123. class ui_tipNode extends fgui.GComponent {
  17124. static createInstance() {
  17125. return (fgui.UIPackage.createObject("loading", "tipNode"));
  17126. }
  17127. onConstruct() {
  17128. this.bg = (this.getChild("bg"));
  17129. this.n55 = (this.getChild("n55"));
  17130. this.n56 = (this.getChild("n56"));
  17131. this.tipNode = (this.getChild("tipNode"));
  17132. }
  17133. }
  17134. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  17135. class ui_fcmNode extends fgui.GComponent {
  17136. static createInstance() {
  17137. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  17138. }
  17139. onConstruct() {
  17140. this.n63 = (this.getChild("n63"));
  17141. this.n62 = (this.getChild("n62"));
  17142. this.btnRn = (this.getChild("btnRn"));
  17143. this.n61 = (this.getChild("n61"));
  17144. this.n58 = (this.getChild("n58"));
  17145. this.fcmNode = (this.getChild("fcmNode"));
  17146. }
  17147. }
  17148. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  17149. class ui_msgNode extends fgui.GComponent {
  17150. static createInstance() {
  17151. return (fgui.UIPackage.createObject("loading", "msgNode"));
  17152. }
  17153. onConstruct() {
  17154. this.n69 = (this.getChild("n69"));
  17155. this.txtMsg = (this.getChild("txtMsg"));
  17156. this.msgNode = (this.getChild("msgNode"));
  17157. }
  17158. }
  17159. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  17160. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  17161. static createInstance() {
  17162. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  17163. }
  17164. onConstruct() {
  17165. this.n1 = (this.getChild("n1"));
  17166. this.n13 = (this.getChild("n13"));
  17167. this.n14 = (this.getChild("n14"));
  17168. this.n15 = (this.getChild("n15"));
  17169. this.n3 = (this.getChild("n3"));
  17170. this.n4 = (this.getChild("n4"));
  17171. this.n5 = (this.getChild("n5"));
  17172. this.n6 = (this.getChild("n6"));
  17173. this.n7 = (this.getChild("n7"));
  17174. this.n8 = (this.getChild("n8"));
  17175. this.n9 = (this.getChild("n9"));
  17176. this.n10 = (this.getChild("n10"));
  17177. this.n12 = (this.getChild("n12"));
  17178. this.n11 = (this.getChild("n11"));
  17179. this.n16 = (this.getChild("n16"));
  17180. this.n17 = (this.getChild("n17"));
  17181. this.n18 = (this.getChild("n18"));
  17182. this.n20 = (this.getChild("n20"));
  17183. this.n21 = (this.getChild("n21"));
  17184. this.t0 = this.getTransition("t0");
  17185. }
  17186. }
  17187. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  17188. class ui_btn5 extends fgui.GButton {
  17189. static createInstance() {
  17190. return (fgui.UIPackage.createObject("loading", "btn5"));
  17191. }
  17192. onConstruct() {
  17193. this.n9 = (this.getChild("n9"));
  17194. this.n1 = (this.getChild("n1"));
  17195. }
  17196. }
  17197. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  17198. class ui_UILoading extends fgui.GComponent {
  17199. static createInstance() {
  17200. return (fgui.UIPackage.createObject("loading", "UILoading"));
  17201. }
  17202. onConstruct() {
  17203. this.n12 = (this.getChild("n12"));
  17204. this.loadinfo = (this.getChild("loadinfo"));
  17205. this.n13 = (this.getChild("n13"));
  17206. this.txtLoad = (this.getChild("txtLoad"));
  17207. this.n18 = (this.getChild("n18"));
  17208. }
  17209. }
  17210. ui_UILoading.URL = "ui://37nctnhwphc33";
  17211. class ui_AgeItem extends fgui.GComponent {
  17212. static createInstance() {
  17213. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  17214. }
  17215. onConstruct() {
  17216. this.txtAge = (this.getChild("txtAge"));
  17217. }
  17218. }
  17219. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  17220. class ui_btn1 extends fgui.GButton {
  17221. static createInstance() {
  17222. return (fgui.UIPackage.createObject("loading", "btn1"));
  17223. }
  17224. onConstruct() {
  17225. this.n6 = (this.getChild("n6"));
  17226. this.n1 = (this.getChild("n1"));
  17227. }
  17228. }
  17229. ui_btn1.URL = "ui://37nctnhwxe622p";
  17230. class ui_btn3 extends fgui.GButton {
  17231. static createInstance() {
  17232. return (fgui.UIPackage.createObject("loading", "btn3"));
  17233. }
  17234. onConstruct() {
  17235. this.n9 = (this.getChild("n9"));
  17236. this.n1 = (this.getChild("n1"));
  17237. }
  17238. }
  17239. ui_btn3.URL = "ui://37nctnhwxe622s";
  17240. class ui_btn2 extends fgui.GButton {
  17241. static createInstance() {
  17242. return (fgui.UIPackage.createObject("loading", "btn2"));
  17243. }
  17244. onConstruct() {
  17245. this.n6 = (this.getChild("n6"));
  17246. this.n1 = (this.getChild("n1"));
  17247. }
  17248. }
  17249. ui_btn2.URL = "ui://37nctnhwxe622t";
  17250. class ui_btnBack extends fgui.GButton {
  17251. static createInstance() {
  17252. return (fgui.UIPackage.createObject("loading", "btnBack"));
  17253. }
  17254. onConstruct() {
  17255. this.n6 = (this.getChild("n6"));
  17256. this.n7 = (this.getChild("n7"));
  17257. }
  17258. }
  17259. ui_btnBack.URL = "ui://37nctnhwxe622u";
  17260. class ui_btnXy1 extends fgui.GButton {
  17261. static createInstance() {
  17262. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  17263. }
  17264. onConstruct() {
  17265. this.n1 = (this.getChild("n1"));
  17266. }
  17267. }
  17268. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  17269. class ui_btnXy2 extends fgui.GButton {
  17270. static createInstance() {
  17271. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  17272. }
  17273. onConstruct() {
  17274. this.n1 = (this.getChild("n1"));
  17275. }
  17276. }
  17277. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17278. class ui_btnXy3 extends fgui.GButton {
  17279. static createInstance() {
  17280. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17281. }
  17282. onConstruct() {
  17283. this.n1 = (this.getChild("n1"));
  17284. }
  17285. }
  17286. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17287. class ui_btn4 extends fgui.GButton {
  17288. static createInstance() {
  17289. return (fgui.UIPackage.createObject("loading", "btn4"));
  17290. }
  17291. onConstruct() {
  17292. this.n9 = (this.getChild("n9"));
  17293. this.n1 = (this.getChild("n1"));
  17294. }
  17295. }
  17296. ui_btn4.URL = "ui://37nctnhwxe622z";
  17297. class loadingBinder {
  17298. static bindAll() {
  17299. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17300. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17301. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17302. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17303. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17304. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17305. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17306. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17307. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17308. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17309. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17310. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17311. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17312. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17313. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17314. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17315. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17316. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17317. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17318. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17319. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17320. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17321. }
  17322. }
  17323. class UIMgr {
  17324. constructor() {
  17325. this._stage = null;
  17326. this._uiList = [];
  17327. this._showList = [];
  17328. this._bindPkgList = [];
  17329. this.uiIndex = 0;
  17330. }
  17331. static get inst() {
  17332. if (UIMgr._inst == null) {
  17333. UIMgr._inst = new UIMgr();
  17334. }
  17335. return UIMgr._inst;
  17336. }
  17337. setStage(s) {
  17338. if (this._stage) {
  17339. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17340. return;
  17341. }
  17342. this._stage = s;
  17343. }
  17344. clearTempData() {
  17345. console.log('zh:clearTempData start');
  17346. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17347. console.log('zh:clearTempData end');
  17348. }
  17349. init() {
  17350. this.setStage(Laya.stage);
  17351. fairygui.UIConfig.defaultFont = "arial";
  17352. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17353. fairygui.UIConfig.packageFileExtension = "obj";
  17354. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17355. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17356. fairygui.GRoot.inst.width = Laya.stage.width;
  17357. fairygui.GRoot.inst.height = Laya.stage.height;
  17358. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17359. }
  17360. addAllUpdate() {
  17361. this.uiIndex = 0;
  17362. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17363. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17364. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17365. }
  17366. }
  17367. }
  17368. bindFUI(pkgname) {
  17369. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17370. return;
  17371. }
  17372. switch (pkgname) {
  17373. case fguiRes.loading:
  17374. fairygui.UIPackage.addPackage(pkgname);
  17375. loadingBinder.bindAll();
  17376. this._bindPkgList.push(pkgname);
  17377. break;
  17378. case fguiRes.game:
  17379. fairygui.UIPackage.addPackage(pkgname);
  17380. gameBinder.bindAll();
  17381. this._bindPkgList.push(pkgname);
  17382. break;
  17383. default:
  17384. break;
  17385. }
  17386. }
  17387. Show(cls, ...param) {
  17388. let nameStr = cls.uiName;
  17389. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17390. let temp = this._uiList[i];
  17391. let str = temp.className;
  17392. if (str == nameStr) {
  17393. if (temp.isMuti) {
  17394. if (temp.isHide) {
  17395. temp.show(...param);
  17396. this._uiList.splice(i, 1);
  17397. this._uiList.push(temp);
  17398. return temp;
  17399. }
  17400. }
  17401. else {
  17402. temp.show(...param);
  17403. this._uiList.splice(i, 1);
  17404. this._uiList.push(temp);
  17405. return temp;
  17406. }
  17407. }
  17408. }
  17409. let ui = new cls();
  17410. ui.className = nameStr;
  17411. this._showUI(ui, param);
  17412. return ui;
  17413. }
  17414. destroyUI(ui) {
  17415. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17416. let temp = this._uiList[i].className;
  17417. if (temp == ui.className) {
  17418. this._uiList.splice(i, 1);
  17419. break;
  17420. }
  17421. }
  17422. this.checkUIState();
  17423. }
  17424. _showUI(ui, param) {
  17425. this._uiList.push(ui);
  17426. ui.show(...param);
  17427. }
  17428. Hide(uiClass) {
  17429. let ui = this.getUI(uiClass);
  17430. if (ui && !ui.isHide) {
  17431. ui.hide();
  17432. }
  17433. }
  17434. getUI(ui) {
  17435. let nameStr = ui.uiName;
  17436. for (let index = 0; index < this._uiList.length; index++) {
  17437. let temp = this._uiList[index];
  17438. if (temp.className == nameStr) {
  17439. return temp;
  17440. }
  17441. }
  17442. return null;
  17443. }
  17444. isShow(cls) {
  17445. for (var i of this._uiList) {
  17446. if (i instanceof cls) {
  17447. return i.isShowing;
  17448. }
  17449. }
  17450. return false;
  17451. }
  17452. showUINum() {
  17453. let num = 0;
  17454. for (var i of this._uiList) {
  17455. if (i.isShowing) {
  17456. num++;
  17457. }
  17458. }
  17459. return num;
  17460. }
  17461. checkUIState() {
  17462. Laya.timer.clear(this, this._uiCheck);
  17463. Laya.timer.once(400, this, this._uiCheck);
  17464. }
  17465. _uiCheck() {
  17466. let showList = [];
  17467. for (var i of this._uiList) {
  17468. if (!i.isHide) {
  17469. showList.push(i);
  17470. }
  17471. }
  17472. for (let index = 0; index < showList.length; index++) {
  17473. if (index == showList.length - 1) {
  17474. showList[index].checkActive(true);
  17475. }
  17476. else {
  17477. showList[index].checkActive(false);
  17478. }
  17479. }
  17480. }
  17481. showTip(msg, time = 600, size = 30) {
  17482. }
  17483. }
  17484. class UIShowList {
  17485. }
  17486. class SoundMgr {
  17487. constructor() {
  17488. this.soundMax = 4;
  17489. this.isLoad = false;
  17490. this.soundMap = {};
  17491. this.isSound = true;
  17492. this.openShake = true;
  17493. SoundMgr._instance = this;
  17494. }
  17495. static getInstance() {
  17496. if (!this._instance) {
  17497. this._instance = new SoundMgr();
  17498. }
  17499. return this._instance;
  17500. }
  17501. init() {
  17502. console.log('zh:sm init 1');
  17503. Laya.SoundManager.autoReleaseSound = true;
  17504. Laya.SoundManager.autoStopMusic = true;
  17505. Laya.SoundManager.musicVolume = 0.3;
  17506. Laya.SoundManager.soundVolume = 0.5;
  17507. this.musicPlayed = false;
  17508. this.audioUrl = "asset/sound/ogg/";
  17509. console.log('zh:sm init 2');
  17510. console.log('zh:dev type ');
  17511. if (Laya.Browser.onAndroid) {
  17512. console.log('zh:dev type android');
  17513. this.audioUrl = "asset/sound/ogg/";
  17514. this.isLoad = true;
  17515. }
  17516. else {
  17517. console.log('zh:dev type not android');
  17518. this.audioUrl = "asset/sound/mp3/";
  17519. this.isLoad = true;
  17520. }
  17521. }
  17522. onSetting(isS) {
  17523. this.isSound = isS;
  17524. this.mute(!this.isSound);
  17525. }
  17526. clearCount() {
  17527. for (var key in this.soundMap) {
  17528. delete this.soundMap[key];
  17529. }
  17530. }
  17531. playMusic(path, loop = 0) {
  17532. console.log('zh:playMusic 1 PATH=' + path);
  17533. this.musicPath = path;
  17534. if (!this.isLoad) {
  17535. return;
  17536. }
  17537. if (!path || path == "") {
  17538. return;
  17539. }
  17540. if (!this.isSound) {
  17541. return;
  17542. }
  17543. this.musicPlayed = true;
  17544. let url = this.getUrl(path);
  17545. if (!Laya.Browser.onAndroid) {
  17546. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17547. this.play(url, loop);
  17548. }));
  17549. }
  17550. else {
  17551. this.play(url, loop);
  17552. }
  17553. }
  17554. play(url, loop) {
  17555. Laya.SoundManager.playMusic(url, loop);
  17556. }
  17557. getUrl(path) {
  17558. let url = this.audioUrl + path;
  17559. if (Laya.Browser.onAndroid) {
  17560. url += ".ogg";
  17561. }
  17562. else {
  17563. url += ".mp3";
  17564. }
  17565. return url;
  17566. }
  17567. pauseMusic(pause) {
  17568. if (pause) {
  17569. this.mute(true);
  17570. }
  17571. else if (this.isSound)
  17572. this.mute(false);
  17573. }
  17574. stopMusic() {
  17575. Laya.SoundManager.stopMusic();
  17576. if (Moyu.isNeedPlatAudio) {
  17577. Moyu.stopMusic();
  17578. }
  17579. }
  17580. mute(mute) {
  17581. if (Moyu.isNeedPlatAudio) {
  17582. Moyu.pauseMusic(mute);
  17583. }
  17584. else {
  17585. Laya.SoundManager.musicMuted = mute;
  17586. if (!mute && !this.musicPlayed && this.musicPath) {
  17587. this.playMusic(this.musicPath);
  17588. }
  17589. }
  17590. }
  17591. stopSound(path) {
  17592. let url = this.getUrl(path);
  17593. Laya.SoundManager.stopSound(url);
  17594. }
  17595. playSound(path, loop = 1, soundMax = this.soundMax) {
  17596. if (!this.isLoad)
  17597. return;
  17598. if (!this.isSound)
  17599. return;
  17600. if (!path || path == "")
  17601. return;
  17602. let url = this.getUrl(path);
  17603. if (Moyu.isNeedPlatAudio) {
  17604. Moyu.playSound(path, loop == 0);
  17605. }
  17606. else {
  17607. let count = 1;
  17608. if (this.soundMap[path])
  17609. count = this.soundMap[path] + 1;
  17610. if (count > soundMax)
  17611. return;
  17612. this.soundMap[path] = count;
  17613. Laya.SoundManager.playSound(url, loop);
  17614. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17615. }
  17616. }
  17617. removePath(path) {
  17618. if (this.soundMap[path]) {
  17619. let count = this.soundMap[path];
  17620. count--;
  17621. if (count < 1)
  17622. delete this.soundMap[path];
  17623. else
  17624. this.soundMap[path] = count;
  17625. }
  17626. }
  17627. playBtnSound() {
  17628. this.playSound("btn");
  17629. }
  17630. playGetSound() {
  17631. }
  17632. playCloseUISound() {
  17633. }
  17634. }
  17635. SoundMgr._instance = null;
  17636. var Handler$1 = Laya.Handler;
  17637. var EResType;
  17638. (function (EResType) {
  17639. EResType[EResType["none"] = 0] = "none";
  17640. EResType[EResType["nromal"] = 1] = "nromal";
  17641. EResType[EResType["td"] = 2] = "td";
  17642. EResType[EResType["sk"] = 3] = "sk";
  17643. })(EResType || (EResType = {}));
  17644. class CResLoader {
  17645. constructor(doneCall, proCall) {
  17646. this.completrCall = doneCall;
  17647. this.progressCall = proCall;
  17648. this.progressHander = new Handler$1(this, this.onProgress);
  17649. this.tdResMap = {};
  17650. }
  17651. load(resList) {
  17652. this.resCount = 0;
  17653. this.loadCount = 0;
  17654. for (let i = 0; i < resList.length; i++) {
  17655. let path = resList[i];
  17656. if (!path)
  17657. continue;
  17658. this.resCount++;
  17659. let type = this.getResType(path);
  17660. if (type == EResType.nromal)
  17661. this.loadNromal(path);
  17662. else if (type == EResType.td)
  17663. this.loadTd(path);
  17664. }
  17665. }
  17666. getRes(path) {
  17667. let type = this.getResType(path);
  17668. if (type == EResType.nromal)
  17669. return Laya.loader.getRes(path);
  17670. else if (type == EResType.td) {
  17671. let res = this.tdResMap[path];
  17672. if (res)
  17673. return res.clone();
  17674. return null;
  17675. }
  17676. }
  17677. destroy() {
  17678. this.progressHander.clear();
  17679. this.progressHander = null;
  17680. }
  17681. clearRes(path) {
  17682. let type = this.getResType(path);
  17683. if (type == EResType.nromal)
  17684. Laya.loader.clearRes(path);
  17685. else if (type == EResType.td) {
  17686. let obj = this.tdResMap[path];
  17687. if (obj)
  17688. obj.destroy();
  17689. delete this.tdResMap[path];
  17690. }
  17691. }
  17692. getResType(path) {
  17693. let exs = this.getExtension(path);
  17694. if (exs == "sk")
  17695. return EResType.sk;
  17696. if (exs == "ls" || exs == "lh" || exs == "lm")
  17697. return EResType.td;
  17698. else
  17699. return EResType.nromal;
  17700. }
  17701. getExtension(res) {
  17702. var index = res.lastIndexOf(".");
  17703. return res.substr(index + 1);
  17704. }
  17705. loadNromal(path) {
  17706. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17707. if (res) {
  17708. this.onLoad();
  17709. }
  17710. else
  17711. console.log("load res fail:" + path);
  17712. }), this.progressHander);
  17713. }
  17714. loadSk() {
  17715. }
  17716. loadTd(path) {
  17717. if (this.tdResMap[path]) {
  17718. this.onLoad();
  17719. return;
  17720. }
  17721. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17722. if (res) {
  17723. this.tdResMap[path] = res;
  17724. this.onLoad();
  17725. }
  17726. else
  17727. console.log("load res fail:" + path);
  17728. }));
  17729. }
  17730. onLoad() {
  17731. this.loadCount++;
  17732. this.onProgress(1);
  17733. if (this.loadCount >= this.resCount) {
  17734. this.completrCall.run();
  17735. }
  17736. }
  17737. onProgress(pro) {
  17738. let progress = (this.loadCount + pro) / this.resCount;
  17739. this.progressCall.runWith(progress);
  17740. }
  17741. }
  17742. var Handler$2 = Laya.Handler;
  17743. class ResInfo {
  17744. constructor() {
  17745. this.index = 0;
  17746. }
  17747. }
  17748. class ResMgr {
  17749. constructor() {
  17750. this.resList = [];
  17751. this.doneList = [];
  17752. this.resMap = {};
  17753. this.currentLoad = null;
  17754. this.completeHandler = new Handler$2(this, this.onComplete);
  17755. this.progressHandler = new Handler$2(this, this.onProgress);
  17756. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17757. }
  17758. static getInstance() {
  17759. if (ResMgr._instance == null) {
  17760. ResMgr._instance = new ResMgr();
  17761. }
  17762. return ResMgr._instance;
  17763. }
  17764. loadList(list, completeHandler, progressHandler) {
  17765. if (list.length < 1) {
  17766. completeHandler.run();
  17767. return;
  17768. }
  17769. let info = this.getResInfo();
  17770. info.resList = list;
  17771. info.completeHandler = completeHandler;
  17772. info.progressHandler = progressHandler;
  17773. this.resList.push(info);
  17774. this.startLoad();
  17775. }
  17776. loadFguiRes(list, completeHandler, progressHandler) {
  17777. Laya.loader.load(list, completeHandler, progressHandler);
  17778. }
  17779. loadAny(list, completeHandler, progressHandler) {
  17780. Laya.loader.load(list, completeHandler, progressHandler);
  17781. }
  17782. load(path, completeHandler, progressHandler) {
  17783. let count = this.resMap[path];
  17784. if (count && count > 0) {
  17785. if (completeHandler)
  17786. completeHandler.run();
  17787. }
  17788. else
  17789. this.loadList([path], completeHandler, progressHandler);
  17790. }
  17791. getRes(path) {
  17792. let res = this.resMap[path];
  17793. if (!res)
  17794. this.showLog("资源不存在:" + path);
  17795. else
  17796. return this.loader.getRes(path);
  17797. }
  17798. clearList(list, force = false) {
  17799. if (!list || list.length < 1)
  17800. return;
  17801. let cr = () => {
  17802. for (const k in list) {
  17803. let v = list[k];
  17804. if (!v)
  17805. continue;
  17806. if (force) {
  17807. this.loader.clearRes(v);
  17808. delete this.resMap[v];
  17809. }
  17810. else {
  17811. let count = this.resMap[v];
  17812. if (count && count > 1) {
  17813. count--;
  17814. this.resMap[v] = count;
  17815. }
  17816. else {
  17817. this.loader.clearRes(v);
  17818. delete this.resMap[v];
  17819. }
  17820. }
  17821. }
  17822. if (!window.hasOwnProperty("ks"))
  17823. Laya.Resource.destroyUnusedResources();
  17824. };
  17825. Laya.timer.clearAll(this);
  17826. Laya.timer.once(2000, this, cr);
  17827. }
  17828. clear3D() {
  17829. for (const k in this.loader.tdResMap) {
  17830. this.loader.clearRes(k);
  17831. if (this.resMap[k])
  17832. delete this.resMap[k];
  17833. }
  17834. if (!window.hasOwnProperty("ks"))
  17835. Laya.Resource.destroyUnusedResources();
  17836. }
  17837. clear(path, force = false) {
  17838. this.clearList([path], force);
  17839. }
  17840. getResInfo() {
  17841. if (this.doneList.length > 0)
  17842. return this.doneList.pop();
  17843. else
  17844. return new ResInfo();
  17845. }
  17846. startLoad() {
  17847. if (this.currentLoad)
  17848. return;
  17849. this.currentLoad = this.resList.pop();
  17850. if (this.currentLoad) {
  17851. this.loader.load(this.currentLoad.resList);
  17852. }
  17853. }
  17854. onComplete() {
  17855. if (!this.currentLoad)
  17856. return;
  17857. for (const k in this.currentLoad.resList) {
  17858. let v = this.currentLoad.resList[k];
  17859. let count = this.resMap[v];
  17860. if (count)
  17861. count++;
  17862. else
  17863. count = 1;
  17864. this.resMap[v] = count;
  17865. }
  17866. if (this.currentLoad.completeHandler)
  17867. this.currentLoad.completeHandler.run();
  17868. this.doneList.push(this.currentLoad);
  17869. this.currentLoad = null;
  17870. this.startLoad();
  17871. }
  17872. onProgress(pro) {
  17873. if (!this.currentLoad)
  17874. return;
  17875. if (this.currentLoad.progressHandler)
  17876. this.currentLoad.progressHandler.runWith(pro);
  17877. }
  17878. showLog(str, ...args) {
  17879. console.log("[ResLoader] " + str);
  17880. }
  17881. }
  17882. ResMgr._instance = null;
  17883. class EventMgr extends Laya.EventDispatcher {
  17884. }
  17885. let eventMgr = new EventMgr();
  17886. /*! *****************************************************************************
  17887. Copyright (c) Microsoft Corporation. All rights reserved.
  17888. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17889. this file except in compliance with the License. You may obtain a copy of the
  17890. License at http://www.apache.org/licenses/LICENSE-2.0
  17891. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17892. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17893. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17894. MERCHANTABLITY OR NON-INFRINGEMENT.
  17895. See the Apache Version 2.0 License for specific language governing permissions
  17896. and limitations under the License.
  17897. ***************************************************************************** */
  17898. /* global Reflect, Promise */
  17899. var extendStatics = function(d, b) {
  17900. extendStatics = Object.setPrototypeOf ||
  17901. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17902. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17903. return extendStatics(d, b);
  17904. };
  17905. function __extends(d, b) {
  17906. extendStatics(d, b);
  17907. function __() { this.constructor = d; }
  17908. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17909. }
  17910. var __assign = function() {
  17911. __assign = Object.assign || function __assign(t) {
  17912. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17913. s = arguments[i];
  17914. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17915. }
  17916. return t;
  17917. };
  17918. return __assign.apply(this, arguments);
  17919. };
  17920. function __rest(s, e) {
  17921. var t = {};
  17922. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17923. t[p] = s[p];
  17924. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17925. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17926. t[p[i]] = s[p[i]];
  17927. return t;
  17928. }
  17929. function __decorate(decorators, target, key, desc) {
  17930. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17931. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17932. 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;
  17933. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17934. }
  17935. function __param(paramIndex, decorator) {
  17936. return function (target, key) { decorator(target, key, paramIndex); }
  17937. }
  17938. function __metadata(metadataKey, metadataValue) {
  17939. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17940. }
  17941. function __awaiter(thisArg, _arguments, P, generator) {
  17942. return new (P || (P = Promise))(function (resolve, reject) {
  17943. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17944. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17945. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17946. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17947. });
  17948. }
  17949. function __generator(thisArg, body) {
  17950. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17951. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17952. function verb(n) { return function (v) { return step([n, v]); }; }
  17953. function step(op) {
  17954. if (f) throw new TypeError("Generator is already executing.");
  17955. while (_) try {
  17956. 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;
  17957. if (y = 0, t) op = [op[0] & 2, t.value];
  17958. switch (op[0]) {
  17959. case 0: case 1: t = op; break;
  17960. case 4: _.label++; return { value: op[1], done: false };
  17961. case 5: _.label++; y = op[1]; op = [0]; continue;
  17962. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17963. default:
  17964. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17965. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17966. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17967. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17968. if (t[2]) _.ops.pop();
  17969. _.trys.pop(); continue;
  17970. }
  17971. op = body.call(thisArg, _);
  17972. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17973. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17974. }
  17975. }
  17976. function __exportStar(m, exports) {
  17977. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17978. }
  17979. function __values(o) {
  17980. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17981. if (m) return m.call(o);
  17982. return {
  17983. next: function () {
  17984. if (o && i >= o.length) o = void 0;
  17985. return { value: o && o[i++], done: !o };
  17986. }
  17987. };
  17988. }
  17989. function __read(o, n) {
  17990. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17991. if (!m) return o;
  17992. var i = m.call(o), r, ar = [], e;
  17993. try {
  17994. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17995. }
  17996. catch (error) { e = { error: error }; }
  17997. finally {
  17998. try {
  17999. if (r && !r.done && (m = i["return"])) m.call(i);
  18000. }
  18001. finally { if (e) throw e.error; }
  18002. }
  18003. return ar;
  18004. }
  18005. function __spread() {
  18006. for (var ar = [], i = 0; i < arguments.length; i++)
  18007. ar = ar.concat(__read(arguments[i]));
  18008. return ar;
  18009. }
  18010. function __await(v) {
  18011. return this instanceof __await ? (this.v = v, this) : new __await(v);
  18012. }
  18013. function __asyncGenerator(thisArg, _arguments, generator) {
  18014. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  18015. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  18016. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  18017. 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); }); }; }
  18018. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  18019. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  18020. function fulfill(value) { resume("next", value); }
  18021. function reject(value) { resume("throw", value); }
  18022. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  18023. }
  18024. function __asyncDelegator(o) {
  18025. var i, p;
  18026. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  18027. 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; }
  18028. }
  18029. function __asyncValues(o) {
  18030. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  18031. var m = o[Symbol.asyncIterator], i;
  18032. 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);
  18033. 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); }); }; }
  18034. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  18035. }
  18036. function __makeTemplateObject(cooked, raw) {
  18037. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  18038. return cooked;
  18039. };
  18040. function __importStar(mod) {
  18041. if (mod && mod.__esModule) return mod;
  18042. var result = {};
  18043. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  18044. result.default = mod;
  18045. return result;
  18046. }
  18047. function __importDefault(mod) {
  18048. return (mod && mod.__esModule) ? mod : { default: mod };
  18049. }
  18050. class CustomAlert {
  18051. static show(title, content, buttons) {
  18052. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  18053. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  18054. return;
  18055. }
  18056. const bg = new Laya.Box();
  18057. bg.alpha = 0;
  18058. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  18059. Laya.stage.addChild(bg);
  18060. Laya.Tween.to(bg, { alpha: 1 }, 200);
  18061. const panel = new Laya.Box();
  18062. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  18063. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  18064. bg.addChild(panel);
  18065. const titleText = new Laya.Text();
  18066. titleText.text = title;
  18067. titleText.fontSize = 32;
  18068. titleText.color = "#333333";
  18069. titleText.bold = true;
  18070. titleText.pos(20, 20);
  18071. titleText.width = 360;
  18072. titleText.align = "center";
  18073. panel.addChild(titleText);
  18074. const contentText = new Laya.Text();
  18075. contentText.text = content;
  18076. contentText.fontSize = 21;
  18077. contentText.color = "#555555";
  18078. contentText.pos(20, 70);
  18079. contentText.width = 360;
  18080. contentText.wordWrap = true;
  18081. contentText.align = "center";
  18082. panel.addChild(contentText);
  18083. const buttonContainer = new Laya.Box();
  18084. buttonContainer.pos(20, 160);
  18085. panel.addChild(buttonContainer);
  18086. const btnWidth = 120;
  18087. const spacing = 30;
  18088. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  18089. buttons.forEach((btn, index) => {
  18090. const button = new Laya.Button();
  18091. button.label = btn.label;
  18092. button.size(btnWidth, 40);
  18093. button.labelSize = 22;
  18094. button.pos(index * (btnWidth + spacing), 0);
  18095. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  18096. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  18097. button.on(Laya.Event.MOUSE_OVER, this, () => {
  18098. button.alpha = 0.9;
  18099. });
  18100. button.on(Laya.Event.MOUSE_OUT, this, () => {
  18101. button.alpha = 1;
  18102. });
  18103. button.on(Laya.Event.CLICK, this, () => {
  18104. btn.handler();
  18105. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  18106. bg.removeSelf();
  18107. }));
  18108. });
  18109. buttonContainer.addChild(button);
  18110. });
  18111. buttonContainer.x = (panel.width - totalWidth) / 2;
  18112. }
  18113. }
  18114. class ConfigMgr {
  18115. constructor() {
  18116. this.httpReqCount = 4;
  18117. this.httpReqOkCount = 0;
  18118. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  18119. try {
  18120. this.httpReqOkCount = 0;
  18121. let reqData = xGame.httpMgr.getReqData();
  18122. console.log('zh:第1个请求getClassicCfg');
  18123. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  18124. this.classicCfg = classicCfg;
  18125. this.httpReqOkCount++;
  18126. console.log('zh:第2个请求getLevelCfg');
  18127. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  18128. this.levelCfg = levelCfg;
  18129. this.httpReqOkCount++;
  18130. console.log('zh:第3个请求 getPlaceBallCfg');
  18131. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  18132. this.placeBallCfg = placeBallCfg;
  18133. this.httpReqOkCount++;
  18134. console.log('zh:第4个请求 npc');
  18135. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  18136. this.npcJson = npc.Data;
  18137. this.httpReqOkCount++;
  18138. console.log('zh:所有配置加载完成');
  18139. xGame.eventMgr.event("gameConfigReadyMark");
  18140. }
  18141. catch (error) {
  18142. console.error('zh:❌请求失败:', error);
  18143. Laya.timer.once(5000, this, () => {
  18144. let retryCount = 0;
  18145. const maxRetries = 3;
  18146. const tryFetchConfig = () => {
  18147. try {
  18148. xGame.cfgMgr.getConfigFromServer();
  18149. }
  18150. catch (error) {
  18151. if (retryCount < maxRetries) {
  18152. retryCount++;
  18153. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  18154. Laya.timer.once(5000, this, tryFetchConfig);
  18155. }
  18156. else {
  18157. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  18158. }
  18159. }
  18160. };
  18161. tryFetchConfig();
  18162. });
  18163. }
  18164. finally {
  18165. if (this.httpReqCount > this.httpReqOkCount) {
  18166. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  18167. label: "Okay", handler: () => {
  18168. JSBridgeUtils.instance.exitAndCloseGame();
  18169. }
  18170. }]);
  18171. }
  18172. }
  18173. });
  18174. this.sendPostAsync = (action, reqData) => {
  18175. return new Promise((resolve, reject) => {
  18176. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  18177. try {
  18178. let code = res.code;
  18179. if (code == 200) {
  18180. const parsedData = JSON.parse(res.msg);
  18181. resolve(parsedData);
  18182. }
  18183. else {
  18184. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  18185. reject(new Error(`Request failed with code: ${code}`));
  18186. }
  18187. }
  18188. catch (error) {
  18189. console.error(`ERROR=${error}`);
  18190. alert("Please check your network connection.");
  18191. reject(error);
  18192. }
  18193. finally {
  18194. console.log(`zh:${action}的请求处理完毕`);
  18195. }
  18196. });
  18197. });
  18198. };
  18199. }
  18200. static getInstance() {
  18201. if (!this._instance) {
  18202. this._instance = new ConfigMgr();
  18203. }
  18204. return this._instance;
  18205. }
  18206. init() {
  18207. this.getConfigFromServer();
  18208. }
  18209. test() {
  18210. let reqData = xGame.httpMgr.getReqData();
  18211. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  18212. console.log('zh:1s');
  18213. try {
  18214. let code = res.code;
  18215. let data = res.data;
  18216. if (code == 200) {
  18217. const parsedData = JSON.parse(data);
  18218. this.classicCfg = parsedData;
  18219. }
  18220. else {
  18221. console.log('zh:res = ' + JSON.stringify(res));
  18222. }
  18223. }
  18224. catch (error) {
  18225. console.log('error=' + error);
  18226. alert("Please check your network connection.");
  18227. }
  18228. finally {
  18229. console.log('zh:1');
  18230. }
  18231. });
  18232. }
  18233. getUserInfoByIndex(index) {
  18234. return this.npcJson[index];
  18235. }
  18236. getRandomUserInfo() {
  18237. let index = xGame.tools.random(0, this.npcJson.length);
  18238. let rs = this.npcJson[index];
  18239. return rs;
  18240. }
  18241. getMaxBigMoveLength() {
  18242. return Object.keys(this.levelCfg).length;
  18243. }
  18244. getBigMoveLevelByIndex(index) {
  18245. let cfg = this.levelCfg;
  18246. cfg = cfg[index];
  18247. return cfg;
  18248. }
  18249. getRandomClassicLevel() {
  18250. let cfg = this.classicCfg;
  18251. let num = Object.keys(cfg).length;
  18252. let rand = xGame.common.randomNum(1, num);
  18253. return cfg[rand];
  18254. }
  18255. getPlaceBallByLevel(level) {
  18256. return this.placeBallCfg[level];
  18257. }
  18258. getMaxPlaceBall() {
  18259. return Object.keys(this.placeBallCfg).length;
  18260. }
  18261. }
  18262. class PoolD3Mgr {
  18263. constructor() {
  18264. this.pool = {};
  18265. }
  18266. static get ins() {
  18267. return this._ins || (this._ins = new PoolD3Mgr);
  18268. }
  18269. createList(key, prefab, parent) {
  18270. if (!this.pool[key]) {
  18271. this.pool[key] = {};
  18272. this.pool[key].prefab = prefab;
  18273. this.pool[key].list = [];
  18274. this.pool[key].parent = parent;
  18275. }
  18276. }
  18277. getItem(key) {
  18278. if (!this.pool[key]) {
  18279. return;
  18280. }
  18281. let temp;
  18282. if (this.pool[key].list.length > 0) {
  18283. temp = this.pool[key].list.pop();
  18284. }
  18285. else {
  18286. temp = this.pool[key].prefab.clone();
  18287. if (this.pool[key].parent) {
  18288. this.pool[key].parent.addChild(temp);
  18289. }
  18290. }
  18291. temp.active = true;
  18292. return temp;
  18293. }
  18294. putItem(key, obj) {
  18295. if (!this.pool[key]) {
  18296. return;
  18297. }
  18298. obj.active = false;
  18299. this.pool[key].list.push(obj);
  18300. }
  18301. }
  18302. let context$1 = context;
  18303. let uiMgr = UIMgr.inst;
  18304. let soundMgr = SoundMgr.getInstance();
  18305. let resMgr = ResMgr.getInstance();
  18306. let httpMgr = HttpMgr.getInstance();
  18307. let common = Common.getInstance();
  18308. let cfgMgr = ConfigMgr.getInstance();
  18309. let poolD3Mgr = PoolD3Mgr.ins;
  18310. let d3TexUrl = "res/d3Res/";
  18311. let d3ModeUrl = "res/unityRes/";
  18312. function setStageSize(view) {
  18313. if (view.width) {
  18314. view.width = Laya.stage.width;
  18315. view.height = Laya.stage.height;
  18316. }
  18317. }
  18318. function filledBg(view) {
  18319. let wh = Laya.stage.height / Laya.stage.width;
  18320. if (wh > 16 / 9) {
  18321. view.height = Laya.stage.height;
  18322. view.width = Laya.stage.height / 1334 * 750;
  18323. }
  18324. else {
  18325. view.width = Laya.stage.width;
  18326. view.height = Laya.stage.width / 750 * 1334;
  18327. }
  18328. }
  18329. function setNotch(view) {
  18330. if (view.height) {
  18331. view.y += context$1.notchHeight;
  18332. }
  18333. }
  18334. function showTip(str) {
  18335. uiMgr.Show(UIMsg, str);
  18336. }
  18337. function log(...args) {
  18338. console.log(args);
  18339. }
  18340. let xGame = {
  18341. context: context$1,
  18342. eventMgr,
  18343. resMgr,
  18344. uiMgr,
  18345. soundMgr,
  18346. define,
  18347. tools,
  18348. httpMgr,
  18349. d3TexUrl,
  18350. d3ModeUrl,
  18351. common,
  18352. cfgMgr,
  18353. poolD3Mgr,
  18354. setStageSize,
  18355. filledBg,
  18356. setNotch,
  18357. showTip,
  18358. log,
  18359. };
  18360. window["xGame"] = xGame;
  18361. let dataName = 'tBall_';
  18362. class UserData {
  18363. constructor() {
  18364. this.userId = "";
  18365. this.isAgree = false;
  18366. this.coinNum = 0;
  18367. this.gemNum = 0;
  18368. this.sound = true;
  18369. this.vibration = true;
  18370. this.currentDate = 0;
  18371. this.createTime = 0;
  18372. this.awardTime = 0;
  18373. this.roleId = 1;
  18374. this.roleList = [];
  18375. this.roleAds = [];
  18376. this.dressId = 101;
  18377. this.itemId = 201;
  18378. this.bigSkills = [1, 1, 1, 1, 1];
  18379. this.coin = 4000;
  18380. this.diamond = 0;
  18381. this.skillSuccessTimes = 0;
  18382. this.skillGuide = 0;
  18383. this.lianXiGuide = 0;
  18384. this.guideDefaultGameMode = 1;
  18385. this.skillAccTimes = 0;
  18386. this.placeBallData = [];
  18387. this.shareDiamondTimes = 0;
  18388. this.dailyVideoShareTimes = 3;
  18389. this.secretary = [1, 0];
  18390. this.curSecretary = 0;
  18391. this.ballRod = [1, 0, 0, 0, 0, 1];
  18392. this.curBallRod = 5;
  18393. this.signData = 0;
  18394. this.signTime = 0;
  18395. this.drawTimes = 0;
  18396. this.drawAwardTimes = 0;
  18397. this.dailyfreeDrawTimes = 1;
  18398. this.power = 5;
  18399. this.powerTime = 0;
  18400. this.challengeTimes = 0;
  18401. this.extraSign = 0;
  18402. this.classicTimes = 0;
  18403. this.guideHelpLine = 0;
  18404. this.newUser = true;
  18405. this.rootBallFoul = 0;
  18406. this.timeoutFoul = 0;
  18407. this.roleList = [1];
  18408. }
  18409. saveData() {
  18410. let data = {};
  18411. for (let k in this) {
  18412. data[k.toString()] = this[k];
  18413. }
  18414. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18415. }
  18416. getData() {
  18417. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18418. if (ld) {
  18419. let localData = JSON.parse(ld);
  18420. if (localData) {
  18421. for (let k in this) {
  18422. let key = k.toString();
  18423. let data = localData[key];
  18424. if (data != undefined) {
  18425. this[k] = data;
  18426. }
  18427. }
  18428. }
  18429. }
  18430. }
  18431. }
  18432. class ItemData {
  18433. constructor() {
  18434. this.itemList = {};
  18435. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18436. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18437. }
  18438. saveData() {
  18439. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18440. }
  18441. getData() {
  18442. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18443. if (ld) {
  18444. let localData = JSON.parse(ld);
  18445. if (localData) {
  18446. this.itemList = localData;
  18447. }
  18448. }
  18449. }
  18450. }
  18451. class GameData {
  18452. constructor() {
  18453. this.curLevel = 0;
  18454. this.gameType = 1;
  18455. this.signIdx = 0;
  18456. this.signMax = 0;
  18457. this.rotaryTime = 0;
  18458. this.rotaryCount = 0;
  18459. this.rotaryList = [];
  18460. this.diyCount = 3;
  18461. this.awardIdx = 0;
  18462. this.shareNum = 2;
  18463. this.rankWeek = 0;
  18464. this.rankScore = 0;
  18465. this.gameCount = 0;
  18466. this.trySkill = -1;
  18467. this.tryTime = 0;
  18468. }
  18469. saveData() {
  18470. let data = {};
  18471. for (let k in this) {
  18472. data[k.toString()] = this[k];
  18473. }
  18474. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18475. }
  18476. getData() {
  18477. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18478. if (ld) {
  18479. let localData = JSON.parse(ld);
  18480. if (localData) {
  18481. for (let k in this) {
  18482. let key = k.toString();
  18483. let data = localData[key];
  18484. if (data != undefined) {
  18485. this[k] = data;
  18486. }
  18487. }
  18488. }
  18489. }
  18490. }
  18491. }
  18492. class Diy2025GameData {
  18493. constructor() {
  18494. this.challengeMode_overLev = 0;
  18495. this.xszyForClassic = false;
  18496. this.xszyForChallenge = false;
  18497. }
  18498. saveData() {
  18499. let data = {};
  18500. for (let k in this) {
  18501. data[k.toString()] = this[k];
  18502. }
  18503. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18504. }
  18505. getData() {
  18506. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18507. if (ld) {
  18508. let localData = JSON.parse(ld);
  18509. if (localData) {
  18510. for (let k in this) {
  18511. let key = k.toString();
  18512. let data = localData[key];
  18513. if (data != undefined) {
  18514. this[k] = data;
  18515. }
  18516. }
  18517. }
  18518. }
  18519. }
  18520. }
  18521. class UIFuli1 extends UIBase {
  18522. constructor() {
  18523. super();
  18524. this.jiage = 4.99;
  18525. }
  18526. onConstructor() {
  18527. this.ui = ui_UIFuli1.createInstance();
  18528. this.contentPane = this.ui;
  18529. this.isEject = false;
  18530. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18531. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18532. }
  18533. show() {
  18534. super.show();
  18535. this.x = (Laya.stage.width - this.width) / 2;
  18536. this.y = (Laya.stage.height - this.height) / 2;
  18537. this.ui.n2.txt_price.text = "$" + this.jiage;
  18538. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18539. this.setGlobalFont(this.ui);
  18540. }
  18541. closeSelf() {
  18542. DataMgr.loadUserSpOrderForAd();
  18543. this.hide();
  18544. }
  18545. gotoBuy() {
  18546. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18547. if (userInfo != null) {
  18548. let token = userInfo.token;
  18549. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18550. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18551. DataMgr.loadUserSpOrderForAd();
  18552. return;
  18553. }
  18554. else {
  18555. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18556. }
  18557. }
  18558. gotoBuy2() {
  18559. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18560. if (userInfo == null) {
  18561. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18562. return;
  18563. }
  18564. let reqData = xGame.httpMgr.getReqData();
  18565. let pd = JSON.parse(reqData);
  18566. pd.productId = 1;
  18567. reqData = JSON.stringify(pd);
  18568. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18569. try {
  18570. console.log('zh:buySp res = ' + JSON.stringify(res));
  18571. let code = res.code;
  18572. let msg = res.msg;
  18573. if (code == 401) {
  18574. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18575. alert(TIP_MSG_key.loginTimeOut);
  18576. xGame.uiMgr.Show(UIMsg, msg);
  18577. return;
  18578. }
  18579. if (code == 200) {
  18580. xGame.uiMgr.Show(UIMsg, msg);
  18581. DataMgr.loadUserSpOrderForAd();
  18582. DataMgr.getUserZiChanInfo(false);
  18583. this.closeSelf();
  18584. }
  18585. else {
  18586. xGame.uiMgr.Show(UIMsg, msg);
  18587. }
  18588. }
  18589. catch (error) {
  18590. console.log('error=' + error);
  18591. alert(error);
  18592. }
  18593. finally {
  18594. }
  18595. });
  18596. }
  18597. }
  18598. UIFuli1.uiName = "UIFuli1";
  18599. class UIFuli2 extends UIBase {
  18600. constructor() {
  18601. super();
  18602. this.jiage = 14.99;
  18603. }
  18604. onConstructor() {
  18605. this.ui = ui_UIFuli2.createInstance();
  18606. this.contentPane = this.ui;
  18607. this.isEject = false;
  18608. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18609. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18610. }
  18611. show() {
  18612. super.show();
  18613. this.x = (Laya.stage.width - this.width) / 2;
  18614. this.y = (Laya.stage.height - this.height) / 2;
  18615. this.ui.n2.txt_price.text = "$" + this.jiage;
  18616. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18617. this.setGlobalFont(this.ui);
  18618. }
  18619. closeSelf() {
  18620. DataMgr.loadUserSpOrderForAd();
  18621. this.hide();
  18622. }
  18623. gotoBuy() {
  18624. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18625. if (userInfo != null) {
  18626. let token = userInfo.token;
  18627. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18628. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18629. DataMgr.loadUserSpOrderForAd();
  18630. return;
  18631. }
  18632. else {
  18633. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18634. }
  18635. }
  18636. gotoBuy1() {
  18637. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18638. if (userInfo == null) {
  18639. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18640. return;
  18641. }
  18642. let reqData = xGame.httpMgr.getReqData();
  18643. let pd = JSON.parse(reqData);
  18644. pd.productId = 2;
  18645. reqData = JSON.stringify(pd);
  18646. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18647. try {
  18648. console.log('zh:buySp res = ' + JSON.stringify(res));
  18649. let code = res.code;
  18650. let msg = res.msg;
  18651. if (code == 401) {
  18652. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18653. alert(TIP_MSG_key.loginTimeOut);
  18654. xGame.uiMgr.Show(UIMsg, msg);
  18655. return;
  18656. }
  18657. if (code == 200) {
  18658. xGame.uiMgr.Show(UIMsg, msg);
  18659. DataMgr.loadUserSpOrderForAd();
  18660. DataMgr.getUserZiChanInfo(false);
  18661. this.closeSelf();
  18662. }
  18663. else {
  18664. xGame.uiMgr.Show(UIMsg, msg);
  18665. }
  18666. }
  18667. catch (error) {
  18668. console.log('error=' + error);
  18669. alert(error);
  18670. }
  18671. finally {
  18672. }
  18673. });
  18674. }
  18675. }
  18676. UIFuli2.uiName = "UIFuli2";
  18677. class DataMgr {
  18678. static Init() {
  18679. this.userData = new UserData();
  18680. this.gameData = new GameData();
  18681. this.itemData = new ItemData();
  18682. this.diyGameData = new Diy2025GameData();
  18683. this.userData.getData();
  18684. this.gameData.getData();
  18685. this.itemData.getData();
  18686. this.diyGameData.getData();
  18687. this.roleId = this.userData.roleId;
  18688. this.resetUse();
  18689. }
  18690. static isNewDay() {
  18691. Moyu.isNewDay(this, (isnew) => {
  18692. xGame.common.isNewDay = isnew;
  18693. if (!isnew)
  18694. return;
  18695. DataMgr.setShareDiamondTimes(0, false);
  18696. DataMgr.setDailyVideoShareTimes(0, false);
  18697. DataMgr.setDailyfreeDrawTimes(1);
  18698. DataMgr.setExtraSign(0);
  18699. });
  18700. }
  18701. static deletData() {
  18702. Laya.LocalStorage.clear();
  18703. }
  18704. static upRankData() {
  18705. let num = xGame.common.getAllStarNum();
  18706. if (num > 0)
  18707. Moyu.upRankData(xGame.common.curRankID, num);
  18708. }
  18709. static addItem(id, count = 1) {
  18710. let v = this.itemData.itemList[id];
  18711. if (!v)
  18712. v = { id: id, count: count, adnum: 0, active: true };
  18713. else {
  18714. if (v.active) {
  18715. v.count += count;
  18716. }
  18717. else {
  18718. v.count = count;
  18719. v.active = true;
  18720. }
  18721. }
  18722. this.itemData.itemList[id] = v;
  18723. xGame.soundMgr.playGetSound();
  18724. this.saveItemData();
  18725. }
  18726. static hasItem(id) {
  18727. let v = this.itemData.itemList[id];
  18728. if (v && v.active)
  18729. return true;
  18730. return false;
  18731. }
  18732. static getItem(id) {
  18733. let v = this.itemData.itemList[id];
  18734. return v;
  18735. }
  18736. static getItemCount(id) {
  18737. let v = this.itemData.itemList[id];
  18738. if (v && v.active)
  18739. return v.count;
  18740. return 0;
  18741. }
  18742. static getItemAd(id) {
  18743. let v = this.itemData.itemList[id];
  18744. if (v) {
  18745. return v.adnum;
  18746. }
  18747. return 0;
  18748. }
  18749. static onItemAd(id, num = 1) {
  18750. let v = this.itemData.itemList[id];
  18751. if (!v)
  18752. v = { id: id, count: 1, adnum: num, active: false };
  18753. else
  18754. v.adnum += num;
  18755. this.itemData.itemList[id] = v;
  18756. this.saveItemData();
  18757. }
  18758. static costItem(id, count) {
  18759. let v = this.itemData.itemList[id];
  18760. if (v && v.active) {
  18761. if (v.count < count)
  18762. return false;
  18763. else {
  18764. v.count -= count;
  18765. this.itemData.itemList[id] = v;
  18766. return true;
  18767. }
  18768. }
  18769. return false;
  18770. }
  18771. static resetUse() {
  18772. this.dressId = this.userData.dressId;
  18773. this.itemId = this.userData.itemId;
  18774. }
  18775. static passLevel() {
  18776. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18777. this.gameData.curLevel++;
  18778. this.curLevel = this.gameData.curLevel;
  18779. this.saveGameData();
  18780. }
  18781. static useRole(id) {
  18782. this.roleId = id;
  18783. if (this.hasRole(id)) {
  18784. this.userData.roleId = id;
  18785. this.saveUserData();
  18786. }
  18787. }
  18788. static addRole(id) {
  18789. if (this.hasRole(id))
  18790. return;
  18791. this.userData.roleList.push(id);
  18792. this.saveUserData();
  18793. }
  18794. static hasRole(id) {
  18795. return this.userData.roleList.indexOf(id) >= 0;
  18796. }
  18797. static gemEnough(num) {
  18798. return this.userData.gemNum >= num;
  18799. }
  18800. static roleHasAd(id) {
  18801. let count = this.userData.roleAds[id];
  18802. if (count != undefined && count >= 0)
  18803. return true;
  18804. else
  18805. return false;
  18806. }
  18807. static saveUserData(time = 500, event, arg) {
  18808. if (this.userSaving)
  18809. return;
  18810. this.userSaving = true;
  18811. Laya.timer.once(time, this, () => {
  18812. this.userSaving = false;
  18813. this.userData.saveData();
  18814. if (event)
  18815. xGame.eventMgr.event(event, arg);
  18816. });
  18817. }
  18818. static updateUserNickName(loginUserName) {
  18819. let kyeStr = 'moyudata_180';
  18820. console.log('zh:################### kyeStr=' + kyeStr);
  18821. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18822. if (moyudata) {
  18823. const obj = JSON.parse(moyudata);
  18824. obj.nickName = loginUserName;
  18825. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18826. console.log('zh:################### updateUserNickName');
  18827. }
  18828. }
  18829. static saveGameData() {
  18830. if (this.gameSaving)
  18831. return;
  18832. this.gameSaving = true;
  18833. Laya.timer.once(1000, this, () => {
  18834. this.gameSaving = false;
  18835. this.gameData.saveData();
  18836. });
  18837. }
  18838. static saveItemData() {
  18839. let fun = () => {
  18840. this.itemData.saveData();
  18841. };
  18842. Laya.timer.clear(this, fun);
  18843. Laya.timer.once(500, this, fun);
  18844. }
  18845. static saveData() {
  18846. this.saveUserData();
  18847. this.saveGameData();
  18848. }
  18849. static getBigSkillList() {
  18850. return this.userData.bigSkills;
  18851. }
  18852. static getBigSkillByIndex(index) {
  18853. return this.userData.bigSkills[index];
  18854. }
  18855. static setBigSkill(index, val, addUp = true) {
  18856. if (addUp) {
  18857. this.userData.bigSkills[index] += val;
  18858. }
  18859. else {
  18860. this.userData.bigSkills[index] = val;
  18861. }
  18862. this.saveUserData();
  18863. console.log("zh:大技能更新");
  18864. this.updateUserInfo2Server("bigSkills");
  18865. }
  18866. static setBigSkillFormServer(jsonStr) {
  18867. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18868. this.userData.bigSkills = JSON.parse(jsonStr);
  18869. this.saveUserData();
  18870. }
  18871. static coinEnough(need) {
  18872. if (typeof need != "number") {
  18873. console.error("金币格式错误");
  18874. return;
  18875. }
  18876. return this.userData.coin >= need;
  18877. }
  18878. static setCoin(val) {
  18879. if (typeof val != "number") {
  18880. return;
  18881. }
  18882. this.userData.coin += val;
  18883. this.saveUserData();
  18884. xGame.eventMgr.event(COIN_CHANGE);
  18885. this.updateUserInfo2Server("jb");
  18886. }
  18887. static setCoin2(val) {
  18888. if (typeof val != "number") {
  18889. return;
  18890. }
  18891. this.userData.coin = val;
  18892. this.saveUserData();
  18893. xGame.eventMgr.event(COIN_CHANGE);
  18894. }
  18895. static setCoinFormServer(val) {
  18896. if (typeof val != "number") {
  18897. return;
  18898. }
  18899. this.userData.coin = val;
  18900. this.saveUserData();
  18901. console.log('zh:通知更新金币变化' + val);
  18902. xGame.eventMgr.event(COIN_CHANGE);
  18903. }
  18904. static getCoin() {
  18905. return this.userData.coin;
  18906. }
  18907. static diamondEnough(need) {
  18908. if (typeof need != "number") {
  18909. console.error("金币格式错误");
  18910. return;
  18911. }
  18912. return this.userData.diamond >= need;
  18913. }
  18914. static setDiamond(val) {
  18915. if (typeof val != "number") {
  18916. return;
  18917. }
  18918. this.userData.diamond += val;
  18919. this.saveUserData();
  18920. xGame.eventMgr.event(DIAMOND_CHANGE);
  18921. this.updateUserInfo2Server("zs");
  18922. }
  18923. static setDiamond2(val) {
  18924. if (typeof val != "number") {
  18925. return;
  18926. }
  18927. this.userData.diamond = val;
  18928. this.saveUserData();
  18929. xGame.eventMgr.event(DIAMOND_CHANGE);
  18930. }
  18931. static setDiamondFormServer(val) {
  18932. if (typeof val != "number") {
  18933. return;
  18934. }
  18935. this.userData.diamond = val;
  18936. this.saveUserData();
  18937. console.log('zh:通知更新钻石变化' + val);
  18938. xGame.eventMgr.event(DIAMOND_CHANGE);
  18939. }
  18940. static getDiamond() {
  18941. return this.userData.diamond;
  18942. }
  18943. static getSkillSuccessTimes() {
  18944. return this.userData.skillSuccessTimes;
  18945. }
  18946. static setSkillSuccessTimes(val, addUp = true) {
  18947. if (addUp)
  18948. this.userData.skillSuccessTimes += val;
  18949. else
  18950. this.userData.skillSuccessTimes = val;
  18951. this.saveUserData();
  18952. }
  18953. static getSkillAccTimes() {
  18954. return this.userData.skillAccTimes;
  18955. }
  18956. static setSkillAccTimes(val) {
  18957. this.userData.skillAccTimes += val;
  18958. this.saveUserData();
  18959. }
  18960. static getGuideDefaultModel() {
  18961. return this.userData.guideDefaultGameMode;
  18962. }
  18963. static getSkillGuide() {
  18964. if (!xGame.common.openGuide) {
  18965. return 1;
  18966. }
  18967. return this.userData.skillGuide;
  18968. }
  18969. static setSkillGuide(val) {
  18970. this.userData.skillGuide = val;
  18971. this.saveUserData();
  18972. }
  18973. static setLianXiGuide(val) {
  18974. this.userData.lianXiGuide = val;
  18975. this.saveUserData();
  18976. }
  18977. static getLianXiGuide() {
  18978. return this.userData.lianXiGuide;
  18979. }
  18980. static getPlaceBallLevelList() {
  18981. return this.userData.placeBallData;
  18982. }
  18983. static setPlaceBallLevelList(objStr) {
  18984. if (objStr) {
  18985. let obj = JSON.parse(objStr);
  18986. this.userData.placeBallData = obj;
  18987. let cd = obj.length;
  18988. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18989. xGame.common.placeBallCurLevel = cd;
  18990. DataMgr.setChallengeMode_overLev(cd);
  18991. this.saveUserData();
  18992. }
  18993. else {
  18994. this.userData.placeBallData = [];
  18995. this.saveUserData();
  18996. }
  18997. }
  18998. static getPlaceBallLevel(level) {
  18999. let arr = this.userData.placeBallData;
  19000. let index = level - 1;
  19001. let out;
  19002. if (arr[index]) {
  19003. out = arr[index];
  19004. }
  19005. else {
  19006. let max = arr.length;
  19007. if (max == index) {
  19008. out = {
  19009. star: 0,
  19010. play: true,
  19011. isCur: true,
  19012. getAward: false
  19013. };
  19014. }
  19015. else {
  19016. out = {
  19017. star: 0,
  19018. play: false,
  19019. getAward: false
  19020. };
  19021. }
  19022. }
  19023. return out;
  19024. }
  19025. static setPlaceBallLevel(level, star) {
  19026. let arr = this.userData.placeBallData;
  19027. let index = level - 1;
  19028. if (arr[index]) {
  19029. arr[index].star = Math.max(arr[index].star, star);
  19030. }
  19031. else {
  19032. let max = arr.length;
  19033. if (max == index) {
  19034. arr.push({
  19035. star: star,
  19036. play: true,
  19037. getAward: false
  19038. });
  19039. }
  19040. else {
  19041. console.error("关卡存储出错");
  19042. }
  19043. }
  19044. this.saveUserData();
  19045. }
  19046. static setPlaceBallAward(level) {
  19047. let arr = this.userData.placeBallData;
  19048. let index = level - 1;
  19049. if (arr[index]) {
  19050. arr[index].getAward = true;
  19051. }
  19052. this.saveUserData();
  19053. }
  19054. static getShareDiamondTimes() {
  19055. return this.userData.shareDiamondTimes;
  19056. }
  19057. static setShareDiamondTimes(val, addUp = true) {
  19058. if (addUp) {
  19059. this.userData.shareDiamondTimes += val;
  19060. }
  19061. else {
  19062. this.userData.shareDiamondTimes = val;
  19063. }
  19064. this.saveUserData();
  19065. }
  19066. static getDailyVideoShareTimes() {
  19067. return this.userData.dailyVideoShareTimes;
  19068. }
  19069. static setDailyVideoShareTimes(val, addUp = true) {
  19070. if (addUp) {
  19071. this.userData.dailyVideoShareTimes += val;
  19072. }
  19073. else {
  19074. this.userData.dailyVideoShareTimes = val;
  19075. }
  19076. this.saveUserData();
  19077. }
  19078. static getSecretary(index) {
  19079. return this.userData.secretary[index];
  19080. }
  19081. static setSecretary(index, val) {
  19082. this.userData.secretary[index] = val;
  19083. this.saveUserData();
  19084. }
  19085. static getCurSecretary() {
  19086. return this.userData.curSecretary;
  19087. }
  19088. static setCurSecretary(index) {
  19089. this.userData.curSecretary = index;
  19090. this.saveUserData();
  19091. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  19092. }
  19093. static getBallRod(index) {
  19094. return this.userData.ballRod[index];
  19095. }
  19096. static setBallRod(index, val) {
  19097. this.userData.ballRod[index] = val;
  19098. this.saveUserData();
  19099. }
  19100. static setBallRodFormServer(haveQiuGanJsonStr) {
  19101. if (!haveQiuGanJsonStr) {
  19102. console.log("setBallRodFormServer数据为空或未定义");
  19103. return;
  19104. }
  19105. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  19106. const keys = Object.keys(haveQiuGanJsonObj);
  19107. keys.forEach(key => {
  19108. let v = haveQiuGanJsonObj[key];
  19109. let k = parseInt(key);
  19110. let idx = k - 1;
  19111. this.userData.ballRod[idx] = v;
  19112. });
  19113. }
  19114. static getCurBallRod() {
  19115. return this.userData.curBallRod;
  19116. }
  19117. static setCurBallRod(index) {
  19118. this.userData.curBallRod = index;
  19119. this.saveUserData();
  19120. }
  19121. static setSignData(val) {
  19122. this.userData.signData = val;
  19123. this.saveUserData();
  19124. }
  19125. static getSignData() {
  19126. return this.userData.signData;
  19127. }
  19128. static setSignTime(val) {
  19129. this.userData.signTime = val;
  19130. this.saveUserData();
  19131. }
  19132. static getSignTime() {
  19133. return this.userData.signTime;
  19134. }
  19135. static getDrawTimes() {
  19136. return this.userData.drawTimes;
  19137. }
  19138. static setDrawTimes(val, addUp = true) {
  19139. if (addUp) {
  19140. this.userData.drawTimes += val;
  19141. }
  19142. else {
  19143. this.userData.drawTimes = val;
  19144. }
  19145. this.saveUserData();
  19146. }
  19147. static getDrawAwardTimes() {
  19148. return this.userData.drawAwardTimes;
  19149. }
  19150. static setDrawAwardTimes(val) {
  19151. this.userData.drawAwardTimes = val;
  19152. this.saveUserData();
  19153. }
  19154. static getDailyfreeDrawTimes() {
  19155. return this.userData.dailyfreeDrawTimes;
  19156. }
  19157. static setDailyfreeDrawTimes(val) {
  19158. this.userData.dailyfreeDrawTimes = val;
  19159. this.saveUserData();
  19160. }
  19161. static setPower(val, addUp = true) {
  19162. if (addUp) {
  19163. this.userData.power += val;
  19164. }
  19165. else {
  19166. this.userData.power = val;
  19167. }
  19168. if (this.userData.power >= xGame.common.maxPower) {
  19169. this.userData.power = xGame.common.maxPower;
  19170. }
  19171. xGame.eventMgr.event(POWER_CHANGE, val);
  19172. this.saveUserData();
  19173. this.updateUserInfo2Server("power");
  19174. console.log('zh:up tili over = ' + this.userData.power);
  19175. }
  19176. static getPower() {
  19177. return this.userData.power;
  19178. }
  19179. static setPowerTime(val) {
  19180. this.userData.powerTime = val;
  19181. this.saveUserData();
  19182. }
  19183. static getPowerTime() {
  19184. return this.userData.powerTime;
  19185. }
  19186. static powerEnough() {
  19187. return this.getPower() > 0;
  19188. }
  19189. static getChallengeTimes() {
  19190. return this.userData.challengeTimes;
  19191. }
  19192. static setChallengeTimes(val) {
  19193. this.userData.challengeTimes += val;
  19194. this.saveUserData();
  19195. }
  19196. static getExtraSign() {
  19197. return this.userData.extraSign;
  19198. }
  19199. static setExtraSign(val) {
  19200. this.userData.extraSign = val;
  19201. this.saveUserData();
  19202. }
  19203. static getClassicTimes() {
  19204. return this.userData.classicTimes;
  19205. }
  19206. static setClassicTimes() {
  19207. this.userData.classicTimes += 1;
  19208. this.saveUserData();
  19209. }
  19210. static getGuideHelpLine() {
  19211. return this.userData.guideHelpLine;
  19212. }
  19213. static setGuideHelpLine() {
  19214. this.userData.guideHelpLine = 1;
  19215. this.saveUserData();
  19216. }
  19217. static getNewUser() {
  19218. return this.userData.newUser;
  19219. }
  19220. static setNewUser() {
  19221. this.userData.newUser = false;
  19222. this.saveUserData();
  19223. }
  19224. static getRootBallFoul() {
  19225. return this.userData.rootBallFoul;
  19226. }
  19227. static setRootBallFoul() {
  19228. this.userData.rootBallFoul = 1;
  19229. this.saveUserData();
  19230. }
  19231. static getTimeoutFoul() {
  19232. return this.userData.timeoutFoul;
  19233. }
  19234. static setTimeoutFoul() {
  19235. this.userData.timeoutFoul = 1;
  19236. this.saveUserData();
  19237. }
  19238. static saveDiyGameData() {
  19239. if (this.diyGameSaving)
  19240. return;
  19241. this.diyGameSaving = true;
  19242. Laya.timer.once(500, this, () => {
  19243. this.diyGameSaving = false;
  19244. this.diyGameData.saveData();
  19245. });
  19246. }
  19247. static getChallengeMode_overLev() {
  19248. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  19249. return this.challengeMode_overLev;
  19250. }
  19251. static setChallengeMode_overLev(levNum) {
  19252. this.diyGameData.challengeMode_overLev = levNum;
  19253. this.saveDiyGameData();
  19254. }
  19255. static updateUserInfo2Server(type, count = 0) {
  19256. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19257. if (userInfoData == null) {
  19258. return;
  19259. }
  19260. let reqData = xGame.httpMgr.getReqData();
  19261. let rd = JSON.parse(reqData);
  19262. rd.dataType = type;
  19263. let dataValue = 0;
  19264. if (type == "zs") {
  19265. dataValue = this.getDiamond();
  19266. }
  19267. if (type == "jb") {
  19268. dataValue = this.getCoin();
  19269. }
  19270. if (type == "power") {
  19271. dataValue = this.getPower();
  19272. }
  19273. rd.dataValue = dataValue;
  19274. if (type == "bigSkills") {
  19275. let dataValueStr = this.userData.bigSkills;
  19276. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  19277. rd.dataValueStr = JSON.stringify(dvsJson);
  19278. }
  19279. reqData = JSON.stringify(rd);
  19280. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  19281. try {
  19282. let code = res.code;
  19283. let data = res.data;
  19284. if (code == 401) {
  19285. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19286. console.log('zh:保存资产信息失败,请重新登录 ');
  19287. return;
  19288. }
  19289. if (code == 200) {
  19290. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  19291. }
  19292. else {
  19293. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  19294. }
  19295. }
  19296. catch (error) {
  19297. console.log('error=' + error);
  19298. alert("Please check your network connection.");
  19299. }
  19300. finally {
  19301. }
  19302. });
  19303. }
  19304. static getUserZiChanInfo(winTip = false) {
  19305. console.log('zh:getUserZCI');
  19306. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19307. console.log('zh:userInfoData=' + userInfoData);
  19308. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  19309. if (winTip) {
  19310. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19311. }
  19312. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19313. return;
  19314. }
  19315. let reqData = xGame.httpMgr.getReqData();
  19316. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  19317. try {
  19318. console.log('zh:buySp res = ' + JSON.stringify(res));
  19319. let code = res.code;
  19320. let msg = res.msg;
  19321. if (code == 401) {
  19322. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19323. if (winTip) {
  19324. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19325. }
  19326. return;
  19327. }
  19328. if (code == 200) {
  19329. let d = res.data;
  19330. let zuanShi = d.zuanShi;
  19331. let jinBi = d.jinBi;
  19332. let haveQiuGanJson = d.haveQiuGanJson;
  19333. let signData = d.signData;
  19334. let placeBallData = d.placeBallData;
  19335. let bigSkills = d.bigSkills;
  19336. DataMgr.setDiamondFormServer(zuanShi);
  19337. DataMgr.setCoinFormServer(jinBi);
  19338. DataMgr.setBallRodFormServer(haveQiuGanJson);
  19339. DataMgr.setPlaceBallLevelList(placeBallData);
  19340. if (signData && signData > 0) {
  19341. DataMgr.setSignData(signData);
  19342. }
  19343. DataMgr.setBigSkillFormServer(bigSkills);
  19344. }
  19345. else {
  19346. console.log("zh:更新用户资产信息error" + msg);
  19347. if (winTip) {
  19348. xGame.uiMgr.Show(UIMsg, msg);
  19349. }
  19350. }
  19351. }
  19352. catch (error) {
  19353. console.log('error=' + error);
  19354. if (winTip) {
  19355. alert(error);
  19356. }
  19357. }
  19358. finally {
  19359. console.log("zh:更新用户资产信息结束");
  19360. }
  19361. });
  19362. }
  19363. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  19364. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19365. console.log('zh:updateLocalUserData=' + userInfo);
  19366. if (userInfo != null) {
  19367. if (!userInfo.buySpids) {
  19368. userInfo.buySpids = { 1: false, 7: false };
  19369. }
  19370. else {
  19371. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  19372. }
  19373. userInfo.buySpids[spid] = isBuyOk;
  19374. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  19375. }
  19376. else {
  19377. }
  19378. }
  19379. static loadUserSpOrderForAd() {
  19380. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19381. if (userInfo == null) {
  19382. return;
  19383. }
  19384. console.log('zh:重新加载更新广告权利');
  19385. let reqData = xGame.httpMgr.getReqData();
  19386. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  19387. try {
  19388. console.log('zh:getOrderListForNoChongFuBuy res = ' + JSON.stringify(res));
  19389. let code = res.code;
  19390. let msg = res.msg;
  19391. if (code == 401) {
  19392. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19393. return;
  19394. }
  19395. if (code == 200) {
  19396. let data = res.data;
  19397. let buy_spid1 = false;
  19398. let buy_spid7 = false;
  19399. for (let index = 0; index < data.length; index++) {
  19400. let element = data[index];
  19401. console.log('zh:list element.spid = ' + element.spid);
  19402. if (element.spid == 1) {
  19403. buy_spid1 = true;
  19404. }
  19405. if (element.spid == 7) {
  19406. buy_spid7 = true;
  19407. }
  19408. }
  19409. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  19410. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  19411. }
  19412. else {
  19413. }
  19414. }
  19415. catch (error) {
  19416. console.log('error=' + error);
  19417. alert(error);
  19418. }
  19419. finally {
  19420. }
  19421. });
  19422. }
  19423. static checkForShowFuLi17AndAlert(alert_spid) {
  19424. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19425. if (userInfo == null) {
  19426. if (alert_spid === 1) {
  19427. xGame.uiMgr.Show(UIFuli1);
  19428. }
  19429. if (alert_spid === 7) {
  19430. xGame.uiMgr.Show(UIFuli2);
  19431. }
  19432. return;
  19433. }
  19434. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  19435. let reqData = xGame.httpMgr.getReqData();
  19436. let pd = JSON.parse(reqData);
  19437. pd.productId = alert_spid;
  19438. reqData = JSON.stringify(pd);
  19439. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  19440. try {
  19441. let code = res.code;
  19442. let msg = res.msg;
  19443. if (code == 401) {
  19444. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19445. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19446. return;
  19447. }
  19448. if (code == 200) {
  19449. let data = res.data;
  19450. let buyOkSpid = [];
  19451. for (let i = 0; i < data.length; i++) {
  19452. let item = data[i];
  19453. let temp_spid = item.spid;
  19454. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19455. buyOkSpid.push(temp_spid);
  19456. }
  19457. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19458. if (isBuyOk7) {
  19459. return;
  19460. }
  19461. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19462. if (isBuyOk && alert_spid === 1) {
  19463. return;
  19464. }
  19465. else {
  19466. if (isBuyOk === false) {
  19467. if (alert_spid === 1) {
  19468. xGame.uiMgr.Show(UIFuli1);
  19469. }
  19470. if (alert_spid === 7) {
  19471. xGame.uiMgr.Show(UIFuli2);
  19472. }
  19473. }
  19474. else {
  19475. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19476. }
  19477. }
  19478. }
  19479. else {
  19480. xGame.uiMgr.Show(UIMsg, msg);
  19481. }
  19482. }
  19483. catch (error) {
  19484. console.log('error=' + error);
  19485. alert(error);
  19486. }
  19487. finally {
  19488. }
  19489. });
  19490. }
  19491. }
  19492. DataMgr.isNewUser = false;
  19493. DataMgr.fristEnter = true;
  19494. DataMgr.levelType = 0;
  19495. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19496. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19497. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19498. DataMgr.challengeMode_overLev = 0;
  19499. DataMgr.xszyForClassic = false;
  19500. DataMgr.xszyForChallenge = false;
  19501. DataMgr.awardId = 0;
  19502. DataMgr.awardCoin = 0;
  19503. DataMgr.sceneId = -1;
  19504. DataMgr.tryId = 0;
  19505. DataMgr.curLevel = 1;
  19506. DataMgr.vipLevel = 0;
  19507. DataMgr.maxLevel = 0;
  19508. DataMgr.awardRatio = 1;
  19509. DataMgr.gameList = [];
  19510. DataMgr.rankList = [];
  19511. DataMgr.recoverTime = 480000;
  19512. DataMgr.minScore = 0;
  19513. DataMgr.rankDis = 0;
  19514. DataMgr.userSaving = false;
  19515. DataMgr.gameSaving = false;
  19516. DataMgr.diyGameSaving = false;
  19517. class D3Tween extends Laya.Script3D {
  19518. constructor() {
  19519. super();
  19520. this.isInited = false;
  19521. }
  19522. ;
  19523. init() {
  19524. if (this.isInited)
  19525. return;
  19526. this.isInited = true;
  19527. this.gameObj = this.owner;
  19528. this.transform = this.gameObj.transform;
  19529. }
  19530. get rotX() {
  19531. return this.transform.localRotationEulerX;
  19532. }
  19533. set rotX(v) {
  19534. this.transform.localRotationEulerX = v;
  19535. }
  19536. get rotY() {
  19537. return this.transform.localRotationEulerY;
  19538. }
  19539. set rotY(v) {
  19540. this.transform.localRotationEulerY = v;
  19541. }
  19542. get rotZ() {
  19543. return this.transform.localRotationEulerZ;
  19544. }
  19545. set rotZ(v) {
  19546. this.transform.localRotationEulerZ = v;
  19547. }
  19548. get posX() {
  19549. return this.transform.localPositionX;
  19550. }
  19551. set posX(v) {
  19552. this.transform.localPositionX = v;
  19553. }
  19554. get posY() {
  19555. return this.transform.localPositionY;
  19556. }
  19557. set posY(v) {
  19558. this.transform.localPositionY = v;
  19559. }
  19560. get posZ() {
  19561. return this.transform.localPositionZ;
  19562. }
  19563. set posZ(v) {
  19564. this.transform.localPositionZ = v;
  19565. }
  19566. get rotation() {
  19567. return this.transform.localRotation;
  19568. }
  19569. set rotation(v) {
  19570. this.transform.localRotation = v;
  19571. }
  19572. }
  19573. class D2Hole extends Laya.Script {
  19574. constructor() { super(); }
  19575. onTriggerEnter(collider) {
  19576. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19577. return;
  19578. }
  19579. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19580. if (collider.owner["mySrc"].isRunSkillAni) {
  19581. return;
  19582. }
  19583. if (collider.owner["mySrc"].number != 0) {
  19584. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19585. }
  19586. xGame.common.ballColliHole(collider);
  19587. xGame.common.recoverCameraView();
  19588. }
  19589. }
  19590. }
  19591. class Table extends Laya.Script3D {
  19592. constructor() {
  19593. super();
  19594. this.isSetBorder = false;
  19595. this.inited = false;
  19596. }
  19597. ;
  19598. onAwake() {
  19599. this.init();
  19600. }
  19601. init() {
  19602. if (this.inited)
  19603. return;
  19604. this.inited = true;
  19605. this.gameObj = this.owner;
  19606. this.border = this.gameObj.getChildByName("border");
  19607. }
  19608. setBorderPos() {
  19609. if (this.isSetBorder)
  19610. return;
  19611. this.isSetBorder = true;
  19612. let ui = xGame.common.gameUI.ui;
  19613. let bar1 = this.border.getChildByName("bar1");
  19614. let bar2 = this.border.getChildByName("bar2");
  19615. let bar3 = this.border.getChildByName("bar3");
  19616. let bar4 = this.border.getChildByName("bar4");
  19617. let bar5 = this.border.getChildByName("bar5");
  19618. let bar6 = this.border.getChildByName("bar6");
  19619. this.setInfo(bar1, ui.border.bar1, "box");
  19620. this.setInfo(bar2, ui.border.bar2, "box");
  19621. this.setInfo(bar3, ui.border.bar3, "box");
  19622. this.setInfo(bar4, ui.border.bar4, "box");
  19623. this.setInfo(bar5, ui.border.bar5, "box");
  19624. this.setInfo(bar6, ui.border.bar6, "box");
  19625. let circle1 = this.border.getChildByName("circle1");
  19626. let circle2 = this.border.getChildByName("circle2");
  19627. let circle3 = this.border.getChildByName("circle3");
  19628. let circle4 = this.border.getChildByName("circle4");
  19629. let circle5 = this.border.getChildByName("circle5");
  19630. let circle6 = this.border.getChildByName("circle6");
  19631. this.setInfo(circle1, ui.border.circle1, "circle");
  19632. this.setInfo(circle2, ui.border.circle2, "circle");
  19633. this.setInfo(circle3, ui.border.circle3, "circle");
  19634. this.setInfo(circle4, ui.border.circle4, "circle");
  19635. this.setInfo(circle5, ui.border.circle5, "circle");
  19636. this.setInfo(circle6, ui.border.circle6, "circle");
  19637. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19638. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19639. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19640. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19641. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19642. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19643. let arr = xGame.common.gameMgr.holePosList;
  19644. xGame.common.gameMgr.posObj = {
  19645. "1": arr[0],
  19646. "3": arr[2],
  19647. "4": arr[3],
  19648. "6": arr[5]
  19649. };
  19650. }
  19651. initHolePos(x, y) {
  19652. if (x < 300)
  19653. x += 25;
  19654. else if (x > 1000)
  19655. x -= 25;
  19656. else if (y > 200)
  19657. y -= 10;
  19658. else
  19659. y += 10;
  19660. if (y < 200)
  19661. y += 30;
  19662. else if (y > 500)
  19663. y -= 30;
  19664. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19665. }
  19666. setInfo(d3Obj, d2Obj, type) {
  19667. let ui = xGame.common.gameUI.ui;
  19668. let sprite = new Laya.Sprite();
  19669. ui.border.displayObject.addChild(sprite);
  19670. let colli = xGame.common.getCollider(type);
  19671. sprite.addComponentIntance(colli);
  19672. let rigy = xGame.common.getRigbody();
  19673. rigy.type = "static";
  19674. sprite.addComponentIntance(rigy);
  19675. let d3Pos = d3Obj.transform.position;
  19676. xGame.common.pos3to2Convert(d3Pos);
  19677. let scaleX = d3Obj.transform.localScaleX;
  19678. let scaleZ = d3Obj.transform.localScaleZ;
  19679. let width = xGame.common.scale3to2Convert(scaleZ);
  19680. let height = xGame.common.scale3to2Convert(scaleX);
  19681. sprite.pivotX = width / 2;
  19682. sprite.pivotY = height / 2;
  19683. sprite.x = d3Pos.x;
  19684. sprite.y = d3Pos.y;
  19685. sprite.width = width;
  19686. sprite.height = height;
  19687. d2Obj.x = d3Pos.x;
  19688. d2Obj.y = d3Pos.y;
  19689. d2Obj.width = width;
  19690. d2Obj.height = height;
  19691. if (type == "box") {
  19692. colli.width = width;
  19693. colli.height = height;
  19694. colli.isSensor = false;
  19695. colli.label = "border";
  19696. }
  19697. else {
  19698. colli.radius = width / 2;
  19699. colli.isSensor = true;
  19700. colli.label = "hole";
  19701. sprite.addComponent(D2Hole);
  19702. }
  19703. }
  19704. }
  19705. class D3World extends Laya.Script3D {
  19706. constructor() {
  19707. super();
  19708. this.loadNum = 0;
  19709. this.setLoadNum = 7;
  19710. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19711. }
  19712. onAwake() {
  19713. }
  19714. loadScene() {
  19715. this.scene = this.owner;
  19716. let url = `res/unityRes/root.lh`;
  19717. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19718. this.scene.addChild(prefab);
  19719. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19720. this.putCameraInfo();
  19721. this.camera.enableHDR = false;
  19722. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19723. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19724. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19725. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19726. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19727. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19728. this.knife.active = false;
  19729. this.loadD3Obj();
  19730. }));
  19731. }
  19732. putCameraInfo() {
  19733. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19734. this.cameraObj = new cameraType();
  19735. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19736. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19737. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19738. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19739. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19740. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19741. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19742. this.visitAngleChild.init();
  19743. this.visitRootObj.posX = this.visitAngleChild.posX;
  19744. this.visitRootObj.posY = this.visitAngleChild.posY;
  19745. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19746. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19747. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19748. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19749. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19750. xGame.common.showOneCamera("mainCamera");
  19751. }
  19752. loadD3Obj() {
  19753. this.loadTable();
  19754. this.loadRoom();
  19755. this.loadInHoleParticial();
  19756. this.loadIceParticial();
  19757. this.loadHitParticial();
  19758. this.loadFireworksParticial();
  19759. this.loadBall();
  19760. }
  19761. loadInHoleParticial() {
  19762. this.loadD3Res("inHoleEft", "", (prefab) => {
  19763. prefab.addComponent(Partical);
  19764. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19765. });
  19766. }
  19767. loadIceParticial() {
  19768. this.loadD3Res("iceEft", "", (prefab) => {
  19769. prefab.addComponent(Partical);
  19770. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19771. });
  19772. }
  19773. loadHitParticial() {
  19774. this.loadD3Res("hitEft", "", (prefab) => {
  19775. prefab.addComponent(Partical);
  19776. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19777. });
  19778. }
  19779. loadFireworksParticial() {
  19780. this.loadD3Res("fireworksEft", "", (prefab) => {
  19781. prefab.addComponent(Partical);
  19782. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19783. });
  19784. }
  19785. loadBall(index = 1) {
  19786. this.loadD3Res("ball", index, (prefab) => {
  19787. this.ballPrefab = prefab;
  19788. this.ballPrefab.addComponent(Ball);
  19789. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19790. });
  19791. }
  19792. loadTable(index = 1) {
  19793. this.loadD3Res("table", index, (prefab) => {
  19794. this.tableSrc = prefab.addComponent(Table);
  19795. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19796. this.d3Hand.init();
  19797. this.tableRoot.addChild(prefab);
  19798. });
  19799. }
  19800. loadRoom(index = 1) {
  19801. this.loadD3Res("room", index, (prefab) => {
  19802. this.roomRoot.addChild(prefab);
  19803. });
  19804. }
  19805. loadD3Res(type, index, callback) {
  19806. let url = `res/unityRes/${type}${index}.lh`;
  19807. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19808. callback && callback(prefab);
  19809. this.checkResLoad();
  19810. }));
  19811. }
  19812. checkResLoad() {
  19813. this.loadNum++;
  19814. if (this.loadNum >= this.setLoadNum) {
  19815. xGame.eventMgr.event(D3RES_LOADED);
  19816. }
  19817. }
  19818. prePlayEft() {
  19819. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19820. eft.transform.localPositionX = 0;
  19821. eft.transform.localPositionY = -5;
  19822. eft.transform.localPositionZ = 0;
  19823. eft.active = true;
  19824. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19825. ice.transform.localPositionX = 0;
  19826. ice.transform.localPositionY = -5;
  19827. ice.transform.localPositionZ = 0;
  19828. ice.active = true;
  19829. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19830. hit.transform.localPositionX = 0;
  19831. hit.transform.localPositionY = -5;
  19832. hit.transform.localPositionZ = 0;
  19833. hit.active = true;
  19834. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19835. fireworks.transform.localPositionX = 0;
  19836. fireworks.transform.localPositionY = -5;
  19837. fireworks.transform.localPositionZ = 0;
  19838. fireworks.active = true;
  19839. }
  19840. }
  19841. class cameraType {
  19842. }
  19843. class MoyuMgr$1 {
  19844. static initMoyu() {
  19845. this.moyuView = new MoyuView$1();
  19846. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19847. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19848. this.moyuView.ui.displayObject.zOrder = 1000;
  19849. this.moyuView.init();
  19850. this.moyuView.showTip(true);
  19851. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19852. window['XApk'] = this;
  19853. }
  19854. static showAge(show) {
  19855. if (this.moyuView)
  19856. this.moyuView.showAge(show);
  19857. }
  19858. static onPlatMsg(idx) {
  19859. if (!MoyuMgr$1.moyuView)
  19860. return;
  19861. if (idx == '0') {
  19862. MoyuMgr$1.moyuView.showTip(false);
  19863. }
  19864. }
  19865. static showAgree(call) {
  19866. if (this.moyuView)
  19867. this.moyuView.showAgree(call);
  19868. else
  19869. call && call();
  19870. }
  19871. static showXy(type = 1) {
  19872. if (this.moyuView)
  19873. this.moyuView.showXy(type);
  19874. }
  19875. }
  19876. MoyuMgr$1.isAdvise = false;
  19877. class MoyuView$1 {
  19878. constructor() {
  19879. this.ysxyNum = 1;
  19880. this.ysJson = null;
  19881. this.ui = ui_UIMoyu.createInstance();
  19882. }
  19883. init() {
  19884. this.ui.mainBg.visible = false;
  19885. this.ui.xyNode.visible = false;
  19886. this.ui.ageNode.visible = false;
  19887. this.ui.tipNode.visible = false;
  19888. this.ui.rnNode.visible = false;
  19889. this.ui.fcmNode.visible = false;
  19890. this.ui.ageTip.visible = false;
  19891. this.ui.msgNode.visible = false;
  19892. this.ui.visible = false;
  19893. this.ui.xyNode.xyList.setVirtual();
  19894. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19895. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19896. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19897. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19898. this.ui.xyNode.btnKnown.visible = false;
  19899. this.ui.xyNode.xy1.visible = false;
  19900. this.ui.xyNode.xy2.visible = false;
  19901. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19902. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19903. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19904. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19905. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19906. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19907. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19908. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19909. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19910. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19911. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19912. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19913. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19914. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19915. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19916. this.ysxyNum = 2;
  19917. }
  19918. }
  19919. onClick(obj) {
  19920. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19921. switch (obj) {
  19922. case this.ui.ageTip:
  19923. if (Moyu.isTTApk) {
  19924. this.ui.ageNode.visible = true;
  19925. this.ui.mainBg.visible = true;
  19926. }
  19927. break;
  19928. case this.ui.tipNode:
  19929. this.showTip(false);
  19930. break;
  19931. case this.ui.ageNode.btnAge:
  19932. this.ui.ageNode.visible = false;
  19933. this.ui.mainBg.visible = false;
  19934. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19935. this.ui.visible = false;
  19936. break;
  19937. case this.ui.xyNode.btnXy3:
  19938. case this.ui.xyNode.btnXy1:
  19939. this.loadXy(1);
  19940. break;
  19941. case this.ui.xyNode.btnXy2:
  19942. this.loadXy(2);
  19943. break;
  19944. case this.ui.xyNode.btnBack:
  19945. this.ui.xyNode.xy1.visible = true;
  19946. this.ui.xyNode.xy2.visible = false;
  19947. break;
  19948. case this.ui.xyNode.btnKnown:
  19949. this.ui.xyNode.visible = false;
  19950. this.ui.mainBg.visible = false;
  19951. this.ui.visible = false;
  19952. break;
  19953. case this.ui.rnNode.btnCheck:
  19954. this.check();
  19955. break;
  19956. case this.ui.rnNode.btnExit:
  19957. case this.ui.xyNode.btnNo:
  19958. this.ysxyNum--;
  19959. if (this.ysxyNum > 0)
  19960. this.showMsg("Refuse to quit the game once again");
  19961. else {
  19962. Moyu.userAgree(false);
  19963. Moyu.exit();
  19964. }
  19965. break;
  19966. case this.ui.xyNode.btnSure:
  19967. case this.ui.xyNode.btnYes:
  19968. DataMgr.userData.isAgree = true;
  19969. DataMgr.saveUserData();
  19970. this.onAgree();
  19971. break;
  19972. case this.ui.rnNode.btnDone:
  19973. this.ui.rnNode.visible = false;
  19974. this.ui.visible = false;
  19975. break;
  19976. case this.ui.fcmNode.btnRn:
  19977. this.showRn();
  19978. break;
  19979. }
  19980. }
  19981. showTip(show) {
  19982. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19983. return;
  19984. if (show) {
  19985. MoyuMgr$1.isAdvise = true;
  19986. this.ui.visible = true;
  19987. this.ui.tipNode.visible = true;
  19988. this.ui.tipNode.alpha = 1;
  19989. Laya.timer.once(1000, this, this.showTip, [false]);
  19990. }
  19991. else {
  19992. this.ui.tipNode.alpha = 1;
  19993. this.ui.tipNode.visible = true;
  19994. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19995. this.ui.tipNode.visible = false;
  19996. MoyuMgr$1.isAdvise = false;
  19997. }), 1000);
  19998. }
  19999. }
  20000. showAge(show, px = 0, py = 0) {
  20001. if (Moyu.platType > 10 && !Moyu.isIos) {
  20002. this.ui.ageTip.x = px;
  20003. this.ui.ageTip.y = py;
  20004. this.ui.ageTip.visible = show;
  20005. if (show)
  20006. this.ui.visible = true;
  20007. }
  20008. }
  20009. showAgree(call) {
  20010. this.agreeCall = call;
  20011. this.onAgree();
  20012. return;
  20013. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  20014. this.showXy(0);
  20015. }
  20016. else
  20017. this.onAgree();
  20018. }
  20019. onAgree() {
  20020. if (!this.ui.ageNode.visible)
  20021. this.ui.visible = false;
  20022. this.ui.xyNode.visible = false;
  20023. Moyu.userAgree(true);
  20024. this.showAge(false);
  20025. this.agreeCall && this.agreeCall();
  20026. this.showRn();
  20027. }
  20028. showMsg(txt) {
  20029. this.ui.msgNode.txtMsg.text = txt;
  20030. this.ui.msgNode.visible = true;
  20031. this.ui.msgNode.alpha = 1;
  20032. this.ui.visible = true;
  20033. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  20034. this.ui.msgNode.visible = false;
  20035. }), 2500, true);
  20036. }
  20037. showRn() {
  20038. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  20039. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  20040. this.ui.rnNode.rn1.visible = true;
  20041. this.ui.rnNode.rn2.visible = false;
  20042. this.ui.rnNode.rn3.visible = false;
  20043. this.ui.rnNode.rn4.visible = false;
  20044. this.ui.rnNode.visible = true;
  20045. this.ui.mainBg.visible = true;
  20046. this.ui.rnNode.btnDone.visible = false;
  20047. this.ui.rnNode.btnExit.visible = true;
  20048. this.ui.rnNode.btnCheck.visible = true;
  20049. this.ui.fcmNode.visible = false;
  20050. this.ui.visible = true;
  20051. return;
  20052. }
  20053. }
  20054. this.showFcm();
  20055. }
  20056. showFcm() {
  20057. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  20058. Moyu.initFCM(true);
  20059. if (Moyu.gameTime < 1)
  20060. this.fcmLoop();
  20061. else if (Moyu.gameTime < 999)
  20062. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  20063. }
  20064. }
  20065. fcmLoop() {
  20066. if (Moyu.gameTime < 1) {
  20067. this.ui.rnNode.visible = false;
  20068. this.ui.fcmNode.visible = true;
  20069. this.ui.mainBg.visible = true;
  20070. this.ui.visible = true;
  20071. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  20072. Laya.timer.clear(this.ui, this.fcmLoop);
  20073. }
  20074. }
  20075. check() {
  20076. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  20077. this.ui.rnNode.rn1.visible = false;
  20078. this.ui.rnNode.rn2.visible = false;
  20079. this.ui.rnNode.rn4.visible = true;
  20080. }
  20081. else if (this.ui.rnNode.rn4.visible) {
  20082. let name = this.ui.rnNode.inputName.text;
  20083. let code = this.ui.rnNode.inputCode.text;
  20084. if (code && code.length == 18) {
  20085. this.ui.rnNode.rn1.visible = false;
  20086. this.ui.rnNode.rn4.visible = false;
  20087. Moyu.authenticate(name, code, (res) => {
  20088. this.ui.rnNode.rn2.visible = !res;
  20089. this.ui.rnNode.rn3.visible = res;
  20090. this.ui.rnNode.btnDone.visible = res;
  20091. this.ui.rnNode.btnExit.visible = !res;
  20092. this.ui.rnNode.btnCheck.visible = !res;
  20093. if (res)
  20094. this.showFcm();
  20095. });
  20096. }
  20097. else
  20098. this.showMsg("信息填写不完整");
  20099. }
  20100. }
  20101. loadXy(type = 0) {
  20102. this.ui.xyNode.xy1.visible = false;
  20103. this.ui.xyNode.xy2.visible = true;
  20104. this.ui.xyNode.xyList.scrollToView(0);
  20105. if (type == 1) {
  20106. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  20107. }
  20108. else if (type == 2) {
  20109. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  20110. }
  20111. }
  20112. showXy(type = 0) {
  20113. this.xyBtn();
  20114. if (type == 0) {
  20115. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  20116. this.ui.xyNode.btnSure.visible = true;
  20117. }
  20118. else {
  20119. this.ui.xyNode.btnYes.visible = true;
  20120. this.ui.xyNode.btnNo.visible = true;
  20121. }
  20122. }
  20123. else {
  20124. this.ui.xyNode.btnKnown.visible = true;
  20125. this.ui.mainBg.visible = true;
  20126. }
  20127. this.ui.xyNode.xy1.visible = true;
  20128. this.ui.xyNode.xy2.visible = false;
  20129. this.ui.xyNode.visible = true;
  20130. this.ui.visible = true;
  20131. }
  20132. xyBtn() {
  20133. this.ui.xyNode.btnSure.visible = false;
  20134. this.ui.xyNode.btnYes.visible = false;
  20135. this.ui.xyNode.btnNo.visible = false;
  20136. this.ui.xyNode.btnKnown.visible = false;
  20137. {
  20138. this.ui.xyNode.btnXy3.visible = false;
  20139. this.ui.xyNode.btnXy2.visible = true;
  20140. this.ui.xyNode.btnXy1.visible = true;
  20141. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  20142. }
  20143. }
  20144. createXY(json) {
  20145. this.ysJson = json.content;
  20146. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  20147. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  20148. this.ui.xyNode.xy2.visible = true;
  20149. }
  20150. renderListItem(idx, cell) {
  20151. let xy = this.ysJson[idx];
  20152. cell.height = xy.line * 30;
  20153. cell.xyItem.text = xy.text;
  20154. }
  20155. onDestroy() {
  20156. this.agreeCall = null;
  20157. }
  20158. }
  20159. class UILoading extends UIBase {
  20160. constructor() {
  20161. super();
  20162. this.accTime = 0;
  20163. this.curNum = 0;
  20164. this.rate = 1;
  20165. this.loadSubOk = false;
  20166. this.loadResOK = false;
  20167. this.openLoading = true;
  20168. this.beginLoadRes = false;
  20169. this.finishD2 = false;
  20170. this.finishD3 = false;
  20171. }
  20172. onConstructor() {
  20173. this.ui = ui_UILoading.createInstance();
  20174. this.contentPane = this.ui;
  20175. this.isEject = false;
  20176. this._initUI();
  20177. this._addEvent();
  20178. }
  20179. _initUI() {
  20180. MoyuMgr$1.initMoyu();
  20181. }
  20182. _addEvent() {
  20183. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  20184. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  20185. }
  20186. show() {
  20187. super.show();
  20188. console.log('zh:加载分包资源');
  20189. loadSubRes(this.subResProgress.bind(this));
  20190. this.ui.txtLoad.text = "Loading...";
  20191. this.setGlobalFont(this.ui);
  20192. }
  20193. subResProgress(pro, finish) {
  20194. this.curNum = pro;
  20195. if (finish) {
  20196. this.curNum = 1;
  20197. this.loadSubOk = true;
  20198. }
  20199. }
  20200. laodD3Res() {
  20201. let scene3D = new Laya.Scene3D();
  20202. xGame.common.d3Scene = scene3D;
  20203. xGame.common.d3World = scene3D.addComponent(D3World);
  20204. xGame.common.d3World.loadScene();
  20205. }
  20206. loadD2Res() {
  20207. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  20208. this.finishD2 = true;
  20209. this.checkLoadAll();
  20210. this.curNum = 1;
  20211. }), Laya.Handler.create(this, (pro) => {
  20212. this.curNum = pro;
  20213. }, null, false));
  20214. }
  20215. d3ResFinish() {
  20216. this.finishD3 = true;
  20217. this.checkLoadAll();
  20218. }
  20219. checkLoadAll() {
  20220. if (this.finishD2 && this.finishD3) {
  20221. this.loadResOK = true;
  20222. }
  20223. }
  20224. loadRes() {
  20225. this.laodD3Res();
  20226. this.loadD2Res();
  20227. }
  20228. myUpdate(dt) {
  20229. if (!this.openLoading)
  20230. return;
  20231. this.accTime += dt * this.rate;
  20232. if (this.accTime >= this.curNum)
  20233. this.accTime = this.curNum;
  20234. this.ui.loadinfo.value = this.accTime * 100;
  20235. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  20236. if (!this.beginLoadRes) {
  20237. this.beginLoadRes = true;
  20238. this.ui.txtLoad.text = "Loading...";
  20239. this.curNum = 0;
  20240. this.accTime = 0;
  20241. this.loadRes();
  20242. }
  20243. if (this.loadResOK) {
  20244. this.openLoading = false;
  20245. Laya.timer.once(300, this, () => {
  20246. xGame.common.d3Scene.active = false;
  20247. MoyuMgr$1.showAgree(enterGame);
  20248. });
  20249. }
  20250. }
  20251. }
  20252. release() {
  20253. }
  20254. hide() {
  20255. super.hide();
  20256. this.release();
  20257. }
  20258. onClose() {
  20259. this.hide();
  20260. }
  20261. }
  20262. UILoading.uiName = "UILoading";
  20263. class UIRepentProp$1 extends UIBase {
  20264. constructor() {
  20265. super();
  20266. this.viewType = 0;
  20267. this.regretType = 0;
  20268. }
  20269. onConstructor() {
  20270. this.ui = ui_UIRepentProp.createInstance();
  20271. this.contentPane = this.ui;
  20272. this.isEject = false;
  20273. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  20274. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  20275. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  20276. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  20277. }
  20278. show(viewType, regretType, callback) {
  20279. PlatMgr.showInsert(true);
  20280. this.viewType = viewType;
  20281. this.regretType = regretType;
  20282. this.callback = callback;
  20283. super.show();
  20284. this.ui.t0.play();
  20285. this.ui.c1.selectedIndex = this.viewType;
  20286. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  20287. if (this.viewType == 0) {
  20288. let guide = DataMgr.getGuideHelpLine();
  20289. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  20290. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  20291. }
  20292. xGame.common.gameMgr.gamePause = true;
  20293. this.setGlobalFont(this.ui);
  20294. }
  20295. hideSelf() {
  20296. xGame.common.gameMgr.gamePause = false;
  20297. this.callback && this.callback(false);
  20298. this.hide();
  20299. }
  20300. videoRegret() {
  20301. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  20302. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  20303. }
  20304. else {
  20305. console.log('zh:AD 失败,直接发放奖励');
  20306. this.qjff_AD_for_UIrepentProp_videoRegret();
  20307. }
  20308. }
  20309. qjff_AD_for_UIrepentProp_videoRegret() {
  20310. this.callback && this.callback(true);
  20311. this.hideSelf();
  20312. }
  20313. videoAddHelpLine() {
  20314. let guide = DataMgr.getGuideHelpLine();
  20315. if (guide == 0) {
  20316. this.callback && this.callback(true);
  20317. this.hideSelf();
  20318. DataMgr.setGuideHelpLine();
  20319. xGame.common.gameUI.ui.guideNode.visible = false;
  20320. }
  20321. else {
  20322. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  20323. if (Laya.Browser.onAndroid) {
  20324. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20325. if (!boo) {
  20326. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20327. return;
  20328. }
  20329. }
  20330. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  20331. }
  20332. else {
  20333. console.log('zh:AD 失败,直接发放奖励');
  20334. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20335. }
  20336. }
  20337. }
  20338. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  20339. this.callback && this.callback(true);
  20340. this.hideSelf();
  20341. }
  20342. }
  20343. UIRepentProp$1.uiName = "UIRepentProp";
  20344. class UIRodMethod$1 extends UIBase {
  20345. constructor() {
  20346. super();
  20347. this.isPressd = false;
  20348. }
  20349. onConstructor() {
  20350. this.ui = ui_UIRodMethod.createInstance();
  20351. this.contentPane = this.ui;
  20352. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  20353. this.moveDir = new Laya.Vector2();
  20354. this.moveDest = new Laya.Vector2();
  20355. this.centerPos = new Laya.Vector2();
  20356. xGame.common.uiRodMethod = this;
  20357. }
  20358. show() {
  20359. super.show();
  20360. xGame.common.gameMgr.gamePause = true;
  20361. this.openPressDotEvent();
  20362. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  20363. this.centerPos.x = this.ui.white.x;
  20364. this.centerPos.y = this.ui.white.y;
  20365. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  20366. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  20367. this.setDot();
  20368. this.setGlobalFont(this.ui);
  20369. }
  20370. setDot() {
  20371. this.ui.dot.x = this.moveDest.x;
  20372. this.ui.dot.y = this.moveDest.y;
  20373. }
  20374. closeSelf() {
  20375. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  20376. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  20377. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  20378. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  20379. xGame.common.gameMgr.gamePause = false;
  20380. this.hide();
  20381. }
  20382. openPressDotEvent() {
  20383. this.closePressDotEvent();
  20384. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20385. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20386. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20387. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20388. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20389. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20390. }
  20391. closePressDotEvent() {
  20392. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20393. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20394. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20395. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20396. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20397. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20398. }
  20399. onDown(e) {
  20400. if (e.type == Laya.Event.MOUSE_DOWN)
  20401. this.isPressd = true;
  20402. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  20403. this.isPressd = false;
  20404. if (!this.isPressd)
  20405. return;
  20406. this.moveDest.x = e.stageX;
  20407. this.moveDest.y = e.stageY;
  20408. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  20409. if (dis > 6724) {
  20410. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  20411. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  20412. }
  20413. this.setDot();
  20414. }
  20415. resetRod() {
  20416. this.ui.dot.x = this.ui.white.x;
  20417. this.ui.dot.y = this.ui.white.y;
  20418. this.gameRod.dot.x = this.gameRod.bg.x;
  20419. this.gameRod.dot.y = this.gameRod.bg.y;
  20420. xGame.common.rodOffest.x = 0;
  20421. xGame.common.rodOffest.y = 0;
  20422. }
  20423. }
  20424. UIRodMethod$1.uiName = "UIRodMethod";
  20425. class UIMsg$1 extends UIBase {
  20426. constructor() {
  20427. super();
  20428. }
  20429. onConstructor() {
  20430. this.ui = ui_UIMsg.createInstance();
  20431. this.contentPane = this.ui;
  20432. this.isEject = false;
  20433. this.isMuti = true;
  20434. }
  20435. show(msg, callback) {
  20436. super.show();
  20437. this.ui.tipsNode.msgTxt.text = msg;
  20438. this.ui.alpha = 1;
  20439. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  20440. this.hide();
  20441. callback && callback();
  20442. }), 1000);
  20443. this.setGlobalFont(this.ui);
  20444. }
  20445. }
  20446. UIMsg$1.uiName = "UIMsg";
  20447. class UITips$1 extends UIBase {
  20448. constructor() {
  20449. super();
  20450. this.type = 0;
  20451. }
  20452. onConstructor() {
  20453. this.ui = ui_UITips.createInstance();
  20454. this.contentPane = this.ui;
  20455. this.isEject = false;
  20456. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20457. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20458. }
  20459. show(tipsTxt, womanTxt, type) {
  20460. super.show();
  20461. this.ui.t0.play();
  20462. this.ui.myNode.tipsTxt.text = tipsTxt;
  20463. this.ui.myNode.womanTxt.text = womanTxt;
  20464. PlatMgr.showInsert(true);
  20465. this.ui.myNode.c1.selectedIndex = type;
  20466. this.type = type;
  20467. switch (this.type) {
  20468. case TipsType.exitGame:
  20469. xGame.common.gameMgr.gamePause = true;
  20470. break;
  20471. case TipsType.foul:
  20472. Laya.timer.once(200, this, () => {
  20473. if (xGame.common.gameMgr) {
  20474. xGame.common.gameMgr.gamePause = true;
  20475. }
  20476. else {
  20477. console.log("zh:gameMgr is null");
  20478. }
  20479. });
  20480. break;
  20481. default:
  20482. break;
  20483. }
  20484. this.setGlobalFont(this.ui);
  20485. }
  20486. clickLeftBtn() {
  20487. this.hide();
  20488. xGame.common.gameMgr.gamePause = false;
  20489. switch (this.type) {
  20490. case TipsType.exitGame:
  20491. break;
  20492. case TipsType.foul:
  20493. break;
  20494. default:
  20495. break;
  20496. }
  20497. }
  20498. clickRightBtn() {
  20499. this.hide();
  20500. switch (this.type) {
  20501. case TipsType.exitGame:
  20502. xGame.eventMgr.event(RESET_GAME);
  20503. xGame.uiMgr.Show(UIMain$1);
  20504. Moyu.recordEnd(this, null);
  20505. xGame.common.longHelpLine = false;
  20506. break;
  20507. case TipsType.foul:
  20508. if (xGame.common.gameMgr) {
  20509. xGame.common.gameMgr.gamePause = false;
  20510. }
  20511. Laya.timer.clearAll(this);
  20512. break;
  20513. default:
  20514. break;
  20515. }
  20516. }
  20517. }
  20518. UITips$1.uiName = "UITips";
  20519. class UIGame$1 extends UIBase {
  20520. constructor() {
  20521. super();
  20522. this.powerNum = 0;
  20523. this.isD3Inited = false;
  20524. this.isPrePlay = false;
  20525. this.isMoveRod = false;
  20526. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20527. this.rulerDis = 20;
  20528. this.rulerOffset = 0;
  20529. }
  20530. onConstructor() {
  20531. this.ui = ui_UIGame.createInstance();
  20532. this.contentPane = this.ui;
  20533. this.ui.x += xGame.common.sysOffestNum;
  20534. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20535. this.isEject = false;
  20536. xGame.common.gameUI = this;
  20537. this.initSelf();
  20538. }
  20539. isTurnSelf() {
  20540. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20541. return true;
  20542. }
  20543. }
  20544. initSelf() {
  20545. let topUI = this.ui.topNode;
  20546. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20547. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20548. this.barInfo = {};
  20549. this.barInfo.curY = 0;
  20550. this.barInfo.height = this.ui.powerNode.height;
  20551. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20552. this.barInfo.powerStartY = this.ui.powerNode.y;
  20553. xGame.common.aiPlayer = new AIPlayer();
  20554. xGame.common.gameMgr = new GameMgr();
  20555. xGame.common.skillMgr = new SkillMgr();
  20556. xGame.common.wordsMgr = new WordsMgr();
  20557. xGame.common.talkMgr = new TalkMgr();
  20558. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20559. });
  20560. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20561. });
  20562. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20563. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20564. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20565. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20566. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20567. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20568. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20569. }
  20570. getGanZiImg() {
  20571. let index = DataMgr.getCurBallRod();
  20572. let data = cfgTable.ballrodData[index + 1];
  20573. let gan_url = xGame.common.getGameIconUrl(data.img);
  20574. this.ui.powerNode.showImg.url = gan_url;
  20575. }
  20576. returnHome() {
  20577. let tips = "Are you sure to exit the game?";
  20578. let woman = "Boss, why don't you play for a while longer?";
  20579. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20580. }
  20581. addRodMethodClick() {
  20582. if (this.isTurnSelf()) {
  20583. xGame.uiMgr.Show(UIRodMethod$1);
  20584. }
  20585. }
  20586. clickHelpLineBtn(force = false) {
  20587. if (!this.isTurnSelf())
  20588. return;
  20589. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20590. if (success) {
  20591. xGame.common.longHelpLine = true;
  20592. xGame.common.d2World.getHelpLine();
  20593. Moyu.sendDataEvent("guideNum");
  20594. }
  20595. else {
  20596. }
  20597. });
  20598. }
  20599. renderSelfDisplayBalls(index, target) {
  20600. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20601. target.myImg.url = xGame.common.getGameIconUrl(str);
  20602. }
  20603. renderAIDisplayBalls(index, target) {
  20604. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20605. target.myImg.url = xGame.common.getGameIconUrl(str);
  20606. ;
  20607. }
  20608. updateMode() {
  20609. if (xGame.common.gameMode == GameMode.classic) {
  20610. this.ui.topNode.scoreNode.visible = false;
  20611. }
  20612. else if (xGame.common.gameMode == GameMode.bigMove) {
  20613. this.ui.topNode.scoreNode.visible = true;
  20614. }
  20615. }
  20616. show() {
  20617. super.show();
  20618. this.ui.alpha = 0;
  20619. this.updateSelf();
  20620. xGame.common.gameMgr.gamePause = false;
  20621. xGame.common.gameUI.ui.blackAni.visible = false;
  20622. xGame.common.gameUI.ui.whiteAni.visible = false;
  20623. this.ui.powerEft.visible = false;
  20624. this.ui.colorNode.visible = false;
  20625. this.updateHead();
  20626. let curUse = DataMgr.getCurBallRod();
  20627. this.getGanZiImg();
  20628. if (DataMgr.getGuideDefaultModel() === 1) {
  20629. Laya.timer.once(3000, this, () => {
  20630. this.yinDaoForLianxi();
  20631. });
  20632. }
  20633. else {
  20634. }
  20635. this.setGlobalFont(this.ui);
  20636. }
  20637. yinDaoForLianxi() {
  20638. let lianXiGuide = DataMgr.getLianXiGuide();
  20639. console.log('zh:lianXiGuide=', lianXiGuide);
  20640. if (lianXiGuide === 0) {
  20641. this.ui.n_lxms_yd1.visible = true;
  20642. console.log('zh:yinDaoForLianxi 111 set ok');
  20643. }
  20644. else {
  20645. this.ui.n_lxms_yd1.visible = false;
  20646. console.log('zh:无需引导11');
  20647. }
  20648. }
  20649. updateSelf() {
  20650. if (xGame.common.gameMode == GameMode.classic) {
  20651. this.ui.c1.selectedIndex = 0;
  20652. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20653. this.ui.topNode.middleNode.visible = true;
  20654. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20655. }
  20656. else if (xGame.common.gameMode == GameMode.bigMove) {
  20657. this.ui.c1.selectedIndex = 0;
  20658. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20659. this.ui.topNode.middleNode.visible = false;
  20660. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20661. let rand = xGame.common.randomNum(1, max);
  20662. let guide = DataMgr.getSkillGuide();
  20663. if (guide == 0)
  20664. rand = 1;
  20665. xGame.common.bigMoveLevelIndex = rand;
  20666. }
  20667. else if (xGame.common.gameMode == GameMode.placeBall) {
  20668. console.log('zh:练习模式...');
  20669. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20670. this.ui.c1.selectedIndex = 1 + data.type;
  20671. this.ui.alpha = 1;
  20672. this.startGame();
  20673. }
  20674. this.updateMode();
  20675. this.initD3world();
  20676. this.initD2world();
  20677. }
  20678. startGame() {
  20679. this.ui.snowNode.visible = Math.random() <= 0.1;
  20680. this.ui.d2Node.visible = false;
  20681. xGame.common.d3World.d3Hand.gameObj.active = false;
  20682. xGame.common.d3World.tableSrc.init();
  20683. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20684. this.cameraViewChange(() => {
  20685. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20686. switch (xGame.common.gameMode) {
  20687. case GameMode.classic:
  20688. xGame.common.d3World.d3Hand.gameObj.active = true;
  20689. this.playPutBallD3Ani();
  20690. break;
  20691. case GameMode.bigMove:
  20692. this.enterGame();
  20693. Laya.timer.once(500, this, () => {
  20694. this.ui.topNode.middleNode.visible = true;
  20695. this.ui.topNode.middleNode.t0.play();
  20696. });
  20697. break;
  20698. case GameMode.placeBall:
  20699. this.enterGame();
  20700. break;
  20701. default:
  20702. break;
  20703. }
  20704. });
  20705. PlatMgr.showBanner(false);
  20706. }
  20707. enterGame() {
  20708. this.ui.d2Node.visible = true;
  20709. xGame.common.d3World.d3Hand.gameObj.active = false;
  20710. xGame.common.showOneCamera("mainCamera");
  20711. Moyu.recordGame(30, true);
  20712. if (!this.isPrePlay) {
  20713. this.isPrePlay = true;
  20714. xGame.common.d3World.prePlayEft();
  20715. }
  20716. xGame.common.gameMgr.gameReady();
  20717. this.openAllEvent();
  20718. this.ui.snowNode.visible = false;
  20719. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20720. this.ui.helpBtn.visible = condition;
  20721. }
  20722. showHelpLineGuide() {
  20723. let longGuide = DataMgr.getGuideHelpLine();
  20724. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20725. this.ui.helpBtn.visible = true;
  20726. this.ui.guideNode.visible = true;
  20727. }
  20728. }
  20729. setTurnAlpha(alpha) {
  20730. this.ui.keduNode.alpha = alpha;
  20731. this.ui.ganNode.alpha = alpha;
  20732. this.ui.rodMethodNode.alpha = alpha;
  20733. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20734. }
  20735. cameraViewChange(callback) {
  20736. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20737. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20738. xGame.common.showOneCamera("visitAngle");
  20739. cameraSrc.localRotationEulerY = 180;
  20740. cameraSrc.localRotationEulerZ = 0;
  20741. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20742. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20743. callback && callback();
  20744. }));
  20745. }));
  20746. }
  20747. playPutBallD3Ani() {
  20748. xGame.common.showOneCamera("mainCamera");
  20749. let handSrc = xGame.common.d3World.d3Hand;
  20750. handSrc.gameObj.active = true;
  20751. handSrc.transform.localPositionZ = 3;
  20752. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20753. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20754. handSrc.gameObj.active = false;
  20755. this.enterGame();
  20756. }), 400);
  20757. }));
  20758. }
  20759. updateHead() {
  20760. let user = Moyu.getUserInfo();
  20761. this.ui.topNode.selfNameTxt.text = user.nickName;
  20762. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20763. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20764. let guide = 1;
  20765. if (DataMgr.getGuideDefaultModel() === 1) {
  20766. guide = DataMgr.getLianXiGuide();
  20767. }
  20768. else {
  20769. guide = DataMgr.getSkillGuide();
  20770. }
  20771. if (guide < 1) {
  20772. this.ui.topNode.aiNameTxt.text = 'billiards';
  20773. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20774. }
  20775. else {
  20776. this.ui.topNode.aiNameTxt.text = aiData.name;
  20777. let randNo = Math.floor(Math.random() * 10) + 1;
  20778. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20779. }
  20780. }
  20781. initD2world() {
  20782. let node = this.ui.d2Root.displayObject;
  20783. let src = node.getComponent(D2World);
  20784. if (!src) {
  20785. xGame.common.d2World = node.addComponent(D2World);
  20786. }
  20787. xGame.common.d2World.initSelf();
  20788. }
  20789. initD3world() {
  20790. if (this.isD3Inited)
  20791. return;
  20792. this.isD3Inited = true;
  20793. let scene3D = xGame.common.d3Scene;
  20794. this.ui.d3Root.displayObject.addChild(scene3D);
  20795. scene3D.active = true;
  20796. xGame.common.d3World.tableSrc.setBorderPos();
  20797. }
  20798. onRootMove(e) {
  20799. let rootBall = xGame.common.d2World.rootBall;
  20800. this.ui.moveNode.x = e.x;
  20801. this.ui.moveNode.y = e.y;
  20802. rootBall.gameObj.x = e.x;
  20803. rootBall.gameObj.y = e.y;
  20804. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20805. }
  20806. aiRootMove(move) {
  20807. if (move)
  20808. this.hideBallUI();
  20809. else {
  20810. this.showBallUI();
  20811. xGame.common.d2World.getHelpLine();
  20812. }
  20813. }
  20814. aiForce(type, force = 0) {
  20815. this.pressTarget = PressType.powerNode;
  20816. if (type == 1)
  20817. this.onEventUp({ force: true });
  20818. else if (type == 2)
  20819. this.onEventMove({ stageY: force, force: true });
  20820. }
  20821. onEventPress(e) {
  20822. if (e.stopPropagation)
  20823. e.stopPropagation();
  20824. if (!this.isTurnSelf())
  20825. return;
  20826. let target = e.target;
  20827. switch (target) {
  20828. case this.ui.myPowerNode.displayObject:
  20829. this.pressTarget = PressType.powerNode;
  20830. this.barInfo.curY = e.stageY;
  20831. this.updateBarInfo();
  20832. break;
  20833. case this.ui.moveNode.displayObject:
  20834. this.pressTarget = PressType.moveNode;
  20835. this.hideBallUI();
  20836. this.eventObj.curX = this.ui.moveNode.x;
  20837. this.eventObj.curY = this.ui.moveNode.y;
  20838. this.ui.moveNode.finger.visible = false;
  20839. this.eventObj.lastX = e.stageX;
  20840. this.eventObj.lastY = e.stageY;
  20841. break;
  20842. case this.ui.rulerClickNode.displayObject:
  20843. this.pressTarget = PressType.rulerNode;
  20844. this.eventObj.lastY = e.stageY;
  20845. break;
  20846. case this.ui.d2Root.displayObject:
  20847. this.pressTarget = PressType.d2Root;
  20848. this.eventObj.lastX = e.stageX;
  20849. this.eventObj.lastY = e.stageY;
  20850. this.eventObj.starX = e.stageX;
  20851. this.eventObj.starY = e.stageY;
  20852. this.eventObj.curX = 0;
  20853. this.eventObj.curY = 0;
  20854. xGame.common.d2World.d2Gan.setGanLastInfo();
  20855. this.rulerOffset = 0;
  20856. break;
  20857. default:
  20858. break;
  20859. }
  20860. }
  20861. onEventMove(e) {
  20862. if (e.stopPropagation)
  20863. e.stopPropagation();
  20864. if (e && e.force) {
  20865. }
  20866. else {
  20867. if (!this.isTurnSelf())
  20868. return;
  20869. }
  20870. switch (this.pressTarget) {
  20871. case PressType.powerNode:
  20872. this.barInfo.curY = e.stageY;
  20873. this.updateBarInfo();
  20874. this.isMoveRod = true;
  20875. break;
  20876. case PressType.moveNode:
  20877. let rootBall = xGame.common.d2World.rootBall;
  20878. let radius = rootBall.gameObj.width / 2;
  20879. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20880. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20881. let border = xGame.common.d2World.borderRect;
  20882. if (curX <= border.x + radius)
  20883. curX = border.x + radius;
  20884. else if (curX >= border.x + border.width - radius)
  20885. curX = border.x + border.width - radius;
  20886. if (curY <= border.y + radius)
  20887. curY = border.y + radius;
  20888. else if (curY >= border.y + border.height - radius)
  20889. curY = border.y + border.height - radius;
  20890. if (xGame.common.gameMgr.isOpenBall) {
  20891. if (curX >= border.x + border.openBallW - radius)
  20892. curX = border.x + border.openBallW - radius;
  20893. }
  20894. this.ui.moveNode.x = curX;
  20895. this.ui.moveNode.y = curY;
  20896. rootBall.gameObj.x = curX;
  20897. rootBall.gameObj.y = curY;
  20898. rootBall.d3BallSrc.setTransPos(curX, curY);
  20899. this.isMoveRod = true;
  20900. break;
  20901. case PressType.rulerNode:
  20902. let yy = e.stageY - this.eventObj.lastY;
  20903. this.eventObj.lastY = e.stageY;
  20904. let ruler1 = this.ui.rulerNode.img1;
  20905. let ruler2 = this.ui.rulerNode.img2;
  20906. ruler1.y += yy;
  20907. ruler2.y += yy;
  20908. this.rulerOffset += yy;
  20909. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20910. this.rulerOffset = 0;
  20911. xGame.soundMgr.playSound("inch", 1, 10);
  20912. }
  20913. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20914. let h = ruler1.height;
  20915. if (DataMgr.getGuideDefaultModel() === 1) {
  20916. this.checkGuideForLxms();
  20917. }
  20918. else {
  20919. this.checkGuide();
  20920. }
  20921. this.isMoveRod = true;
  20922. if (ruler1.y >= h) {
  20923. ruler1.y = -h;
  20924. ruler2.y = 0;
  20925. return;
  20926. }
  20927. else if (ruler1.y <= -h) {
  20928. ruler1.y = h;
  20929. ruler2.y = 0;
  20930. return;
  20931. }
  20932. if (ruler2.y >= h) {
  20933. ruler2.y = -h;
  20934. ruler1.y = 0;
  20935. return;
  20936. }
  20937. else if (ruler2.y <= -h) {
  20938. ruler2.y = h;
  20939. ruler1.y = 0;
  20940. return;
  20941. }
  20942. break;
  20943. case PressType.d2Root:
  20944. this.eventObj.curX = e.stageX;
  20945. this.eventObj.curY = e.stageY;
  20946. let offset = this.checkRodMoveDir();
  20947. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20948. this.eventObj.lastX = e.stageX;
  20949. this.eventObj.lastY = e.stageY;
  20950. break;
  20951. default:
  20952. break;
  20953. }
  20954. }
  20955. onEventUp(e) {
  20956. if (e.stopPropagation)
  20957. e.stopPropagation();
  20958. if (e && e.force) {
  20959. }
  20960. else {
  20961. if (!this.isTurnSelf())
  20962. return;
  20963. }
  20964. switch (this.pressTarget) {
  20965. case PressType.powerNode:
  20966. this.ui.powerNode.value = 0;
  20967. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20968. this.ui.powerTxt.text = "";
  20969. if (this.powerNum > 0) {
  20970. xGame.eventMgr.event(BALL_SHOOT);
  20971. xGame.common.d2World.shoot(this.powerNum);
  20972. xGame.common.d2World.d2Gan.shoot();
  20973. xGame.common.d2World.d2HelpLine.shoot();
  20974. if (DataMgr.getGuideDefaultModel() === 1) {
  20975. this.finishGuideForLxms();
  20976. }
  20977. else {
  20978. this.finishGuide();
  20979. }
  20980. this.ui.powerEft.visible = false;
  20981. this.ui.colorNode.visible = false;
  20982. let ganStr = "";
  20983. if (this.powerNum <= 30) {
  20984. ganStr = "gan_30";
  20985. }
  20986. else if (this.powerNum <= 60) {
  20987. ganStr = "gan_50";
  20988. }
  20989. else {
  20990. ganStr = "gan_80";
  20991. }
  20992. xGame.soundMgr.playSound(ganStr);
  20993. }
  20994. break;
  20995. case PressType.moveNode:
  20996. let rootBall = xGame.common.d2World.rootBall;
  20997. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20998. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20999. let isIntersect = this.judgeBallIntersect();
  21000. if (isIntersect) {
  21001. this.ui.moveNode.x = lastX;
  21002. this.ui.moveNode.y = lastY;
  21003. rootBall.gameObj.x = lastX;
  21004. rootBall.gameObj.y = lastY;
  21005. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  21006. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  21007. }
  21008. else {
  21009. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  21010. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  21011. }
  21012. this.showBallUI();
  21013. this.ui.moveNode.finger.visible = true;
  21014. xGame.common.d2World.getHelpLine();
  21015. break;
  21016. case PressType.rulerNode:
  21017. break;
  21018. case PressType.d2Root:
  21019. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  21020. if (dis <= 25) {
  21021. this.moveToClickDot(e);
  21022. }
  21023. break;
  21024. default:
  21025. break;
  21026. }
  21027. this.pressTarget = -1;
  21028. }
  21029. checkGuide() {
  21030. let guide = DataMgr.getSkillGuide();
  21031. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  21032. xGame.common.guideStep++;
  21033. xGame.common.gameUI.ui.guide2.visible = false;
  21034. xGame.common.gameUI.ui.guide3.visible = true;
  21035. }
  21036. }
  21037. checkGuideForLxms() {
  21038. let guide = DataMgr.getLianXiGuide();
  21039. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  21040. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  21041. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  21042. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  21043. xGame.common.guideStepForLianXi = 3;
  21044. }
  21045. }
  21046. finishGuide() {
  21047. let guide = DataMgr.getSkillGuide();
  21048. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  21049. xGame.common.guideStep = 10;
  21050. this.closeAllGuide();
  21051. console.log('zh: 新手引导完毕');
  21052. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  21053. }
  21054. }
  21055. finishGuideForLxms() {
  21056. let guide = DataMgr.getLianXiGuide();
  21057. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  21058. xGame.common.guideStepForLianXi = 3;
  21059. DataMgr.setLianXiGuide(1);
  21060. this.closeAllGuideForLxms();
  21061. console.log('zh: lxms新手引导完毕');
  21062. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  21063. }
  21064. }
  21065. closeAllGuide() {
  21066. xGame.common.gameUI.ui.guide1.visible = false;
  21067. xGame.common.gameUI.ui.guide2.visible = false;
  21068. xGame.common.gameUI.ui.guide3.visible = false;
  21069. }
  21070. closeAllGuideForLxms() {
  21071. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  21072. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  21073. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  21074. }
  21075. updateBarInfo() {
  21076. let star = this.ui.powerNode.y;
  21077. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  21078. if (rate >= 1)
  21079. rate = 1;
  21080. if (rate <= 0)
  21081. rate = 0;
  21082. this.powerNum = Math.ceil(rate * 100);
  21083. this.ui.powerNode.value = this.powerNum;
  21084. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  21085. this.ui.colorNode.value = this.powerNum;
  21086. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  21087. this.ui.powerEft.visible = this.powerNum != 0;
  21088. this.ui.colorNode.visible = this.powerNum != 0;
  21089. this.ui.powerTxt.text = this.powerNum + "";
  21090. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  21091. }
  21092. forceCancel() {
  21093. this.ui.powerNode.value = 0;
  21094. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  21095. this.ui.powerTxt.text = "";
  21096. }
  21097. checkRodMoveDir() {
  21098. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  21099. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  21100. if (tempX >= 0 && tempY <= 0) {
  21101. return this.checkDir();
  21102. }
  21103. else if (tempX < 0 && tempY < 0) {
  21104. return this.checkDir(1, -1);
  21105. }
  21106. else if (tempX < 0 && tempY > 0) {
  21107. return this.checkDir(-1, -1);
  21108. }
  21109. else {
  21110. return this.checkDir(-1, 1);
  21111. }
  21112. }
  21113. checkDir(flagX = 1, flagY = 1) {
  21114. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  21115. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  21116. if (offsetY == 0) {
  21117. return offsetX * flagX;
  21118. }
  21119. if (offsetX == 0) {
  21120. return offsetY * flagY;
  21121. }
  21122. let angle = offsetY / offsetX;
  21123. if (Math.abs(angle) >= 1) {
  21124. return offsetY * flagY;
  21125. }
  21126. else {
  21127. return offsetX * flagX;
  21128. }
  21129. }
  21130. judgeBallIntersect() {
  21131. let rootBall = xGame.common.d2World.rootBall;
  21132. let ballArr = xGame.common.d2World.ballArr;
  21133. let radius = rootBall.gameObj.width / 2;
  21134. let temp;
  21135. let isIntersect = false;
  21136. for (let index = 0; index < ballArr.length; index++) {
  21137. temp = ballArr[index];
  21138. if (temp.number == rootBall.number)
  21139. continue;
  21140. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  21141. if (isIntersect) {
  21142. break;
  21143. }
  21144. }
  21145. return isIntersect;
  21146. }
  21147. hideBallUI() {
  21148. let d2Gan = xGame.common.d2World.d2Gan;
  21149. if (!d2Gan.ui.isDisposed)
  21150. d2Gan.ui.visible = false;
  21151. let d2Help = xGame.common.d2World.d2HelpLine;
  21152. if (!d2Help.ui.isDisposed)
  21153. d2Help.ui.visible = false;
  21154. let rootBall = xGame.common.d2World.rootBall;
  21155. if (!rootBall.destroyed) {
  21156. rootBall.gameObj.active = false;
  21157. }
  21158. }
  21159. showBallUI() {
  21160. let d2Gan = xGame.common.d2World.d2Gan;
  21161. if (!d2Gan.ui.isDisposed)
  21162. d2Gan.ui.visible = true;
  21163. let d2Help = xGame.common.d2World.d2HelpLine;
  21164. if (!d2Help.ui.isDisposed)
  21165. d2Help.ui.visible = true;
  21166. let rootBall = xGame.common.d2World.rootBall;
  21167. if (!rootBall.destroyed) {
  21168. rootBall.gameObj.active = true;
  21169. }
  21170. }
  21171. moveToClickDot(e) {
  21172. if (!this.isMoveRod && !xGame.common.clickedBall) {
  21173. let root = xGame.common.d2World.rootBall.gameObj;
  21174. let xx = e.stageX - xGame.common.sysOffestNum;
  21175. let yy = e.stageY;
  21176. let x = xx - root.x;
  21177. let y = yy - root.y;
  21178. let angle = xGame.common.getfguiRotation(x, y);
  21179. xGame.common.d2World.d2Gan.ui.rotation = angle;
  21180. xGame.common.d2World.getHelpLine();
  21181. }
  21182. this.isMoveRod = false;
  21183. xGame.common.clickedBall = false;
  21184. }
  21185. openAllEvent() {
  21186. this.closeAllEvent();
  21187. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21188. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21189. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21190. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21191. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21192. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21193. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21194. }
  21195. closeAllEvent() {
  21196. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21197. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21198. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21199. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21200. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21201. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21202. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21203. }
  21204. resetGame() {
  21205. this.closeAllEvent();
  21206. this.hideBallUI();
  21207. xGame.common.gameMgr.gamePause = true;
  21208. }
  21209. }
  21210. UIGame$1.uiName = "UIGame";
  21211. class UIAddCoin$1 extends UIBase {
  21212. constructor() {
  21213. super();
  21214. this.coinNum = 2000;
  21215. }
  21216. onConstructor() {
  21217. this.ui = ui_UIAddCoin.createInstance();
  21218. this.contentPane = this.ui;
  21219. this.isEject = false;
  21220. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21221. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  21222. }
  21223. show() {
  21224. super.show();
  21225. this.ui.t0.play();
  21226. this.setGlobalFont(this.ui);
  21227. }
  21228. videoAddCoin() {
  21229. console.log('zh:qjff_AD_for_UIAddCoin');
  21230. if (Laya.Browser.onAndroid) {
  21231. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21232. if (!boo) {
  21233. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21234. return;
  21235. }
  21236. }
  21237. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  21238. }
  21239. else {
  21240. console.log('zh:AD 失败,直接发放奖励');
  21241. this.qjff_AD_for_UIAddCoin();
  21242. }
  21243. }
  21244. qjff_AD_for_UIAddCoin() {
  21245. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  21246. this.hide();
  21247. }
  21248. }
  21249. UIAddCoin$1.uiName = "UIAddCoin";
  21250. class UIInvitation$1 extends UIBase {
  21251. constructor() {
  21252. super();
  21253. }
  21254. onConstructor() {
  21255. this.ui = ui_UIInvitation.createInstance();
  21256. this.contentPane = this.ui;
  21257. this.isEject = false;
  21258. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  21259. }
  21260. show() {
  21261. super.show();
  21262. this.setGlobalFont(this.ui);
  21263. }
  21264. enterGame() {
  21265. xGame.common.gameMode = GameMode.classic;
  21266. DataMgr.setChallengeTimes(1);
  21267. xGame.common.passAwardCoin = 2000;
  21268. let need = xGame.common.classicNiceNeddCoin;
  21269. if (DataMgr.coinEnough(need)) {
  21270. DataMgr.setCoin(-need);
  21271. xGame.eventMgr.event(RESTART_GAME, true);
  21272. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  21273. }
  21274. else {
  21275. xGame.eventMgr.event(RESTART_GAME, true);
  21276. }
  21277. this.hide();
  21278. }
  21279. hide() {
  21280. super.hide();
  21281. }
  21282. }
  21283. UIInvitation$1.uiName = "UIInvitation";
  21284. class UIPower$1 extends UIBase {
  21285. constructor() {
  21286. super();
  21287. }
  21288. onConstructor() {
  21289. this.ui = ui_UIPower.createInstance();
  21290. this.contentPane = this.ui;
  21291. this.isEject = false;
  21292. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21293. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  21294. }
  21295. show() {
  21296. super.show();
  21297. this.ui.t0.play();
  21298. this.setGlobalFont(this.ui);
  21299. }
  21300. videoGetPower() {
  21301. console.log('zh:qjff_AD_for_uipower');
  21302. if (Laya.Browser.onAndroid) {
  21303. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21304. if (!boo) {
  21305. console.log('zh:net error ');
  21306. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21307. return;
  21308. }
  21309. }
  21310. if (Laya.Browser.onAndroid) {
  21311. console.log('zh:android ad show ');
  21312. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  21313. }
  21314. else {
  21315. console.log('zh:AD 失败,直接发放奖励');
  21316. this.qjff_AD_for_uipower();
  21317. }
  21318. }
  21319. else {
  21320. this.qjff_AD_for_uipower();
  21321. }
  21322. }
  21323. qjff_AD_for_uipower() {
  21324. console.log('zh:ADD 体力 start');
  21325. DataMgr.setPower(xGame.common.videoPower, true);
  21326. xGame.eventMgr.event(POWER_TIME);
  21327. this.hide();
  21328. }
  21329. }
  21330. UIPower$1.uiName = "UIPower";
  21331. class UIGameEnd$1 extends UIBase {
  21332. constructor() {
  21333. super();
  21334. this.success = false;
  21335. this.awardCoinNum = 1000;
  21336. this.awardDiamondNum = 10;
  21337. }
  21338. onConstructor() {
  21339. this.ui = ui_UIGameEnd.createInstance();
  21340. this.contentPane = this.ui;
  21341. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  21342. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  21343. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  21344. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21345. this.ui.talkNode.visible = false;
  21346. if (Moyu.isKs)
  21347. this.ui.closeNode.closeBtn.x += 100;
  21348. }
  21349. updateType() {
  21350. switch (xGame.common.gameMode) {
  21351. case GameMode.classic:
  21352. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21353. this.ui.coinNode.visible = this.success;
  21354. if (!this.success) {
  21355. Laya.timer.once(500, this, () => {
  21356. xGame.uiMgr.Show(UIAddCoin$1);
  21357. });
  21358. }
  21359. else {
  21360. this.logEventForClassic_win();
  21361. }
  21362. this.logEventForClassic_complete();
  21363. this.ui.isGetAward.visible = false;
  21364. this.ui.leftBtn.c1.selectedIndex = 3;
  21365. this.ui.rightBtn.c1.selectedIndex = 0;
  21366. this.moneyNode.ui.c1.selectedIndex = 1;
  21367. break;
  21368. case GameMode.bigMove:
  21369. console.log('zh:招法模式 aaaaaa bigMove');
  21370. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21371. this.ui.coinNode.visible = this.success;
  21372. if (xGame.common.gameMode == GameMode.bigMove) {
  21373. if (this.success) {
  21374. DataMgr.setSkillSuccessTimes(1, true);
  21375. DataMgr.setSkillAccTimes(1);
  21376. }
  21377. else {
  21378. DataMgr.setSkillSuccessTimes(0, false);
  21379. }
  21380. }
  21381. this.logEventForRod_complete_N();
  21382. if (!this.success) {
  21383. Laya.timer.once(500, this, () => {
  21384. xGame.uiMgr.Show(UIAddCoin$1);
  21385. });
  21386. }
  21387. else {
  21388. this.logEventForRod_win();
  21389. }
  21390. this.ui.isGetAward.visible = false;
  21391. this.ui.leftBtn.c1.selectedIndex = 3;
  21392. this.ui.rightBtn.c1.selectedIndex = 0;
  21393. this.moneyNode.ui.c1.selectedIndex = 1;
  21394. break;
  21395. case GameMode.placeBall:
  21396. this.ui.coinNode.visible = false;
  21397. if (this.success) {
  21398. if (xGame.common.placeBallStarNum == 3) {
  21399. this.ui.c1.selectedIndex = 2;
  21400. }
  21401. else {
  21402. this.ui.c1.selectedIndex = 3;
  21403. }
  21404. let level = xGame.common.placeBallCurLevel;
  21405. if (level > 59) {
  21406. this.logEventForChallenge_level_complete(level);
  21407. }
  21408. else {
  21409. this.logEventForChallenge_level_N(level);
  21410. }
  21411. }
  21412. else {
  21413. this.ui.c1.selectedIndex = 4;
  21414. }
  21415. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  21416. if (cfg.type == PlaceBallType.challenge) {
  21417. this.ui.c1.selectedIndex = 2;
  21418. }
  21419. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  21420. this.updatePlaceBallBtn();
  21421. this.updatePlaceBallStarNum();
  21422. this.updatePlaceBallAwardState();
  21423. this.moneyNode.ui.c1.selectedIndex = 2;
  21424. this.moneyNode.checkPowerTime();
  21425. this.moneyNode.powerChange();
  21426. DataMgr.upRankData();
  21427. break;
  21428. default:
  21429. break;
  21430. }
  21431. }
  21432. logEventForRod_complete_N() {
  21433. let gfmsIdx = xGame.common.curPlayerSkillType;
  21434. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  21435. let gfmc = 'Skyfall Shot';
  21436. if (gfmsIdx == 0) {
  21437. gfmc = 'Skyfall Shot';
  21438. }
  21439. if (gfmsIdx == 1) {
  21440. gfmc = 'Surging break';
  21441. }
  21442. if (gfmsIdx == 2) {
  21443. gfmc = 'Frost Lock';
  21444. }
  21445. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21446. console.log('zh:logEventForRod_complete_N level = ' + level);
  21447. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21448. let jsonStr = {
  21449. "count": 0,
  21450. "name": gfmc
  21451. };
  21452. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21453. const d = LocalStorageManager.getItem(keyStr);
  21454. jsonStr.count = d.count + 1;
  21455. LocalStorageManager.setItem(keyStr, jsonStr);
  21456. }
  21457. else {
  21458. LocalStorageManager.setItem(keyStr, jsonStr);
  21459. }
  21460. const d2 = LocalStorageManager.getItem(keyStr);
  21461. let count = d2.count;
  21462. console.log('zh:logEventForRod_complete_N count = ' + count);
  21463. if (count % 5 == 0) {
  21464. const reqStr = JSON.stringify(jsonStr);
  21465. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  21466. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  21467. }
  21468. }
  21469. logEventForRod_win() {
  21470. console.log('zh:logEventForRod_win,胜利');
  21471. let gfmsIdx = xGame.common.curPlayerSkillType;
  21472. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  21473. let gfmc = 'Skyfall Shot';
  21474. if (gfmsIdx == 0) {
  21475. gfmc = 'Skyfall Shot';
  21476. }
  21477. if (gfmsIdx == 1) {
  21478. gfmc = 'Surging break';
  21479. }
  21480. if (gfmsIdx == 2) {
  21481. gfmc = 'Frost Lock';
  21482. }
  21483. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21484. console.log('zh:logEventForRod_win level = ' + level);
  21485. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  21486. let jsonStr = {
  21487. "count": 1,
  21488. "name": gfmc + ' Lev' + level
  21489. };
  21490. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21491. const d = LocalStorageManager.getItem(keyStr);
  21492. jsonStr.count = d.count + 1;
  21493. LocalStorageManager.setItem(keyStr, jsonStr);
  21494. }
  21495. else {
  21496. LocalStorageManager.setItem(keyStr, jsonStr);
  21497. }
  21498. const reqStr = JSON.stringify(jsonStr);
  21499. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  21500. }
  21501. logEventForClassic_win() {
  21502. console.log('zh:logEventForClassic_win,胜利');
  21503. let rtype = xGame.common.classicRoomType;
  21504. let msmc = '';
  21505. if (rtype == 1) {
  21506. msmc = 'beginner';
  21507. }
  21508. if (rtype == 2) {
  21509. msmc = 'expert';
  21510. }
  21511. if (rtype == 3) {
  21512. msmc = 'master';
  21513. }
  21514. let keyStr = 'sjmd_classic_win_' + rtype;
  21515. let jsonStr = {
  21516. "difficulty": msmc,
  21517. "classic_count": 1,
  21518. "difficulty_count": 1
  21519. };
  21520. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21521. const d = LocalStorageManager.getItem(keyStr);
  21522. jsonStr.classic_count = d.classic_count + 1;
  21523. jsonStr.difficulty_count = d.difficulty_count + 1;
  21524. LocalStorageManager.setItem(keyStr, jsonStr);
  21525. }
  21526. else {
  21527. LocalStorageManager.setItem(keyStr, jsonStr);
  21528. }
  21529. const reqStr = JSON.stringify(jsonStr);
  21530. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21531. }
  21532. logEventForClassic_complete() {
  21533. console.log('zh:logEventForClassic_complete,胜利');
  21534. let rtype = xGame.common.classicRoomType;
  21535. let msmc = '';
  21536. if (rtype == 1) {
  21537. msmc = 'beginner';
  21538. }
  21539. if (rtype == 2) {
  21540. msmc = 'expert';
  21541. }
  21542. if (rtype == 3) {
  21543. msmc = 'master';
  21544. }
  21545. let keyStr = 'sjmd_classic_complete_' + rtype;
  21546. let jsonStr = {
  21547. "msmc": msmc,
  21548. "count": 0
  21549. };
  21550. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21551. const d = LocalStorageManager.getItem(keyStr);
  21552. jsonStr.count = d.count + 1;
  21553. LocalStorageManager.setItem(keyStr, jsonStr);
  21554. }
  21555. else {
  21556. LocalStorageManager.setItem(keyStr, jsonStr);
  21557. }
  21558. if (jsonStr.count % 5 == 0) {
  21559. const reqStr = JSON.stringify(jsonStr);
  21560. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21561. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21562. }
  21563. }
  21564. updatePlaceBallBtn() {
  21565. this.ui.leftBtn.c1.selectedIndex = 5;
  21566. if (this.success) {
  21567. this.ui.rightBtn.c1.selectedIndex = 14;
  21568. }
  21569. else {
  21570. if (xGame.common.placeBallStarNum == 3) {
  21571. this.ui.rightBtn.c1.selectedIndex = 14;
  21572. }
  21573. else {
  21574. this.ui.rightBtn.c1.selectedIndex = 1;
  21575. }
  21576. }
  21577. }
  21578. updatePlaceBallStarNum() {
  21579. let starNum = xGame.common.placeBallStarNum;
  21580. if (starNum == 0)
  21581. this.ui.starNumNode.c1.selectedIndex = 3;
  21582. else {
  21583. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21584. }
  21585. }
  21586. updatePlaceBallAwardState() {
  21587. let level = xGame.common.placeBallCurLevel;
  21588. let starNum = xGame.common.placeBallStarNum;
  21589. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21590. let data = cfgTable.placeballData[level].award;
  21591. let cfg = cfgTable.placeballData[level];
  21592. this.awardDiamondNum = data[1];
  21593. this.awardCoinNum = data[0];
  21594. if (cfg.type == PlaceBallType.challenge) {
  21595. this.awardDiamondNum = 0;
  21596. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21597. }
  21598. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21599. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21600. if (cfg.type == PlaceBallType.challenge) {
  21601. this.ui.awardNode.coinNode.visible = true;
  21602. }
  21603. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21604. this.ui.awardNode.diamondNode.x = 265;
  21605. this.ui.awardNode.coinNode.x = 354;
  21606. }
  21607. else {
  21608. this.ui.awardNode.diamondNode.x = 291;
  21609. this.ui.awardNode.coinNode.x = 291;
  21610. }
  21611. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21612. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21613. if (this.awardCoinNum == 0) {
  21614. this.ui.awardNode.coinNode.numTxt.text = "";
  21615. }
  21616. if (getAward) {
  21617. this.ui.isGetAward.visible = true;
  21618. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21619. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21620. }
  21621. else {
  21622. this.ui.isGetAward.visible = false;
  21623. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21624. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21625. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21626. }
  21627. else {
  21628. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21629. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21630. }
  21631. }
  21632. }
  21633. show(success) {
  21634. super.show();
  21635. xGame.eventMgr.event(RESET_GAME);
  21636. this.success = success;
  21637. Laya.timer.clearAll(this);
  21638. this.playSecretaryAni();
  21639. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21640. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21641. offsetTime = Math.floor(offsetTime / 1000);
  21642. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21643. this.updateType();
  21644. Laya.timer.once(200, this, () => {
  21645. this.addAward(() => {
  21646. this.updateType();
  21647. Laya.timer.once(500, this, () => {
  21648. this.showChallengeLevel();
  21649. });
  21650. });
  21651. });
  21652. if (this.success) {
  21653. JSBridgeUtils.instance.showInternAd('gameend_success');
  21654. console.log('zh:game end 成功');
  21655. xGame.soundMgr.playSound('slots_roll01');
  21656. xGame.soundMgr.playSound("s_win");
  21657. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21658. this.diyGameDataUtilForGameWin();
  21659. this.updateGamePlaceBallData2Server();
  21660. }
  21661. else {
  21662. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21663. console.log('zh:game end失败');
  21664. xGame.soundMgr.playSound('matchwin01');
  21665. xGame.soundMgr.playSound("s_lose");
  21666. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21667. }
  21668. console.log('zh:开始弹出福利框2个');
  21669. Laya.timer.once(1000, this, () => {
  21670. console.log('zh: 1秒后 showFuLiSp1');
  21671. DataMgr.checkForShowFuLi17AndAlert(1);
  21672. });
  21673. let challengeNum = DataMgr.getChallengeTimes();
  21674. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21675. DataMgr.setChallengeTimes(1);
  21676. }
  21677. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21678. DataMgr.setClassicTimes();
  21679. }
  21680. this.setGlobalFont(this.ui);
  21681. }
  21682. diyGameDataUtilForGameWin() {
  21683. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21684. switch (xGame.common.gameMode) {
  21685. case GameMode.classic:
  21686. console.log('zh:DiyGameDataUtilForGameWin 111');
  21687. case GameMode.bigMove:
  21688. console.log('zh:DiyGameDataUtilForGameWin 222');
  21689. this.restartGame();
  21690. break;
  21691. case GameMode.placeBall:
  21692. console.log('zh:DiyGameDataUtilForGameWin 333');
  21693. var level = xGame.common.placeBallCurLevel;
  21694. console.log('zh:练习模式 联系了多少LEV=' + level);
  21695. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21696. if (level > db_over_lev) {
  21697. DataMgr.setChallengeMode_overLev(level);
  21698. }
  21699. break;
  21700. default:
  21701. console.log('zh:DiyGameDataUtilForGameWin 444');
  21702. break;
  21703. }
  21704. }
  21705. updateGamePlaceBallData2Server() {
  21706. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21707. if (userInfo == null) {
  21708. return;
  21709. }
  21710. let pbdObj = DataMgr.getPlaceBallLevelList();
  21711. let reqData = xGame.httpMgr.getReqData();
  21712. let pd = JSON.parse(reqData);
  21713. pd.placeBallData = JSON.stringify(pbdObj);
  21714. reqData = JSON.stringify(pd);
  21715. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21716. try {
  21717. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21718. let code = res.code;
  21719. let msg = res.msg;
  21720. if (code == 401) {
  21721. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21722. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21723. return;
  21724. }
  21725. if (code == 200) {
  21726. let data = res.data;
  21727. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21728. }
  21729. else {
  21730. xGame.uiMgr.Show(UIMsg$1, msg);
  21731. }
  21732. }
  21733. catch (error) {
  21734. console.log('error=' + error);
  21735. alert(error);
  21736. }
  21737. finally {
  21738. }
  21739. });
  21740. }
  21741. showChallengeLevel() {
  21742. if (DataMgr.getChallengeTimes() != 0)
  21743. return;
  21744. let skill = DataMgr.getSkillAccTimes();
  21745. let put = DataMgr.getPlaceBallLevelList().length;
  21746. if (skill >= 3 || put >= 5) {
  21747. xGame.uiMgr.Show(UIInvitation$1);
  21748. this.hide();
  21749. }
  21750. }
  21751. addAward(callback) {
  21752. if (!this.success) {
  21753. callback && callback();
  21754. return;
  21755. }
  21756. switch (xGame.common.gameMode) {
  21757. case GameMode.classic:
  21758. this.awardCoinNum = xGame.common.passAwardCoin;
  21759. this.awardDiamondNum = 0;
  21760. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21761. break;
  21762. case GameMode.bigMove:
  21763. this.awardCoinNum = xGame.common.passAwardCoin;
  21764. this.awardDiamondNum = 0;
  21765. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21766. callback && callback();
  21767. break;
  21768. case GameMode.placeBall:
  21769. let level = xGame.common.placeBallCurLevel;
  21770. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21771. if (xGame.common.placeBallStarNum != 3) {
  21772. callback && callback();
  21773. return;
  21774. }
  21775. else {
  21776. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21777. if (getAward) {
  21778. callback && callback();
  21779. return;
  21780. }
  21781. }
  21782. let cfg = cfgTable.placeballData[level];
  21783. let data = cfgTable.placeballData[level].award;
  21784. this.awardCoinNum = data[0];
  21785. this.awardDiamondNum = data[1];
  21786. if (cfg.type == PlaceBallType.challenge) {
  21787. this.awardDiamondNum = 0;
  21788. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21789. }
  21790. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21791. let diamondAward;
  21792. if (this.awardDiamondNum > 0) {
  21793. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21794. xGame.common.getAward([diamondAward, coinAward], callback);
  21795. }
  21796. else {
  21797. xGame.common.getAward([coinAward], callback);
  21798. }
  21799. if (cfg.type == PlaceBallType.normal) {
  21800. DataMgr.setPlaceBallAward(level);
  21801. }
  21802. break;
  21803. default:
  21804. break;
  21805. }
  21806. }
  21807. playSecretaryAni_old() {
  21808. let parent = this.ui.secretary.displayObject;
  21809. parent.destroyChildren();
  21810. let xx = this.ui.secretary.width / 2;
  21811. let yy = this.ui.secretary.height;
  21812. let scale = xGame.common.getSecretaryScale();
  21813. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21814. if (this.success) {
  21815. let rand = Math.random() <= 0.5 ? 2 : 3;
  21816. xGame.common.secretary.play(data, rand, false, parent, () => {
  21817. xGame.common.secretary.play(data, 1, true, parent);
  21818. });
  21819. }
  21820. else {
  21821. xGame.common.secretary.play(data, 0, true, parent);
  21822. }
  21823. }
  21824. playSecretaryAni() {
  21825. let parent = this.ui.secretary.displayObject;
  21826. parent.destroyChildren();
  21827. let xx = this.ui.secretary.width / 2;
  21828. let yy = this.ui.secretary.height;
  21829. let scale = xGame.common.getSecretaryScale();
  21830. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21831. if (this.success) {
  21832. let rand = 0;
  21833. xGame.common.secretary.play(data, 0, true, parent);
  21834. }
  21835. else {
  21836. xGame.common.secretary.play(data, 0, true, parent);
  21837. }
  21838. }
  21839. restartGame() {
  21840. switch (xGame.common.gameMode) {
  21841. case GameMode.classic:
  21842. xGame.eventMgr.event(RESTART_GAME);
  21843. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21844. break;
  21845. case GameMode.bigMove:
  21846. this.hide();
  21847. xGame.eventMgr.event(RESTART_GAME);
  21848. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21849. break;
  21850. default:
  21851. break;
  21852. }
  21853. }
  21854. hide() {
  21855. super.hide();
  21856. xGame.common.stopGirlPop(this.ui.talkNode);
  21857. PlatMgr.showBanner(false);
  21858. }
  21859. returnHome() {
  21860. this.hide();
  21861. let showFailWords = !this.success;
  21862. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21863. }
  21864. clickLeftBtn() {
  21865. switch (xGame.common.gameMode) {
  21866. case GameMode.classic:
  21867. case GameMode.bigMove:
  21868. this.returnHome();
  21869. break;
  21870. case GameMode.placeBall:
  21871. let level = xGame.common.placeBallCurLevel;
  21872. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21873. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21874. break;
  21875. default:
  21876. break;
  21877. }
  21878. }
  21879. powerStartPlaceBallLevel(level, btn) {
  21880. if (DataMgr.powerEnough()) {
  21881. btn.touchable = false;
  21882. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21883. btn.touchable = true;
  21884. DataMgr.setPower(-1);
  21885. xGame.eventMgr.event(POWER_TIME);
  21886. this.startPlaceBallLevel(level);
  21887. this.logEventForChallenge_level_start(level);
  21888. }));
  21889. }
  21890. else {
  21891. xGame.uiMgr.Show(UIPower$1, 0);
  21892. }
  21893. }
  21894. clickRightBtn() {
  21895. switch (xGame.common.gameMode) {
  21896. case GameMode.classic:
  21897. console.log('zh:clickRightBtn 111');
  21898. case GameMode.bigMove:
  21899. console.log('zh:clickRightBtn 222');
  21900. this.restartGame();
  21901. break;
  21902. case GameMode.placeBall:
  21903. console.log('zh:clickRightBtn 333');
  21904. let level = xGame.common.placeBallCurLevel;
  21905. let data = DataMgr.getPlaceBallLevel(level);
  21906. let curPss = data.play && !data.isCur;
  21907. if (curPss) {
  21908. console.log('zh:clickRightBtn 333-111');
  21909. console.log('zh:当前LV=' + level);
  21910. if (level == 60) {
  21911. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21912. Laya.timer.once(3000, this, () => {
  21913. this.returnHome();
  21914. });
  21915. }
  21916. else {
  21917. let lev = level + 1;
  21918. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21919. }
  21920. }
  21921. else {
  21922. console.log('zh:clickRightBtn 333-000');
  21923. Moyu.sendDataEvent("placeBallNextLevel");
  21924. console.log('zh:qjff_AD_for_uiGameEnd');
  21925. if (Laya.Browser.onAndroid) {
  21926. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21927. if (!boo) {
  21928. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21929. return;
  21930. }
  21931. }
  21932. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21933. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21934. }
  21935. else {
  21936. console.log('zh:AD 失败,直接发放奖励');
  21937. this.qjff_AD_for_uiGameEnd(level);
  21938. }
  21939. }
  21940. break;
  21941. default:
  21942. console.log('zh:clickRightBtn 444');
  21943. break;
  21944. }
  21945. }
  21946. logEventForChallenge_level_start(level) {
  21947. let keyStr = 'sjmd_challenge_level_start';
  21948. let jsonStr = {
  21949. "count": 0,
  21950. "gold_balance ": DataMgr.getCoin(),
  21951. "level": level,
  21952. "diamond_balance ": DataMgr.getDiamond()
  21953. };
  21954. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21955. const d = LocalStorageManager.getItem(keyStr);
  21956. if (level > d.level) {
  21957. jsonStr.count = d.count + 1;
  21958. LocalStorageManager.setItem(keyStr, jsonStr);
  21959. }
  21960. else {
  21961. }
  21962. }
  21963. else {
  21964. LocalStorageManager.setItem(keyStr, jsonStr);
  21965. }
  21966. const reqStr = JSON.stringify(jsonStr);
  21967. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21968. }
  21969. qjff_AD_for_uiGameEnd(level) {
  21970. DataMgr.setPlaceBallLevel(level, 1);
  21971. this.startPlaceBallLevel(level + 1);
  21972. }
  21973. startPlaceBallLevel(level) {
  21974. xGame.common.gameMode = GameMode.placeBall;
  21975. xGame.common.placeBallCurLevel = level;
  21976. xGame.uiMgr.Show(UIGame$1);
  21977. this.hide();
  21978. }
  21979. logEventForChallenge_level_complete(level) {
  21980. let keyStr = 'sjmd_challenge_level_complete';
  21981. let jsonStr = {
  21982. "count": 1,
  21983. "gold_balance ": DataMgr.getCoin(),
  21984. "level": level,
  21985. "diamond_balance ": DataMgr.getDiamond()
  21986. };
  21987. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21988. const d = LocalStorageManager.getItem(keyStr);
  21989. jsonStr.count = d.count + 1;
  21990. LocalStorageManager.setItem(keyStr, jsonStr);
  21991. }
  21992. else {
  21993. LocalStorageManager.setItem(keyStr, jsonStr);
  21994. }
  21995. const reqStr = JSON.stringify(jsonStr);
  21996. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21997. }
  21998. logEventForChallenge_level_N(level) {
  21999. console.log('zh:logEventForChallenge_level_N ' + level);
  22000. let keyStr = 'sjmd_challenge_level_N';
  22001. if (LocalStorageManager.hasKey(keyStr)) {
  22002. let lev = LocalStorageManager.getItem(keyStr);
  22003. if (level > lev) {
  22004. LocalStorageManager.setItem(keyStr, level);
  22005. }
  22006. if ((level) % 5 == 0) {
  22007. console.log('zh:每5关上报1次');
  22008. let sjmc = 'challenge_level_' + level;
  22009. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  22010. let sjmcForFirebase = 'challenge_level_' + level;
  22011. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  22012. }
  22013. else {
  22014. console.log('zh:5 no 上报');
  22015. }
  22016. }
  22017. else {
  22018. LocalStorageManager.setItem(keyStr, level);
  22019. }
  22020. }
  22021. }
  22022. UIGameEnd$1.uiName = "UIGameEnd";
  22023. class ShowItem$1 {
  22024. constructor() {
  22025. this.ui = ui_ShowItem.createInstance();
  22026. }
  22027. destroySelf() {
  22028. if (!this.ui.isDisposed) {
  22029. this.ui.removeFromParent();
  22030. this.ui.dispose();
  22031. }
  22032. }
  22033. setParent(parent) {
  22034. parent.addChild(this.ui);
  22035. }
  22036. setPos(x, y) {
  22037. this.ui.x = x;
  22038. this.ui.y = y;
  22039. }
  22040. setUrl(index) {
  22041. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  22042. }
  22043. }
  22044. class UILevelProp$1 extends UIBase {
  22045. constructor() {
  22046. super();
  22047. this.firstPos = 385;
  22048. this.secondPos = 467;
  22049. this.showItemArr = [];
  22050. }
  22051. onConstructor() {
  22052. this.ui = ui_UILevelProp.createInstance();
  22053. this.contentPane = this.ui;
  22054. this.isEject = false;
  22055. this.addUIClick(this.ui.closeBtn, this.hideWin);
  22056. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22057. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  22058. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  22059. }
  22060. show(level) {
  22061. console.log('zh:show.');
  22062. super.show();
  22063. this.ui.t1.play();
  22064. this.level = level;
  22065. this.data = cfgTable.placeballData[this.level];
  22066. this.updateSelf();
  22067. this.showPreView();
  22068. this.moneyNode.ui.c1.selectedIndex = 2;
  22069. this.moneyNode.checkPowerTime();
  22070. this.moneyNode.powerChange();
  22071. this.yinDaoForLianxi();
  22072. this.setGlobalFont(this.ui);
  22073. }
  22074. yinDaoForLianxi() {
  22075. let lianXiGuide = DataMgr.getLianXiGuide();
  22076. console.log('zh:lianXiGuide=', lianXiGuide);
  22077. if (lianXiGuide === 0) {
  22078. this.ui.myNode.n_yd_lxms_3.visible = true;
  22079. console.log('zh:yinDaoForLianxi 333 set ok');
  22080. }
  22081. else {
  22082. this.ui.myNode.n_yd_lxms_3.visible = false;
  22083. console.log('zh:无需引导33');
  22084. }
  22085. }
  22086. showPreView() {
  22087. let item;
  22088. let data;
  22089. for (let index = 0; index < this.showItemArr.length; index++) {
  22090. item = this.showItemArr[index];
  22091. item.destroySelf();
  22092. }
  22093. this.showItemArr = [];
  22094. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  22095. for (const key in cfgData) {
  22096. data = cfgData[key];
  22097. item = new ShowItem$1();
  22098. item.setParent(this.ui.myNode.displayRoot);
  22099. item.setPos(data.x, data.y);
  22100. item.setUrl(data.value);
  22101. this.showItemArr.push(item);
  22102. }
  22103. }
  22104. updateSelf() {
  22105. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  22106. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  22107. if (this.data.ball == -1) {
  22108. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  22109. }
  22110. else {
  22111. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  22112. }
  22113. let localData = DataMgr.getPlaceBallLevel(this.level);
  22114. let getAward = localData.getAward;
  22115. let cfg = cfgTable.placeballData[this.level];
  22116. let coin = this.data.award[0];
  22117. let diamond = this.data.award[1];
  22118. if (cfg.type == PlaceBallType.challenge) {
  22119. diamond = 0;
  22120. coin = 100;
  22121. }
  22122. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  22123. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  22124. this.ui.myNode.coinNode.numTxt.text = coin + "";
  22125. if (cfg.type == PlaceBallType.challenge) {
  22126. this.ui.myNode.coinNode.numTxt.text = "";
  22127. }
  22128. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  22129. if (coin > 0 && diamond > 0) {
  22130. this.ui.myNode.diamondNode.x = 385;
  22131. this.ui.myNode.coinNode.x = 467;
  22132. }
  22133. else {
  22134. this.ui.myNode.diamondNode.x = 385;
  22135. this.ui.myNode.coinNode.x = 385;
  22136. }
  22137. if (!getAward) {
  22138. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  22139. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  22140. }
  22141. else {
  22142. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  22143. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  22144. }
  22145. }
  22146. startGame() {
  22147. console.log("zh:startGame");
  22148. if (DataMgr.powerEnough()) {
  22149. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  22150. this.ui.myNode.startBtn.touchable = false;
  22151. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  22152. console.log('zh:startGame dh ');
  22153. this.ui.myNode.startBtn.touchable = true;
  22154. DataMgr.setPower(-1);
  22155. xGame.eventMgr.event(POWER_TIME);
  22156. xGame.common.gameMode = GameMode.placeBall;
  22157. xGame.common.placeBallCurLevel = this.level;
  22158. xGame.uiMgr.Show(UIGame$1);
  22159. xGame.uiMgr.Hide(UILevelDisplay$1);
  22160. xGame.uiMgr.Hide(UIMain$1);
  22161. this.logEventForChallenge_level_start(this.level);
  22162. this.hideWin();
  22163. }));
  22164. console.log('zh:eeeee');
  22165. }
  22166. else {
  22167. let guide = DataMgr.getLianXiGuide();
  22168. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  22169. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  22170. DataMgr.setPower(2);
  22171. }
  22172. console.log('zh:guide = ' + guide);
  22173. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  22174. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  22175. xGame.uiMgr.Show(UIPower$1);
  22176. }
  22177. }
  22178. logEventForChallenge_level_start(level) {
  22179. let keyStr = 'sjmd_challenge_level_start';
  22180. let jsonStr = {
  22181. "count": 1,
  22182. "gold_balance ": DataMgr.getCoin(),
  22183. "level": level,
  22184. "diamond_balance ": DataMgr.getDiamond()
  22185. };
  22186. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22187. const d = LocalStorageManager.getItem(keyStr);
  22188. if (level > d.level) {
  22189. jsonStr.count = d.count + 1;
  22190. LocalStorageManager.setItem(keyStr, jsonStr);
  22191. }
  22192. else {
  22193. }
  22194. }
  22195. else {
  22196. LocalStorageManager.setItem(keyStr, jsonStr);
  22197. }
  22198. const reqStr = JSON.stringify(jsonStr);
  22199. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  22200. }
  22201. hideWin() {
  22202. super.hide();
  22203. if (this.ui.myNode.startBtn) {
  22204. this.ui.myNode.startBtn.touchable = true;
  22205. if (this.ui.myNode.startBtn.powerEft.t0) {
  22206. this.ui.myNode.startBtn.powerEft.t0.stop();
  22207. }
  22208. }
  22209. }
  22210. }
  22211. UILevelProp$1.uiName = "UILevelProp";
  22212. class PutBallLevelDisplay$1 {
  22213. constructor(ui, index) {
  22214. this.index = 0;
  22215. this.ui = ui;
  22216. this.index = index;
  22217. this.ui.onClick(this, this.clickSelf);
  22218. this.updateSelf();
  22219. this.ui.levelTxt.text = (this.index + 1) + "";
  22220. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  22221. this.ui.special.levelTxt.text = (this.index + 1) + "";
  22222. }
  22223. updateSelf() {
  22224. let level = this.index + 1;
  22225. this.data = DataMgr.getPlaceBallLevel(level);
  22226. this.ui.starNode.c1.selectedIndex = this.data.star;
  22227. let isChallenge = cfgTable.placeballData[level].type;
  22228. if (this.data.isCur) {
  22229. if (isChallenge) {
  22230. this.ui.c1.selectedIndex = 5;
  22231. }
  22232. else {
  22233. this.ui.c1.selectedIndex = 2;
  22234. }
  22235. }
  22236. else {
  22237. if (this.data.play) {
  22238. if (this.data.star == 3) {
  22239. this.ui.c1.selectedIndex = 0;
  22240. }
  22241. else {
  22242. this.ui.c1.selectedIndex = 1;
  22243. }
  22244. }
  22245. else {
  22246. if (isChallenge) {
  22247. this.ui.c1.selectedIndex = 4;
  22248. }
  22249. else {
  22250. this.ui.c1.selectedIndex = 3;
  22251. }
  22252. }
  22253. }
  22254. }
  22255. clickSelf() {
  22256. console.log("zh:lev clickSelf");
  22257. if (!this.data.play)
  22258. return;
  22259. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22260. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  22261. }
  22262. }
  22263. class UILevelDisplay$1 extends UIBase {
  22264. constructor() {
  22265. super();
  22266. }
  22267. onConstructor() {
  22268. this.ui = ui_UILevelDisplay.createInstance();
  22269. this.contentPane = this.ui;
  22270. this.isEject = false;
  22271. this.myList = this.ui.myNode.myList;
  22272. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  22273. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  22274. this.levelItemArr = [];
  22275. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  22276. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  22277. this.myList.numItems = levelNum;
  22278. }
  22279. levelItemRender(index, target) {
  22280. let item = new PutBallLevelDisplay$1(target, index);
  22281. this.levelItemArr.push(item);
  22282. }
  22283. show() {
  22284. super.show();
  22285. this.updateLevel();
  22286. this.scrollToPlace();
  22287. this.yinDaoForLianxi();
  22288. this.setGlobalFont(this.ui);
  22289. }
  22290. yinDaoForLianxi() {
  22291. let lianXiGuide = DataMgr.getLianXiGuide();
  22292. console.log('zh:lianXiGuide=', lianXiGuide);
  22293. if (lianXiGuide === 0) {
  22294. this.ui.myNode.n_yd_lxms_2.visible = true;
  22295. console.log('zh:yinDaoForLianxi 222 set ok');
  22296. }
  22297. else {
  22298. this.ui.myNode.n_yd_lxms_2.visible = false;
  22299. console.log('zh:无需引导');
  22300. }
  22301. }
  22302. showLevelTipWindows() {
  22303. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22304. xGame.uiMgr.Show(UILevelProp$1, 1);
  22305. }
  22306. updateLevel() {
  22307. let temp;
  22308. for (let index = 0; index < this.levelItemArr.length; index++) {
  22309. temp = this.levelItemArr[index];
  22310. temp.updateSelf();
  22311. }
  22312. }
  22313. scrollToPlace() {
  22314. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  22315. let passArr = DataMgr.getPlaceBallLevelList();
  22316. let offest = passArr.length;
  22317. if (offest >= maxNum - 1)
  22318. offest = maxNum - 1;
  22319. this.myList.scrollToView(offest, true, true);
  22320. }
  22321. hide() {
  22322. super.hide();
  22323. }
  22324. }
  22325. UILevelDisplay$1.uiName = "UILevelDisplay";
  22326. class UIMatching$1 extends UIBase {
  22327. constructor() {
  22328. super();
  22329. }
  22330. onConstructor() {
  22331. this.ui = ui_UIMatching.createInstance();
  22332. this.contentPane = this.ui;
  22333. this.isEject = false;
  22334. }
  22335. show(callback) {
  22336. super.show();
  22337. PlatMgr.showBanner(true);
  22338. this.callback = callback;
  22339. let user = Moyu.getUserInfo();
  22340. if (!this.selfPot) {
  22341. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  22342. }
  22343. if (!this.aiPot) {
  22344. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  22345. }
  22346. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  22347. this.ui.selfHead.nameTxt.text = user.nickName;
  22348. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  22349. this.ui.aiHead.nameTxt.text = "???";
  22350. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  22351. this.ui.selfHead.c1.selectedIndex = 0;
  22352. this.ui.aiHead.c1.selectedIndex = 0;
  22353. this.ui.selfHead.x = this.selfPot.x;
  22354. this.ui.selfHead.y = this.selfPot.y;
  22355. this.ui.aiHead.x = this.aiPot.x;
  22356. this.ui.aiHead.y = this.aiPot.y;
  22357. switch (xGame.common.gameMode) {
  22358. case GameMode.classic:
  22359. break;
  22360. case GameMode.bigMove:
  22361. this.initSkillData();
  22362. break;
  22363. default:
  22364. break;
  22365. }
  22366. this.ui.t1.play(Laya.Handler.create(this, () => {
  22367. this.ui.t2.play(Laya.Handler.create(this, () => {
  22368. switch (xGame.common.gameMode) {
  22369. case GameMode.classic:
  22370. this.waitingPeople();
  22371. break;
  22372. case GameMode.bigMove:
  22373. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  22374. break;
  22375. default:
  22376. break;
  22377. }
  22378. }));
  22379. }));
  22380. this.setGlobalFont(this.ui);
  22381. }
  22382. initSkillData() {
  22383. this.skillSelectData = [];
  22384. let skillUrl = xGame.common.skillIconList;
  22385. let skillName = xGame.common.skillNameList;
  22386. let skillLevel = DataMgr.getBigSkillList();
  22387. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  22388. for (let index = 0; index < 5; index++) {
  22389. let obj = {};
  22390. obj.skillImg = skillUrl[index];
  22391. obj.skillName = skillName[index];
  22392. obj.skillType = skillType[index];
  22393. obj.skillLevel = skillLevel[index];
  22394. this.skillSelectData.push(obj);
  22395. }
  22396. }
  22397. getAISkillLevel(myLevel) {
  22398. let video = xGame.common.upSkillLevel;
  22399. let aiLevel;
  22400. let temp;
  22401. if (video) {
  22402. temp = xGame.common.randomNum(-2, -1);
  22403. }
  22404. else {
  22405. if (myLevel <= 5) {
  22406. temp = xGame.common.randomNum(1, 3);
  22407. }
  22408. else if (myLevel <= 9) {
  22409. temp = xGame.common.randomNum(-2, 1);
  22410. }
  22411. else {
  22412. temp = xGame.common.randomNum(-4, 0);
  22413. }
  22414. }
  22415. aiLevel = temp + myLevel;
  22416. if (aiLevel <= 1)
  22417. aiLevel = 1;
  22418. if (aiLevel >= 10)
  22419. aiLevel = 10;
  22420. return aiLevel;
  22421. }
  22422. getAISkillType() {
  22423. return xGame.common.randomNum(1, 4);
  22424. let successTimes = DataMgr.getSkillSuccessTimes();
  22425. let info = cfgTable.aiskillData[successTimes];
  22426. if (!info) {
  22427. let max = Object.keys(cfgTable.aiskillData).length - 1;
  22428. info = cfgTable.aiskillData[max];
  22429. }
  22430. let dataArr = info.skillselect;
  22431. let myCfg = {};
  22432. for (let index = 0; index < dataArr.length; index++) {
  22433. let temp = dataArr[index].split('-');
  22434. myCfg[temp[0]] = {};
  22435. myCfg[temp[0]].id = parseInt(temp[0]);
  22436. myCfg[temp[0]].weight = parseInt(temp[1]);
  22437. }
  22438. let aiCfg = xGame.common.initWeight(myCfg);
  22439. let curData = xGame.common.getRandomWeightData(aiCfg);
  22440. return parseInt(curData.id);
  22441. }
  22442. getAISkillData(index) {
  22443. let myLevel = this.skillSelectData[index].skillLevel;
  22444. let aiLevel = this.getAISkillLevel(myLevel);
  22445. let aiType = this.getAISkillType() - 1;
  22446. return { aiLevel, aiType } = { aiLevel, aiType };
  22447. }
  22448. skillSelectFinish(index) {
  22449. let aiInfo = this.getAISkillData(index);
  22450. xGame.common.gameMgr.selfCurSkill = index;
  22451. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  22452. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  22453. this.ui.selfHead.c1.selectedIndex = 1;
  22454. this.ui.aiHead.c1.selectedIndex = 1;
  22455. let myData = this.skillSelectData[index];
  22456. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  22457. if (DataMgr.getGuideDefaultModel() === 1) {
  22458. let guide = DataMgr.getLianXiGuide();
  22459. if (guide == 0) {
  22460. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  22461. }
  22462. else {
  22463. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  22464. }
  22465. }
  22466. else {
  22467. let guide = DataMgr.getSkillGuide();
  22468. if (guide == 0) {
  22469. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  22470. }
  22471. else {
  22472. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  22473. }
  22474. }
  22475. let aiData = this.skillSelectData[aiInfo.aiType];
  22476. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  22477. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  22478. this.waitingPeople();
  22479. }
  22480. waitingPeople() {
  22481. let time = xGame.common.randomNum(1000, 3000);
  22482. time += 1000;
  22483. Laya.timer.once(time, this, () => {
  22484. this.matchingSuccess();
  22485. });
  22486. }
  22487. matchingSuccess() {
  22488. let gameUI = xGame.common.gameUI;
  22489. let name = gameUI.ui.topNode.aiNameTxt.text;
  22490. let url = gameUI.ui.topNode.aiHeadLoader.url;
  22491. this.ui.aiHead.nameTxt.text = name;
  22492. this.ui.aiHead.headImg.url = url;
  22493. name = gameUI.ui.topNode.selfNameTxt.text;
  22494. url = gameUI.ui.topNode.selfHeadLoader.url;
  22495. this.ui.selfHead.nameTxt.text = name;
  22496. this.ui.selfHead.headImg.url = url;
  22497. this.ui.t3.play(Laya.Handler.create(this, () => {
  22498. this.callback && this.callback();
  22499. this.ui.t4.play(Laya.Handler.create(this, () => {
  22500. this.destroySelf();
  22501. }));
  22502. }));
  22503. }
  22504. destroySelf() {
  22505. this.callback = null;
  22506. this.skillSelectData = null;
  22507. this.selfPot = null;
  22508. this.aiPot = null;
  22509. if (!this.ui.isDisposed) {
  22510. this.ui.removeFromParent();
  22511. this.ui.dispose();
  22512. }
  22513. xGame.uiMgr.destroyUI(this);
  22514. }
  22515. }
  22516. UIMatching$1.uiName = "UIMatching";
  22517. class SkillDisplay$1 {
  22518. constructor(ui, data, uiIndex) {
  22519. this.starX = 0;
  22520. this.starY = 0;
  22521. this.index = 0;
  22522. this.ui = ui;
  22523. this.data = data;
  22524. this.index = uiIndex;
  22525. this.initSelf();
  22526. console.log('zh:SkillDisplay constructor this.skillData=', data);
  22527. }
  22528. initSelf() {
  22529. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  22530. this.ui.nameTxt.text = this.data.name;
  22531. this.ui.describeTxt.text = this.data.describe;
  22532. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  22533. this.ui.startBtn.onClick(this, this.startGame);
  22534. this.updateSelf();
  22535. }
  22536. updateSelf() {
  22537. this.checkTry();
  22538. let level = DataMgr.getBigSkillByIndex(this.index);
  22539. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  22540. }
  22541. checkTry() {
  22542. let index = this.index;
  22543. let level = DataMgr.getBigSkillByIndex(index);
  22544. if (level == null) {
  22545. DataMgr.setBigSkill(index, 1, false);
  22546. level = 1;
  22547. }
  22548. this.ui.levelTxt.text = "LV." + level;
  22549. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  22550. this.ui.tryNode.visible = true;
  22551. else
  22552. this.ui.tryNode.visible = false;
  22553. }
  22554. clickAddLevel() {
  22555. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22556. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  22557. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  22558. if (Laya.Browser.onAndroid) {
  22559. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  22560. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22561. }
  22562. else {
  22563. console.log('zh:AD 失败,直接发放奖励');
  22564. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22565. }
  22566. }
  22567. else {
  22568. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22569. }
  22570. }
  22571. qjff_AD_for_skilldisplay_clickAddLevel() {
  22572. DataMgr.setBigSkill(this.data.index, 1);
  22573. this.updateSelf();
  22574. xGame.common.upSkillLevel = true;
  22575. }
  22576. startGame() {
  22577. console.log('zh:rod skill startgame');
  22578. if (this.data.index == 3) {
  22579. alert('Coming soon!');
  22580. return;
  22581. }
  22582. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22583. let needCoin = xGame.common.bigMoveNeedCoin;
  22584. xGame.common.passAwardCoin = 2000;
  22585. let guide = 1;
  22586. if (DataMgr.getGuideDefaultModel() === 1) {
  22587. guide = DataMgr.getLianXiGuide();
  22588. if (guide == 0) {
  22589. needCoin = 0;
  22590. xGame.common.temSelfLevel = 100;
  22591. }
  22592. }
  22593. else {
  22594. guide = DataMgr.getSkillGuide();
  22595. console.log('zh:startGame guide=' + guide);
  22596. if (guide == 0) {
  22597. needCoin = 0;
  22598. xGame.common.temSelfLevel = 100;
  22599. }
  22600. }
  22601. xGame.common.temSelfLevel = 0;
  22602. if (DataMgr.coinEnough(needCoin)) {
  22603. DataMgr.setCoin(-needCoin);
  22604. xGame.common.curPlayerSkillType = this.index;
  22605. if (guide == 0)
  22606. xGame.common.curPlayerSkillType = 0;
  22607. console.log('zh: skilldisplay 1');
  22608. xGame.uiMgr.Show(UIGame$1);
  22609. xGame.uiMgr.Hide(UIMain$1);
  22610. xGame.uiMgr.Show(UIMatching$1, () => {
  22611. xGame.common.gameUI.ui.alpha = 1;
  22612. xGame.common.gameUI.startGame();
  22613. xGame.uiMgr.Hide(UISkill$1);
  22614. });
  22615. this.logEventForRod_start();
  22616. }
  22617. else {
  22618. console.log('zh: skilldisplay 2');
  22619. xGame.uiMgr.Show(UIAddProp$1, 0);
  22620. Moyu.sendDataEvent("AddCoinVideo");
  22621. }
  22622. }
  22623. logEventForRod_start() {
  22624. let gfmsIdx = xGame.common.curPlayerSkillType;
  22625. console.log('zh:选择的技能=' + gfmsIdx);
  22626. let gfmc = 'Skyfall Shot';
  22627. if (gfmsIdx == 0) {
  22628. gfmc = 'Skyfall Shot';
  22629. }
  22630. if (gfmsIdx == 1) {
  22631. gfmc = 'Surging break';
  22632. }
  22633. if (gfmsIdx == 2) {
  22634. gfmc = 'Frost Lock';
  22635. }
  22636. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22637. let jsonStr = {
  22638. "count": 0,
  22639. "name": gfmc
  22640. };
  22641. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22642. const d = LocalStorageManager.getItem(keyStr);
  22643. jsonStr.count = d.count + 1;
  22644. LocalStorageManager.setItem(keyStr, jsonStr);
  22645. }
  22646. else {
  22647. LocalStorageManager.setItem(keyStr, jsonStr);
  22648. }
  22649. const reqStr = JSON.stringify(jsonStr);
  22650. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22651. }
  22652. }
  22653. class UISkill$1 extends UIBase {
  22654. constructor() {
  22655. super();
  22656. this.skillData = [];
  22657. }
  22658. onConstructor() {
  22659. this.ui = ui_UISkill.createInstance();
  22660. this.contentPane = this.ui;
  22661. this.isEject = false;
  22662. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22663. this.initSkillData();
  22664. console.log('zh:aaaaaa1111111111');
  22665. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22666. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22667. console.log('zh:aaaaaa22222222');
  22668. this.displayList = [];
  22669. this.ui.skillNode.skillList.numItems = 3;
  22670. this.addUIClick(this.ui, this.interuptSecretary);
  22671. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22672. this.ui.talkNode.visible = false;
  22673. if (Moyu.isKs)
  22674. this.ui.closeNode.closeBtn.x += 100;
  22675. }
  22676. show() {
  22677. super.show();
  22678. this.playSecretaryIdle();
  22679. this.moneyNode.ui.c1.selectedIndex = 1;
  22680. Laya.timer.clearAll(this);
  22681. xGame.soundMgr.playSound("s_start");
  22682. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22683. let guide = 0;
  22684. if (DataMgr.getGuideDefaultModel() === 2) {
  22685. guide = DataMgr.getSkillGuide();
  22686. this.ui.guideNode.visible = guide == 0;
  22687. }
  22688. let item = this.getSkillItemByUIIndex(0);
  22689. if (guide == 0) {
  22690. item.ui.c1.selectedIndex = 1;
  22691. }
  22692. else {
  22693. item.ui.c1.selectedIndex = 0;
  22694. }
  22695. if (DataMgr.getGuideDefaultModel() === 2) {
  22696. this.ui.guideNode.guideBtn.visible = guide == 0;
  22697. }
  22698. for (let index = 0; index < this.displayList.length; index++) {
  22699. this.displayList[index].checkTry();
  22700. }
  22701. this.setGlobalFont(this.ui);
  22702. }
  22703. getSkillItemByUIIndex(cur) {
  22704. for (let index = 0; index < this.displayList.length; index++) {
  22705. if (this.displayList[index].index == cur) {
  22706. return this.displayList[index];
  22707. }
  22708. }
  22709. }
  22710. enterGuideLevel() {
  22711. let item = this.getSkillItemByUIIndex(0);
  22712. item.startGame();
  22713. if (DataMgr.getNewUser())
  22714. Moyu.sendDataEvent("gameStart1");
  22715. }
  22716. initSkillData() {
  22717. this.skillData = [];
  22718. let nameList = xGame.common.skillNameList;
  22719. let iconList = xGame.common.skillIconList;
  22720. let describeList = [
  22721. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22722. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22723. "The power of frost descends—freezing the flow and taking full control of the game!"
  22724. ];
  22725. console.log('zh:initSkillData 111111111');
  22726. let data;
  22727. for (let index = 0; index < nameList.length; index++) {
  22728. data = {};
  22729. data.name = nameList[index];
  22730. data.icon = iconList[index];
  22731. data.describe = describeList[index];
  22732. data.index = index;
  22733. this.skillData.push(data);
  22734. }
  22735. }
  22736. updateSkillItem(index, target) {
  22737. if (this.displayList[index] == null) {
  22738. let uiIndex;
  22739. switch (index) {
  22740. case 0:
  22741. uiIndex = 1;
  22742. break;
  22743. case 1:
  22744. uiIndex = 0;
  22745. break;
  22746. case 2:
  22747. uiIndex = 2;
  22748. break;
  22749. case 3:
  22750. uiIndex = 3;
  22751. break;
  22752. default:
  22753. break;
  22754. }
  22755. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22756. this.displayList.push(temp);
  22757. }
  22758. }
  22759. playSecretaryIdle() {
  22760. let parent = this.ui.secretary.displayObject;
  22761. parent.destroyChildren();
  22762. let xx = this.ui.secretary.width / 2;
  22763. let yy = this.ui.secretary.height;
  22764. let scale = xGame.common.getSecretaryScale();
  22765. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22766. xGame.common.secretary.play(data, 0, true, parent);
  22767. }
  22768. returnUIMain() {
  22769. this.hide();
  22770. xGame.common.stopGirlPop(this.ui.talkNode);
  22771. xGame.uiMgr.Show(UIMain$1);
  22772. }
  22773. interuptSecretary() {
  22774. Laya.timer.clearAll(this);
  22775. this.playSecretaryRandomSound();
  22776. }
  22777. playSecretaryRandomSound() {
  22778. if (this.isHide)
  22779. return;
  22780. let time = xGame.common.randomNum(45000, 60000);
  22781. Laya.timer.once(time, this, () => {
  22782. if (this.isHide)
  22783. return;
  22784. let index = xGame.common.randomNum(4, 7);
  22785. xGame.soundMgr.playSound("s_main0" + index);
  22786. let words = 1;
  22787. switch (index) {
  22788. case 4:
  22789. words = 5;
  22790. break;
  22791. case 5:
  22792. words = 3;
  22793. break;
  22794. case 6:
  22795. words = 6;
  22796. break;
  22797. case 7:
  22798. words = 7;
  22799. break;
  22800. default:
  22801. break;
  22802. }
  22803. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22804. this.playSecretaryRandomSound();
  22805. });
  22806. }
  22807. }
  22808. UISkill$1.uiName = "UISkill";
  22809. class UIAddProp$1 extends UIBase {
  22810. constructor() {
  22811. super();
  22812. this.curType = "";
  22813. }
  22814. onConstructor() {
  22815. this.ui = ui_UIAddProp.createInstance();
  22816. this.contentPane = this.ui;
  22817. this.isEject = false;
  22818. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22819. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22820. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22821. this.updateUI();
  22822. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22823. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22824. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22825. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22826. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22827. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22828. }
  22829. show(type) {
  22830. super.show();
  22831. this.curType = type == 0 ? "coin" : "diamond";
  22832. this.switchBtn("");
  22833. this.ui.t0.play();
  22834. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22835. PlatMgr.showInsert(true);
  22836. this.setGlobalFont(this.ui);
  22837. }
  22838. closeSelf() {
  22839. this.hide();
  22840. }
  22841. updateUI() {
  22842. let data = cfgTable.moneyData;
  22843. let temp;
  22844. let obj;
  22845. for (const key in data) {
  22846. temp = data[key];
  22847. obj = this.ui.myNode["node" + key];
  22848. if (parseInt(key) <= 2) {
  22849. obj.diamondTxt.text = "+" + temp.num;
  22850. }
  22851. else {
  22852. obj.coinTxt.text = temp.num;
  22853. obj.diamondTxt.text = temp.get.split('_')[1];
  22854. }
  22855. }
  22856. this.updateDiamondShare();
  22857. }
  22858. updateDiamondShare() {
  22859. let data = DataMgr.getShareDiamondTimes();
  22860. if (data >= xGame.common.maxShareDiamondTimes) {
  22861. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22862. this.ui.myNode.node1.touchable = false;
  22863. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22864. }
  22865. else {
  22866. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22867. this.ui.myNode.node1.touchable = true;
  22868. }
  22869. }
  22870. switchBtn(type) {
  22871. if (type == "")
  22872. type = this.curType;
  22873. else {
  22874. if (this.curType == type) {
  22875. return;
  22876. }
  22877. else {
  22878. this.curType = type;
  22879. }
  22880. }
  22881. if (type == "coin") {
  22882. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22883. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22884. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22885. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22886. this.ui.myNode.c1.selectedIndex = 0;
  22887. }
  22888. else {
  22889. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22890. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22891. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22892. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22893. this.ui.myNode.c1.selectedIndex = 1;
  22894. }
  22895. }
  22896. convertCoin(index) {
  22897. let data = cfgTable.moneyData[index];
  22898. let coinNum = data.num;
  22899. let str = data.get.split('_')[1];
  22900. let needDiamond = parseInt(str);
  22901. if (DataMgr.diamondEnough(needDiamond)) {
  22902. DataMgr.setDiamond(-needDiamond);
  22903. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22904. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22905. }
  22906. else {
  22907. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22908. this.switchBtn("diamond");
  22909. }
  22910. }
  22911. videoGetDiamond() {
  22912. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22913. if (Laya.Browser.onAndroid) {
  22914. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22915. if (!boo) {
  22916. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22917. return;
  22918. }
  22919. }
  22920. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22921. }
  22922. else {
  22923. console.log('zh:AD 失败,直接发放奖励');
  22924. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22925. }
  22926. }
  22927. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22928. let num = cfgTable.moneyData[2].num;
  22929. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22930. this.closeSelf();
  22931. }
  22932. videoGetCoin() {
  22933. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22934. if (Laya.Browser.onAndroid) {
  22935. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22936. if (!boo) {
  22937. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22938. return;
  22939. }
  22940. }
  22941. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22942. }
  22943. else {
  22944. console.log('zh:AD 失败,直接发放奖励');
  22945. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22946. }
  22947. }
  22948. qjff_AD_for_uiAddProp_videoGetCoin() {
  22949. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22950. this.closeSelf();
  22951. }
  22952. shareGetDiamond() {
  22953. let times = DataMgr.getShareDiamondTimes();
  22954. if (times >= xGame.common.maxShareDiamondTimes) {
  22955. console.log('zh: 233333333333 maxShareDiamondTimes');
  22956. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22957. }
  22958. else {
  22959. console.log('zh:33333333333333ad');
  22960. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22961. if (Laya.Browser.onAndroid) {
  22962. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22963. if (!boo) {
  22964. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22965. return;
  22966. }
  22967. }
  22968. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22969. }
  22970. else {
  22971. console.log('zh:AD 失败,直接发放奖励');
  22972. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22973. }
  22974. }
  22975. }
  22976. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22977. let diamond = xGame.common.randomNum(50, 100);
  22978. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22979. DataMgr.setShareDiamondTimes(1);
  22980. this.updateDiamondShare();
  22981. }
  22982. openPutBallView() {
  22983. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22984. let skill = xGame.uiMgr.getUI(UISkill$1);
  22985. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22986. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22987. if (end && !end.isHide) {
  22988. xGame.uiMgr.Hide(UIGameEnd$1);
  22989. xGame.uiMgr.Show(UIMain$1);
  22990. }
  22991. if (skill && !skill.isHide)
  22992. xGame.uiMgr.Hide(UISkill$1);
  22993. if (uigame && !uigame.isHide)
  22994. xGame.uiMgr.Hide(UIGame$1);
  22995. if (level && !level.isHide) {
  22996. }
  22997. else {
  22998. xGame.uiMgr.Show(UILevelDisplay$1);
  22999. }
  23000. this.closeSelf();
  23001. }
  23002. }
  23003. UIAddProp$1.uiName = "UIAddProp";
  23004. class MoneyNode$1 {
  23005. constructor(ui) {
  23006. this.leftTime = 0;
  23007. this.ui = ui;
  23008. this.ui.addCoinBtn.onClick(this, this.addCoin);
  23009. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  23010. this.ui.addPowerBtn.onClick(this, this.addPower);
  23011. this.ui.c1.selectedIndex = 1;
  23012. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  23013. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  23014. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  23015. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  23016. this.coinChange();
  23017. this.diamondChange();
  23018. this.powerChange();
  23019. }
  23020. addPower() {
  23021. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23022. xGame.uiMgr.Show(UIPower$1);
  23023. }
  23024. powerChange() {
  23025. let powerNum = DataMgr.getPower();
  23026. this.ui.powerTxt.text = powerNum + "";
  23027. }
  23028. checkPowerTime() {
  23029. let cur = new Date().getTime();
  23030. let last = DataMgr.getPowerTime();
  23031. if (last == 0) {
  23032. last = cur;
  23033. DataMgr.setPowerTime(cur);
  23034. }
  23035. let power = DataMgr.getPower();
  23036. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  23037. Laya.timer.clearAll(this);
  23038. if (power >= xGame.common.natureMaxPower) {
  23039. this.ui.powerTimeTxt.text = "";
  23040. DataMgr.setPowerTime(cur);
  23041. return;
  23042. }
  23043. if (power + offset >= xGame.common.natureMaxPower) {
  23044. DataMgr.setPower(xGame.common.natureMaxPower, false);
  23045. this.ui.powerTimeTxt.text = "";
  23046. DataMgr.setPowerTime(cur);
  23047. }
  23048. else {
  23049. if (offset > 0) {
  23050. DataMgr.setPower(offset);
  23051. DataMgr.setPowerTime(cur);
  23052. }
  23053. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  23054. this.leftTime = xGame.common.powerRecoverNum - time;
  23055. if (this.leftTime <= 0)
  23056. this.leftTime = 0;
  23057. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  23058. Laya.timer.loop(1000, this, this.updatePowerTime);
  23059. }
  23060. }
  23061. updatePowerTime() {
  23062. this.leftTime -= 1;
  23063. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  23064. if (this.leftTime <= 0) {
  23065. this.checkPowerTime();
  23066. }
  23067. }
  23068. coinChange() {
  23069. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  23070. }
  23071. diamondChange() {
  23072. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  23073. }
  23074. addCoin() {
  23075. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23076. Moyu.sendDataEvent("AddCoinBtn");
  23077. xGame.uiMgr.Show(UIAddProp$1, 0);
  23078. }
  23079. addDiamond() {
  23080. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23081. Moyu.sendDataEvent("AddDiamondBtn");
  23082. xGame.uiMgr.Show(UIAddProp$1, 1);
  23083. }
  23084. }
  23085. class SettingNode$1 {
  23086. constructor(ui) {
  23087. this.showSetting = false;
  23088. this.openSound = true;
  23089. this.openShake = true;
  23090. this.ui = ui;
  23091. this.ui.soundBtn.onClick(this, this.switchSound);
  23092. this.ui.shakeBtn.onClick(this, this.switchShake);
  23093. this.ui.xyBtn.onClick(this, this.onXy);
  23094. this.ui.clickNode.onClick(this, this.changeSetting);
  23095. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  23096. this.ui.xyBtn.visible = false;
  23097. this.ui.shakeBtn.visible = false;
  23098. }
  23099. changeSetting() {
  23100. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23101. this.showSetting = !this.showSetting;
  23102. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  23103. }
  23104. switchSound() {
  23105. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23106. this.openSound = !this.openSound;
  23107. Moyu.onSetting(this.openSound, this.openShake);
  23108. xGame.soundMgr.onSetting(this.openSound);
  23109. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  23110. }
  23111. switchShake() {
  23112. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23113. this.openShake = !this.openShake;
  23114. Moyu.onSetting(this.openSound, this.openShake);
  23115. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  23116. }
  23117. onXy() {
  23118. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23119. MoyuMgr$1.showXy(1);
  23120. }
  23121. }
  23122. class UIDraw$1 extends UIBase {
  23123. constructor() {
  23124. super();
  23125. this.curKey = 0;
  23126. }
  23127. onConstructor() {
  23128. this.ui = ui_UIDraw.createInstance();
  23129. this.contentPane = this.ui;
  23130. this.isEject = false;
  23131. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23132. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23133. this.addUIClick(this.ui.drawBtn, this.startDraw);
  23134. this.initDraw();
  23135. this.initUI();
  23136. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  23137. }
  23138. show() {
  23139. super.show();
  23140. this.ui.t0.play();
  23141. this.playSecretaryIdle();
  23142. this.updateDraw();
  23143. this.checkFree();
  23144. if (PlatMgr.bannerDelay > 0) {
  23145. this.ui.closeNode.closeBtn.visible = false;
  23146. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  23147. this.ui.closeNode.closeBtn.visible = true;
  23148. });
  23149. }
  23150. PlatMgr.showRateBanner();
  23151. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23152. this.setGlobalFont(this.ui);
  23153. }
  23154. hide() {
  23155. Laya.timer.clearAll(this);
  23156. super.hide();
  23157. }
  23158. checkFree() {
  23159. let isFree = DataMgr.getDailyfreeDrawTimes();
  23160. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  23161. }
  23162. initDraw() {
  23163. this.drawObj = [];
  23164. let data = cfgTable.drawData;
  23165. let temp;
  23166. let weight = 0;
  23167. for (const key in data) {
  23168. temp = data[key];
  23169. weight += temp.weight;
  23170. this.drawObj.push(weight);
  23171. }
  23172. this.allWeight = weight;
  23173. }
  23174. initUI() {
  23175. let data = cfgTable.drawData;
  23176. let temp;
  23177. let img;
  23178. let txt;
  23179. for (const key in data) {
  23180. temp = data[key];
  23181. img = this.ui.myNode.rotNode["img" + key];
  23182. txt = this.ui.myNode.rotNode["txt" + key];
  23183. img.url = xGame.common.getGameIconUrl(temp.icon);
  23184. txt.visible = true;
  23185. if (temp.award > 2) {
  23186. img.rotation = 0;
  23187. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  23188. }
  23189. else {
  23190. img.rotation = temp.rotation;
  23191. txt.text = temp.num;
  23192. }
  23193. }
  23194. }
  23195. getCurkey() {
  23196. let rand = Math.random() * this.allWeight;
  23197. let temp;
  23198. for (let index = 0; index < this.drawObj.length - 1; index++) {
  23199. temp = this.drawObj[index];
  23200. if (index == 0) {
  23201. if (rand < temp) {
  23202. return index + 1;
  23203. }
  23204. }
  23205. else {
  23206. if (rand >= temp && rand < this.drawObj[index + 1]) {
  23207. return index + 1;
  23208. }
  23209. }
  23210. }
  23211. return 2;
  23212. }
  23213. startDraw() {
  23214. console.log('zh:开始抽奖');
  23215. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  23216. if (freeTimes > 0) {
  23217. console.log('zh:freeTimes=' + freeTimes);
  23218. this.beginDraw();
  23219. DataMgr.setDailyfreeDrawTimes(0);
  23220. this.checkFree();
  23221. }
  23222. else {
  23223. if (Laya.Browser.onAndroid) {
  23224. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23225. if (!boo) {
  23226. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23227. return;
  23228. }
  23229. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  23230. }
  23231. else {
  23232. console.log('zh:AD 失败,直接发放奖励');
  23233. this.qjff_chouJiang();
  23234. }
  23235. }
  23236. else {
  23237. this.qjff_chouJiang();
  23238. }
  23239. }
  23240. }
  23241. qjff_chouJiang() {
  23242. this.beginDraw();
  23243. }
  23244. beginDraw() {
  23245. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  23246. this.ui.drawBtn.touchable = false;
  23247. this.curKey = this.getCurkey();
  23248. console.log("zh:当前key", this.curKey);
  23249. let cell = 60;
  23250. let lap = 3;
  23251. let angle = cell * (this.curKey - 1) + lap * 360;
  23252. let target = this.ui.myNode.rotNode;
  23253. target.rotation = 0;
  23254. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  23255. console.log("zh:旋转完成");
  23256. this.ui.drawBtn.touchable = true;
  23257. this.getAward();
  23258. }));
  23259. }
  23260. getAward() {
  23261. let data = cfgTable.drawData[this.curKey];
  23262. let temp = new AwardType();
  23263. temp.type = data.award;
  23264. temp.num = data.num;
  23265. xGame.common.getAward([temp], () => {
  23266. DataMgr.setDrawTimes(1);
  23267. this.updateDraw();
  23268. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  23269. });
  23270. }
  23271. updateDraw() {
  23272. let drawTimes = DataMgr.getDrawTimes();
  23273. let awardTimes = DataMgr.getDrawAwardTimes();
  23274. if (Math.floor(drawTimes / 3) > awardTimes) {
  23275. this.ui.extraNode.boxBtn.t0.play(null, -1);
  23276. this.ui.extraNode.boxBtn.touchable = true;
  23277. this.ui.extraNode.tipsTxt.text = "3/3";
  23278. this.ui.extraNode.barNode.width = 265;
  23279. this.getExtraAward();
  23280. }
  23281. else {
  23282. this.ui.extraNode.boxBtn.t0.stop();
  23283. this.ui.extraNode.boxBtn.touchable = false;
  23284. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  23285. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  23286. }
  23287. let data = cfgTable.drawData[1];
  23288. if (awardTimes == 0) {
  23289. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  23290. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  23291. this.ui.myNode.rotNode.img1.rotation = 0;
  23292. }
  23293. else {
  23294. let award = data.nextid;
  23295. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  23296. this.ui.myNode.rotNode.txt1.text = award[1];
  23297. this.ui.myNode.rotNode.img1.rotation = 0;
  23298. }
  23299. }
  23300. getExtraAward() {
  23301. let drawTimes = DataMgr.getDrawTimes();
  23302. let awardTimes = DataMgr.getDrawAwardTimes();
  23303. let data = cfgTable.drawData[1];
  23304. let award = new AwardType();
  23305. if (awardTimes == 0) {
  23306. award.num = data.num;
  23307. award.type = data.award;
  23308. xGame.common.getAward([award], () => {
  23309. let all = Math.floor(drawTimes / 3);
  23310. DataMgr.setDrawAwardTimes(all);
  23311. this.updateDraw();
  23312. });
  23313. }
  23314. else {
  23315. award.num = parseInt(data.nextid[1]);
  23316. award.type = parseInt(data.nextid[0]);
  23317. xGame.common.getAward([award], () => {
  23318. let all = Math.floor(drawTimes / 3);
  23319. DataMgr.setDrawAwardTimes(all);
  23320. this.updateDraw();
  23321. });
  23322. }
  23323. }
  23324. closeSelf() {
  23325. this.hide();
  23326. }
  23327. playSecretaryIdle() {
  23328. let parent = this.ui.secretary.displayObject;
  23329. parent.destroyChildren();
  23330. let xx = this.ui.secretary.width / 2;
  23331. let yy = this.ui.secretary.height;
  23332. let scale = xGame.common.getSecretaryScale();
  23333. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23334. xGame.common.secretary.play(data, 0, true, parent);
  23335. }
  23336. }
  23337. UIDraw$1.uiName = "UIDraw";
  23338. class UIRanking$1 extends UIBase {
  23339. constructor() {
  23340. super();
  23341. this.showSelf = true;
  23342. this.rankType = 1;
  23343. this.rankList = [];
  23344. this.topX = 10;
  23345. this.myIndex = this.topX + 1;
  23346. this.myStar = 0;
  23347. }
  23348. onConstructor() {
  23349. this.ui = ui_UIRanking.createInstance();
  23350. this.contentPane = this.ui;
  23351. this.isEject = false;
  23352. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  23353. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  23354. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  23355. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  23356. this.ui.myNode.myList.setVirtual();
  23357. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  23358. }
  23359. show() {
  23360. super.show();
  23361. this.getPaiHangBangDataFormJosnFile();
  23362. this.updateSelf();
  23363. let self = Moyu.getUserInfo();
  23364. if (!self.isAuth) {
  23365. Moyu.initUser(this, () => {
  23366. DataMgr.upRankData();
  23367. });
  23368. }
  23369. this.setGlobalFont(this.ui);
  23370. }
  23371. getPaiHangBangDataFormJosnFile() {
  23372. const rankingList = cfgTable.paiHangBangData.list;
  23373. this.updateItemData(rankingList);
  23374. }
  23375. updateSelfItem() {
  23376. console.log('zh:Moyu.platType =' + Moyu.platType);
  23377. let self = Moyu.getUserInfo();
  23378. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  23379. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  23380. if (this.myIndex > this.topX) {
  23381. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  23382. }
  23383. else {
  23384. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  23385. }
  23386. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  23387. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  23388. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  23389. }
  23390. updateItemData(data) {
  23391. this.myStar = xGame.common.getAllStarNum();
  23392. if (this.rankList.length < 2) {
  23393. this.rankList = data;
  23394. let self = Moyu.getUserInfo();
  23395. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  23396. self.headIcon = self.headIcon;
  23397. for (let i = 0; i < data.length; i++) {
  23398. let data = this.rankList[i];
  23399. if (data.userId == self.userId) {
  23400. this.rankList.splice(i, 1);
  23401. break;
  23402. }
  23403. }
  23404. for (let i = 0; i < data.length; i++) {
  23405. let data = this.rankList[i];
  23406. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  23407. this.myIndex = i + 1;
  23408. let user = { headIcon: self.headIcon, nickName: "myself" };
  23409. let ud = { user: user, data: {} };
  23410. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  23411. console.log('zh:Moyu.platType = ' + Moyu.platType);
  23412. if (Moyu.platType < 11) {
  23413. user.headIcon = self.headIcon;
  23414. user.nickName = self.nickName;
  23415. }
  23416. this.rankList.splice(i, 0, md);
  23417. break;
  23418. }
  23419. }
  23420. }
  23421. this.updateSelfItem();
  23422. this.ui.myNode.myList.numItems = this.rankList.length;
  23423. }
  23424. updateItemUI(index, obj) {
  23425. let data = this.rankList[index];
  23426. let userData = JSON.parse(data.userData).user;
  23427. obj.nameTxt.text = userData.nickName.toString();
  23428. obj.valueTxt.text = data.rankScore;
  23429. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  23430. obj.rankTxt.text = index + 1;
  23431. switch (index) {
  23432. case 0:
  23433. this.setImg(obj, 1, 0, 0);
  23434. obj.rankTxt.color = "#FFC047";
  23435. break;
  23436. case 1:
  23437. this.setImg(obj, 0, 1, 0);
  23438. obj.rankTxt.color = "#ACACAC";
  23439. break;
  23440. case 2:
  23441. this.setImg(obj, 0, 0, 1);
  23442. obj.rankTxt.color = "#D09672";
  23443. break;
  23444. default:
  23445. this.setImg(obj, 0, 0, 0);
  23446. obj.rankTxt.color = "#496FAB";
  23447. break;
  23448. }
  23449. }
  23450. setImg(obj, a, b, c) {
  23451. obj.img1.visible = a ? true : false;
  23452. obj.img2.visible = b ? true : false;
  23453. obj.img3.visible = c ? true : false;
  23454. }
  23455. changeList(type) {
  23456. this.rankType = type;
  23457. this.updateSelf();
  23458. }
  23459. changeSelfNode() {
  23460. this.showSelf = !this.showSelf;
  23461. this.updateSelf();
  23462. }
  23463. updateSelf() {
  23464. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  23465. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  23466. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23467. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  23468. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23469. }
  23470. }
  23471. UIRanking$1.uiName = "UIRanking";
  23472. class UISecretary$1 extends UIBase {
  23473. constructor() {
  23474. super();
  23475. this.curIndex = 1;
  23476. }
  23477. onConstructor() {
  23478. this.ui = ui_UISecretary.createInstance();
  23479. this.contentPane = this.ui;
  23480. this.isEject = false;
  23481. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23482. this.nodeObj = { left: null, right: null, cur: null };
  23483. this.nodeObj.cur = this.ui.myNode.gameNode3;
  23484. }
  23485. show() {
  23486. super.show();
  23487. this.ui.t0.play();
  23488. this.updateData();
  23489. this.setGlobalFont(this.ui);
  23490. }
  23491. addSecretarySpine(node, spineName) {
  23492. if (spineName == "mishu") {
  23493. if (this.secretarySpine1) {
  23494. node.displayObject.destroyChildren();
  23495. this.playWoman(this.secretarySpine1, node.displayObject);
  23496. }
  23497. else {
  23498. let spine1 = new SpineMgr("mishu", () => {
  23499. this.secretarySpine1 = spine1;
  23500. this.playWoman(this.secretarySpine1, node.displayObject);
  23501. });
  23502. }
  23503. }
  23504. else {
  23505. if (this.secretarySpine2) {
  23506. node.displayObject.destroyChildren();
  23507. this.playWoman(this.secretarySpine2, node.displayObject);
  23508. }
  23509. else {
  23510. let spine2 = new SpineMgr("xiaomishu2", () => {
  23511. this.secretarySpine2 = spine2;
  23512. this.playWoman(this.secretarySpine2, node.displayObject);
  23513. });
  23514. }
  23515. }
  23516. }
  23517. playWoman(node, parent) {
  23518. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  23519. let yy = this.ui.myNode.gameNode3.secretary.height;
  23520. let scale = 1.5;
  23521. if (node == this.secretarySpine2) {
  23522. scale = 1.2;
  23523. }
  23524. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23525. node.play(data, 0, true, parent);
  23526. }
  23527. turnLeft() {
  23528. this.curIndex--;
  23529. if (this.curIndex < 1) {
  23530. this.curIndex = 2;
  23531. }
  23532. let left = this.nodeObj.left;
  23533. let right = this.nodeObj.right;
  23534. let cur = this.nodeObj.cur;
  23535. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23536. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23537. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23538. this.updateData();
  23539. }));
  23540. this.ui.myNode.setChildIndex(right, 2);
  23541. this.nodeObj.left = cur;
  23542. this.nodeObj.right = left;
  23543. this.nodeObj.cur = right;
  23544. }
  23545. turnRight() {
  23546. this.curIndex++;
  23547. if (this.curIndex > 2) {
  23548. this.curIndex = 1;
  23549. }
  23550. let left = this.nodeObj.left;
  23551. let right = this.nodeObj.right;
  23552. let cur = this.nodeObj.cur;
  23553. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23554. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23555. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23556. this.updateData();
  23557. }));
  23558. this.ui.myNode.setChildIndex(left, 2);
  23559. this.nodeObj.left = right;
  23560. this.nodeObj.right = cur;
  23561. this.nodeObj.cur = left;
  23562. }
  23563. updateData() {
  23564. console.log('zh: updateData FFFFFFFFFF');
  23565. let data = cfgTable.secretaryshopData;
  23566. let children = this.ui.myNode._children;
  23567. let temp;
  23568. let curData;
  23569. for (let index = 0; index < children.length; index++) {
  23570. temp = children[index];
  23571. curData = data[1];
  23572. temp.heightTxt.text = curData.height;
  23573. temp.foodTxt.text = curData.food;
  23574. temp.historyTxt.text = curData.history;
  23575. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  23576. this.addSecretarySpine(temp.secretary, curData.spine);
  23577. let womanIndex = curData.id - 1;
  23578. let getWoman = DataMgr.getSecretary(womanIndex);
  23579. let curUse = DataMgr.getCurSecretary();
  23580. if (getWoman) {
  23581. if (curUse == womanIndex) {
  23582. temp.purchaseBtn.c1.selectedIndex = 1;
  23583. }
  23584. else {
  23585. temp.purchaseBtn.c1.selectedIndex = 2;
  23586. }
  23587. }
  23588. else {
  23589. temp.purchaseBtn.c1.selectedIndex = 0;
  23590. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23591. }
  23592. temp.purchaseBtn.visible = false;
  23593. }
  23594. }
  23595. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23596. console.log('zh: 点击了clickSecretary ');
  23597. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23598. if (getWoman) {
  23599. if (curUse != womanIndex) {
  23600. console.log();
  23601. DataMgr.setCurSecretary(womanIndex);
  23602. this.updateData();
  23603. }
  23604. }
  23605. else {
  23606. console.log('zh:点击购买了');
  23607. let need = needDiamond;
  23608. if (DataMgr.diamondEnough(need)) {
  23609. DataMgr.setDiamond(-need);
  23610. DataMgr.setSecretary(womanIndex, 1);
  23611. DataMgr.setCurSecretary(womanIndex);
  23612. this.updateData();
  23613. }
  23614. else {
  23615. xGame.uiMgr.Show(UIAddProp$1, 1);
  23616. }
  23617. }
  23618. }
  23619. closeSelf() {
  23620. this.hide();
  23621. }
  23622. }
  23623. UISecretary$1.uiName = "UISecretary";
  23624. class BallRodDisplay$1 {
  23625. constructor(ui, index) {
  23626. this.index = 0;
  23627. this.uiIndex = 0;
  23628. this.ui = ui;
  23629. this.index = index;
  23630. this.initData();
  23631. }
  23632. initData() {
  23633. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23634. let data = cfgTable.ballrodData[this.index + 1];
  23635. this.ui.nameTxt.text = data.name;
  23636. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23637. this.ui.levelNode.c1.selectedIndex = data.quality;
  23638. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23639. if (data.spine) {
  23640. this.mySpine = new SpineMgr(data.spine, () => {
  23641. let xx = 150;
  23642. let yy = 70;
  23643. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23644. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23645. });
  23646. }
  23647. }
  23648. updateSelf() {
  23649. let get = DataMgr.getBallRod(this.index);
  23650. if (get == null)
  23651. get = 1;
  23652. let curUse = DataMgr.getCurBallRod();
  23653. if (get) {
  23654. if (curUse == this.index) {
  23655. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23656. }
  23657. else {
  23658. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23659. }
  23660. }
  23661. else {
  23662. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23663. }
  23664. }
  23665. buyBallRod() {
  23666. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23667. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23668. switch (selectedIndex) {
  23669. case 0:
  23670. break;
  23671. case 1:
  23672. console.log('zh:点击了 USE THIS');
  23673. DataMgr.setCurBallRod(this.index);
  23674. let curUse = DataMgr.getCurBallRod();
  23675. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23676. let ui = xGame.uiMgr.getUI(UIShop$1);
  23677. ui.updateBallRod();
  23678. break;
  23679. case 2:
  23680. let data = cfgTable.ballrodData[this.index + 1];
  23681. let need = data.price;
  23682. if (DataMgr.diamondEnough(need)) {
  23683. this.buyQiuGan(data);
  23684. DataMgr.setDiamond(-need);
  23685. DataMgr.setBallRod(this.index, 1);
  23686. DataMgr.setCurBallRod(this.index);
  23687. let ui = xGame.uiMgr.getUI(UIShop$1);
  23688. ui.updateBallRod();
  23689. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23690. }
  23691. else {
  23692. xGame.uiMgr.Show(UIAddProp$1, 1);
  23693. }
  23694. break;
  23695. default:
  23696. break;
  23697. }
  23698. }
  23699. buyQiuGan(qgItem) {
  23700. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23701. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23702. if (userInfo == null) {
  23703. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23704. return;
  23705. }
  23706. let reqData = xGame.httpMgr.getReqData();
  23707. let pd = JSON.parse(reqData);
  23708. pd.qiuGanData = qgItem;
  23709. reqData = JSON.stringify(pd);
  23710. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23711. try {
  23712. console.log('zh:buySp res = ' + JSON.stringify(res));
  23713. let code = res.code;
  23714. let msg = res.msg;
  23715. if (code == 401) {
  23716. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23717. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23718. return;
  23719. }
  23720. if (code == 200) {
  23721. xGame.uiMgr.Show(UIMsg$1, msg);
  23722. DataMgr.getUserZiChanInfo(false);
  23723. }
  23724. else {
  23725. xGame.uiMgr.Show(UIMsg$1, msg);
  23726. }
  23727. }
  23728. catch (error) {
  23729. console.log('error=' + error);
  23730. alert(error);
  23731. }
  23732. finally {
  23733. }
  23734. });
  23735. }
  23736. logEventForGouMaiGan(qiuGanName) {
  23737. const ev = {
  23738. value: qiuGanName
  23739. };
  23740. const jsonStr = JSON.stringify(ev);
  23741. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23742. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23743. }
  23744. }
  23745. class DaoJuDisplay$1 {
  23746. constructor(ui, index) {
  23747. this.index = 0;
  23748. this.uiIndex = 0;
  23749. this.ggSpid = "";
  23750. this.spid = 0;
  23751. this.ui = ui;
  23752. this.index = index;
  23753. this.initData();
  23754. }
  23755. initData() {
  23756. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23757. let data = cfgTable.daoJuData[this.index + 1];
  23758. this.ui.nameTxt.text = data.spbt;
  23759. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23760. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23761. this.ggSpid = data.ggSpid;
  23762. this.spid = data.spid;
  23763. let baseUrl = "asset/sound/ogg/";
  23764. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23765. }
  23766. gotoBuy() {
  23767. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23768. if (userInfo != null) {
  23769. let token = userInfo.token;
  23770. let ggSpid = this.ggSpid;
  23771. let spid = this.spid;
  23772. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23773. console.log('zh:gotoBuy1 spid =' + spid);
  23774. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23775. return;
  23776. }
  23777. else {
  23778. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23779. }
  23780. }
  23781. gotoBuy1() {
  23782. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23783. let djItem = cfgTable.daoJuData[this.index + 1];
  23784. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23785. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23786. if (userInfo == null) {
  23787. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23788. return;
  23789. }
  23790. let reqData = xGame.httpMgr.getReqData();
  23791. let pd = JSON.parse(reqData);
  23792. pd.spItem = djItem;
  23793. reqData = JSON.stringify(pd);
  23794. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23795. try {
  23796. console.log('zh:buySp res = ' + JSON.stringify(res));
  23797. let code = res.code;
  23798. let msg = res.msg;
  23799. if (code == 401) {
  23800. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23801. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23802. return;
  23803. }
  23804. if (code == 200) {
  23805. xGame.uiMgr.Show(UIMsg$1, msg);
  23806. DataMgr.getUserZiChanInfo(false);
  23807. }
  23808. else {
  23809. xGame.uiMgr.Show(UIMsg$1, msg);
  23810. }
  23811. }
  23812. catch (error) {
  23813. console.log('error=' + error);
  23814. alert(error);
  23815. }
  23816. finally {
  23817. }
  23818. });
  23819. }
  23820. }
  23821. class UIShop$1 extends UIBase {
  23822. constructor() {
  23823. super();
  23824. this.itemNums = 0;
  23825. this.itemNumsForDj = 0;
  23826. this.curType = "";
  23827. }
  23828. onConstructor() {
  23829. this.ui = ui_UIShop.createInstance();
  23830. this.contentPane = this.ui;
  23831. this.isEject = false;
  23832. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23833. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23834. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23835. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23836. this.addUIClick(this.ui, this.interuptSecretary);
  23837. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23838. this.ballRodArr = [];
  23839. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23840. this.ui.myNode.myList.numItems = this.itemNums;
  23841. this.loadDjdata_old();
  23842. }
  23843. loadDjdata_old() {
  23844. let fff = cfgTable.daoJuData;
  23845. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23846. this.daoJuArr = [];
  23847. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23848. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23849. }
  23850. getProductList() {
  23851. let reqData = xGame.httpMgr.getReqData();
  23852. let pd = JSON.parse(reqData);
  23853. pd.splx = "Consumable";
  23854. reqData = JSON.stringify(pd);
  23855. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23856. try {
  23857. let code = res.code;
  23858. let msg = res.msg;
  23859. if (code == 401) {
  23860. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23861. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23862. return;
  23863. }
  23864. if (code == 200) {
  23865. let data = res.data;
  23866. for (let index = 0; index < data.length; index++) {
  23867. let element = data[index];
  23868. cfgTable.daoJuData[element.spid] = element;
  23869. }
  23870. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23871. }
  23872. else {
  23873. xGame.uiMgr.Show(UIMsg, msg);
  23874. }
  23875. }
  23876. catch (error) {
  23877. console.log('error=' + error);
  23878. alert(error);
  23879. }
  23880. finally {
  23881. }
  23882. });
  23883. }
  23884. show(type) {
  23885. super.show();
  23886. this.curType = type == 0 ? "qiugan" : "daoju";
  23887. this.switchBtn("");
  23888. this.playSecretaryIdle();
  23889. this.updateBallRod();
  23890. this.setGlobalFont(this.ui);
  23891. }
  23892. test123() {
  23893. console.log('zh:test123 ');
  23894. }
  23895. switchBtn(type) {
  23896. console.log('zh:1111切換 sel type=' + type);
  23897. if (type == "") {
  23898. type = this.curType;
  23899. }
  23900. else {
  23901. if (this.curType == type) {
  23902. return;
  23903. }
  23904. else {
  23905. this.curType = type;
  23906. }
  23907. }
  23908. if (type == "qiugan") {
  23909. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23910. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23911. this.ui.myNode.c1.selectedIndex = 0;
  23912. this.ui.myNode.myList.visible = true;
  23913. this.ui.myNode.djList.visible = false;
  23914. }
  23915. else {
  23916. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23917. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23918. this.ui.myNode.c1.selectedIndex = 1;
  23919. this.ui.myNode.myList.visible = false;
  23920. this.ui.myNode.djList.visible = true;
  23921. }
  23922. }
  23923. updateBallRod() {
  23924. for (let index = 0; index < this.ballRodArr.length; index++) {
  23925. this.ballRodArr[index].updateSelf();
  23926. }
  23927. }
  23928. renderBallRod(sort, obj) {
  23929. let index = this.getIndexBySort(sort + 1) - 1;
  23930. let ballRod = new BallRodDisplay$1(obj, index);
  23931. this.ballRodArr.push(ballRod);
  23932. }
  23933. renderDaoJu(idx, obj) {
  23934. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23935. let b = new DaoJuDisplay$1(obj, index);
  23936. this.daoJuArr.push(b);
  23937. }
  23938. getIndexBySort(sort) {
  23939. let object = cfgTable.ballrodData;
  23940. for (const key in object) {
  23941. if (object[key].sort == sort) {
  23942. return parseInt(key);
  23943. }
  23944. }
  23945. }
  23946. getIndexBySortForDj(idx) {
  23947. let object = cfgTable.daoJuData;
  23948. for (const key in object) {
  23949. if (object[key].idx == idx) {
  23950. return parseInt(key);
  23951. }
  23952. }
  23953. }
  23954. playSecretaryIdle() {
  23955. let parent = this.ui.secretary.displayObject;
  23956. parent.destroyChildren();
  23957. let xx = this.ui.secretary.width / 2;
  23958. let yy = this.ui.secretary.height;
  23959. let scale = xGame.common.getSecretaryScale();
  23960. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23961. xGame.common.secretary.play(data, 0, true, parent);
  23962. }
  23963. interuptSecretary() {
  23964. Laya.timer.clearAll(this);
  23965. this.playSecretaryRandomSound();
  23966. }
  23967. playSecretaryRandomSound() {
  23968. if (this.isHide)
  23969. return;
  23970. let time = xGame.common.randomNum(45000, 60000);
  23971. Laya.timer.once(time, this, () => {
  23972. if (this.isHide)
  23973. return;
  23974. let index = xGame.common.randomNum(4, 7);
  23975. xGame.soundMgr.playSound("s_main0" + index);
  23976. let words = 1;
  23977. switch (index) {
  23978. case 4:
  23979. words = 5;
  23980. break;
  23981. case 5:
  23982. words = 3;
  23983. break;
  23984. case 6:
  23985. words = 6;
  23986. break;
  23987. case 7:
  23988. words = 7;
  23989. break;
  23990. default:
  23991. break;
  23992. }
  23993. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23994. this.playSecretaryRandomSound();
  23995. });
  23996. }
  23997. closeSelf() {
  23998. this.hide();
  23999. }
  24000. }
  24001. UIShop$1.uiName = "UIShop";
  24002. class SignMax$1 {
  24003. constructor(ui) {
  24004. this.ui = ui;
  24005. }
  24006. updateSelf(index, sameDay, curDayIndex) {
  24007. let data = cfgTable.signData[index + 1];
  24008. this.ui.titleTxt.text = data.title;
  24009. let arr1 = data.award[0].split('-');
  24010. let arr2 = data.award[1].split('-');
  24011. let num1 = parseInt(arr1[1]);
  24012. let num2 = parseInt(arr2[1]);
  24013. this.ui.numTxt1.text = num1 + "";
  24014. this.ui.numTxt2.text = num2 + "";
  24015. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  24016. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  24017. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  24018. this.ui.numTxt1.visible = false;
  24019. }
  24020. else {
  24021. this.ui.numTxt1.visible = true;
  24022. }
  24023. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  24024. this.ui.numTxt2.visible = false;
  24025. }
  24026. else {
  24027. this.ui.numTxt2.visible = true;
  24028. }
  24029. if (index < curDayIndex) {
  24030. this.ui.c1.selectedIndex = 1;
  24031. }
  24032. else if (index == curDayIndex) {
  24033. if (sameDay) {
  24034. this.ui.c1.selectedIndex = 2;
  24035. }
  24036. else {
  24037. this.ui.c1.selectedIndex = 2;
  24038. }
  24039. }
  24040. else {
  24041. this.ui.c1.selectedIndex = 0;
  24042. }
  24043. }
  24044. }
  24045. class SignNormal$1 {
  24046. constructor(ui) {
  24047. this.ui = ui;
  24048. }
  24049. updateSelf(index, sameDay, curDayIndex) {
  24050. let data = cfgTable.signData[index + 1];
  24051. this.ui.titleTxt.text = data.title;
  24052. let arr = data.award[0].split('-');
  24053. let type = parseInt(arr[0]);
  24054. let num = parseInt(arr[1]);
  24055. this.ui.numTxt.text = num + "";
  24056. if (type > 2) {
  24057. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  24058. this.ui.myIcon.rotation = 0;
  24059. }
  24060. else {
  24061. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  24062. this.ui.myIcon.rotation = 0;
  24063. }
  24064. if (xGame.common.signAwardContainsRod(data.award)) {
  24065. this.ui.numTxt.visible = false;
  24066. }
  24067. else {
  24068. this.ui.numTxt.visible = true;
  24069. }
  24070. if (index < curDayIndex) {
  24071. this.ui.c1.selectedIndex = 1;
  24072. }
  24073. else if (index == curDayIndex) {
  24074. if (sameDay) {
  24075. this.ui.c1.selectedIndex = 2;
  24076. }
  24077. else {
  24078. this.ui.c1.selectedIndex = 2;
  24079. }
  24080. }
  24081. else {
  24082. this.ui.c1.selectedIndex = 0;
  24083. }
  24084. }
  24085. }
  24086. class UISign$1 extends UIBase {
  24087. constructor() {
  24088. super();
  24089. this.curDayIndex = 0;
  24090. this.starX = 0;
  24091. }
  24092. onConstructor() {
  24093. this.ui = ui_UISign.createInstance();
  24094. this.contentPane = this.ui;
  24095. this.isEject = false;
  24096. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24097. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  24098. this.initSignItem();
  24099. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  24100. this.addUIClick(this.ui.againBtn, this.againGetAward);
  24101. }
  24102. show() {
  24103. super.show();
  24104. this.ui.t0.play();
  24105. this.playSecretaryIdle();
  24106. this.updateSign();
  24107. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  24108. this.setGlobalFont(this.ui);
  24109. }
  24110. initSignItem() {
  24111. this.signArr = [];
  24112. for (let index = 0; index < 6; index++) {
  24113. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  24114. this.signArr.push(temp);
  24115. }
  24116. this.signMax = new SignMax$1(this.ui.myNode.day7);
  24117. if (Moyu.isKs)
  24118. this.ui.closeNode.closeBtn.x += 100;
  24119. }
  24120. updateSign() {
  24121. let sameDay = xGame.common.judgeSameDay();
  24122. let max = 7;
  24123. this.curDayIndex = DataMgr.getSignData();
  24124. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  24125. this.curDayIndex = 0;
  24126. if (!sameDay) {
  24127. this.ui.normalBtn.visible = true;
  24128. this.ui.tipsNode.visible = false;
  24129. this.ui.againBtn.visible = false;
  24130. }
  24131. else {
  24132. this.ui.normalBtn.visible = false;
  24133. let again = DataMgr.getExtraSign();
  24134. let isCurrency = false;
  24135. let index = this.curDayIndex;
  24136. if (index == 0)
  24137. index = 7;
  24138. let award = cfgTable.signData[index].award;
  24139. let num = award[0].split("-")[0];
  24140. if (num == "1" || num == "2")
  24141. isCurrency = true;
  24142. let showAgain = again == 0 && isCurrency;
  24143. this.ui.againBtn.visible = showAgain;
  24144. this.ui.tipsNode.visible = !showAgain;
  24145. }
  24146. for (let index = 0; index < this.signArr.length; index++) {
  24147. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  24148. }
  24149. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  24150. }
  24151. playSecretaryIdle() {
  24152. let parent = this.ui.secretary.displayObject;
  24153. parent.destroyChildren();
  24154. let xx = this.ui.secretary.width / 2;
  24155. let yy = this.ui.secretary.height;
  24156. let scale = xGame.common.getSecretaryScale();
  24157. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24158. xGame.common.secretary.play(data, 0, true, parent);
  24159. }
  24160. closeSelf() {
  24161. this.hide();
  24162. }
  24163. normalGetAward() {
  24164. let sameDay = xGame.common.judgeSameDay();
  24165. if (!sameDay) {
  24166. let award = cfgTable.signData[this.curDayIndex + 1].award;
  24167. let temp;
  24168. let type;
  24169. let num;
  24170. let arr = [];
  24171. for (let index = 0; index < award.length; index++) {
  24172. temp = award[index].split("-");
  24173. type = parseInt(temp[0]);
  24174. num = parseInt(temp[1]);
  24175. let awardType = new AwardType();
  24176. awardType.num = num;
  24177. awardType.type = type;
  24178. arr.push(awardType);
  24179. }
  24180. xGame.common.getAward(arr, (watchVideo) => {
  24181. this.curDayIndex++;
  24182. if (this.curDayIndex > 7)
  24183. this.curDayIndex = 0;
  24184. DataMgr.setSignData(this.curDayIndex);
  24185. this.updateSignData2Server(this.curDayIndex);
  24186. DataMgr.setSignTime(new Date().getTime());
  24187. if (watchVideo) {
  24188. DataMgr.setExtraSign(1);
  24189. Moyu.sendDataEvent("signIn1");
  24190. }
  24191. this.updateSign();
  24192. });
  24193. }
  24194. }
  24195. againGetAward() {
  24196. Moyu.sendDataEvent("signIn2");
  24197. console.log('zh:qjff_AD_for_uisign');
  24198. if (Laya.Browser.onAndroid) {
  24199. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24200. if (!boo) {
  24201. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24202. return;
  24203. }
  24204. }
  24205. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  24206. }
  24207. else {
  24208. console.log('zh:AD 失败,直接发放奖励');
  24209. this.qjff_AD_for_uisign();
  24210. }
  24211. }
  24212. qjff_AD_for_uisign() {
  24213. let index = this.curDayIndex;
  24214. if (index == 0)
  24215. index = 7;
  24216. let award = cfgTable.signData[index].award;
  24217. let temp;
  24218. let type;
  24219. let num;
  24220. for (let index = 0; index < award.length; index++) {
  24221. temp = award[index].split("-");
  24222. type = parseInt(temp[0]);
  24223. num = parseInt(temp[1]) * 3;
  24224. xGame.common.playObjFlyAnim(num, type);
  24225. }
  24226. DataMgr.setExtraSign(1);
  24227. this.updateSign();
  24228. }
  24229. updateSignData2Server(day) {
  24230. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24231. if (userInfo == null) {
  24232. return;
  24233. }
  24234. let reqData = xGame.httpMgr.getReqData();
  24235. let pd = JSON.parse(reqData);
  24236. pd.signData = day;
  24237. reqData = JSON.stringify(pd);
  24238. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  24239. try {
  24240. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  24241. let code = res.code;
  24242. let msg = res.msg;
  24243. if (code == 401) {
  24244. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24245. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24246. return;
  24247. }
  24248. if (code == 200) {
  24249. let data = res.data;
  24250. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  24251. }
  24252. else {
  24253. xGame.uiMgr.Show(UIMsg$1, msg);
  24254. }
  24255. }
  24256. catch (error) {
  24257. console.log('error=' + error);
  24258. alert(error);
  24259. }
  24260. finally {
  24261. }
  24262. });
  24263. }
  24264. }
  24265. UISign$1.uiName = "UISign";
  24266. class UIModeSelection$1 extends UIBase {
  24267. constructor() {
  24268. super();
  24269. }
  24270. onConstructor() {
  24271. this.ui = ui_UIModeSelection.createInstance();
  24272. this.contentPane = this.ui;
  24273. this.isEject = false;
  24274. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  24275. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  24276. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  24277. this.addUIClick(this.ui.closeBtn, this.hide);
  24278. this.peopleArr = [65, 990, 580];
  24279. this.peopleOffest = [5, 10, 10];
  24280. }
  24281. show(callback) {
  24282. this.updateSelf();
  24283. super.show();
  24284. this.ui.t0.play();
  24285. this.callback = callback;
  24286. this.setGlobalFont(this.ui);
  24287. }
  24288. updateSelf() {
  24289. let cfg = cfgTable.modeselectData;
  24290. for (let index = 1; index <= 3; index++) {
  24291. let node = this.ui.myNode["type" + index];
  24292. node.need.text = cfg[index].need;
  24293. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  24294. node.peopleTxt.text = this.getRandPeople(index - 1);
  24295. }
  24296. }
  24297. enterGame(type) {
  24298. console.log('zh: 进入经典模式 type: ' + type);
  24299. xGame.common.classicRoomType = type;
  24300. let cfg = cfgTable.modeselectData[type];
  24301. let need = cfg.need;
  24302. xGame.common.passAwardCoin = cfg.award;
  24303. if (DataMgr.coinEnough(need)) {
  24304. DataMgr.setCoin(-need);
  24305. this.ui.myNode["type" + type].t0.play();
  24306. Laya.timer.once(200, this, () => {
  24307. this.callback && this.callback();
  24308. });
  24309. this.logEventForClassic_start();
  24310. }
  24311. else {
  24312. Moyu.sendDataEvent("AddCoinVideo");
  24313. xGame.uiMgr.Show(UIAddProp$1, 0);
  24314. }
  24315. }
  24316. getRandPeople(index) {
  24317. let rand = this.peopleOffest[index];
  24318. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  24319. }
  24320. logEventForClassic_start() {
  24321. let rtype = xGame.common.classicRoomType;
  24322. let msmc = '';
  24323. if (rtype == 1) {
  24324. msmc = 'beginner';
  24325. }
  24326. if (rtype == 2) {
  24327. msmc = 'expert';
  24328. }
  24329. if (rtype == 3) {
  24330. msmc = 'master';
  24331. }
  24332. let keyStr = 'sjmd_classic_start_' + rtype;
  24333. let jsonStr = {
  24334. "difficulty": msmc,
  24335. "classic_count": 1,
  24336. "difficulty_count": 1
  24337. };
  24338. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24339. const d = LocalStorageManager.getItem(keyStr);
  24340. jsonStr.classic_count = d.classic_count + 1;
  24341. jsonStr.difficulty_count = d.difficulty_count + 1;
  24342. LocalStorageManager.setItem(keyStr, jsonStr);
  24343. }
  24344. else {
  24345. LocalStorageManager.setItem(keyStr, jsonStr);
  24346. }
  24347. const reqStr = JSON.stringify(jsonStr);
  24348. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  24349. }
  24350. }
  24351. UIModeSelection$1.uiName = "UIModeSelection";
  24352. class UILogin$1 extends UIBase {
  24353. constructor() {
  24354. super();
  24355. this.fontStr = 'big-john-woff2-2';
  24356. try {
  24357. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24358. console.log("zh: constructor加载arial字体成功");
  24359. }
  24360. catch (error) {
  24361. console.log("zh: constructor加载arial字体失败");
  24362. }
  24363. }
  24364. onFontLoaded() {
  24365. try {
  24366. Laya.Text.defaultFont = this.fontStr;
  24367. this.ui.txt_ua.font = this.fontStr;
  24368. this.ui.txt_up.font = this.fontStr;
  24369. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24370. }
  24371. catch (error) {
  24372. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24373. }
  24374. }
  24375. onConstructor() {
  24376. this.ui = ui_UILogin.createInstance();
  24377. this.contentPane = this.ui;
  24378. this.isEject = false;
  24379. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24380. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  24381. this.addUIClick(this.ui.btn_login, this.userLogin);
  24382. }
  24383. show() {
  24384. super.show();
  24385. this.x = (Laya.stage.width - this.width) / 2;
  24386. this.y = (Laya.stage.height - this.height) / 2;
  24387. this.onFontLoaded();
  24388. }
  24389. closeSelf() {
  24390. this.hide();
  24391. }
  24392. userLogin() {
  24393. let ua = this.ui.txt_ua.text;
  24394. let up = this.ui.txt_up.text;
  24395. console.log('zh:ua font' + this.ui.txt_ua.font);
  24396. if (ua && up) {
  24397. let reqData = JSON.stringify({
  24398. username: ua.trim(),
  24399. password: up.trim(),
  24400. fromMark: 'app_game'
  24401. });
  24402. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  24403. try {
  24404. console.log('zh:res = ' + JSON.stringify(res));
  24405. let code = res.code;
  24406. let msg = res.msg;
  24407. if (code == 200) {
  24408. let keyStr = keyForLoginInfo;
  24409. let jsonStr = {
  24410. "username": res.username,
  24411. "token": res.token,
  24412. "buySpids": { 1: false, 7: false }
  24413. };
  24414. LocalStorageManager.setItem(keyStr, jsonStr);
  24415. let myu = Moyu.getUserInfo();
  24416. console.log('zh:myu = ' + JSON.stringify(myu));
  24417. DataMgr.updateUserNickName(res.username);
  24418. Moyu.updateUserInfo(res.username);
  24419. xGame.uiMgr.Show(UIMsg$1, msg);
  24420. DataMgr.loadUserSpOrderForAd();
  24421. DataMgr.getUserZiChanInfo(false);
  24422. xGame.eventMgr.event(LOGIN_IN);
  24423. this.closeSelf();
  24424. }
  24425. else {
  24426. xGame.uiMgr.Show(UIMsg$1, msg);
  24427. }
  24428. }
  24429. catch (error) {
  24430. console.log('error=' + error);
  24431. alert(error);
  24432. }
  24433. finally {
  24434. }
  24435. });
  24436. }
  24437. else {
  24438. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24439. }
  24440. }
  24441. gotoRegPage() {
  24442. this.closeSelf();
  24443. xGame.uiMgr.Show(UIReg$1);
  24444. }
  24445. }
  24446. UILogin$1.uiName = "UILogin";
  24447. class UIReg$1 extends UIBase {
  24448. constructor() {
  24449. super();
  24450. this.fontStr = 'big-john-woff2-2';
  24451. try {
  24452. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24453. console.log("zh: constructor加载arial字体成功");
  24454. }
  24455. catch (error) {
  24456. console.log("zh: constructor加载arial字体失败");
  24457. }
  24458. }
  24459. onFontLoaded() {
  24460. try {
  24461. Laya.Text.defaultFont = this.fontStr;
  24462. this.ui.txt_ua.font = this.fontStr;
  24463. this.ui.txt_up1.font = this.fontStr;
  24464. this.ui.txt_up2.font = this.fontStr;
  24465. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24466. }
  24467. catch (error) {
  24468. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24469. }
  24470. }
  24471. onConstructor() {
  24472. this.ui = ui_UIReg.createInstance();
  24473. this.contentPane = this.ui;
  24474. this.isEject = false;
  24475. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24476. this.addUIClick(this.ui.btn_reg, this.regUser);
  24477. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  24478. }
  24479. show() {
  24480. super.show();
  24481. this.x = (Laya.stage.width - this.width) / 2;
  24482. this.y = (Laya.stage.height - this.height) / 2;
  24483. this.onFontLoaded();
  24484. }
  24485. closeSelf() {
  24486. this.hide();
  24487. }
  24488. regUser() {
  24489. this.ui.lab_tip.visible = false;
  24490. let ua = this.ui.txt_ua.text;
  24491. let up1 = this.ui.txt_up1.text;
  24492. let up2 = this.ui.txt_up2.text;
  24493. if (ua && up1 && up2 && up1 == up2) {
  24494. let reqData = JSON.stringify({
  24495. username: ua.trim(),
  24496. password: up1.trim(),
  24497. fromMark: 'app_game'
  24498. });
  24499. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  24500. try {
  24501. console.log('zh:res = ' + JSON.stringify(res));
  24502. let code = res.code;
  24503. let msg = res.msg;
  24504. xGame.uiMgr.Show(UIMsg$1, msg);
  24505. if (code == 200) {
  24506. this.ui.lab_tip.color = "#FFFFFF";
  24507. xGame.uiMgr.Show(UIMsg$1, msg);
  24508. this.closeSelf();
  24509. }
  24510. else {
  24511. this.ui.lab_tip.color = "#FF0000";
  24512. xGame.uiMgr.Show(UIMsg$1, msg);
  24513. }
  24514. }
  24515. catch (error) {
  24516. console.log('error=' + error);
  24517. alert(error);
  24518. }
  24519. finally {
  24520. }
  24521. });
  24522. }
  24523. else {
  24524. if (up1 != up2) {
  24525. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  24526. }
  24527. else {
  24528. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24529. }
  24530. }
  24531. }
  24532. gotoLogin() {
  24533. this.closeSelf();
  24534. xGame.uiMgr.Show(UILogin$1);
  24535. }
  24536. }
  24537. UIReg$1.uiName = "UIReg";
  24538. class UITry$1 extends UIBase {
  24539. constructor() {
  24540. super();
  24541. this.closeTime = 0;
  24542. this.closeNum = 0;
  24543. this.skillUrl = xGame.common.skillIconList;
  24544. }
  24545. onConstructor() {
  24546. this.ui = ui_UITry.createInstance();
  24547. this.contentPane = this.ui;
  24548. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24549. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24550. }
  24551. show() {
  24552. super.show();
  24553. this.closeNum = 0;
  24554. this.closeTime = 15;
  24555. this.ui.t0.play();
  24556. PlatMgr.showRateBanner();
  24557. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24558. Laya.timer.loop(1000, this, this.updateTime);
  24559. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24560. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24561. xGame.common.gameMgr.gamePause = true;
  24562. this.setGlobalFont(this.ui);
  24563. }
  24564. updateTime() {
  24565. if (this.closeTime > 1) {
  24566. this.closeTime--;
  24567. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24568. }
  24569. else
  24570. this.hide();
  24571. }
  24572. hide() {
  24573. Laya.timer.clearAll(this);
  24574. Moyu.showBannerAd(false);
  24575. super.hide();
  24576. xGame.common.gameMgr.gamePause = false;
  24577. }
  24578. onTry() {
  24579. console.log('zh:qjff_AD_for_uitry');
  24580. if (Laya.Browser.onAndroid) {
  24581. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24582. if (!boo) {
  24583. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24584. return;
  24585. }
  24586. }
  24587. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24588. }
  24589. else {
  24590. console.log('zh:AD 失败,直接发放奖励');
  24591. this.qjff_AD_for_uitry();
  24592. }
  24593. }
  24594. qjff_AD_for_uitry() {
  24595. let select = xGame.common.curPlayerSkillType;
  24596. DataMgr.gameData.trySkill = select;
  24597. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24598. DataMgr.saveGameData();
  24599. DataMgr.setBigSkill(select, 1);
  24600. xGame.showTip("Trial Successful");
  24601. this.hide();
  24602. }
  24603. onCancel() {
  24604. if (this.closeNum > 0) {
  24605. this.closeNum--;
  24606. if (this.closeNum < 2)
  24607. this.hide();
  24608. return;
  24609. }
  24610. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24611. this.onTry();
  24612. }
  24613. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24614. this.closeNum = 3;
  24615. }
  24616. else
  24617. this.hide();
  24618. }
  24619. }
  24620. UITry$1.uiName = "UITry";
  24621. class UIGetAward$1 extends UIBase {
  24622. constructor() {
  24623. super();
  24624. this.showTriple = true;
  24625. }
  24626. onConstructor() {
  24627. this.ui = ui_UIGetAward.createInstance();
  24628. this.contentPane = this.ui;
  24629. this.isEject = false;
  24630. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24631. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24632. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24633. }
  24634. show(arr, showTriple, callback) {
  24635. super.show();
  24636. this.ui.t0.play();
  24637. this.ui.eftNode.visible = true;
  24638. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24639. this.ui.eftNode.visible = false;
  24640. }), 1, 0, 0, 0.9);
  24641. this.awardArr = arr;
  24642. this.showTriple = showTriple;
  24643. this.callback = callback;
  24644. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24645. this.ui.myList.numItems = arr.length;
  24646. xGame.soundMgr.playSound("getaward");
  24647. this.setGlobalFont(this.ui);
  24648. }
  24649. updateSelf(index, obj) {
  24650. let temp = this.awardArr[index];
  24651. let icon = this.getIcon(temp.type);
  24652. let str = icon;
  24653. if (temp.type > 2) {
  24654. str = "s" + icon;
  24655. }
  24656. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24657. obj.myIcon.rotation = 0;
  24658. obj.numTxt.text = temp.num + "";
  24659. obj.numTxt.visible = temp.type > 2 ? false : true;
  24660. obj.nameTxt.text = this.getNameStr(temp.type);
  24661. }
  24662. renderItem(index, obj) {
  24663. this.updateSelf(index, obj);
  24664. }
  24665. tripleGetAward() {
  24666. console.log('zh:qjff_AD_for_uigetAward');
  24667. if (Laya.Browser.onAndroid) {
  24668. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24669. if (!boo) {
  24670. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24671. return;
  24672. }
  24673. }
  24674. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24675. }
  24676. else {
  24677. console.log('zh:AD 失败,直接发放奖励');
  24678. this.qjff_AD_for_uigetAward();
  24679. }
  24680. }
  24681. qjff_AD_for_uigetAward() {
  24682. this.getAward(3);
  24683. }
  24684. normalGetAward() {
  24685. if (PlatMgr.isMisVideo())
  24686. this.tripleGetAward();
  24687. else
  24688. this.getAward();
  24689. }
  24690. getAward(times = 1) {
  24691. this.hide();
  24692. for (let index = 0; index < this.awardArr.length; index++) {
  24693. this.awardArr[index].num *= times;
  24694. }
  24695. this.callback && this.callback(times != 1);
  24696. }
  24697. getIcon(type) {
  24698. switch (type) {
  24699. case Prop.diamond:
  24700. return "ty_zs";
  24701. case Prop.coin:
  24702. return "ty_jb";
  24703. case Prop.gan1:
  24704. return "qg1";
  24705. case Prop.gan2:
  24706. return "qg2";
  24707. case Prop.gan3:
  24708. return "qg3";
  24709. case Prop.gan4:
  24710. return "qg4";
  24711. default:
  24712. break;
  24713. }
  24714. }
  24715. getNameStr(type) {
  24716. switch (type) {
  24717. case Prop.diamond:
  24718. return "Diamond";
  24719. case Prop.coin:
  24720. return "Coins";
  24721. case Prop.gan1:
  24722. case Prop.gan2:
  24723. case Prop.gan3:
  24724. case Prop.gan4:
  24725. return cfgTable.ballrodData[type - 1].name;
  24726. default:
  24727. break;
  24728. }
  24729. }
  24730. }
  24731. UIGetAward$1.uiName = "UIGetAward";
  24732. class UIBox$1 extends UIBase {
  24733. constructor() {
  24734. super();
  24735. this.boxNum = 0;
  24736. this.boxMax = 10;
  24737. this.inAd = false;
  24738. this.isClose = false;
  24739. }
  24740. onConstructor() {
  24741. this.ui = ui_UIBox.createInstance();
  24742. this.contentPane = this.ui;
  24743. this.isEject = false;
  24744. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24745. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24746. Laya.timer.loop(1000, this, this.update);
  24747. }
  24748. update() {
  24749. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24750. this.boxNum -= 1;
  24751. this.upBar();
  24752. }
  24753. }
  24754. upBar() {
  24755. if (this.boxNum > this.boxMax)
  24756. this.boxNum = this.boxMax;
  24757. this.ui.bar.value = this.boxNum * 10;
  24758. }
  24759. show() {
  24760. super.show();
  24761. this.isClose = false;
  24762. this.boxNum = 0;
  24763. this.inAd = false;
  24764. this.upBar();
  24765. this.ui.t0.play();
  24766. this.ui.closeBtn.visible = false;
  24767. Laya.timer.once(3000, this, () => {
  24768. this.ui.closeBtn.visible = true;
  24769. this.ui.bar.alpha = 1;
  24770. });
  24771. Laya.timer.once(500, this, () => {
  24772. this.ui.t1.play();
  24773. });
  24774. this.setGlobalFont(this.ui);
  24775. }
  24776. hide() {
  24777. Laya.timer.clearAll(this);
  24778. Moyu.showBannerAd(false);
  24779. super.hide();
  24780. }
  24781. onOpenBox() {
  24782. this.boxNum++;
  24783. if (this.boxNum < this.boxMax) {
  24784. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24785. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24786. }
  24787. }
  24788. else if (this.boxNum == this.boxMax) {
  24789. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24790. this.ui.openBtn.c1.selectedIndex = 13;
  24791. this.inAd = true;
  24792. }
  24793. else
  24794. this.getAward();
  24795. }
  24796. else if (this.inAd) {
  24797. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24798. if (Laya.Browser.onAndroid) {
  24799. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24800. if (!boo) {
  24801. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24802. return;
  24803. }
  24804. }
  24805. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24806. }
  24807. else {
  24808. console.log('zh:AD 失败,直接发放奖励');
  24809. this.qjff_AD_for_UIBOX_onOpenBox();
  24810. }
  24811. }
  24812. this.upBar();
  24813. }
  24814. qjff_AD_for_UIBOX_onOpenBox() {
  24815. this.getAward();
  24816. }
  24817. onCloseBox() {
  24818. if (this.isClose)
  24819. this.hide();
  24820. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24821. this.isClose = true;
  24822. PlatMgr.showBanner(true, 0, 3000);
  24823. }
  24824. else
  24825. this.hide();
  24826. }
  24827. getAward() {
  24828. let str = "";
  24829. if (Math.random() < 0.5) {
  24830. let max = Moyu.isLegal ? 500 : 2500;
  24831. let num = xGame.tools.random(max, 500 + max);
  24832. DataMgr.setCoin(num);
  24833. str = "金币x" + num;
  24834. }
  24835. else {
  24836. let max = Moyu.isLegal ? 10 : 30;
  24837. let num = xGame.tools.random(max, 30 + max);
  24838. DataMgr.setDiamond(num);
  24839. str = "钻石x" + num;
  24840. }
  24841. xGame.showTip("恭喜获得-" + str);
  24842. this.hide();
  24843. }
  24844. }
  24845. UIBox$1.uiName = "UIBox";
  24846. class UIMain$1 extends UIBase {
  24847. constructor() {
  24848. super();
  24849. this.firstEnter = true;
  24850. this.moni_click_count = 0;
  24851. }
  24852. nativeCallJs(msg) {
  24853. let t = msg;
  24854. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24855. switch (t) {
  24856. case 'qjff_chouJiang':
  24857. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24858. dui.qjff_chouJiang();
  24859. break;
  24860. case 'qjff_AD_for_uisign':
  24861. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24862. dui2.qjff_AD_for_uisign();
  24863. break;
  24864. case 'qjff_AD_for_uitry':
  24865. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24866. dui3.qjff_AD_for_uitry();
  24867. break;
  24868. case 'qjff_AD_for_uipower':
  24869. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24870. dui4.qjff_AD_for_uipower();
  24871. break;
  24872. case 'qjff_AD_for_uigetAward':
  24873. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24874. dui5.qjff_AD_for_uigetAward();
  24875. break;
  24876. case 'qjff_AD_for_uiGameEnd':
  24877. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24878. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24879. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24880. break;
  24881. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24882. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24883. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24884. break;
  24885. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24886. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24887. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24888. break;
  24889. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24890. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24891. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24892. break;
  24893. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24894. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24895. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24896. break;
  24897. case 'qjff_AD_for_UIBOX_onOpenBox':
  24898. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24899. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24900. break;
  24901. case 'qjff_AD_for_UIAddCoin':
  24902. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24903. dui12.qjff_AD_for_UIAddCoin();
  24904. break;
  24905. case 'app_sign_for_buyProduct_onSuccess':
  24906. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24907. DataMgr.getUserZiChanInfo(false);
  24908. break;
  24909. case '222axxxxxx':
  24910. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24911. dui15.qjff_AD_for_uisign();
  24912. break;
  24913. case '333axsxxxxxx':
  24914. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24915. dui16.qjff_AD_for_uisign();
  24916. break;
  24917. default:
  24918. console.log('zh:未知的方法名字' + t);
  24919. break;
  24920. }
  24921. }
  24922. onConstructor() {
  24923. console.log('zh: UIMain onConstructor');
  24924. this.ui = ui_UIMain.createInstance();
  24925. this.contentPane = this.ui;
  24926. this.isEject = false;
  24927. this.addEvent();
  24928. this.addClickSpine();
  24929. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24930. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24931. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24932. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24933. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24934. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24935. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24936. xGame.eventMgr.on("gameConfigReadyMark", this, this.event_gameConfigReadyMark);
  24937. let curUse = DataMgr.getCurSecretary();
  24938. this.changeSecretary(curUse);
  24939. this.ui.talkNode.visible = false;
  24940. let guide = 1;
  24941. if (DataMgr.getGuideDefaultModel() === 1) {
  24942. guide = DataMgr.getLianXiGuide();
  24943. }
  24944. else {
  24945. guide = DataMgr.getSkillGuide();
  24946. }
  24947. if (xGame.common.isNewDay && guide == 1) {
  24948. xGame.common.isNewDay = false;
  24949. xGame.soundMgr.playSound("s_main01");
  24950. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24951. console.log("zh:播放小秘书每天语音");
  24952. }
  24953. this.onGetUserInfo();
  24954. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24955. DataMgr.getUserZiChanInfo(false);
  24956. }
  24957. this.ui.n83.visible = false;
  24958. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24959. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24960. let ua = d.username;
  24961. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24962. }
  24963. this.c_btn_for_user();
  24964. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24965. }
  24966. Logout() {
  24967. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24968. LocalStorageManager.removeItem(keyForLoginInfo);
  24969. this.freshUser();
  24970. }
  24971. JSBridgeUtils.instance.loginOutForApp();
  24972. this.setUserDefaultNickname();
  24973. DataMgr.setCoin2(4000);
  24974. DataMgr.setDiamond2(0);
  24975. this.setDefaultQiuGanInfo();
  24976. DataMgr.setPlaceBallLevelList("");
  24977. DataMgr.setChallengeMode_overLev(1);
  24978. this.setDefaultSignData();
  24979. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24980. DataMgr.setCurBallRod(5);
  24981. }
  24982. setDefaultSignData() {
  24983. DataMgr.setSignData(1);
  24984. DataMgr.setSignTime(new Date().getTime());
  24985. }
  24986. setDefaultQiuGanInfo() {
  24987. DataMgr.setBallRod(0, 1);
  24988. DataMgr.setBallRod(1, 0);
  24989. DataMgr.setBallRod(2, 0);
  24990. DataMgr.setBallRod(3, 0);
  24991. DataMgr.setBallRod(4, 0);
  24992. DataMgr.setBallRod(5, 1);
  24993. }
  24994. setUserDefaultNickname() {
  24995. let defUsername = "player";
  24996. this.ui.headNode.nameTxt.text = defUsername;
  24997. DataMgr.updateUserNickName(defUsername);
  24998. Moyu.updateUserInfo(defUsername);
  24999. }
  25000. gotoLogin() {
  25001. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  25002. xGame.uiMgr.Show(UILogin$1);
  25003. }
  25004. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  25005. this.Logout();
  25006. }
  25007. }
  25008. gotoRegUser() {
  25009. xGame.uiMgr.Show(UIReg$1);
  25010. }
  25011. showFuLiSp1() {
  25012. console.log('zh:福利1');
  25013. DataMgr.checkForShowFuLi17AndAlert(1);
  25014. }
  25015. showFuLiSp7() {
  25016. console.log('zh:福利7');
  25017. DataMgr.checkForShowFuLi17AndAlert(7);
  25018. }
  25019. c_btn_for_user() {
  25020. this.ui.n_dengLu.c1.selectedIndex = 0;
  25021. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  25022. this.ui.n_dengLu.c1.selectedIndex = 1;
  25023. }
  25024. else {
  25025. this.ui.n_dengLu.c1.selectedIndex = 0;
  25026. }
  25027. }
  25028. changeSecretary(curUse) {
  25029. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  25030. xGame.common.secretary && xGame.common.secretary.dispose();
  25031. this.addSecretarySpine(name);
  25032. }
  25033. addSecretarySpine(name) {
  25034. let spine = new SpineMgr(name, () => {
  25035. this.playSecretaryIdle();
  25036. });
  25037. xGame.common.secretary = spine;
  25038. }
  25039. addClickSpine() {
  25040. let clickSpine = new SpineMgr("dianji", () => {
  25041. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  25042. let parent = Laya.stage;
  25043. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  25044. clickSpine.play(data, 0, false, parent, (spine) => {
  25045. spine.destroy(true);
  25046. });
  25047. });
  25048. });
  25049. }
  25050. addEvent() {
  25051. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  25052. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  25053. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  25054. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  25055. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  25056. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  25057. this.addUIClick(this.ui, this.interuptSecretary);
  25058. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  25059. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  25060. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  25061. this.addUIClick(this.ui.shopBtn, this.openShopView);
  25062. this.addUIClick(this.ui.signBtn, this.openSignView);
  25063. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  25064. this.addUIClick(this.ui.rankBtn, this.openRanking);
  25065. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  25066. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  25067. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  25068. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  25069. }
  25070. show(showFailWords) {
  25071. super.show();
  25072. DataMgr.loadUserSpOrderForAd();
  25073. this.moneyNode.ui.c1.selectedIndex = 1;
  25074. this.playSecretaryIdle();
  25075. xGame.soundMgr.playMusic("caromhall01", 0);
  25076. Laya.timer.clearAll(this);
  25077. this.playSecretaryRandomSound();
  25078. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  25079. if (showFailWords) {
  25080. console.log('zh:uimain.ts ');
  25081. setTimeout(() => {
  25082. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  25083. let words = -1;
  25084. if (str == "s_main02") {
  25085. words = 2;
  25086. }
  25087. else {
  25088. words = 3;
  25089. }
  25090. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25091. xGame.soundMgr.playSound(str);
  25092. }, 300);
  25093. }
  25094. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  25095. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  25096. let isGuideOver = false;
  25097. let randTime = xGame.common.randomNum(300, 800);
  25098. if (DataMgr.getGuideDefaultModel() === 1) {
  25099. let guide = DataMgr.getLianXiGuide();
  25100. if (guide == 1) {
  25101. isGuideOver = true;
  25102. this.ui.n_yd_lxms_1.visible = false;
  25103. this.firstEnter = false;
  25104. }
  25105. }
  25106. else {
  25107. let guide = DataMgr.getSkillGuide();
  25108. if (guide == 1) {
  25109. isGuideOver = true;
  25110. if (this.firstEnter) {
  25111. console.log("zh: firstEnter");
  25112. this.firstEnter = false;
  25113. randTime += 900;
  25114. }
  25115. else {
  25116. console.log("zh: no firstEnter");
  25117. }
  25118. }
  25119. }
  25120. if (isGuideOver) {
  25121. Laya.timer.once(randTime, this, () => {
  25122. });
  25123. Laya.timer.once(1000, this, () => {
  25124. console.log('zh: 1秒后 showFuLiSp7');
  25125. this.showFuLiSp7();
  25126. });
  25127. this.showTipForGuest();
  25128. }
  25129. this.setGlobalFont(this.ui);
  25130. }
  25131. event_gameConfigReadyMark() {
  25132. console.log('zh:事件触发,配置加载OK');
  25133. if (DataMgr.getGuideDefaultModel() === 1) {
  25134. this.showGuideForLianxi();
  25135. }
  25136. else {
  25137. this.showGuide();
  25138. }
  25139. }
  25140. showGuideForLianxi() {
  25141. let lianXiGuide = DataMgr.getLianXiGuide();
  25142. if (lianXiGuide == 0) {
  25143. let x = this.ui.placeBallBtn.x;
  25144. let y = this.ui.placeBallBtn.y;
  25145. this.ui.n_yd_lxms_1.visible = true;
  25146. this.ui.n_yd_challenge_1_hand.x = x + 150;
  25147. this.ui.n_yd_challenge_1_hand.y = y;
  25148. this.ui.n_yd_challenge_1_btn.x = x;
  25149. this.ui.n_yd_challenge_1_btn.y = y;
  25150. console.log('zh:yinDaoForLianxi set ok');
  25151. }
  25152. else {
  25153. this.ui.n_yd_lxms_1.visible = false;
  25154. }
  25155. }
  25156. showTipForGuest() {
  25157. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  25158. if (userInfo == null) {
  25159. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  25160. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  25161. let woman = "this is an important notice.";
  25162. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  25163. return;
  25164. }
  25165. }
  25166. checkActive(show) {
  25167. }
  25168. showGuide() {
  25169. let guide = DataMgr.getSkillGuide();
  25170. this.ui.guideBtn.visible = guide == 0;
  25171. this.ui.enterGuide.visible = false;
  25172. this.ui.secretaryGuide.visible = guide == 0;
  25173. if (guide == 0) {
  25174. console.log("zh:显示引导");
  25175. xGame.soundMgr.playSound("s_guide");
  25176. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25177. }
  25178. else {
  25179. console.log("zh:不需要显示引导");
  25180. }
  25181. }
  25182. ensureSecretary() {
  25183. console.log('zh: ensureSecretary ');
  25184. this.ui.secretaryGuide.visible = false;
  25185. this.ui.enterGuide.visible = true;
  25186. this.ui.wordsNode.t0.play();
  25187. if (DataMgr.getNewUser())
  25188. Moyu.sendDataEvent("gameReady");
  25189. }
  25190. playSecretaryIdle() {
  25191. let parent = this.ui.secretary.displayObject;
  25192. parent.destroyChildren();
  25193. let xx = this.ui.secretary.width / 2;
  25194. let yy = this.ui.secretary.height;
  25195. let scale = xGame.common.getSecretaryScale();
  25196. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  25197. xGame.common.secretary.play(data, 0, true, parent);
  25198. }
  25199. startGame(type) {
  25200. if (!this.isReadyForLoadNetSource()) {
  25201. return;
  25202. }
  25203. xGame.common.gameMode = type;
  25204. Moyu.sendDataEvent("PlayGame", { type: type });
  25205. let gm = xGame.common.gameMode;
  25206. console.log('zh:进入游戏gameMode =' + gm);
  25207. switch (gm) {
  25208. case GameMode.classic:
  25209. console.log('zh:进入经典模式111111111');
  25210. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  25211. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25212. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  25213. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  25214. console.log('zh:判断是否可以玩该模式classic =NO');
  25215. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  25216. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25217. return;
  25218. }
  25219. else {
  25220. console.log('zh:可以玩该模式classic');
  25221. this.beginGame();
  25222. }
  25223. }
  25224. else {
  25225. console.log('zh:不需要判断是否可以玩该classic');
  25226. let challengeTimes = DataMgr.getChallengeTimes();
  25227. if (challengeTimes == 0) {
  25228. xGame.uiMgr.Show(UIInvitation$1);
  25229. }
  25230. else {
  25231. this.beginGame();
  25232. }
  25233. }
  25234. break;
  25235. case GameMode.bigMove:
  25236. console.info('zh:bigMove check 大招');
  25237. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  25238. if (DataMgr.getGuideDefaultModel() === 1) {
  25239. let lianXiGuide = DataMgr.getLianXiGuide();
  25240. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && lianXiGuide == 1) {
  25241. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25242. console.log('zh:bigMove db_over_lev=', db_over_lev);
  25243. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  25244. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25245. return;
  25246. }
  25247. else {
  25248. console.log('zh:可以玩');
  25249. this.beginGame();
  25250. if (DataMgr.getNewUser())
  25251. Moyu.sendDataEvent("gameStart0");
  25252. }
  25253. }
  25254. else {
  25255. this.beginGame();
  25256. if (DataMgr.getNewUser())
  25257. Moyu.sendDataEvent("gameStart0");
  25258. }
  25259. }
  25260. else {
  25261. let guide = DataMgr.getSkillGuide();
  25262. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  25263. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25264. console.log('zh:bigMove db_over_lev=', db_over_lev);
  25265. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  25266. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25267. return;
  25268. }
  25269. else {
  25270. console.log('zh:可以玩');
  25271. this.beginGame();
  25272. if (DataMgr.getNewUser())
  25273. Moyu.sendDataEvent("gameStart0");
  25274. }
  25275. }
  25276. else {
  25277. this.beginGame();
  25278. if (DataMgr.getNewUser())
  25279. Moyu.sendDataEvent("gameStart0");
  25280. }
  25281. }
  25282. break;
  25283. default:
  25284. console.error('zh:未知错误!!!!');
  25285. break;
  25286. }
  25287. }
  25288. beginGame(isNice = false) {
  25289. console.log('zh:beginGame ');
  25290. let guide = 1;
  25291. if (DataMgr.getGuideDefaultModel() === 1) {
  25292. guide = DataMgr.getLianXiGuide();
  25293. }
  25294. else {
  25295. guide = DataMgr.getSkillGuide();
  25296. }
  25297. if (guide == 1) {
  25298. console.log('zh:非新手引导,showInternAd ');
  25299. JSBridgeUtils.instance.showInternAd('beginGame');
  25300. }
  25301. else {
  25302. console.log('zh:新手引导,不显示AD ');
  25303. }
  25304. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  25305. console.log('zh:beginGame 1');
  25306. if (xGame.common.gameMode == GameMode.classic) {
  25307. console.log('zh:beginGame 2');
  25308. if (isNice) {
  25309. console.log('zh:进入巅峰赛');
  25310. this.enterClassic();
  25311. }
  25312. else {
  25313. console.log('zh:beginGame 3-1');
  25314. xGame.uiMgr.Show(UIModeSelection$1, () => {
  25315. console.log('zh:beginGame 3-2');
  25316. this.enterClassic();
  25317. });
  25318. }
  25319. }
  25320. else if (xGame.common.gameMode == GameMode.bigMove) {
  25321. console.log('zh:beginGame 5');
  25322. this.ui.enterGuide.visible = false;
  25323. xGame.uiMgr.Show(UISkill$1);
  25324. }
  25325. }
  25326. enterClassic() {
  25327. console.log('zh:beginGame 7');
  25328. xGame.uiMgr.Show(UIGame$1);
  25329. xGame.uiMgr.Show(UIMatching$1, () => {
  25330. if (!this.isHide)
  25331. this.hide();
  25332. xGame.common.gameUI.ui.alpha = 1;
  25333. console.log('zh:beginGame 8');
  25334. xGame.common.gameUI.startGame();
  25335. xGame.uiMgr.Hide(UIGameEnd$1);
  25336. });
  25337. }
  25338. start_debug_for_moni_payOk() {
  25339. let ccc = this.moni_click_count + 1;
  25340. this.moni_click_count = ccc;
  25341. if (ccc % 5 == 0) {
  25342. console.log('zh:start_debug_for_moni_payOk');
  25343. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  25344. if (userInfo != null) {
  25345. let token = userInfo.token;
  25346. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  25347. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  25348. alert('模拟支付OK');
  25349. return;
  25350. }
  25351. else {
  25352. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  25353. }
  25354. }
  25355. }
  25356. startGlobal() {
  25357. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  25358. }
  25359. startWeekly() {
  25360. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  25361. }
  25362. zhouSaiMonth() {
  25363. console.log('zh: zhouSaiMonth 被调用');
  25364. }
  25365. isReadyForLoadNetSource() {
  25366. let reqCount = xGame.cfgMgr.httpReqCount;
  25367. let ok = xGame.cfgMgr.httpReqOkCount;
  25368. if (reqCount > ok) {
  25369. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  25370. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  25371. Laya.timer.once(5000, this, () => {
  25372. let retryCount = 0;
  25373. const maxRetries = 3;
  25374. const tryFetchConfig = () => {
  25375. try {
  25376. xGame.cfgMgr.getConfigFromServer();
  25377. }
  25378. catch (error) {
  25379. if (retryCount < maxRetries) {
  25380. retryCount++;
  25381. console.log(`🔄 第${retryCount}次重试获取配置...`);
  25382. Laya.timer.once(5000, this, tryFetchConfig);
  25383. }
  25384. else {
  25385. console.error("❌ 达到最大重试次数,配置获取失败");
  25386. }
  25387. }
  25388. };
  25389. tryFetchConfig();
  25390. });
  25391. return false;
  25392. }
  25393. return true;
  25394. }
  25395. startPlaceBall() {
  25396. if (!this.isReadyForLoadNetSource()) {
  25397. return;
  25398. }
  25399. xGame.uiMgr.Show(UILevelDisplay$1);
  25400. }
  25401. hide() {
  25402. console.log('zh:uimain hide ...');
  25403. super.hide();
  25404. xGame.common.stopGirlPop(this.ui.talkNode);
  25405. }
  25406. onGetUserInfo(force = false) {
  25407. if (Moyu.isWx) {
  25408. let info = Moyu.getSystemInfo();
  25409. if (info)
  25410. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  25411. }
  25412. else {
  25413. Moyu.initUser(this, this.freshUser, force);
  25414. }
  25415. this.freshUser();
  25416. console.log('zh:5秒后更新用户信息');
  25417. setTimeout(() => {
  25418. DataMgr.getUserZiChanInfo(true);
  25419. }, 5000);
  25420. }
  25421. event_login_in() {
  25422. console.log("zh:event_login_in被触发");
  25423. this.freshUser();
  25424. }
  25425. freshUser() {
  25426. let user = Moyu.getUserInfo();
  25427. if (!user.isAuth) {
  25428. user.headIcon = 'res/ty_touxiang.png';
  25429. }
  25430. else {
  25431. DataMgr.upRankData();
  25432. }
  25433. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  25434. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  25435. let keyStr = keyForLoginInfo;
  25436. if (LocalStorageManager.hasJosnKey(keyStr)) {
  25437. const d = LocalStorageManager.getItem(keyStr);
  25438. let ua = d.username;
  25439. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  25440. }
  25441. else {
  25442. }
  25443. this.c_btn_for_user();
  25444. }
  25445. interuptSecretary() {
  25446. Laya.timer.clearAll(this);
  25447. this.playSecretaryRandomSound();
  25448. }
  25449. playSecretaryRandomSound() {
  25450. if (this.isHide)
  25451. return;
  25452. let time = xGame.common.randomNum(45000, 60000);
  25453. Laya.timer.once(time, this, () => {
  25454. if (this.isHide)
  25455. return;
  25456. let index = xGame.common.randomNum(4, 7);
  25457. xGame.soundMgr.playSound("s_main0" + index);
  25458. let words = 1;
  25459. switch (index) {
  25460. case 4:
  25461. words = 5;
  25462. break;
  25463. case 5:
  25464. words = 3;
  25465. break;
  25466. case 6:
  25467. words = 6;
  25468. break;
  25469. case 7:
  25470. words = 7;
  25471. break;
  25472. default:
  25473. break;
  25474. }
  25475. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25476. this.playSecretaryRandomSound();
  25477. });
  25478. }
  25479. openSecretaryView() {
  25480. xGame.uiMgr.Show(UISecretary$1);
  25481. Moyu.sendDataEvent("secretary");
  25482. }
  25483. openShopView() {
  25484. xGame.uiMgr.Show(UIShop$1, 1);
  25485. }
  25486. openShopView0() {
  25487. xGame.uiMgr.Show(UIShop$1, 0);
  25488. }
  25489. openSignView() {
  25490. xGame.uiMgr.Show(UISign$1);
  25491. }
  25492. openDrawView() {
  25493. xGame.uiMgr.Show(UIDraw$1);
  25494. }
  25495. openRanking() {
  25496. console.log('zh:phb openRanking');
  25497. xGame.uiMgr.Show(UIRanking$1);
  25498. Moyu.sendDataEvent("rankingList");
  25499. }
  25500. }
  25501. UIMain$1.uiName = "UIMain";
  25502. function InitShader() {
  25503. }
  25504. function appInit() {
  25505. xGame.context.init(getLoadingResList(), initCallback);
  25506. }
  25507. function getLoadingResList() {
  25508. return [
  25509. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  25510. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  25511. ];
  25512. }
  25513. function getGameResList() {
  25514. return [
  25515. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  25516. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  25517. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  25518. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  25519. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  25520. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  25521. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  25522. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  25523. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  25524. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  25525. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  25526. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  25527. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  25528. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  25529. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  25530. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  25531. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  25532. ];
  25533. }
  25534. function initCallback() {
  25535. window["DataMgr"] = DataMgr;
  25536. DataMgr.Init();
  25537. Moyu.init(getPlat(), this, () => {
  25538. DataMgr.isNewDay();
  25539. PlatMgr.initConfig();
  25540. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  25541. }, true);
  25542. console.log('zh:开始sm init1 start');
  25543. xGame.soundMgr.init();
  25544. console.log('zh:开始sm init1 end');
  25545. xGame.uiMgr.init();
  25546. xGame.uiMgr.clearTempData();
  25547. xGame.uiMgr.bindFUI(fguiRes.loading);
  25548. xGame.uiMgr.Show(UILoading);
  25549. }
  25550. function onFontLoaded() {
  25551. try {
  25552. Laya.Text.defaultFont = "arial";
  25553. console.log("zh: onFontLoaded 设置arial字体成功");
  25554. }
  25555. catch (error) {
  25556. console.log("zh: constructor onFontLoaded加载arial字体失败");
  25557. }
  25558. }
  25559. function loadSubRes(callback) {
  25560. var tab = ["asset", "res", "spine"];
  25561. let subDone = 0;
  25562. for (var i = 0; i < tab.length; i++) {
  25563. let sub = tab[i];
  25564. Moyu.loadSubRes(sub, (pro) => {
  25565. callback && callback(pro, false);
  25566. }).then(() => {
  25567. subDone++;
  25568. if (subDone >= tab.length)
  25569. callback && callback(1, true);
  25570. });
  25571. }
  25572. }
  25573. function enterGame() {
  25574. xGame.cfgMgr.init();
  25575. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25576. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25577. xGame.uiMgr.Hide(UILoading);
  25578. fgui.UIPackage.removePackage(fguiRes.loading);
  25579. xGame.uiMgr.bindFUI(fguiRes.game);
  25580. xGame.uiMgr.Show(UIMain$1);
  25581. if (DataMgr.getNewUser())
  25582. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25583. }
  25584. function getPlat() {
  25585. let cfg = new MoyuCfg();
  25586. cfg.plat = MoyuPlat.web;
  25587. cfg.myId = 180;
  25588. cfg.myKey = '8848a885774230a4';
  25589. cfg.version = 0;
  25590. if (window.hasOwnProperty("gamebox")) {
  25591. cfg.plat = MoyuPlat.f399;
  25592. cfg.version = 0;
  25593. }
  25594. else if (window.hasOwnProperty("ks")) {
  25595. cfg.plat = MoyuPlat.ks;
  25596. cfg.version = 0;
  25597. cfg.ads.ksVideoId = '2300002254_01';
  25598. cfg.ads.ksInsertId = '2300002254_02';
  25599. }
  25600. else if (Laya.Browser.onTTMiniGame) {
  25601. cfg.plat = MoyuPlat.tt;
  25602. cfg.version = 0;
  25603. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25604. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25605. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25606. }
  25607. else if (Laya.Browser.onMiniGame) {
  25608. cfg.plat = MoyuPlat.wx;
  25609. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25610. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25611. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25612. }
  25613. else if (Laya.Browser.onQQMiniGame) {
  25614. cfg.plat = MoyuPlat.qq;
  25615. }
  25616. else if (Laya.Browser.onQGMiniGame) {
  25617. cfg.plat = MoyuPlat.op;
  25618. cfg.ads.opVideoId = '455502';
  25619. cfg.ads.opBannerId = '455507';
  25620. }
  25621. else if (Laya.Browser.onVVMiniGame) {
  25622. cfg.plat = MoyuPlat.vv;
  25623. cfg.version = 0;
  25624. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25625. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25626. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25627. }
  25628. else if (Laya.Browser.onHWMiniGame) {
  25629. cfg.plat = MoyuPlat.hw;
  25630. }
  25631. else if (window["mz"]) {
  25632. cfg.plat = MoyuPlat.mz;
  25633. }
  25634. else {
  25635. let cfg = window['conchConfig'];
  25636. if (cfg) {
  25637. var os = cfg.getOS();
  25638. if (os == "Conch-ios") {
  25639. cfg.plat = MoyuPlat.ios;
  25640. }
  25641. else if (os == "Conch-android") {
  25642. }
  25643. }
  25644. }
  25645. return cfg;
  25646. }
  25647. class Main {
  25648. constructor() {
  25649. if (window["Laya3D"])
  25650. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25651. else {
  25652. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25653. this.initMain();
  25654. }
  25655. }
  25656. initMain() {
  25657. Laya["Physics"] && Laya["Physics"].enable();
  25658. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25659. Laya.stage.scaleMode = GameConfig.scaleMode;
  25660. Laya.stage.screenMode = GameConfig.screenMode;
  25661. Laya.stage.alignV = GameConfig.alignV;
  25662. Laya.stage.alignH = GameConfig.alignH;
  25663. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25664. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25665. Laya.enableDebugPanel();
  25666. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25667. Laya["PhysicsDebugDraw"].enable();
  25668. if (GameConfig.stat)
  25669. Laya.Stat.show();
  25670. Laya.alertGlobalError(true);
  25671. this.loadFont();
  25672. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25673. }
  25674. loadFont() {
  25675. try {
  25676. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25677. console.log("zh: constructor加载arial字体成功1");
  25678. }
  25679. catch (error) {
  25680. console.log("zh: constructor加载arial字体失败1");
  25681. }
  25682. }
  25683. onFontLoaded() {
  25684. try {
  25685. Laya.Text.defaultFont = "Arial";
  25686. console.log("zh: onFontLoaded 设置arial字体成功1");
  25687. }
  25688. catch (error) {
  25689. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25690. }
  25691. }
  25692. onVersionLoaded() {
  25693. appInit();
  25694. }
  25695. }
  25696. new Main();
  25697. }());
  25698. //# sourceMappingURL=bundle.js.map