bundle.js 963 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117
  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 keyForLoginInfo = "userInfo";
  52. let TIP_MSG_key = {
  53. loginTimeOut: "Login timed out, please log in again.",
  54. pleaseLoginIn: "Please log in."
  55. };
  56. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  57. let poolKey = {
  58. inHoleEft: "inHoleEft",
  59. d3ball: "d3ball",
  60. iceEft: "iceEft",
  61. hitEft: "hitEft",
  62. fireworksEft: "fireworksEft",
  63. };
  64. var GameMode;
  65. (function (GameMode) {
  66. GameMode[GameMode["classic"] = 0] = "classic";
  67. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  68. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  69. })(GameMode || (GameMode = {}));
  70. var SkillType;
  71. (function (SkillType) {
  72. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  73. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  74. SkillType[SkillType["ice"] = 2] = "ice";
  75. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  76. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  77. })(SkillType || (SkillType = {}));
  78. var ClassicWordsType;
  79. (function (ClassicWordsType) {
  80. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  81. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  82. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  83. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  84. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  85. })(ClassicWordsType || (ClassicWordsType = {}));
  86. var PressType;
  87. (function (PressType) {
  88. PressType[PressType["powerNode"] = 0] = "powerNode";
  89. PressType[PressType["d2Root"] = 1] = "d2Root";
  90. PressType[PressType["moveNode"] = 2] = "moveNode";
  91. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  92. })(PressType || (PressType = {}));
  93. var PlaceBallType;
  94. (function (PlaceBallType) {
  95. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  96. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  97. })(PlaceBallType || (PlaceBallType = {}));
  98. var EAdType;
  99. (function (EAdType) {
  100. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  101. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  102. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  103. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  104. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  105. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  106. EAdType[EAdType["sign"] = 6] = "sign";
  107. EAdType[EAdType["draw"] = 7] = "draw";
  108. EAdType[EAdType["triple"] = 8] = "triple";
  109. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  110. EAdType[EAdType["getPower"] = 10] = "getPower";
  111. EAdType[EAdType["box"] = 11] = "box";
  112. EAdType[EAdType["try"] = 12] = "try";
  113. EAdType[EAdType["againSign"] = 13] = "againSign";
  114. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  115. })(EAdType || (EAdType = {}));
  116. var Prop;
  117. (function (Prop) {
  118. Prop[Prop["diamond"] = 1] = "diamond";
  119. Prop[Prop["coin"] = 2] = "coin";
  120. Prop[Prop["gan1"] = 3] = "gan1";
  121. Prop[Prop["gan2"] = 4] = "gan2";
  122. Prop[Prop["gan3"] = 5] = "gan3";
  123. Prop[Prop["gan4"] = 6] = "gan4";
  124. })(Prop || (Prop = {}));
  125. var TipsType;
  126. (function (TipsType) {
  127. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  128. TipsType[TipsType["foul"] = 1] = "foul";
  129. })(TipsType || (TipsType = {}));
  130. class AwardType {
  131. constructor(type, num) {
  132. this.type = type;
  133. this.num = num;
  134. }
  135. }
  136. var define = /*#__PURE__*/Object.freeze({
  137. fguiRes: fguiRes,
  138. ballCamp: ballCamp,
  139. FoulType: FoulType,
  140. ALL_BALL_STOP: ALL_BALL_STOP,
  141. WAIT_SHOOT: WAIT_SHOOT,
  142. D3RES_LOADED: D3RES_LOADED,
  143. BALL_SHOOT: BALL_SHOOT,
  144. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  145. RESET_GAME: RESET_GAME,
  146. COIN_CHANGE: COIN_CHANGE,
  147. DIAMOND_CHANGE: DIAMOND_CHANGE,
  148. RESTART_GAME: RESTART_GAME,
  149. GET_USER_INFO: GET_USER_INFO,
  150. CHANGE_SECRETARY: CHANGE_SECRETARY,
  151. POWER_CHANGE: POWER_CHANGE,
  152. POWER_TIME: POWER_TIME,
  153. keyForLoginInfo: keyForLoginInfo,
  154. TIP_MSG_key: TIP_MSG_key,
  155. baseHeadUrl: baseHeadUrl,
  156. poolKey: poolKey,
  157. get GameMode () { return GameMode; },
  158. get SkillType () { return SkillType; },
  159. get ClassicWordsType () { return ClassicWordsType; },
  160. get PressType () { return PressType; },
  161. get PlaceBallType () { return PlaceBallType; },
  162. get EAdType () { return EAdType; },
  163. get Prop () { return Prop; },
  164. get TipsType () { return TipsType; },
  165. AwardType: AwardType
  166. });
  167. class CContext {
  168. constructor() {
  169. this.winSize = { width: 0, height: 0 };
  170. this.notchHeight = 0;
  171. this.bannerHeight = 0;
  172. }
  173. init(resList, callback) {
  174. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  175. this.notchHeight = this.getNotchHeight();
  176. this.bannerHeight = this.getBannerHeight();
  177. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  178. callback && callback();
  179. }));
  180. }
  181. getNotchHeight() {
  182. let notchHeight = 50;
  183. if (Laya.Browser.onMiniGame) {
  184. let deviceInfo = wx.getSystemInfoSync();
  185. if (Laya.Browser.onIOS) {
  186. if (deviceInfo.model.search('iPhone X') != -1) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. else {
  190. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  191. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  192. notchHeight = deviceInfo.statusBarHeight - 10;
  193. }
  194. }
  195. }
  196. else if (Laya.Browser.onAndroid) {
  197. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  198. notchHeight = deviceInfo.statusBarHeight;
  199. }
  200. }
  201. }
  202. return notchHeight;
  203. }
  204. getBannerHeight() {
  205. return 0;
  206. }
  207. }
  208. let context = new CContext();
  209. var Handler = Laya.Handler;
  210. var Tween = Laya.Tween;
  211. function playClickEffect(btn) {
  212. if (!btn)
  213. return;
  214. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  215. if (!btn)
  216. return;
  217. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  218. if (!btn)
  219. return;
  220. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  221. }), 0, true);
  222. }), 0, true);
  223. }
  224. function getNumList(strList) {
  225. let dataList = [];
  226. if (strList) {
  227. let list = strList;
  228. let array = list.split(',');
  229. for (var v in array) {
  230. dataList.push(Number(array[v]));
  231. }
  232. }
  233. return dataList;
  234. }
  235. function getStrList(strList) {
  236. let dataList = [];
  237. if (strList) {
  238. let list = strList;
  239. let array = list.split('|');
  240. for (var v in array) {
  241. dataList.push(String(array[v]));
  242. }
  243. }
  244. return dataList;
  245. }
  246. function getRandStr(len) {
  247. 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'];
  248. let str = "";
  249. for (let i = 0; i < len; i++) {
  250. let rand = random(0, list.length);
  251. str += list[rand];
  252. }
  253. return str;
  254. }
  255. function getUserId() {
  256. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  257. return str;
  258. }
  259. function formatPos(pos, len = 2) {
  260. let v = Math.pow(10, len);
  261. pos.x = Math.floor(pos.x * v) / v;
  262. pos.y = Math.floor(pos.y * v) / v;
  263. if (pos.z)
  264. pos.z = Math.floor(pos.z * v) / v;
  265. return pos;
  266. }
  267. function setPosInt(pos) {
  268. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  269. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  270. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  271. return pos;
  272. }
  273. function random(min, max) {
  274. var rang = max - min;
  275. var rand = Math.random() * rang;
  276. return Math.floor(rand) + min;
  277. }
  278. function randomList(list, num) {
  279. if (list.length <= num)
  280. return list;
  281. let arry = [];
  282. list.forEach(item => {
  283. arry.push(item);
  284. });
  285. let nums = [];
  286. for (let i = 0; i < num; i++) {
  287. let rand = random(0, arry.length);
  288. let v = arry[rand];
  289. nums.push(v);
  290. arry.splice(rand, 1);
  291. }
  292. return nums;
  293. }
  294. function worldToScreen(camera, point, pos) {
  295. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  296. pos.x = pos.x / Laya.stage.clientScaleX;
  297. pos.y = pos.y / Laya.stage.clientScaleY;
  298. }
  299. function getStringLenght(str) {
  300. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. }
  302. function reviseString(str, len) {
  303. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  304. if (ld > len) {
  305. let sl = Math.floor(len / 2);
  306. let rs = str.substring(0, sl);
  307. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. while (d + 2 < len) {
  309. sl++;
  310. rs = str.substring(0, sl);
  311. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. }
  313. return rs + "...";
  314. }
  315. return str;
  316. }
  317. function getCoinString(coin) {
  318. if (coin < 10000)
  319. return coin.toString();
  320. else if (coin < 1000000) {
  321. let vh = Math.ceil(coin / 100);
  322. return (vh / 10) + "k";
  323. }
  324. else if (coin < 1000000000) {
  325. var vh = Math.ceil(coin / 100000);
  326. return (vh / 10) + "m";
  327. }
  328. else if (coin < 1000000000000) {
  329. var vh = Math.ceil(coin / 100000000);
  330. return (vh / 10) + "b";
  331. }
  332. else if (coin < 1000000000000000) {
  333. var vh = Math.ceil(coin / 100000000000);
  334. return (vh / 10) + "t";
  335. }
  336. }
  337. function getV3Dest(pos, dir, dis, dest) {
  338. dir.x *= dis;
  339. dir.y *= dis;
  340. dir.z *= dis;
  341. Laya.Vector3.add(pos, dir, dest);
  342. return dest;
  343. }
  344. function getV2Dest(x1, y1, dir, dis, dest) {
  345. dest.x = x1 + dir.x * dis;
  346. dest.y = y1 + dir.y * dis;
  347. return dest;
  348. }
  349. function getV2Dir(x1, y1, x2, y2, dir) {
  350. dir.x = x2 - x1;
  351. dir.y = y2 - y1;
  352. Laya.Vector2.normalize(dir, dir);
  353. return dir;
  354. }
  355. function getV3Dir(p1, p2, dir) {
  356. Laya.Vector3.subtract(p1, p2, dir);
  357. Laya.Vector3.normalize(dir, dir);
  358. return dir;
  359. }
  360. function copyPos(ip, op) {
  361. op.x = ip.x;
  362. op.y = ip.y;
  363. if (ip.z)
  364. op.z = ip.z;
  365. return op;
  366. }
  367. function getScreenImg() {
  368. let gl = Laya.WebGLContext.mainContext;
  369. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  370. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  371. let w = gl.drawingBufferWidth;
  372. let h = gl.drawingBufferHeight;
  373. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  374. texture2d.setPixels(pixels);
  375. return new Laya.Texture(texture2d);
  376. }
  377. function playMoveByPositions(sp, positions, v, completeCallback) {
  378. let p;
  379. let play = () => {
  380. if (positions.length == 0) {
  381. completeCallback();
  382. return;
  383. }
  384. p = positions[0];
  385. positions.splice(0, 1);
  386. 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, () => {
  387. play();
  388. }));
  389. };
  390. play();
  391. }
  392. function setStarPos(node, num, max) {
  393. for (let i = 1; i <= 5; i++) {
  394. let img = node.getChildAt(i - 1);
  395. img.width = img.height = 30;
  396. img.pivotX = img.pivotY = 0.5;
  397. img.gray = i > num;
  398. img.visible = i <= max;
  399. if (max == 3) {
  400. img.x = node.width / 2 + (i - 2) * 30 - 15;
  401. img.y = node.height - 40;
  402. if (i == 2)
  403. img.y = node.height - 30;
  404. }
  405. else if (max == 5) {
  406. let ly = Math.abs(i - 3);
  407. img.x = node.width / 2 + (i - 3) * 20 - 15;
  408. img.y = node.height - ly * 8 - 30;
  409. }
  410. }
  411. }
  412. function playLoopAnimRotate(sp, time, clockwise = true) {
  413. let rotation;
  414. sp.rotation = sp.rotation % 360;
  415. if (clockwise) {
  416. rotation = -360;
  417. }
  418. else {
  419. rotation = 360;
  420. }
  421. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  422. this.playLoopAnimRotate(sp, time, clockwise);
  423. }));
  424. }
  425. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  426. let x, y;
  427. if (isBig) {
  428. x = valueXMin;
  429. y = valueYMin;
  430. }
  431. else {
  432. x = valueXMax;
  433. y = valueYMax;
  434. }
  435. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  436. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  437. }));
  438. }
  439. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  440. let scale;
  441. if (isBig) {
  442. scale = valueMin;
  443. }
  444. else {
  445. scale = valueMax;
  446. }
  447. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  448. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  449. }));
  450. }
  451. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  452. let value;
  453. if (isBig) {
  454. value = valueMin;
  455. }
  456. else {
  457. value = valueMax;
  458. }
  459. if (count) {
  460. count--;
  461. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  462. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  463. }));
  464. }
  465. else {
  466. sp.rotation = 0;
  467. }
  468. }
  469. function inRect(rect, p) {
  470. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  471. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  472. return true;
  473. }
  474. }
  475. return false;
  476. }
  477. function getNumberK(number) {
  478. if (number < 1000) {
  479. return number.toString();
  480. }
  481. else {
  482. return (number / 1000).toFixed(1) + "k";
  483. }
  484. }
  485. function pointInsideCircle(point, circle, r) {
  486. if (r === 0)
  487. return false;
  488. var dx = circle.x - point.x;
  489. var dy = circle.y - point.y;
  490. return dx * dx + dy * dy <= r * r;
  491. }
  492. function formatString(str, data) {
  493. if (!str || data == undefined) {
  494. return str;
  495. }
  496. if (typeof data === "object") {
  497. for (var key in data) {
  498. if (data.hasOwnProperty(key)) {
  499. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  500. }
  501. }
  502. }
  503. else {
  504. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  505. return str.replace(reg, function (match, index) {
  506. return args[index - (-1)];
  507. });
  508. }
  509. return str;
  510. }
  511. function getIntersection(a, b) {
  512. let t = [];
  513. for (var i = 0; i < a.length; i++) {
  514. for (var j = 0; j < b.length; j++) {
  515. if (a[i] == b[j]) {
  516. t.push(a[i]);
  517. }
  518. }
  519. }
  520. return t;
  521. }
  522. function getComplement(a, b) {
  523. let t = [];
  524. let count = false;
  525. for (var i = 0; i < a.length; i++) {
  526. count = false;
  527. for (var j = 0; j < b.length; j++) {
  528. if (a[i] == b[j]) {
  529. count = true;
  530. break;
  531. }
  532. }
  533. if (!count) {
  534. t.push(a[i]);
  535. }
  536. }
  537. return t;
  538. }
  539. function geSpriteStageRect(sp) {
  540. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  541. let rect = {
  542. x: point.x,
  543. y: point.y,
  544. width: sp.width * sp.globalScaleX,
  545. height: sp.height * sp.globalScaleY
  546. };
  547. return rect;
  548. }
  549. function touchButton(button) {
  550. let event = new Laya.Event();
  551. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  552. }
  553. function setColor(sprite, r, g, b) {
  554. var redMat = [
  555. r / 255, 0, 0, 0, 0,
  556. g / 255, 0, 0, 0, 0,
  557. b / 255, 0, 0, 0, 0,
  558. 0, 0, 0, 1, 0,
  559. ];
  560. var filter = new Laya.ColorFilter(redMat);
  561. sprite.filters = [filter];
  562. }
  563. function clone(obj, newobj = {}) {
  564. for (var attr in obj) {
  565. if (typeof obj[attr] == "object") {
  566. newobj[attr] = clone(obj[attr], newobj[attr]);
  567. }
  568. else {
  569. newobj[attr] = obj[attr];
  570. }
  571. }
  572. return newobj;
  573. }
  574. function _ms(arr, compare, begin, end) {
  575. const size = end - begin;
  576. if (size <= 1) {
  577. return;
  578. }
  579. const middle = (end + begin) >> 1;
  580. _ms(arr, compare, begin, middle);
  581. _ms(arr, compare, middle, end);
  582. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  583. return;
  584. }
  585. const merged = [];
  586. let leftIndex = begin, rightIndex = middle;
  587. while (merged.length < size) {
  588. if (leftIndex === middle) {
  589. merged.push(arr[rightIndex++]);
  590. }
  591. else if (rightIndex === end) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. const c = compare(arr[leftIndex], arr[rightIndex]);
  596. if (c <= 0) {
  597. merged.push(arr[leftIndex++]);
  598. }
  599. else {
  600. merged.push(arr[rightIndex++]);
  601. }
  602. }
  603. }
  604. arr.splice(begin, size, ...merged);
  605. }
  606. function sort(arr, compare) {
  607. if (!Array.isArray(arr)) {
  608. throw new Error('sort的参数必须为数组');
  609. }
  610. _ms(arr, compare, 0, arr.length);
  611. return arr;
  612. }
  613. function getLanguage(id) {
  614. }
  615. function getLanguageByTip(id) {
  616. }
  617. function toWeights(array) {
  618. let max = 0;
  619. for (var i = 0; i < array.length; i++) {
  620. max = max + array[i];
  621. if (array[i] == 0) {
  622. array[i] = 0;
  623. }
  624. else {
  625. array[i] = max;
  626. }
  627. }
  628. return array;
  629. }
  630. function unique(array) {
  631. var n = {}, r = [], len = array.length, val, type;
  632. for (var i = 0; i < array.length; i++) {
  633. val = array[i];
  634. type = typeof val;
  635. if (!n[val]) {
  636. n[val] = [type];
  637. r.push(val);
  638. }
  639. else if (n[val].indexOf(type) < 0) {
  640. n[val].push(type);
  641. r.push(val);
  642. }
  643. }
  644. return r;
  645. }
  646. function unique1(array) {
  647. var r = [];
  648. for (var i = 0, l = array.length; i < l; i++) {
  649. for (var j = i + 1; j < l; j++)
  650. if (array[i] == array[j])
  651. j == ++i;
  652. r.push(array[i]);
  653. }
  654. return r;
  655. }
  656. function getDistance(x1, y1, x2, y2) {
  657. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  658. }
  659. function getV2Dis(pos1, pos2) {
  660. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  661. }
  662. function getV2SqDis(pos1, pos2) {
  663. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  664. }
  665. function getDis(x1, y1, x2, y2) {
  666. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  667. }
  668. function getDeltaxy(x1, y1, x2, y2) {
  669. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  670. }
  671. function getSymbolNumber(num) {
  672. if (num > 0) {
  673. return "+" + num;
  674. }
  675. else if (num < 0) {
  676. return num.toString();
  677. }
  678. return num.toString();
  679. }
  680. function fixNumber(num, length) {
  681. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  682. }
  683. function toThousands(num) {
  684. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  685. }
  686. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  687. function fmtMoney(money) {
  688. money = toThousands(money.replace(/^0+/, ''));
  689. if (money.length == 0) {
  690. money = "0";
  691. }
  692. let unit = 0;
  693. for (var i = 0; i < money.length; i++) {
  694. if (money.charAt(i) == ",") {
  695. unit++;
  696. }
  697. }
  698. if (unit == 0) {
  699. return money;
  700. }
  701. else {
  702. let idx = money.indexOf(",");
  703. if (idx) {
  704. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  705. }
  706. return money.replace(",", ".");
  707. }
  708. }
  709. function flatten(arr) {
  710. while (arr.some(item => Array.isArray(item))) {
  711. arr = [].concat(...arr);
  712. }
  713. return arr;
  714. }
  715. function getDistanceByPoint(p1, p2) {
  716. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  717. }
  718. function getAngleByPoint(p1, p2) {
  719. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  720. }
  721. function toIntByArray(array) {
  722. for (var index = 0; index < array.length; index++) {
  723. array[index] = parseInt(array[index]);
  724. }
  725. return array;
  726. }
  727. function getAngle0To360(angle) {
  728. while (angle < 0) {
  729. angle += 360;
  730. }
  731. while (angle >= 360) {
  732. angle -= 360;
  733. }
  734. return angle;
  735. }
  736. function toAngle(radian) {
  737. return radian * 180 / Math.PI;
  738. }
  739. function toRadian(angle) {
  740. return angle * Math.PI / 180;
  741. }
  742. function getArrayValueRandom(array) {
  743. return array[random(0, array.length - 1)];
  744. }
  745. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  746. }
  747. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  748. }
  749. function fmtTimeMMSS(time) {
  750. if (time < 0) {
  751. time = 0;
  752. }
  753. else
  754. time = Math.floor(time);
  755. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  756. }
  757. function fmtTimeMS(time) {
  758. if (time < 0) {
  759. time = 0;
  760. }
  761. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  762. }
  763. function fmtTimeHHMM(time) {
  764. if (time < 0) {
  765. time = 0;
  766. }
  767. time = Math.floor(time / 1000);
  768. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  769. }
  770. let severTime = 0;
  771. function getServerTime() {
  772. return new Date(new Date().getTime() - severTime);
  773. }
  774. function setServerTime(data) {
  775. severTime = (new Date().getTime() - data);
  776. }
  777. var tools = /*#__PURE__*/Object.freeze({
  778. playClickEffect: playClickEffect,
  779. getNumList: getNumList,
  780. getStrList: getStrList,
  781. getRandStr: getRandStr,
  782. getUserId: getUserId,
  783. formatPos: formatPos,
  784. setPosInt: setPosInt,
  785. random: random,
  786. randomList: randomList,
  787. worldToScreen: worldToScreen,
  788. getStringLenght: getStringLenght,
  789. reviseString: reviseString,
  790. getCoinString: getCoinString,
  791. getV3Dest: getV3Dest,
  792. getV2Dest: getV2Dest,
  793. getV2Dir: getV2Dir,
  794. getV3Dir: getV3Dir,
  795. copyPos: copyPos,
  796. getScreenImg: getScreenImg,
  797. playMoveByPositions: playMoveByPositions,
  798. setStarPos: setStarPos,
  799. playLoopAnimRotate: playLoopAnimRotate,
  800. playLoopAnimPosition: playLoopAnimPosition,
  801. playLoopAnimScale: playLoopAnimScale,
  802. playLoopAnimRotation: playLoopAnimRotation,
  803. inRect: inRect,
  804. getNumberK: getNumberK,
  805. pointInsideCircle: pointInsideCircle,
  806. formatString: formatString,
  807. getIntersection: getIntersection,
  808. getComplement: getComplement,
  809. geSpriteStageRect: geSpriteStageRect,
  810. touchButton: touchButton,
  811. setColor: setColor,
  812. clone: clone,
  813. sort: sort,
  814. getLanguage: getLanguage,
  815. getLanguageByTip: getLanguageByTip,
  816. toWeights: toWeights,
  817. unique: unique,
  818. unique1: unique1,
  819. getDistance: getDistance,
  820. getV2Dis: getV2Dis,
  821. getV2SqDis: getV2SqDis,
  822. getDis: getDis,
  823. getDeltaxy: getDeltaxy,
  824. getSymbolNumber: getSymbolNumber,
  825. fixNumber: fixNumber,
  826. toThousands: toThousands,
  827. fmtMoney: fmtMoney,
  828. flatten: flatten,
  829. getDistanceByPoint: getDistanceByPoint,
  830. getAngleByPoint: getAngleByPoint,
  831. toIntByArray: toIntByArray,
  832. getAngle0To360: getAngle0To360,
  833. toAngle: toAngle,
  834. toRadian: toRadian,
  835. getArrayValueRandom: getArrayValueRandom,
  836. promptByTip: promptByTip,
  837. promptByErrorCode: promptByErrorCode,
  838. fmtTimeMMSS: fmtTimeMMSS,
  839. fmtTimeMS: fmtTimeMS,
  840. fmtTimeHHMM: fmtTimeHHMM,
  841. getServerTime: getServerTime,
  842. setServerTime: setServerTime
  843. });
  844. class HttpMgr {
  845. constructor() {
  846. this.isDev = true;
  847. HttpMgr._instance = this;
  848. }
  849. static getInstance() {
  850. if (!this._instance) {
  851. this._instance = new HttpMgr();
  852. }
  853. return this._instance;
  854. }
  855. sendPost(url, data, call) {
  856. let httpObj = new Laya.HttpRequest();
  857. httpObj.http.timeout = 5000;
  858. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  859. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  860. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  861. function errorHandler(error) {
  862. console.log("errorHandler:" + error);
  863. alert("Please check your network connection.");
  864. }
  865. function completeHandler(data) {
  866. if (data && data.length > 0) {
  867. let jsonData = JSON.parse(data);
  868. if (call)
  869. call(jsonData);
  870. }
  871. }
  872. }
  873. getReqData() {
  874. let reqData = JSON.stringify({
  875. gameName: "TQ",
  876. gameUserName: "zhangSan",
  877. isDev: this.isDev
  878. });
  879. return reqData;
  880. }
  881. sendPost2025(reqUrl, data, call) {
  882. let isDev = this.isDev;
  883. let urlTop = "https://api.kessongame.site/";
  884. let urlMid = urlTop + "prod-api/api/";
  885. if (isDev) {
  886. urlTop = "http://192.168.1.13:8090/";
  887. urlMid = urlTop + "api/";
  888. }
  889. let url = urlMid + reqUrl;
  890. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  891. if (isDev) {
  892. url = urlTop + reqUrl;
  893. }
  894. else {
  895. url = urlTop + "prod-api/" + reqUrl;
  896. }
  897. }
  898. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  899. if (reqUrl.indexOf("/api/game/") >= 0) {
  900. }
  901. const keyForLoginInfo = "userInfo";
  902. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  903. if (userInfoData != null) {
  904. try {
  905. let bb = JSON.parse(userInfoData);
  906. if (bb) {
  907. let token = bb.token;
  908. headers.push("Authorization");
  909. headers.push(`Bearer ${token}`);
  910. }
  911. }
  912. catch (e) {
  913. }
  914. }
  915. let httpObj = new Laya.HttpRequest();
  916. httpObj.http.timeout = 5000;
  917. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  918. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  919. httpObj.send(url, data, 'post', 'text', headers);
  920. console.log('zh: http url = ' + url);
  921. function errorHandler(error) {
  922. if (call) {
  923. call("{'msg':'Network exception','code':500}");
  924. }
  925. else {
  926. alert("Tip:Please check your network connection.");
  927. }
  928. }
  929. function completeHandler(data) {
  930. if (data && data.length > 0) {
  931. let jsonData = JSON.parse(data);
  932. if (call)
  933. call(jsonData);
  934. }
  935. }
  936. }
  937. sendGet(url, call) {
  938. let httpObj = new Laya.HttpRequest();
  939. httpObj.http.timeout = 5000;
  940. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  941. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  942. httpObj.send(url, '', 'get');
  943. function errorHandler(error) {
  944. console.log("errorHandler:" + error);
  945. }
  946. function completeHandler(data) {
  947. if (data && data.length > 0) {
  948. if (call)
  949. call(data);
  950. }
  951. }
  952. }
  953. }
  954. HttpMgr._instance = null;
  955. class LightShader extends Laya.Sprite {
  956. constructor() {
  957. super();
  958. this._time = 0;
  959. this._sin = 0;
  960. this.initShader();
  961. }
  962. initShader() {
  963. var vs = `
  964. #define FSHIGHPRECISION
  965. attribute vec4 posuv;
  966. uniform vec2 size;
  967. varying vec4 v_texcoord;
  968. void main() {
  969. vec4 pos = vec4(posuv.xy,0.,1.);
  970. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  971. gl_Position=pos1;
  972. v_texcoord.xy = posuv.xy;
  973. }
  974. `;
  975. var ps = `
  976. #define FSHIGHPRECISION
  977. precision highp float;
  978. varying vec4 v_texcoord;
  979. uniform vec2 size;
  980. uniform sampler2D texture;
  981. uniform float u_Time;
  982. void main() {
  983. vec4 color= texture2D(texture, v_texcoord.xy);
  984. float width = 0.2;
  985. float start = u_Time;
  986. float offset = 1.0;
  987. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  988. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  989. {
  990. color.r=1.1;
  991. color.g=1.1;
  992. color.b=1.1;
  993. gl_FragColor = color;
  994. } else {
  995. gl_FragColor = color;
  996. }
  997. }
  998. `;
  999. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1000. this.customRenderEnable = true;
  1001. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1002. }
  1003. customRender(context, x, y) {
  1004. this.onUpdate();
  1005. if (!this.texture)
  1006. return;
  1007. let xx = x - this.pivotX;
  1008. let yy = y - this.pivotY;
  1009. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1010. }
  1011. onUpdate() {
  1012. this._time += 2 * Laya.timer.delta * 0.001;
  1013. this._sin = Math.sin(this._time);
  1014. if (this._sin > 0.99) {
  1015. this._sin = 0;
  1016. this._time = 0;
  1017. }
  1018. this.shaderValue['u_Time'] = this._sin;
  1019. }
  1020. }
  1021. LightShader.DissolveSurfaceSaveName = 9997;
  1022. class UIBase extends fairygui.Window {
  1023. constructor() {
  1024. super();
  1025. this.isEject = true;
  1026. this.isHide = true;
  1027. this.showbanner = true;
  1028. this.className = "";
  1029. this.isMuti = false;
  1030. this.showbanner = false;
  1031. this.onConstructor();
  1032. }
  1033. checkActive(show) {
  1034. }
  1035. getUIName() {
  1036. return UIBase.uiName;
  1037. }
  1038. onConstructor() {
  1039. }
  1040. onInit() {
  1041. if (!!this.contentPane) {
  1042. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1043. }
  1044. this.setPivot(0.5, 0.5, false);
  1045. }
  1046. doShowAnimation() {
  1047. if (!this.isEject)
  1048. return;
  1049. super.doShowAnimation();
  1050. Laya.Tween.clearTween(this);
  1051. this.scaleX = this.scaleY = 0.8;
  1052. let tweenFunc1 = (func) => {
  1053. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1054. };
  1055. let tweenFunc2 = (func) => {
  1056. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1057. };
  1058. tweenFunc1(tweenFunc2);
  1059. }
  1060. show(...args) {
  1061. super.show();
  1062. this._openParam = args;
  1063. this.isHide = false;
  1064. xGame.uiMgr.checkUIState();
  1065. }
  1066. moveBannerButton() {
  1067. }
  1068. showBannerButton() {
  1069. this.bannerButton.visible = true;
  1070. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1071. this.bannerButton.touchable = true;
  1072. }));
  1073. }
  1074. hide() {
  1075. super.hide();
  1076. this.isHide = true;
  1077. xGame.uiMgr.checkUIState();
  1078. }
  1079. Dispose() {
  1080. super.dispose();
  1081. }
  1082. myUpdate(delay) {
  1083. }
  1084. refresh() { }
  1085. addUIClick(obj, func, arr = null) {
  1086. obj.onClick(this, func, arr);
  1087. obj.onClick(this, this.playBtnSound);
  1088. }
  1089. offUIClick(obj, func) {
  1090. obj.offClick(this, func);
  1091. }
  1092. playBtnSound() {
  1093. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1094. }
  1095. }
  1096. UIBase.lastShowBanner = 0;
  1097. UIBase.showBannerNum = 0;
  1098. UIBase.uiName = "";
  1099. class ui_UIDraw extends fgui.GComponent {
  1100. static createInstance() {
  1101. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1102. }
  1103. onConstruct() {
  1104. this.n1 = (this.getChild("n1"));
  1105. this.extraNode = (this.getChild("extraNode"));
  1106. this.myNode = (this.getChild("myNode"));
  1107. this.closeNode = (this.getChild("closeNode"));
  1108. this.moneyNode = (this.getChild("moneyNode"));
  1109. this.n38 = (this.getChild("n38"));
  1110. this.secretary = (this.getChild("secretary"));
  1111. this.drawBtn = (this.getChild("drawBtn"));
  1112. this.talkNode = (this.getChild("talkNode"));
  1113. this.t0 = this.getTransition("t0");
  1114. }
  1115. }
  1116. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1117. class ui_UIBox extends fgui.GComponent {
  1118. static createInstance() {
  1119. return (fgui.UIPackage.createObject("game", "UIBox"));
  1120. }
  1121. onConstruct() {
  1122. this.n0 = (this.getChild("n0"));
  1123. this.n12 = (this.getChild("n12"));
  1124. this.n1 = (this.getChild("n1"));
  1125. this.n2 = (this.getChild("n2"));
  1126. this.bar = (this.getChild("bar"));
  1127. this.closeBtn = (this.getChild("closeBtn"));
  1128. this.openBtn = (this.getChild("openBtn"));
  1129. this.t0 = this.getTransition("t0");
  1130. this.t1 = this.getTransition("t1");
  1131. }
  1132. }
  1133. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1134. class LocalStorageManager {
  1135. test1() {
  1136. LocalStorageManager.setItem("playerName", "Tom");
  1137. LocalStorageManager.setItem("playerLevel", 5);
  1138. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1139. const name = LocalStorageManager.getItem("playerName");
  1140. const level = LocalStorageManager.getItem("playerLevel");
  1141. const data = LocalStorageManager.getItem("playerData");
  1142. console.log(name);
  1143. console.log(level);
  1144. console.log(data);
  1145. LocalStorageManager.removeItem("playerLevel");
  1146. }
  1147. static setItem(key, value) {
  1148. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1149. }
  1150. static getItem(key) {
  1151. const data = Laya.LocalStorage.getItem(key);
  1152. if (data === null)
  1153. return null;
  1154. try {
  1155. return JSON.parse(data);
  1156. }
  1157. catch (e) {
  1158. return data;
  1159. }
  1160. }
  1161. static removeItem(key) {
  1162. Laya.LocalStorage.removeItem(key);
  1163. }
  1164. static clear() {
  1165. Laya.LocalStorage.clear();
  1166. }
  1167. static hasJosnKey(key) {
  1168. var value = Laya.LocalStorage.getJSON(key);
  1169. if (value != null) {
  1170. return true;
  1171. }
  1172. else {
  1173. return false;
  1174. }
  1175. }
  1176. static hasKey(key) {
  1177. return Laya.LocalStorage.getItem(key) !== null;
  1178. }
  1179. }
  1180. class GlobalManager {
  1181. constructor() {
  1182. }
  1183. registerMethod(name, method) {
  1184. console.log('zh: 注册全局方法', name);
  1185. this[name] = method;
  1186. }
  1187. callMethod(name, ...args) {
  1188. console.log('zh: 调用全局方法', name);
  1189. if (this[name]) {
  1190. return this[name](...args);
  1191. }
  1192. else {
  1193. console.error(`zh: 全局方法 Method ${name} not found`);
  1194. }
  1195. }
  1196. }
  1197. GlobalManager.instance = new GlobalManager();
  1198. class JSBridgeUtils {
  1199. constructor() { }
  1200. static get instance() {
  1201. if (!this._instance) {
  1202. this._instance = new JSBridgeUtils();
  1203. }
  1204. return this._instance;
  1205. }
  1206. initBridge() {
  1207. if (!Laya.Browser.onAndroid) {
  1208. console.log('zh:非android dev');
  1209. return;
  1210. }
  1211. let cfg = window['conchConfig'];
  1212. if (cfg) {
  1213. var os = cfg.getOS();
  1214. if (os == "Conch-android") {
  1215. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1216. if (this.bridge) {
  1217. return true;
  1218. }
  1219. else {
  1220. return false;
  1221. }
  1222. }
  1223. else {
  1224. return false;
  1225. }
  1226. }
  1227. else {
  1228. return false;
  1229. }
  1230. }
  1231. testAd1() {
  1232. if (!Laya.Browser.onAndroid) {
  1233. console.log('zh:非android dev');
  1234. return;
  1235. }
  1236. if (!this.initBridge()) {
  1237. return;
  1238. }
  1239. let rs = this.bridge.call("testString", "hello");
  1240. console.log('zh:testString rs=' + rs);
  1241. }
  1242. testAdCallBack() {
  1243. if (!this.initBridge()) {
  1244. return;
  1245. }
  1246. console.log("zh:testAdCallBack start");
  1247. const defaultObj = { code: 200, msg: "req update Ui" };
  1248. const reqObj = { code: 300, msg: "hello java ui" };
  1249. this.bridge.callWithBack((rsStr) => {
  1250. const rsObj = JSON.parse(rsStr);
  1251. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1252. }, "testAsyncCallback", JSON.stringify(reqObj));
  1253. }
  1254. showInternAd(mark) {
  1255. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1256. if (boo1) {
  1257. console.log('zh: VIP SPID = 1,免除插页AD');
  1258. return false;
  1259. }
  1260. console.log('zh:showInternAd start');
  1261. if (!Laya.Browser.onAndroid) {
  1262. console.log('zh:showInternAd 非android dev');
  1263. return false;
  1264. }
  1265. if (!this.initBridge()) {
  1266. return false;
  1267. }
  1268. let rs = this.bridge.call("showInternAd", mark);
  1269. try {
  1270. const result = JSON.parse(rs);
  1271. if (result.code === 200) {
  1272. console.log("zh:showInternAd OK");
  1273. return true;
  1274. }
  1275. else {
  1276. console.warn("zh:showInternAd FAILL:", result.msg);
  1277. return false;
  1278. }
  1279. }
  1280. catch (e) {
  1281. console.error("zh:解析桥接返回值失败:", e);
  1282. return false;
  1283. }
  1284. }
  1285. exitAndCloseGame() {
  1286. if (!Laya.Browser.onAndroid) {
  1287. return;
  1288. }
  1289. if (!this.initBridge()) {
  1290. return;
  1291. }
  1292. console.log('zh:开始关闭游戏-');
  1293. this.bridge.call("exitAndCloseGame");
  1294. }
  1295. checkAdForUserOrderForSpid17(spid) {
  1296. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1297. if (userInfo != null) {
  1298. if (!userInfo.buySpids) {
  1299. userInfo.buySpids = { 1: false, 7: false };
  1300. }
  1301. else {
  1302. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1303. }
  1304. let boo = userInfo.buySpids[spid];
  1305. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1306. return boo;
  1307. }
  1308. return false;
  1309. }
  1310. showRewardAd(mark) {
  1311. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1312. if (boo7) {
  1313. console.log('zh: VIP SPID = 7,无任何AD');
  1314. return false;
  1315. }
  1316. if (!Laya.Browser.onAndroid) {
  1317. return false;
  1318. }
  1319. if (!this.initBridge()) {
  1320. return false;
  1321. }
  1322. let rs = this.bridge.call("showRewardAd", mark);
  1323. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:广告显示成功");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:广告显示失败:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. logEventForAdNoParams(eventName) {
  1341. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1342. if (!Laya.Browser.onAndroid) {
  1343. return;
  1344. }
  1345. if (!this.initBridge()) {
  1346. return;
  1347. }
  1348. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1349. this.bridge.call("logEventForAdNoParams", eventName);
  1350. }
  1351. logEventForAdHaveParams(eventName, jsonStr) {
  1352. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1353. if (!Laya.Browser.onAndroid) {
  1354. return;
  1355. }
  1356. if (!this.initBridge()) {
  1357. return;
  1358. }
  1359. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1360. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1361. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1362. }
  1363. logEventForFirebase(eventName, jsonStr) {
  1364. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1365. if (!Laya.Browser.onAndroid) {
  1366. return;
  1367. }
  1368. if (!this.initBridge()) {
  1369. return;
  1370. }
  1371. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1372. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1373. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1374. }
  1375. testNetTip() {
  1376. if (Laya.Browser.onAndroid) {
  1377. let boo = this.getNetworkAvailable();
  1378. this.showToast2("Network error, reward unavailable");
  1379. return;
  1380. }
  1381. }
  1382. getNetworkAvailable() {
  1383. if (!Laya.Browser.onAndroid) {
  1384. return;
  1385. }
  1386. if (!this.initBridge()) {
  1387. return;
  1388. }
  1389. let boo = this.bridge.call("getNetworkAvailable");
  1390. console.log("zh:getNetworkAvailable boo=" + boo);
  1391. return boo;
  1392. }
  1393. showToast2(msg) {
  1394. if (!Laya.Browser.onAndroid) {
  1395. return;
  1396. }
  1397. if (!this.initBridge()) {
  1398. return;
  1399. }
  1400. this.bridge.call("showToast2", msg);
  1401. }
  1402. loginOutForApp() {
  1403. if (!Laya.Browser.onAndroid) {
  1404. return;
  1405. }
  1406. if (!this.initBridge()) {
  1407. return;
  1408. }
  1409. this.bridge.call("loginOutForApp");
  1410. }
  1411. startGgPay(token, ggSpid, spid) {
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. let jsonObj = {
  1419. token: token,
  1420. ggSpid: ggSpid,
  1421. spid: spid,
  1422. spsl: 1
  1423. };
  1424. let reqData = JSON.stringify(jsonObj);
  1425. console.log("zh:startGgPay ts reqData=" + reqData);
  1426. this.bridge.call("startGgPay", reqData);
  1427. }
  1428. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1429. if (!Laya.Browser.onAndroid) {
  1430. return;
  1431. }
  1432. if (!this.initBridge()) {
  1433. return;
  1434. }
  1435. let jsonObj = {
  1436. token: token,
  1437. ggSpid: ggSpid,
  1438. spid: spid,
  1439. spsl: 1
  1440. };
  1441. let reqData = JSON.stringify(jsonObj);
  1442. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1443. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1444. }
  1445. nativeCallJs(msg) {
  1446. console.log("zh:nativeCallJs received data: 1111", msg);
  1447. if (msg === 'Ad1') {
  1448. GlobalManager.instance.callMethod('Ad1');
  1449. console.log("zh: Ad1 奖励发送成功");
  1450. }
  1451. else if (msg === 'Ad2') {
  1452. GlobalManager.instance.callMethod('Ad2');
  1453. console.log("zh: Ad2 奖励发送成功");
  1454. }
  1455. else if (msg === 'Ad3') {
  1456. GlobalManager.instance.callMethod('Ad3');
  1457. console.log("zh: Ad3 奖励发送成功");
  1458. }
  1459. else if (msg === 'Ad4') {
  1460. GlobalManager.instance.callMethod('Ad4');
  1461. console.log("zh: Ad4 奖励发送成功");
  1462. }
  1463. else if (msg === 'Ad5') {
  1464. console.log("zh: Ad5 奖励发送成功");
  1465. GlobalManager.instance.callMethod('Ad5');
  1466. }
  1467. }
  1468. }
  1469. class UIBox extends UIBase {
  1470. constructor() {
  1471. super();
  1472. this.boxNum = 0;
  1473. this.boxMax = 10;
  1474. this.inAd = false;
  1475. this.isClose = false;
  1476. }
  1477. onConstructor() {
  1478. this.ui = ui_UIBox.createInstance();
  1479. this.contentPane = this.ui;
  1480. this.isEject = false;
  1481. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1482. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1483. Laya.timer.loop(1000, this, this.update);
  1484. }
  1485. update() {
  1486. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1487. this.boxNum -= 1;
  1488. this.upBar();
  1489. }
  1490. }
  1491. upBar() {
  1492. if (this.boxNum > this.boxMax)
  1493. this.boxNum = this.boxMax;
  1494. this.ui.bar.value = this.boxNum * 10;
  1495. }
  1496. show() {
  1497. super.show();
  1498. this.isClose = false;
  1499. this.boxNum = 0;
  1500. this.inAd = false;
  1501. this.upBar();
  1502. this.ui.t0.play();
  1503. this.ui.closeBtn.visible = false;
  1504. Laya.timer.once(3000, this, () => {
  1505. this.ui.closeBtn.visible = true;
  1506. this.ui.bar.alpha = 1;
  1507. });
  1508. Laya.timer.once(500, this, () => {
  1509. this.ui.t1.play();
  1510. });
  1511. }
  1512. hide() {
  1513. Laya.timer.clearAll(this);
  1514. Moyu.showBannerAd(false);
  1515. super.hide();
  1516. }
  1517. onOpenBox() {
  1518. this.boxNum++;
  1519. if (this.boxNum < this.boxMax) {
  1520. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1521. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1522. }
  1523. }
  1524. else if (this.boxNum == this.boxMax) {
  1525. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1526. this.ui.openBtn.c1.selectedIndex = 13;
  1527. this.inAd = true;
  1528. }
  1529. else
  1530. this.getAward();
  1531. }
  1532. else if (this.inAd) {
  1533. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1534. if (Laya.Browser.onAndroid) {
  1535. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1536. if (!boo) {
  1537. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1538. return;
  1539. }
  1540. }
  1541. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1542. }
  1543. else {
  1544. console.log('zh:AD 失败,直接发放奖励');
  1545. this.qjff_AD_for_UIBOX_onOpenBox();
  1546. }
  1547. }
  1548. this.upBar();
  1549. }
  1550. qjff_AD_for_UIBOX_onOpenBox() {
  1551. this.getAward();
  1552. }
  1553. onCloseBox() {
  1554. if (this.isClose)
  1555. this.hide();
  1556. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1557. this.isClose = true;
  1558. PlatMgr.showBanner(true, 0, 3000);
  1559. }
  1560. else
  1561. this.hide();
  1562. }
  1563. getAward() {
  1564. let str = "";
  1565. if (Math.random() < 0.5) {
  1566. let max = Moyu.isLegal ? 500 : 2500;
  1567. let num = xGame.tools.random(max, 500 + max);
  1568. DataMgr.setCoin(num);
  1569. str = "金币x" + num;
  1570. }
  1571. else {
  1572. let max = Moyu.isLegal ? 10 : 30;
  1573. let num = xGame.tools.random(max, 30 + max);
  1574. DataMgr.setDiamond(num);
  1575. str = "钻石x" + num;
  1576. }
  1577. xGame.showTip("恭喜获得-" + str);
  1578. this.hide();
  1579. }
  1580. }
  1581. UIBox.uiName = "UIBox";
  1582. class ui_UITry extends fgui.GComponent {
  1583. static createInstance() {
  1584. return (fgui.UIPackage.createObject("game", "UITry"));
  1585. }
  1586. onConstruct() {
  1587. this.n11 = (this.getChild("n11"));
  1588. this.myNode = (this.getChild("myNode"));
  1589. this.t0 = this.getTransition("t0");
  1590. }
  1591. }
  1592. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1593. class UITry extends UIBase {
  1594. constructor() {
  1595. super();
  1596. this.closeTime = 0;
  1597. this.closeNum = 0;
  1598. this.skillUrl = xGame.common.skillIconList;
  1599. }
  1600. onConstructor() {
  1601. this.ui = ui_UITry.createInstance();
  1602. this.contentPane = this.ui;
  1603. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1604. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1605. }
  1606. show() {
  1607. super.show();
  1608. this.closeNum = 0;
  1609. this.closeTime = 15;
  1610. this.ui.t0.play();
  1611. PlatMgr.showRateBanner();
  1612. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1613. Laya.timer.loop(1000, this, this.updateTime);
  1614. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1615. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1616. xGame.common.gameMgr.gamePause = true;
  1617. }
  1618. updateTime() {
  1619. if (this.closeTime > 1) {
  1620. this.closeTime--;
  1621. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1622. }
  1623. else
  1624. this.hide();
  1625. }
  1626. hide() {
  1627. Laya.timer.clearAll(this);
  1628. Moyu.showBannerAd(false);
  1629. super.hide();
  1630. xGame.common.gameMgr.gamePause = false;
  1631. }
  1632. onTry() {
  1633. console.log('zh:qjff_AD_for_uitry');
  1634. if (Laya.Browser.onAndroid) {
  1635. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1636. if (!boo) {
  1637. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1638. return;
  1639. }
  1640. }
  1641. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1642. }
  1643. else {
  1644. console.log('zh:AD 失败,直接发放奖励');
  1645. this.qjff_AD_for_uitry();
  1646. }
  1647. }
  1648. qjff_AD_for_uitry() {
  1649. let select = xGame.common.curPlayerSkillType;
  1650. DataMgr.gameData.trySkill = select;
  1651. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1652. DataMgr.saveGameData();
  1653. DataMgr.setBigSkill(select, 1);
  1654. xGame.showTip("Trial Successful");
  1655. this.hide();
  1656. }
  1657. onCancel() {
  1658. if (this.closeNum > 0) {
  1659. this.closeNum--;
  1660. if (this.closeNum < 2)
  1661. this.hide();
  1662. return;
  1663. }
  1664. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1665. this.onTry();
  1666. }
  1667. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1668. this.closeNum = 3;
  1669. }
  1670. else
  1671. this.hide();
  1672. }
  1673. }
  1674. UITry.uiName = "UITry";
  1675. class PlatMgr {
  1676. static initConfig() {
  1677. this.lastVt = 0;
  1678. if (!Moyu.platConfig)
  1679. return;
  1680. for (let k in Moyu.platConfig) {
  1681. let pd = this[k];
  1682. let pc = Moyu.platConfig[k];
  1683. if (pd != undefined && pc != undefined)
  1684. this[k] = pc;
  1685. }
  1686. Moyu.setBannerPos(0.5, 1);
  1687. }
  1688. static rand100(num) {
  1689. return xGame.tools.random(0, 100) < num;
  1690. }
  1691. static isMisVideo() {
  1692. let dt = Laya.timer.currTimer - this.lastVt;
  1693. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1694. this.lastVt = Laya.timer.currTimer;
  1695. return true;
  1696. }
  1697. else {
  1698. if (this.rand100(this.fullVideoRate)) {
  1699. console.log('zh:插屏 ad start');
  1700. JSBridgeUtils.instance.showInternAd('platMgr');
  1701. }
  1702. return false;
  1703. }
  1704. }
  1705. static showVideo(call, type) {
  1706. Moyu.showVideoAd(() => {
  1707. this.lastVt = Laya.timer.currTimer;
  1708. call && call();
  1709. }, type);
  1710. }
  1711. static showInsert(delay = false) {
  1712. if (this.getRand() < this.insertRate) {
  1713. let dt = delay ? this.insertDelay : 0;
  1714. console.log('zh:插屏 ad start');
  1715. JSBridgeUtils.instance.showInternAd('gameInsert');
  1716. }
  1717. }
  1718. static gameInsert() {
  1719. let t = this.getRand();
  1720. let r = this.gameInsertRate;
  1721. if (t < r) {
  1722. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1723. }
  1724. }
  1725. static showRateBanner() {
  1726. if (this.getRand() < this.bannerRate)
  1727. this.showBanner(true, this.bannerDelay, 3000);
  1728. }
  1729. static showBanner(show, delay = 0, hide = 0) {
  1730. if (2 > 1) {
  1731. console.log('zh:显示showBanner广告 直接返回');
  1732. return;
  1733. }
  1734. if (!show)
  1735. Moyu.showBannerAd(false);
  1736. else {
  1737. Laya.timer.clear(this, this.bannerShow);
  1738. if (delay > 0)
  1739. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1740. else
  1741. this.bannerShow(true);
  1742. if (hide > 0)
  1743. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1744. }
  1745. }
  1746. static bannerShow(show) {
  1747. if (2 > 1) {
  1748. console.log('zh:显示showBanner广告 直接返回');
  1749. return;
  1750. }
  1751. Moyu.showBannerAd(show);
  1752. console.log("showBanner" + show);
  1753. }
  1754. static getRand() {
  1755. return xGame.tools.random(0, 100);
  1756. }
  1757. static openBox() {
  1758. if (this.getRand() < this.boxRate)
  1759. xGame.uiMgr.Show(UIBox);
  1760. }
  1761. static openTry() {
  1762. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1763. return;
  1764. if (this.getRand() < this.tryRate)
  1765. xGame.uiMgr.Show(UITry);
  1766. else if (DataMgr.gameData.gameCount == 1)
  1767. xGame.uiMgr.Show(UITry);
  1768. }
  1769. }
  1770. PlatMgr.forceShare = 0;
  1771. PlatMgr.signAdRate = 0;
  1772. PlatMgr.forceVideoRate = 0;
  1773. PlatMgr.forceVideoGap = 0;
  1774. PlatMgr.fullVideoRate = 0;
  1775. PlatMgr.gameInsertRate = 0;
  1776. PlatMgr.insertGap = 0;
  1777. PlatMgr.insertDelay = 0;
  1778. PlatMgr.insertRate = 0;
  1779. PlatMgr.boxRate = 0;
  1780. PlatMgr.boxVideoRate = 0;
  1781. PlatMgr.boxInsertRate = 0;
  1782. PlatMgr.boxBannerRate = 0;
  1783. PlatMgr.tryRate = 0;
  1784. PlatMgr.tryClose3Rate = 0;
  1785. PlatMgr.tryVideoRate = 0;
  1786. PlatMgr.bannerRate = 0;
  1787. PlatMgr.lastVt = 0;
  1788. class ui_UIAddProp extends fgui.GComponent {
  1789. static createInstance() {
  1790. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1791. }
  1792. onConstruct() {
  1793. this.n11 = (this.getChild("n11"));
  1794. this.myNode = (this.getChild("myNode"));
  1795. this.closeBtn = (this.getChild("closeBtn"));
  1796. this.t0 = this.getTransition("t0");
  1797. }
  1798. }
  1799. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1800. class SpineMgr {
  1801. constructor(name, loadCb = null) {
  1802. this.loaded = false;
  1803. this.spineName = '';
  1804. this.loadedCallback = loadCb;
  1805. this.templet = new Laya.Templet();
  1806. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1807. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1808. if (name === 'mishu') {
  1809. this.templet.loadAni('spine/nvmishu.sk');
  1810. }
  1811. else {
  1812. this.templet.loadAni(`spine/${name}.sk`);
  1813. }
  1814. this.templet.lock = true;
  1815. this.spineName = name;
  1816. }
  1817. onError() {
  1818. console.log("zh:spine加载出错");
  1819. }
  1820. parseComplete() {
  1821. this.loaded = true;
  1822. this.loadedCallback && this.loadedCallback();
  1823. }
  1824. dispose() {
  1825. if (this.templet && !this.templet.destroyed) {
  1826. this.templet.destroy();
  1827. }
  1828. this.templet = null;
  1829. }
  1830. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1831. if (!this.loaded) {
  1832. return;
  1833. }
  1834. let spine;
  1835. if (mySpine) {
  1836. spine = mySpine;
  1837. }
  1838. else {
  1839. spine = this.createSpine(data, parent);
  1840. }
  1841. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1842. if (!isLoop) {
  1843. spine.on(Laya.Event.STOPPED, this, () => {
  1844. spine.offAll(Laya.Event.STOPPED);
  1845. callback && callback(spine);
  1846. });
  1847. }
  1848. return spine;
  1849. }
  1850. createSpine(data, parent, type = 1) {
  1851. let spine;
  1852. spine = this.templet.buildArmature(type);
  1853. spine.showSkinByIndex(0);
  1854. parent.addChild(spine);
  1855. spine.pos(data.x, data.y);
  1856. spine.scale(data.scaleX, data.scaleY, true);
  1857. return spine;
  1858. }
  1859. }
  1860. var AIState;
  1861. (function (AIState) {
  1862. AIState[AIState["none"] = 0] = "none";
  1863. AIState[AIState["idle"] = 1] = "idle";
  1864. AIState[AIState["reset"] = 2] = "reset";
  1865. AIState[AIState["move"] = 3] = "move";
  1866. AIState[AIState["wait"] = 4] = "wait";
  1867. AIState[AIState["select"] = 5] = "select";
  1868. AIState[AIState["turn"] = 6] = "turn";
  1869. AIState[AIState["shoot"] = 7] = "shoot";
  1870. AIState[AIState["leave"] = 8] = "leave";
  1871. })(AIState || (AIState = {}));
  1872. class AIPlayer {
  1873. constructor() {
  1874. this.dtime = 30;
  1875. this.awayTime = 0;
  1876. this.awayNum = 0;
  1877. this.hideTime = 0;
  1878. this.rootMoveTime = 0;
  1879. this.isGuide = false;
  1880. this.state = AIState.none;
  1881. this.waitTime = 0;
  1882. this.forceNum = 0;
  1883. this.forceMax = 0;
  1884. this.ballSize = 33;
  1885. this.selectNum = 0;
  1886. this.destRot = 0;
  1887. this.aiLv = 10;
  1888. this.kickBall = [];
  1889. this.lineBall = [];
  1890. this.scoreBall = [];
  1891. this.holeBall = [];
  1892. this.turnNum = 0;
  1893. this.setNum = 0;
  1894. this.setMax = 0;
  1895. this.setRate = 0;
  1896. this.rectL = 0;
  1897. this.rectR = 0;
  1898. this.rectT = 0;
  1899. this.rectB = 0;
  1900. this.rootPos = { x: 0, y: 0 };
  1901. this.bestForce = 0;
  1902. this.bestAngle = 180;
  1903. this.bestPos = { x: 0, y: 0 };
  1904. this.bestKick = { x: 0, y: 0 };
  1905. this.posList = [];
  1906. this.posIdx = 0;
  1907. this.chatTime = 3000;
  1908. this.tempDir1 = new Laya.Vector2();
  1909. this.tempDir2 = new Laya.Vector2();
  1910. this.tempDir3 = new Laya.Vector2();
  1911. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1912. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1913. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1914. this.gameSrc = xGame.common.gameUI;
  1915. this.hideTime = Laya.timer.currTimer;
  1916. Moyu.setOnTipCall((id) => {
  1917. if (id == 20012)
  1918. this.hideTime = Laya.timer.currTimer;
  1919. else
  1920. (id == 20011);
  1921. {
  1922. let dt = Laya.timer.currTimer - this.hideTime;
  1923. console.log("onshow" + dt);
  1924. if (dt > 30000 && this.state > AIState.none)
  1925. xGame.common.gameMgr.aiGameEnd(false);
  1926. }
  1927. }, this);
  1928. }
  1929. init() {
  1930. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1931. this.awayTime = xGame.tools.random(5000, 10000);
  1932. this.awayNum = 0;
  1933. this.hideTime = Laya.timer.currTimer;
  1934. let rect = xGame.common.d2World.borderRect;
  1935. this.rectL = Math.ceil(rect.x) + 17;
  1936. this.rectT = Math.ceil(rect.y) + 17;
  1937. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1938. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1939. this.wBall = xGame.common.d2World.rootBall;
  1940. this.ballSize = this.wBall.gameObj.width - 1;
  1941. if (this.posList.length < 1) {
  1942. let dp = 40;
  1943. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1944. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1945. let dx = i < this.rectR ? i : this.rectR;
  1946. let dy = j < this.rectB ? j : this.rectB;
  1947. let order = xGame.tools.random(0, 1000);
  1948. this.posList.push({ x: dx, y: dy, order: order });
  1949. }
  1950. }
  1951. this.posList.sort(function (a, b) {
  1952. return a.order - b.order;
  1953. });
  1954. this.setMax = this.posList.length;
  1955. }
  1956. this.state = AIState.idle;
  1957. }
  1958. setAiLevel(num) {
  1959. this.aiLv = num;
  1960. }
  1961. initBall() {
  1962. this.rootPos.x = this.wBall.gameObj.x;
  1963. this.rootPos.y = this.wBall.gameObj.y;
  1964. this.initHoleBall();
  1965. }
  1966. initHoleBall() {
  1967. this.kickBall = [];
  1968. this.lineBall = [];
  1969. this.scoreBall = [];
  1970. this.holeBall = [];
  1971. this.selectNum = 0;
  1972. this.forceNum = 0;
  1973. this.forceMax = 0;
  1974. this.turnNum = 0;
  1975. let list = xGame.common.d2World.ballArr;
  1976. if (list.length < 20 && !this.isGuide) {
  1977. let holes = xGame.common.gameMgr.holePosList;
  1978. for (let i = 0; i < list.length; i++) {
  1979. let obj = list[i];
  1980. if (!obj)
  1981. continue;
  1982. obj.kickPos.x = 0;
  1983. obj.kickPos.y = 0;
  1984. obj.poleAngle = 0;
  1985. obj.hard = 0;
  1986. obj.borderDis = 0;
  1987. obj.kickAngle = 180;
  1988. if (obj.number == 0)
  1989. continue;
  1990. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1991. continue;
  1992. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1993. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1994. continue;
  1995. }
  1996. let b = obj.gameObj;
  1997. let wbp = this.rootPos;
  1998. let bx = wbp.x - b.x;
  1999. let by = wbp.y - b.y;
  2000. obj.borderDis = xGame.tools.random(0, 100);
  2001. this.kickBall.push(obj);
  2002. if (!this.isLine(wbp, obj))
  2003. continue;
  2004. obj.kickAngle = xGame.tools.random(90, 180);
  2005. obj.kickPos.x = b.x;
  2006. obj.kickPos.y = b.y;
  2007. this.lineBall.push(obj);
  2008. let minDis = 999999;
  2009. let hole = false;
  2010. for (let j = 0; j < holes.length; j++) {
  2011. let hp = holes[j];
  2012. if (bx >= 0 && hp.x > b.x + 100)
  2013. continue;
  2014. if (bx <= 0 && hp.x < b.x - 100)
  2015. continue;
  2016. if (by < -10 && hp.y < wbp.y)
  2017. continue;
  2018. if (by > 10 && hp.y > wbp.y)
  2019. continue;
  2020. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2021. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2022. if (dis < minDis) {
  2023. let dx = b.x - this.tempDir1.x * this.ballSize;
  2024. let dy = b.y - this.tempDir1.y * this.ballSize;
  2025. this.tempDir3.x = this.tempDir1.x;
  2026. this.tempDir3.y = this.tempDir1.y;
  2027. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2028. obj.kickPos.x = dx;
  2029. obj.kickPos.y = dy;
  2030. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2031. if (num > 1)
  2032. num = 1;
  2033. obj.kickAngle = Math.acos(num) * 57.3;
  2034. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2035. dis = dis * 2;
  2036. if (Math.abs(hp.x - 600) < 100)
  2037. dis += 50;
  2038. obj.hard = dis + obj.kickAngle * 3;
  2039. hole = true;
  2040. }
  2041. }
  2042. }
  2043. }
  2044. if (hole) {
  2045. this.scoreBall.push(obj);
  2046. this.holeBall.push(obj);
  2047. }
  2048. }
  2049. this.scoreBall.sort(function (a, b) {
  2050. return a.hard - b.hard;
  2051. });
  2052. this.holeBall.sort(function (a, b) {
  2053. return a.kickAngle - b.kickAngle;
  2054. });
  2055. this.kickBall.sort(function (a, b) {
  2056. return a.borderDis - b.borderDis;
  2057. });
  2058. }
  2059. else {
  2060. let max = list.length - 1;
  2061. let i = xGame.tools.random(0, max);
  2062. for (i; i <= max; i++) {
  2063. let idx = i >= max ? i -= max : i;
  2064. let obj = list[idx];
  2065. if (obj && obj.number != 0) {
  2066. obj.kickAngle = xGame.tools.random(90, 180);
  2067. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2068. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2069. this.lineBall.push(obj);
  2070. break;
  2071. }
  2072. }
  2073. }
  2074. }
  2075. selectBall() {
  2076. let ball = null;
  2077. this.destRot = 0;
  2078. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2079. let ai = 110 - this.aiLv * 10;
  2080. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2081. let score = false;
  2082. if (this.scoreBall.length < 1) {
  2083. if (this.lineBall.length < 1) {
  2084. for (let i = 0; i < this.kickBall.length; i++) {
  2085. let list = [];
  2086. let bo = this.kickBall[i];
  2087. let bobj = bo.gameObj;
  2088. let rect = xGame.common.d2World.borderRect;
  2089. let mobj = this.wBall.gameObj;
  2090. let minb = bobj.y - rect.y - 20;
  2091. let minw = mobj.y - rect.y - 50;
  2092. if (minb > 0 && minw > 0) {
  2093. let dlenx = 0;
  2094. let dleny = mobj.y - rect.y;
  2095. let spx = mobj.x;
  2096. let spy = rect.y - dleny;
  2097. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2098. }
  2099. minb = rect.y + rect.height - bobj.y - 20;
  2100. minw = rect.y + rect.height - mobj.y - 50;
  2101. if (minb > 0 && minw > 0) {
  2102. let dlenx = 0;
  2103. let dleny = rect.y + rect.height - mobj.y;
  2104. let spx = mobj.x;
  2105. let spy = rect.y + rect.height + dleny;
  2106. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2107. }
  2108. minb = bobj.x - rect.x - 20;
  2109. minw = mobj.x - rect.x - 50;
  2110. if (minb > 0 && minw > 0) {
  2111. let dlenx = mobj.x - rect.x;
  2112. let dleny = 0;
  2113. let spx = rect.x - dlenx;
  2114. let spy = mobj.y;
  2115. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2116. }
  2117. minb = rect.x + rect.width - bobj.x - 20;
  2118. minw = rect.x + rect.width - mobj.x - 50;
  2119. if (minb > 0 && minw > 0) {
  2120. let dlenx = rect.x + rect.width - mobj.x;
  2121. let dleny = 0;
  2122. let spx = rect.x + rect.width + dlenx;
  2123. let spy = mobj.y;
  2124. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2125. }
  2126. list.sort(function (a, b) {
  2127. return a.order - b.order;
  2128. });
  2129. for (let i = 0; i < list.length; i++) {
  2130. let data = list[i];
  2131. let mx = mobj.x - bobj.x;
  2132. let my = mobj.y - bobj.y;
  2133. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2134. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2135. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2136. if (num > 1)
  2137. num = 1;
  2138. let cos = Math.acos(num);
  2139. if (cos > 1.57)
  2140. cos = 1.57;
  2141. else if (cos < 0.01)
  2142. cos = 0.01;
  2143. let tan = Math.tan(cos);
  2144. let dx = tan * data.dleny;
  2145. let dy = tan * data.dlenx;
  2146. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2147. if (Math.abs(bx - 667) < 40)
  2148. continue;
  2149. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2150. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2151. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2152. this.forceMax = dis * 0.08;
  2153. this.destRot += mis * 0.1;
  2154. this.setKick(bx, by);
  2155. return true;
  2156. }
  2157. }
  2158. }
  2159. }
  2160. else {
  2161. ball = xGame.common.getRandArrEle(this.lineBall);
  2162. }
  2163. }
  2164. else {
  2165. for (let i = 0; i < this.scoreBall.length; i++) {
  2166. if (i < this.scoreBall.length - 1) {
  2167. let rand = 70 + this.aiLv * 10 + i * 10;
  2168. if (xGame.tools.random(0, 100) < rand) {
  2169. ball = this.scoreBall[i];
  2170. break;
  2171. }
  2172. }
  2173. else {
  2174. ball = this.scoreBall[i];
  2175. break;
  2176. }
  2177. }
  2178. score = true;
  2179. this.selectNum++;
  2180. }
  2181. if (!ball)
  2182. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2183. if (this.selectNum >= max) {
  2184. let dx = ball.gameObj.x;
  2185. let dy = ball.gameObj.y;
  2186. let kickAngle = 0;
  2187. if (score) {
  2188. dx = ball.kickPos.x;
  2189. dy = ball.kickPos.y;
  2190. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2191. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2192. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2193. if (adot > 1)
  2194. adot = 1;
  2195. kickAngle = Math.acos(adot) * 57.3;
  2196. if (kickAngle > 45) {
  2197. let kdx = ball.kickPos.x - ball.gameObj.x;
  2198. let kdy = ball.kickPos.y - ball.gameObj.y;
  2199. dx = ball.kickPos.x - kdx * mis * 0.3;
  2200. dy = ball.kickPos.y - kdy * mis * 0.3;
  2201. }
  2202. else
  2203. this.destRot += mis;
  2204. }
  2205. else if (ball.poleAngle != 0) {
  2206. this.destRot += ball.poleAngle;
  2207. }
  2208. if (xGame.common.gameMode == 0) {
  2209. let af = kickAngle * 0.08;
  2210. this.forceMax = ball.hard * 0.1 + af * af;
  2211. }
  2212. this.setKick(dx, dy);
  2213. }
  2214. else {
  2215. let rand = this.aiLv * 5 + 40;
  2216. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2217. ball = xGame.common.getRandArrEle(this.scoreBall);
  2218. else
  2219. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2220. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2221. if (xGame.tools.random(0, 100) > rand) {
  2222. this.selectNum = max;
  2223. }
  2224. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2225. this.selectNum++;
  2226. }
  2227. ball.onClick(0, true);
  2228. }
  2229. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2230. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2231. let balls = xGame.common.d2World.ballArr;
  2232. let max = xGame.tools.getDis(hx, hy, bx, by);
  2233. for (let index = 0; index < balls.length; index++) {
  2234. let obj = balls[index];
  2235. if (obj.number == 0)
  2236. continue;
  2237. if (obj.number == bn || obj.number == dn)
  2238. continue;
  2239. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2240. if (dis * dis > max)
  2241. continue;
  2242. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2243. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2244. if (num > 1)
  2245. num = 1;
  2246. if (num < 0)
  2247. continue;
  2248. let gap = Math.sin(Math.acos(num)) * dis;
  2249. if (gap < this.ballSize)
  2250. return true;
  2251. }
  2252. return false;
  2253. }
  2254. isLine(xy, ball) {
  2255. let bx = xy.x;
  2256. let by = xy.y;
  2257. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2258. let dis = ball.getDestDis(xy);
  2259. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2260. let sin = Math.sin(angle);
  2261. let cos = Math.cos(angle);
  2262. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2263. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2264. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2265. let dx = bx + this.tempDir2.x * dis;
  2266. let dy = by + this.tempDir2.y * dis;
  2267. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2268. sin = Math.sin(-angle);
  2269. cos = Math.cos(-angle);
  2270. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2271. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2272. dx = bx + this.tempDir2.x * dis;
  2273. dy = by + this.tempDir2.y * dis;
  2274. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2275. if (isr && isl)
  2276. return false;
  2277. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2278. }
  2279. return true;
  2280. }
  2281. turnPole() {
  2282. this.turnNum++;
  2283. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2284. let dr = rot - this.destRot;
  2285. let abs = Math.abs(dr) % 360;
  2286. if (abs > 180) {
  2287. if (rot > 180)
  2288. rot -= 360;
  2289. if (this.destRot > 180)
  2290. this.destRot -= 360;
  2291. }
  2292. let max = this.turnNum * 5 + this.aiLv * 5;
  2293. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2294. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2295. let at = xGame.tools.random(1000, 2000);
  2296. if (!this.onAway(3))
  2297. at += xGame.tools.random(10000, 15000);
  2298. this.setState(AIState.shoot, at);
  2299. }
  2300. else {
  2301. let mr = 0;
  2302. if (abs > 3)
  2303. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2304. else if (Math.random() > 0.6)
  2305. mr = xGame.tools.random(1, 10) * 0.1;
  2306. mr = dr > 0 ? -mr : mr;
  2307. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2308. }
  2309. }
  2310. setKick(dx, dy) {
  2311. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2312. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2313. this.tempDir1.x = 0;
  2314. this.tempDir1.y = 1;
  2315. this.tempDir2.y = -this.tempDir2.y;
  2316. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2317. if (num > 1)
  2318. num = 1;
  2319. let rot = Math.acos(num) * 57.3;
  2320. if (this.tempDir2.x < 0)
  2321. rot = 360 - rot;
  2322. this.destRot += rot;
  2323. if (!xGame.common.gameMgr.finishOneShoot) {
  2324. this.forceMax += xGame.tools.random(10, 50);
  2325. this.forceMax -= this.aiLv * 2;
  2326. if (this.forceMax < 20)
  2327. this.forceMax = 20;
  2328. }
  2329. if (this.forceMax > 100)
  2330. this.forceMax = 101;
  2331. else if (this.forceMax < 10)
  2332. this.forceMax += xGame.tools.random(0, 10);
  2333. if (xGame.common.gameMode == 1)
  2334. this.forceMax = xGame.tools.random(80, 100);
  2335. else
  2336. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2337. let max = 2000 - this.aiLv * 100;
  2338. if (Math.random() > 0.8)
  2339. max += xGame.tools.random(100, 2000);
  2340. this.setState(AIState.turn, xGame.tools.random(500, max));
  2341. }
  2342. shoot() {
  2343. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2344. if (Math.random() > 0.8) {
  2345. this.gameSrc.aiForce(1);
  2346. this.setState(AIState.wait);
  2347. }
  2348. }
  2349. else {
  2350. let df = xGame.tools.random(3, 8);
  2351. if (this.forceNum < this.forceMax)
  2352. this.forceNum += df;
  2353. else
  2354. this.forceNum -= df;
  2355. let startY = this.gameSrc.ui.powerNode.y;
  2356. let height = this.gameSrc.ui.powerNode.height;
  2357. let force = startY + height * this.forceNum * 0.01;
  2358. this.gameSrc.aiForce(2, force);
  2359. }
  2360. }
  2361. reset() {
  2362. for (let i = 0; i < 4; i++) {
  2363. this.setRate--;
  2364. this.setNum++;
  2365. let pos = this.posList[this.posIdx];
  2366. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2367. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2368. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2369. this.rootPos.x = 387;
  2370. if (this.rootPos.x < this.rectL)
  2371. this.rootPos.x = this.rectL;
  2372. else if (this.rootPos.x > this.rectR)
  2373. this.rootPos.x = this.rectR;
  2374. if (this.rootPos.y < this.rectT)
  2375. this.rootPos.y = this.rectT;
  2376. else if (this.rootPos.y > this.rectB)
  2377. this.rootPos.y = this.rectB;
  2378. this.posIdx++;
  2379. let max = this.posList.length;
  2380. if (this.posIdx >= max)
  2381. this.posIdx -= max;
  2382. this.initHoleBall();
  2383. let ball = null;
  2384. if (this.scoreBall.length > 0)
  2385. ball = this.scoreBall[0];
  2386. else if (this.lineBall.length > 0)
  2387. ball = xGame.common.getRandArrEle(this.lineBall);
  2388. if (ball && ball.kickAngle < this.bestAngle) {
  2389. this.bestAngle = ball.kickAngle;
  2390. this.bestKick.x = ball.kickPos.x;
  2391. this.bestKick.y = ball.kickPos.y;
  2392. this.bestPos.x = this.rootPos.x;
  2393. this.bestPos.y = this.rootPos.y;
  2394. this.bestForce = ball.hard * 0.08;
  2395. }
  2396. }
  2397. if (this.setNum >= this.setMax)
  2398. this.setMax = 0;
  2399. if (this.setRate < 1) {
  2400. this.setState(AIState.move, 0);
  2401. this.rootMoveTime = Laya.timer.currTimer;
  2402. this.gameSrc.aiRootMove(true);
  2403. }
  2404. }
  2405. delayLine() {
  2406. this.gameSrc.aiRootMove(false);
  2407. }
  2408. move() {
  2409. if (this.bestPos.x < 1)
  2410. this.bestPos = this.rootPos;
  2411. let wObj = this.wBall.gameObj;
  2412. let destx = wObj.x;
  2413. let desty = wObj.y;
  2414. let dx = Math.abs(destx - this.bestPos.x);
  2415. let dy = Math.abs(desty - this.bestPos.y);
  2416. let mx = 3 + dx * 0.03;
  2417. let my = 3 + dy * 0.03;
  2418. if (dx < 4 && dy < 4) {
  2419. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2420. dt = dt < 1000 ? 1000 - dt : 0;
  2421. if (this.setMax > 0) {
  2422. let min = this.setMax * 0.3 + this.aiLv * 5;
  2423. this.setRate = xGame.tools.random(min, this.setMax);
  2424. this.setState(AIState.reset, 0);
  2425. }
  2426. else {
  2427. this.destRot = 0;
  2428. this.forceMax = this.bestForce;
  2429. this.setKick(this.bestKick.x, this.bestKick.y);
  2430. }
  2431. if (dt > 100) {
  2432. Laya.timer.clear(this, this.delayLine);
  2433. Laya.timer.once(dt, this, this.delayLine);
  2434. }
  2435. else
  2436. this.gameSrc.aiRootMove(false);
  2437. }
  2438. else {
  2439. if (dx > 4)
  2440. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2441. if (dy > 4)
  2442. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2443. this.gameSrc.onRootMove({ x: destx, y: desty });
  2444. }
  2445. }
  2446. resetRoot() {
  2447. this.bestAngle = 180;
  2448. this.bestForce = 0;
  2449. this.setMax = this.posList.length;
  2450. this.posIdx = xGame.tools.random(0, this.setMax);
  2451. let min = this.setMax * 0.3 + this.aiLv * 5;
  2452. this.setRate = xGame.tools.random(min, this.setMax);
  2453. let max = 2000 - this.aiLv * 100;
  2454. if (Math.random() > 0.8)
  2455. max += xGame.tools.random(100, 1000);
  2456. if (this.isGuide)
  2457. this.setState(AIState.select, 500);
  2458. else if (this.onAway(2))
  2459. this.setState(AIState.reset, xGame.tools.random(400, max));
  2460. else
  2461. this.setState(AIState.none);
  2462. if (xGame.common.gameMgr.finishOneShoot)
  2463. this.chat();
  2464. }
  2465. runAI() {
  2466. if (this.state > AIState.idle)
  2467. return;
  2468. this.initBall();
  2469. this.onGame(2500);
  2470. if (Math.random() > 0.6)
  2471. this.chat();
  2472. }
  2473. stopRun() {
  2474. this.setState(AIState.idle);
  2475. }
  2476. onGame(base) {
  2477. let max = base - this.aiLv * 100;
  2478. if (Math.random() > 0.8)
  2479. max += xGame.tools.random(100, 1000);
  2480. if (this.onAway(2))
  2481. this.setState(AIState.select, xGame.tools.random(500, max));
  2482. else
  2483. this.setState(AIState.none);
  2484. }
  2485. setState(sta, wt = 0) {
  2486. if (this.state == AIState.none)
  2487. return;
  2488. this.state = sta;
  2489. this.waitTime = wt;
  2490. }
  2491. onUpdate() {
  2492. if (this.state == AIState.none)
  2493. return;
  2494. this.awayTime -= this.dtime;
  2495. if (this.awayTime < 1) {
  2496. this.awayTime = xGame.tools.random(6000, 10000);
  2497. this.awayNum += (11 - this.aiLv);
  2498. this.onAway(1);
  2499. }
  2500. if (this.waitTime >= 0) {
  2501. this.waitTime -= this.dtime;
  2502. return;
  2503. }
  2504. switch (this.state) {
  2505. case AIState.idle:
  2506. this.chat();
  2507. break;
  2508. case AIState.reset:
  2509. this.reset();
  2510. break;
  2511. case AIState.move:
  2512. this.move();
  2513. break;
  2514. case AIState.leave:
  2515. this.state = AIState.none;
  2516. xGame.common.gameMgr.aiGameEnd(true);
  2517. break;
  2518. case AIState.select:
  2519. this.selectBall();
  2520. break;
  2521. case AIState.turn:
  2522. this.turnPole();
  2523. break;
  2524. case AIState.shoot:
  2525. this.shoot();
  2526. break;
  2527. }
  2528. }
  2529. onAway(type) {
  2530. if (type == 1) {
  2531. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2532. let num = this.awayNum + db * 20;
  2533. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2534. xGame.common.gameMgr.aiLeave();
  2535. this.setState(AIState.leave, 6666);
  2536. }
  2537. }
  2538. else if (type == 2) {
  2539. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2540. let num = this.awayNum + db * 30;
  2541. if (xGame.tools.random(0, 10000) < num)
  2542. return false;
  2543. }
  2544. else if (type == 3) {
  2545. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2546. let num = this.awayNum + db * 10;
  2547. if (xGame.tools.random(0, 4000) < num)
  2548. return false;
  2549. }
  2550. return true;
  2551. }
  2552. chat() {
  2553. if (this.chatTime > 0) {
  2554. this.chatTime -= this.dtime;
  2555. return;
  2556. }
  2557. this.chatTime = xGame.tools.random(2000, 10000);
  2558. let rand = xGame.tools.random(0, 100);
  2559. if (rand < 15)
  2560. this.talk();
  2561. else if (rand < 35)
  2562. this.emotion();
  2563. }
  2564. talk() {
  2565. xGame.common.talkMgr.showAITalk(0);
  2566. }
  2567. emotion() {
  2568. xGame.common.talkMgr.showAIEmotion(0);
  2569. }
  2570. resetAI() {
  2571. this.stopRun();
  2572. this.state = AIState.none;
  2573. }
  2574. }
  2575. class Partical extends Laya.Script3D {
  2576. constructor() {
  2577. super();
  2578. this.duration = 2000;
  2579. }
  2580. ;
  2581. onAwake() {
  2582. this.gameObj = this.owner;
  2583. }
  2584. onEnable() {
  2585. this.openTimer();
  2586. }
  2587. openTimer() {
  2588. Laya.timer.once(this.duration, this, this.disappear);
  2589. }
  2590. setCallback(obj, callback) {
  2591. this.obj = obj;
  2592. this.callback = callback;
  2593. Laya.timer.clearAll(this);
  2594. Laya.timer.once(this.duration, this, this.disappear);
  2595. }
  2596. disappear() {
  2597. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2598. this.callback && this.callback(this.obj);
  2599. }
  2600. }
  2601. class Ball extends Laya.Script3D {
  2602. constructor() {
  2603. super();
  2604. this.posV3 = new Laya.Vector3();
  2605. this.rotRate = 2.1;
  2606. this.rotSpeed = new Laya.Vector3();
  2607. this.myIndex = 0;
  2608. }
  2609. onAwake() {
  2610. this.gameObj = this.owner;
  2611. this.transform = this.gameObj.transform;
  2612. this.ballNode = this.gameObj.getChildByName("Ball");
  2613. this.shadowNode = this.gameObj.getChildByName("shadow");
  2614. }
  2615. initSelf(index, x, y, owner) {
  2616. this.d2BallSrc = owner;
  2617. this.myIndex = index;
  2618. this.setAlbedoTexture();
  2619. this.setTransPos(x, y);
  2620. this.setScale();
  2621. this.ballNode.transform.localRotationEulerX = 90;
  2622. if (index == 0) {
  2623. }
  2624. }
  2625. setAlbedoTexture(isIce = false) {
  2626. let url;
  2627. if (isIce) {
  2628. url = `res/d3Res/ballTexture/ice.jpg`;
  2629. }
  2630. else {
  2631. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2632. }
  2633. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2634. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2635. }));
  2636. }
  2637. runFireworks(obj, delay, callback) {
  2638. Laya.timer.clearAll(this);
  2639. Laya.timer.once(delay + 1, this, () => {
  2640. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2641. fire.transform.localPositionX = this.transform.localPositionX;
  2642. fire.transform.localPositionY = this.transform.localPositionY;
  2643. fire.transform.localPositionZ = this.transform.localPositionZ;
  2644. let src = fire.getComponent(Partical);
  2645. src.duration = 1000;
  2646. src.setCallback(obj, callback);
  2647. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2648. eft.transform.localPositionX = this.transform.localPositionX;
  2649. eft.transform.localPositionY = this.transform.localPositionY;
  2650. eft.transform.localPositionZ = this.transform.localPositionZ;
  2651. });
  2652. }
  2653. setTransPos(x, y) {
  2654. this.setRotation();
  2655. xGame.common.pos2to3Convert(x, y, this.posV3);
  2656. this.transform.localPositionX = this.posV3.x;
  2657. this.transform.localPositionY = 0;
  2658. this.transform.localPositionZ = this.posV3.z;
  2659. this.transform.localRotationEulerX = 0;
  2660. this.transform.localRotationEulerY = 0;
  2661. this.transform.localRotationEulerZ = 0;
  2662. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2663. this.shadowNode.transform.localPositionY = 0.1;
  2664. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2665. }
  2666. setRotation() {
  2667. if (this.d2BallSrc.canRot) {
  2668. let speed = this.d2BallSrc.rigy.linearVelocity;
  2669. this.rotSpeed.x = speed.x * this.rotRate;
  2670. this.rotSpeed.z = speed.y * this.rotRate;
  2671. this.rotSpeed.y = this.d2BallSrc.rotY;
  2672. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2673. }
  2674. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2675. this.rotSpeed.x = this.rotSpeed.y = 0;
  2676. this.rotSpeed.y = this.d2BallSrc.rotY;
  2677. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2678. }
  2679. }
  2680. setScale() {
  2681. let radius = xGame.common.d2World.rootBall.ui.width;
  2682. let scale = xGame.common.scale2to3Convert(radius);
  2683. this.transform.localScaleX = scale;
  2684. this.transform.localScaleY = scale;
  2685. this.transform.localScaleZ = scale;
  2686. }
  2687. playInHoleEft() {
  2688. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2689. eft.transform.position = this.transform.position;
  2690. }
  2691. playIceEft() {
  2692. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2693. eft.transform.position = this.transform.position;
  2694. }
  2695. get scaleXYZ() {
  2696. return this.transform.localScaleX;
  2697. }
  2698. set scaleXYZ(val) {
  2699. this.transform.localScaleX = val;
  2700. this.transform.localScaleY = val;
  2701. this.transform.localScaleZ = val;
  2702. }
  2703. get posX() {
  2704. return this.transform.localPositionX;
  2705. }
  2706. set posX(val) {
  2707. this.transform.localPositionX = val;
  2708. }
  2709. get posY() {
  2710. return this.transform.localPositionY;
  2711. }
  2712. set posY(val) {
  2713. this.transform.localPositionY = val;
  2714. }
  2715. get posZ() {
  2716. return this.transform.localPositionZ;
  2717. }
  2718. set posZ(val) {
  2719. this.transform.localPositionZ = val;
  2720. }
  2721. destroySelf() {
  2722. this.posV3 = null;
  2723. this.rotSpeed = null;
  2724. this.d2BallSrc = null;
  2725. this.ballNode = null;
  2726. this.gameObj.destroy(true);
  2727. this.transform = null;
  2728. this.destroy();
  2729. }
  2730. }
  2731. class ui_D2Ball extends fgui.GComponent {
  2732. static createInstance() {
  2733. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2734. }
  2735. onConstruct() {
  2736. this.myIcon = (this.getChild("myIcon"));
  2737. this.inner = (this.getChild("inner"));
  2738. this.n8 = (this.getChild("n8"));
  2739. this.n4 = (this.getChild("n4"));
  2740. this.wrongTips = (this.getChild("wrongTips"));
  2741. this.rightTips = (this.getChild("rightTips"));
  2742. this.breathAni = this.getTransition("breathAni");
  2743. }
  2744. }
  2745. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2746. class D2BallSrc extends Laya.Script {
  2747. constructor() {
  2748. super();
  2749. this.number = 0;
  2750. this.startX = 0;
  2751. this.startY = 0;
  2752. this.angleV2 = new Laya.Vector2();
  2753. this.isRootBall = false;
  2754. this.isBlackBall = false;
  2755. this.ballType = "";
  2756. this.canRot = true;
  2757. this.rotY = 0;
  2758. this.poleAngle = 0;
  2759. this.kickPos = { x: 0, y: 0 };
  2760. this.hard = 0;
  2761. this.kickAngle = 0;
  2762. this.borderDis = 0;
  2763. this.speedP10 = 5.6;
  2764. this.lastSpeed = { x: 0, y: 0 };
  2765. this.stillSpeed = 0.12;
  2766. this.ballFunc = "normal";
  2767. this.isRunSkillAni = false;
  2768. this.isInHole = false;
  2769. this.iceOwner = "";
  2770. this.forceRun = false;
  2771. this.myUNID = "";
  2772. this.rectL = 0;
  2773. this.rectR = 0;
  2774. this.rectT = 0;
  2775. this.rectB = 0;
  2776. this.forceVec = new Laya.Vector2();
  2777. this.lastDis = 0;
  2778. this.helpOut = { type: "", x: 0, y: 0 };
  2779. }
  2780. initSelf(number, x, y, d3Ball) {
  2781. if (!this.gameObj)
  2782. this.gameObj = this.owner;
  2783. this.number = number;
  2784. this.startX = x;
  2785. this.startY = y;
  2786. this.d3Ball = d3Ball;
  2787. this.isRootBall = false;
  2788. this.isBlackBall = false;
  2789. this.ballType = "";
  2790. if (number == 0) {
  2791. this.isRootBall = true;
  2792. }
  2793. else if (number == 8) {
  2794. this.isBlackBall = true;
  2795. }
  2796. else {
  2797. if (number <= 7) {
  2798. this.ballType = ballCamp.full;
  2799. }
  2800. else {
  2801. this.ballType = ballCamp.flower;
  2802. }
  2803. }
  2804. this.setInfo();
  2805. this.setD3Ball();
  2806. this.owner["mySrc"] = this;
  2807. this.rigy.linearDamping = 1;
  2808. D2BallSrc._unid++;
  2809. this.myUNID = "d2ball" + D2BallSrc._unid;
  2810. let rect = xGame.common.d2World.borderRect;
  2811. this.rectL = Math.ceil(rect.x) + 20;
  2812. this.rectT = Math.ceil(rect.y) + 20;
  2813. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2814. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2815. }
  2816. setInfo() {
  2817. this.gameObj.x = this.startX;
  2818. this.gameObj.y = this.startY;
  2819. let radius = this.ui.width / 2;
  2820. this.gameObj.width = radius * 2;
  2821. this.gameObj.height = radius * 2;
  2822. if (xGame.common.showDebug) {
  2823. this.ui.myIcon.alpha = 1;
  2824. this.ui.inner.alpha = 1;
  2825. }
  2826. else {
  2827. this.ui.myIcon.alpha = 0;
  2828. this.ui.inner.alpha = 0;
  2829. }
  2830. }
  2831. setD3Ball() {
  2832. this.d3Ball = this.d3Ball;
  2833. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2834. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2835. }
  2836. onUpdate() {
  2837. if (xGame.common.gameMgr.gamePause)
  2838. return;
  2839. if (this.isInHole)
  2840. return;
  2841. if (!xGame.common.d2World.openCheckStill)
  2842. return;
  2843. this.runBall();
  2844. }
  2845. runBall() {
  2846. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2847. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2848. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2849. this.judgeBorder();
  2850. }
  2851. getDestDis(dest) {
  2852. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2853. }
  2854. setmyXY(x, y) {
  2855. this.d3BallSrc.setTransPos(x, y);
  2856. }
  2857. getSpeed() {
  2858. let speed = this.rigy.linearVelocity;
  2859. return speed.x * speed.x + speed.y * speed.y;
  2860. }
  2861. onTriggerEnter(collider) {
  2862. if (!collider || !collider.owner)
  2863. return;
  2864. let coll = "collide";
  2865. let speed = this.getSpeed();
  2866. let sv2 = this.speedP10 * this.speedP10;
  2867. if (collider.label == "ball") {
  2868. if (speed < 9 && this.number != 0)
  2869. coll = "";
  2870. else if (speed < sv2)
  2871. coll = "collide_4";
  2872. else if (speed < sv2 * 6.2)
  2873. coll = "collide_3";
  2874. else if (speed < sv2 * 25)
  2875. coll = "collide_2";
  2876. else if (speed < sv2 * 56)
  2877. coll = "collide_1";
  2878. xGame.soundMgr.playSound(coll);
  2879. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2880. if (collider.owner) {
  2881. let rig = collider.owner.getComponent(D2BallSrc);
  2882. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2883. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2884. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2885. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2886. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2887. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2888. let rx = 0;
  2889. let ry = 0;
  2890. if (this.gameObj.x < this.rectL)
  2891. rx = vx;
  2892. else if (this.gameObj.x > this.rectR)
  2893. rx = -vx;
  2894. else if (this.gameObj.y < this.rectT)
  2895. ry = vy;
  2896. else if (this.gameObj.y > this.rectB)
  2897. ry = -vy;
  2898. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2899. }
  2900. }
  2901. if (this.number != 0) {
  2902. return;
  2903. }
  2904. else {
  2905. if (this.forceRun) {
  2906. console.log("randon force");
  2907. this.applyForce(collider);
  2908. }
  2909. }
  2910. if (xGame.common.d2World.isOnSameLine) {
  2911. xGame.common.d2World.isOnSameLine = false;
  2912. this.rigy.linearVelocity = { x: 0, y: 0 };
  2913. }
  2914. if (xGame.common.gameMgr.firstColliObj == null) {
  2915. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2916. xGame.common.gameMgr.isTouchedBall = true;
  2917. }
  2918. }
  2919. else {
  2920. xGame.common.recoverCameraView();
  2921. let wallStr = "";
  2922. if (speed < 9) { }
  2923. else if (speed < sv2) { }
  2924. else if (speed < sv2 * 6.2)
  2925. wallStr = "wall_30";
  2926. else if (speed < sv2 * 25)
  2927. wallStr = "wall_50";
  2928. else if (speed < sv2 * 56)
  2929. wallStr = "wall_80";
  2930. xGame.soundMgr.playSound(wallStr);
  2931. }
  2932. }
  2933. applyForce(collider) {
  2934. let src = collider.owner.mySrc;
  2935. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2936. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2937. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2938. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2939. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2940. }
  2941. checkWrongBall(playEft = true) {
  2942. if (this.isInHole)
  2943. return;
  2944. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2945. if (this.number != 0 && playEft)
  2946. this.d3BallSrc.playInHoleEft();
  2947. let coll = "inpocket_1";
  2948. let speed = this.getSpeed();
  2949. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2950. if (speed < 9 && this.number != 0)
  2951. coll = "";
  2952. else if (speed < sv2 * 6.2)
  2953. coll = "inpocket_4";
  2954. else if (speed < sv2 * 25)
  2955. coll = "collide_3";
  2956. else if (speed < sv2 * 56)
  2957. coll = "collide_2";
  2958. xGame.soundMgr.playSound(coll);
  2959. this.isInHole = true;
  2960. if (this.number == 0) {
  2961. console.log("白球进了。。");
  2962. this.reset();
  2963. this.rigy.linearVelocity = { x: 0, y: 0 };
  2964. this.hideSelf();
  2965. xGame.common.gameUI.ui.whiteAni.visible = true;
  2966. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2967. xGame.common.gameUI.ui.whiteAni.visible = false;
  2968. }));
  2969. }
  2970. else {
  2971. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2972. xGame.common.d2World.removeOneBall(this);
  2973. this.destroySelf();
  2974. xGame.common.playHappySound(this.number);
  2975. this.runFlyEft();
  2976. }
  2977. }
  2978. runFlyEft() {
  2979. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2980. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2981. }
  2982. }
  2983. hideSelf() {
  2984. if (this.d3Ball)
  2985. this.d3Ball.active = false;
  2986. }
  2987. showSelf() {
  2988. this.isInHole = false;
  2989. if (this.d3Ball && !this.d3Ball.active)
  2990. this.d3Ball.active = true;
  2991. }
  2992. isStill() {
  2993. let speed = this.rigy.linearVelocity;
  2994. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2995. this.rigy.linearVelocity = { x: 0, y: 0 };
  2996. return true;
  2997. }
  2998. return false;
  2999. }
  3000. reset() {
  3001. }
  3002. destroySelf() {
  3003. this.d3BallSrc.destroySelf();
  3004. if (!this.ui.isDisposed) {
  3005. this.ui.removeFromParent();
  3006. this.ui.dispose();
  3007. this.ui = null;
  3008. }
  3009. this.outColli = null;
  3010. this.innerColli = null;
  3011. this.rigy = null;
  3012. this.d3Ball = null;
  3013. this.d3BallSrc = null;
  3014. this.angleV2 = null;
  3015. this.gameObj.destroy(true);
  3016. this.destroy();
  3017. }
  3018. judgeBorder() {
  3019. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3020. return;
  3021. }
  3022. if (this.destroyed)
  3023. return;
  3024. if (xGame.common.gameMode == GameMode.classic)
  3025. return;
  3026. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3027. if (isOver) {
  3028. this.checkWrongBall();
  3029. }
  3030. }
  3031. onClick(e, force = false) {
  3032. if (this.number == 0)
  3033. return;
  3034. if (force) {
  3035. }
  3036. else {
  3037. if (xGame.common.d2World.openCheckStill)
  3038. return;
  3039. if (!xGame.common.gameMgr.selfTurn) {
  3040. return;
  3041. }
  3042. }
  3043. if (!xGame.common.gameMgr.finishOneShoot)
  3044. return;
  3045. let root = xGame.common.d2World.rootBall.gameObj;
  3046. let x = this.gameObj.x - root.x;
  3047. let y = this.gameObj.y - root.y;
  3048. let angle = xGame.common.getfguiRotation(x, y);
  3049. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3050. xGame.common.d2World.getHelpLine();
  3051. xGame.common.clickedBall = true;
  3052. this.checkGuide();
  3053. }
  3054. checkGuide() {
  3055. let guide = DataMgr.getSkillGuide();
  3056. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3057. xGame.common.guideStep++;
  3058. xGame.common.gameUI.ui.guide1.visible = false;
  3059. xGame.common.gameUI.ui.guide2.visible = true;
  3060. }
  3061. }
  3062. checkDistance(disX, disY, angle) {
  3063. let diameter = this.gameObj.width - 1;
  3064. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3065. if (!this.lastDis)
  3066. this.lastDis = dis;
  3067. else {
  3068. if (dis > this.lastDis) {
  3069. this.helpOut.type = "remove";
  3070. return this.helpOut;
  3071. }
  3072. }
  3073. if (dis <= Math.pow(diameter, 2)) {
  3074. let del = 0.01;
  3075. let offest = 0;
  3076. let realX = disX - this.gameObj.x;
  3077. let realY = disY - this.gameObj.y;
  3078. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3079. offest += del;
  3080. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3081. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3082. }
  3083. this.helpOut.type = "ok";
  3084. this.helpOut.x = realX + this.gameObj.x;
  3085. this.helpOut.y = realY + this.gameObj.y;
  3086. return this.helpOut;
  3087. }
  3088. else {
  3089. this.helpOut.type = "no";
  3090. return this.helpOut;
  3091. }
  3092. }
  3093. clearBallEft() {
  3094. this.clearBallRightEft();
  3095. this.clearBallWrongEft();
  3096. }
  3097. clearBallRightEft() {
  3098. this.ui.breathAni.stop();
  3099. this.ui.rightTips.visible = false;
  3100. }
  3101. clearBallWrongEft() {
  3102. this.ui.wrongTips.visible = false;
  3103. }
  3104. showWrongEft() {
  3105. if (!xGame.common.gameMgr.selfTurn)
  3106. return;
  3107. this.ui.wrongTips.visible = true;
  3108. }
  3109. showRightEft() {
  3110. if (!xGame.common.gameMgr.selfTurn)
  3111. return;
  3112. this.ui.rightTips.visible = true;
  3113. this.ui.rightTips.scaleX = 1;
  3114. this.ui.rightTips.scaleY = 1;
  3115. this.ui.breathAni.play();
  3116. }
  3117. setBallFunc(type, owner) {
  3118. if (type == "ice") {
  3119. this.ballFunc = type;
  3120. this.d3BallSrc.setAlbedoTexture(true);
  3121. this.rigy.type = "static";
  3122. this.iceOwner = owner;
  3123. }
  3124. else {
  3125. if (owner == this.iceOwner) {
  3126. this.ballFunc = type;
  3127. this.d3BallSrc.setAlbedoTexture(false);
  3128. this.rigy.type = "dynamic";
  3129. }
  3130. }
  3131. }
  3132. }
  3133. D2BallSrc._unid = 0;
  3134. class D2RootBallSrc extends D2BallSrc {
  3135. constructor() {
  3136. super();
  3137. this.maxSpeed = 0;
  3138. this.classicMaxSpeed = 2.2;
  3139. this.bigSkillMaxSpeed = 4;
  3140. this.angle = 0;
  3141. this.allPercent = 0;
  3142. this.linearPercent = 0;
  3143. this.anglePercent = 0;
  3144. this.maxAngleRate = 0.6;
  3145. this.baseRot = 7;
  3146. this.angleMax = 0;
  3147. this.speed = new Laya.Vector2();
  3148. this.rotSpeed = new Laya.Vector2();
  3149. }
  3150. isStill() {
  3151. let speed = this.rigy.linearVelocity;
  3152. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3153. if (this.anglePercent <= 0.1) {
  3154. this.rigy.linearVelocity = { x: 0, y: 0 };
  3155. return true;
  3156. }
  3157. }
  3158. return false;
  3159. }
  3160. reset() {
  3161. this.linearPercent = 0;
  3162. this.anglePercent = 0;
  3163. }
  3164. setSpeed(percent, angle) {
  3165. this.allPercent = percent;
  3166. this.angle = angle;
  3167. this.setAngleSpeed();
  3168. this.setLinearSpeed();
  3169. let hit = "hit";
  3170. if (percent < 25)
  3171. hit = "hit03";
  3172. else if (percent < 50)
  3173. hit = "hit02";
  3174. else if (percent < 75)
  3175. hit = "hit01";
  3176. xGame.soundMgr.playSound(hit);
  3177. }
  3178. setAngleSpeed() {
  3179. let offest = xGame.common.rodOffest;
  3180. let radius = 82;
  3181. let rate = Math.abs(offest.y / radius) * 0.5;
  3182. if (offest.y > 0)
  3183. this.angleMax = -this.baseRot * 2;
  3184. else
  3185. this.angleMax = this.baseRot;
  3186. this.rotY = -offest.x / radius * 100;
  3187. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3188. this.linearPercent = this.allPercent - this.anglePercent;
  3189. }
  3190. setLinearSpeed() {
  3191. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3192. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3193. if (!xGame.common.longHelpLine) {
  3194. let offset = -150 + xGame.common.randomNum(0, 300);
  3195. offset /= 100;
  3196. this.angle += offset;
  3197. }
  3198. }
  3199. }
  3200. let sin = Math.sin(this.angle * Math.PI / 180);
  3201. let cos = Math.cos(this.angle * Math.PI / 180);
  3202. switch (xGame.common.gameMode) {
  3203. case GameMode.classic:
  3204. this.maxSpeed = this.classicMaxSpeed;
  3205. break;
  3206. case GameMode.bigMove:
  3207. this.maxSpeed = this.bigSkillMaxSpeed;
  3208. break;
  3209. case GameMode.placeBall:
  3210. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3211. if (data.type == 1) {
  3212. this.maxSpeed = this.bigSkillMaxSpeed;
  3213. }
  3214. else {
  3215. this.maxSpeed = this.classicMaxSpeed;
  3216. }
  3217. break;
  3218. default:
  3219. break;
  3220. }
  3221. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3222. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3223. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3224. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3225. this.rigy.applyLinearImpulseToCenter(this.speed);
  3226. }
  3227. onUpdate() {
  3228. if (this.anglePercent > 0.1) {
  3229. this.anglePercent *= 0.97;
  3230. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3231. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3232. this.rigy.applyForceToCenter(this.rotSpeed);
  3233. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3234. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3235. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3236. if (num > 0.9)
  3237. this.canRot = true;
  3238. }
  3239. else
  3240. this.canRot = true;
  3241. if (Math.abs(this.rotY) > 0.1)
  3242. this.rotY *= 0.98;
  3243. super.onUpdate();
  3244. }
  3245. destroySelf() {
  3246. super.destroySelf();
  3247. this.speed = null;
  3248. }
  3249. }
  3250. class D2Ball extends Laya.Sprite {
  3251. constructor(isRootBall = false) {
  3252. super();
  3253. this.ui = ui_D2Ball.createInstance();
  3254. this.pivotX = this.ui.width / 2;
  3255. this.pivotY = this.ui.width / 2;
  3256. this.x = 0;
  3257. this.y = 0;
  3258. this.addChild(this.ui.displayObject);
  3259. this.ui.displayObject.x += this.ui.width / 2;
  3260. this.ui.displayObject.y += this.ui.width / 2;
  3261. if (isRootBall) {
  3262. this.d2Src = this.addComponent(D2RootBallSrc);
  3263. }
  3264. else {
  3265. this.d2Src = this.addComponent(D2BallSrc);
  3266. }
  3267. this.d2Src.ui = this.ui;
  3268. this.addCircleCollider();
  3269. this.addInnerCircleCollider();
  3270. this.addRigyBody();
  3271. }
  3272. addCircleCollider() {
  3273. let colli = xGame.common.getCollider("circle");
  3274. colli.radius = this.ui.width / 2;
  3275. this.addComponentIntance(colli);
  3276. this.d2Src.outColli = colli;
  3277. colli.label = "ball";
  3278. }
  3279. addInnerCircleCollider() {
  3280. let colli = xGame.common.getCollider("circle");
  3281. colli.radius = this.ui.inner.width / 2;
  3282. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3283. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3284. this.addComponentIntance(colli);
  3285. this.d2Src.innerColli = colli;
  3286. colli.label = "inner";
  3287. }
  3288. addRigyBody() {
  3289. let rigy = xGame.common.getRigbody();
  3290. rigy.type = "dynamic";
  3291. this.addComponentIntance(rigy);
  3292. this.d2Src.rigy = rigy;
  3293. }
  3294. disposeSelf() {
  3295. if (!this.ui.isDisposed) {
  3296. this.ui.dispose();
  3297. this.ui.removeFromParent();
  3298. this.ui = null;
  3299. }
  3300. }
  3301. }
  3302. class ui_D2Gan extends fgui.GComponent {
  3303. static createInstance() {
  3304. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3305. }
  3306. onConstruct() {
  3307. this.myIcon = (this.getChild("myIcon"));
  3308. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3309. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3310. this.self = (this.getChild("self"));
  3311. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3312. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3313. this.ai = (this.getChild("ai"));
  3314. }
  3315. }
  3316. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3317. class D2Gan {
  3318. constructor() {
  3319. this.offset = 0.15;
  3320. this.cell = 1.5;
  3321. this.onBallCell = 0.4;
  3322. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3323. this.moveNum = 70;
  3324. this.rulerRate = 0.1;
  3325. this.ui = ui_D2Gan.createInstance();
  3326. this.changeSelfRod();
  3327. this.changeAIRod();
  3328. }
  3329. changeSelfRod() {
  3330. let index = DataMgr.getCurBallRod();
  3331. let data = cfgTable.ballrodData[index + 1];
  3332. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3333. this.selfMySpine && this.selfMySpine.dispose();
  3334. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3335. if (data.spine) {
  3336. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3337. this.selfMySpine = new SpineMgr(data.spine, () => {
  3338. let xx = this.ui.selfEftRoot.width / 2;
  3339. let yy = this.ui.selfEftRoot.height / 2;
  3340. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3341. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3342. outSpine.rotation = -90;
  3343. });
  3344. }
  3345. }
  3346. changeAIRod() {
  3347. let length = Object.keys(cfgTable.ballrodData).length;
  3348. let rand = Math.floor(length * Math.random()) + 1;
  3349. let data = cfgTable.ballrodData[rand];
  3350. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3351. this.aiMySpine && this.aiMySpine.dispose();
  3352. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3353. if (data.spine) {
  3354. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3355. this.aiMySpine = new SpineMgr(data.spine, () => {
  3356. let xx = this.ui.aiEftRoot.width / 2;
  3357. let yy = this.ui.aiEftRoot.height / 2;
  3358. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3359. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3360. outSpine.rotation = -90;
  3361. });
  3362. }
  3363. }
  3364. setGanLastInfo() {
  3365. this.lastInfo.rotation = this.ui.rotation;
  3366. this.lastInfo.x = this.ui.x;
  3367. this.lastInfo.y = this.ui.y;
  3368. }
  3369. rotateSelf(flag, isRuler = false) {
  3370. let angle;
  3371. flag = flag * this.offset;
  3372. if (xGame.common.d2World.isHelpLineOnBall) {
  3373. angle = flag * this.onBallCell;
  3374. }
  3375. else {
  3376. angle = flag * this.cell;
  3377. }
  3378. if (isRuler) {
  3379. angle *= this.rulerRate;
  3380. }
  3381. this.ui.rotation += angle;
  3382. xGame.common.d2World.getHelpLine();
  3383. }
  3384. checkDistance() {
  3385. let target = xGame.common.d2World.targetBall;
  3386. let root = xGame.common.d2World.rootBall;
  3387. if (target == null) {
  3388. return 1;
  3389. }
  3390. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3391. if (dis <= 2500) {
  3392. return 5;
  3393. }
  3394. return 1;
  3395. }
  3396. rotDest(rot) {
  3397. this.ui.rotation = rot;
  3398. xGame.common.d2World.getHelpLine();
  3399. }
  3400. storagePower(powerNum) {
  3401. let pos = (powerNum / 100) * this.moveNum;
  3402. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3403. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3404. this.ui.x = this.lastInfo.x + xx;
  3405. this.ui.y = this.lastInfo.y + yy;
  3406. }
  3407. shoot() {
  3408. this.storagePower(0);
  3409. this.ui.visible = false;
  3410. }
  3411. destroySelf() {
  3412. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3413. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3414. this.selfMySpine && this.selfMySpine.dispose();
  3415. this.aiMySpine && this.aiMySpine.dispose();
  3416. this.lastInfo = null;
  3417. if (!this.ui.isDisposed) {
  3418. this.ui.removeFromParent();
  3419. this.ui.dispose();
  3420. }
  3421. }
  3422. }
  3423. class ui_HelpLine extends fgui.GComponent {
  3424. static createInstance() {
  3425. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3426. }
  3427. onConstruct() {
  3428. this.n10 = (this.getChild("n10"));
  3429. this.rect = (this.getChild("rect"));
  3430. this.dir11 = (this.getChild("dir11"));
  3431. this.dir = (this.getChild("dir"));
  3432. this.rootDir = (this.getChild("rootDir"));
  3433. this.dirDot = (this.getChild("dirDot"));
  3434. }
  3435. }
  3436. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3437. class D2HelpLine {
  3438. constructor() {
  3439. this.starX = 0;
  3440. this.starY = 0;
  3441. this.ui = ui_HelpLine.createInstance();
  3442. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3443. this.starX = this.ui.rect.x;
  3444. this.starY = this.ui.rect.y;
  3445. }
  3446. shoot() {
  3447. this.ui.visible = false;
  3448. }
  3449. destroySelf() {
  3450. if (this.ui.isDisposed) {
  3451. this.ui.removeFromParent();
  3452. this.ui.dispose();
  3453. }
  3454. }
  3455. }
  3456. class D2World extends Laya.Script {
  3457. constructor() {
  3458. super();
  3459. this.ballArr = [];
  3460. this.openCheckStill = false;
  3461. this.checkArr = [];
  3462. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3463. this.isHelpLineOnBall = false;
  3464. this.isOnSameLine = false;
  3465. this.reflectAngle = 0;
  3466. this.powerPercent = 0;
  3467. this.inHolesSpeed = [];
  3468. this.outDir = new Laya.Vector2();
  3469. this.rootDir = new Laya.Vector2();
  3470. this.aiLv = 0;
  3471. this.rootPos = new Laya.Vector2();
  3472. this.tempDir1 = new Laya.Vector2();
  3473. this.tempDir2 = new Laya.Vector2();
  3474. this.tempDir3 = new Laya.Vector2();
  3475. this.ballSize = 33;
  3476. this.destRot = 0;
  3477. }
  3478. initSelf() {
  3479. this.createBalls();
  3480. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3481. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3482. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3483. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3484. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3485. }
  3486. setBorderRect() {
  3487. let ui = xGame.common.gameUI.ui;
  3488. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3489. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3490. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3491. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3492. this.borderRect.x = starX;
  3493. this.borderRect.y = starY;
  3494. this.borderRect.width = width;
  3495. this.borderRect.height = height;
  3496. }
  3497. resetGame() {
  3498. this.openCheckStill = false;
  3499. let temp;
  3500. for (let index = 0; index < this.ballArr.length; index++) {
  3501. temp = this.ballArr[index];
  3502. temp.destroySelf();
  3503. }
  3504. xGame.common.d3World.ballRoot.destroyChildren();
  3505. xGame.common.gameUI.ui.ballNode.removeChildren();
  3506. console.log("进入摧毁逻辑");
  3507. this.d2Gan.destroySelf();
  3508. this.d2HelpLine.destroySelf();
  3509. this.ballArr = [];
  3510. }
  3511. setD2Gan() {
  3512. let ballNode = this.rootBall.ui;
  3513. let d2Gan = new D2Gan();
  3514. this.d2Gan = d2Gan;
  3515. let ganNode = d2Gan.ui;
  3516. ballNode.addChild(ganNode);
  3517. ganNode.pivotX = ganNode.pivotX;
  3518. ganNode.pivotY = ganNode.pivotY;
  3519. ganNode.x = ganNode.myIcon.width / 2;
  3520. ganNode.y = this.rootBall.gameObj.width;
  3521. d2Gan.setGanLastInfo();
  3522. }
  3523. setHelpLine() {
  3524. let d2Help = new D2HelpLine();
  3525. this.d2HelpLine = d2Help;
  3526. }
  3527. createBalls() {
  3528. let cfg;
  3529. switch (xGame.common.gameMode) {
  3530. case GameMode.classic:
  3531. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3532. break;
  3533. case GameMode.bigMove:
  3534. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3535. break;
  3536. case GameMode.placeBall:
  3537. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3538. break;
  3539. default:
  3540. break;
  3541. }
  3542. cfg = JSON.parse(JSON.stringify(cfg));
  3543. for (const key in cfg) {
  3544. if (cfg[key].value == 0) {
  3545. this.createRootBall(cfg[key]);
  3546. delete cfg[key];
  3547. break;
  3548. }
  3549. }
  3550. this.createOtherBalls(cfg);
  3551. }
  3552. createRootBall(data) {
  3553. let root = new D2Ball(true);
  3554. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3555. this.rootBall = root.d2Src;
  3556. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3557. let d3BallSrc = d3Ball.getComponent(Ball);
  3558. xGame.common.d3World.rootBall = d3Ball;
  3559. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3560. let xx = data.x;
  3561. let yy = data.y;
  3562. let numer = data.value;
  3563. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3564. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3565. this.ballArr.push(this.rootBall);
  3566. this.setD2Gan();
  3567. this.setHelpLine();
  3568. }
  3569. createOtherBalls(cfg) {
  3570. let temp;
  3571. let src;
  3572. let data;
  3573. for (const key in cfg) {
  3574. data = cfg[key];
  3575. temp = new D2Ball();
  3576. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3577. src = temp.d2Src;
  3578. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3579. src.initSelf(data.value, data.x, data.y, d3Ball);
  3580. this.ballArr.push(src);
  3581. }
  3582. }
  3583. shoot(percent) {
  3584. this.powerPercent = percent;
  3585. this.openCheckStill = true;
  3586. let d2Angle = this.d2Gan.ui.rotation;
  3587. this.rootBall.setSpeed(percent, d2Angle);
  3588. this.clearBallAllEft();
  3589. this.changePlayerView();
  3590. }
  3591. onUpdate() {
  3592. if (!this.openCheckStill)
  3593. return;
  3594. this.checkStill();
  3595. }
  3596. checkStill() {
  3597. for (let index = 0; index < this.ballArr.length; index++) {
  3598. if (!this.ballArr[index].isStill()) {
  3599. return;
  3600. }
  3601. }
  3602. xGame.eventMgr.event(ALL_BALL_STOP);
  3603. }
  3604. allBallStop() {
  3605. this.openCheckStill = false;
  3606. xGame.common.recoverCameraView();
  3607. }
  3608. waitShoot() {
  3609. if (!this.d2Gan.ui.isDisposed) {
  3610. this.d2Gan.ui.visible = true;
  3611. }
  3612. if (!this.d2HelpLine.ui.isDisposed) {
  3613. this.d2HelpLine.ui.visible = true;
  3614. }
  3615. this.clearBallAllEft();
  3616. this.showBallRightEft();
  3617. this.getHelpLine();
  3618. this.inHolesSpeed = [];
  3619. this.selectOneBall();
  3620. }
  3621. _getAllBallArr() {
  3622. let arr = this.ballArr;
  3623. let outArr = [];
  3624. for (let index = 0; index < arr.length; index++) {
  3625. if (arr[index] instanceof D2RootBallSrc)
  3626. continue;
  3627. if (arr[index].ballFunc == "ice")
  3628. continue;
  3629. if (arr[index].destroyed)
  3630. continue;
  3631. outArr.push(arr[index]);
  3632. }
  3633. return outArr;
  3634. }
  3635. _getBlackObj() {
  3636. let arr = this.ballArr;
  3637. for (let index = 0; index < arr.length; index++) {
  3638. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3639. return arr[index];
  3640. }
  3641. }
  3642. }
  3643. selectOneBall() {
  3644. let all = this._getAllBallArr();
  3645. let target;
  3646. switch (xGame.common.gameMode) {
  3647. case GameMode.classic:
  3648. if (xGame.common.gameMgr.selfTurn) {
  3649. let self = xGame.common.gameMgr.selfBallArr;
  3650. let black = this._getBlackObj();
  3651. if (xGame.common.gameMgr.ensureBallType) {
  3652. if (self.length > 0) {
  3653. let out = [];
  3654. for (let j = 0; j < all.length; j++) {
  3655. if (self.indexOf(all[j].number) > -1) {
  3656. out.push(all[j]);
  3657. }
  3658. }
  3659. target = this.selectBestEnterOne(out);
  3660. }
  3661. else {
  3662. target = this.selectBestEnterOne([black]);
  3663. }
  3664. }
  3665. else {
  3666. target = this.selectBestEnterOne(all);
  3667. }
  3668. }
  3669. else {
  3670. target = this.selectBestEnterOne(all);
  3671. }
  3672. break;
  3673. case GameMode.bigMove:
  3674. target = this.selectBestEnterOne(all);
  3675. break;
  3676. case GameMode.placeBall:
  3677. if (all.length > 0) {
  3678. target = this.selectBestEnterOne(all);
  3679. }
  3680. break;
  3681. default:
  3682. break;
  3683. }
  3684. if (target && !target.destroyed && target.onClick) {
  3685. target.onClick(0, true);
  3686. let num = -200 + xGame.common.randomNum(0, 400);
  3687. num /= 150;
  3688. if (xGame.common.longHelpLine) {
  3689. num = 0;
  3690. }
  3691. this.destRot += num;
  3692. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3693. }
  3694. }
  3695. removeOneBall(ball) {
  3696. for (let index = 0; index < this.ballArr.length; index++) {
  3697. if (this.ballArr[index].id == ball.id) {
  3698. this.ballArr.splice(index, 1);
  3699. break;
  3700. }
  3701. }
  3702. }
  3703. getHelpLine() {
  3704. this.d2HelpLine.ui.dirDot.visible = false;
  3705. this.isOnSameLine = false;
  3706. let startX = this.rootBall.gameObj.x;
  3707. let startY = this.rootBall.gameObj.y;
  3708. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3709. if (dis == null) {
  3710. this.d2HelpLine.ui.visible = false;
  3711. console.error("辅助线异常");
  3712. return;
  3713. }
  3714. this.d2HelpLine.ui.visible = true;
  3715. let angle = this.d2Gan.ui.rotation;
  3716. let radius = 16.5;
  3717. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3718. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3719. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3720. if (colliObj == null) {
  3721. this.getColliPos(disX, disY, radius, angle);
  3722. xGame.common.d2World.isHelpLineOnBall = false;
  3723. this.targetBall = null;
  3724. this.reflectAngle = 0;
  3725. this.showBallWrongEft();
  3726. }
  3727. else {
  3728. let target = colliObj.src;
  3729. let radius = 16.5;
  3730. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3731. dis1 = Math.sqrt(dis1);
  3732. let realDis = colliObj.disHon - dis1;
  3733. let dir = colliObj.dir;
  3734. let xx = startX + dir.x * realDis;
  3735. let yy = startY + dir.y * realDis;
  3736. this.getColliPos(xx, yy, radius, angle);
  3737. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3738. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3739. let offset = xGame.common.rodOffest;
  3740. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3741. this.isOnSameLine = true;
  3742. }
  3743. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3744. xGame.common.d2World.isHelpLineOnBall = true;
  3745. this.targetBall = target;
  3746. this.reflectAngle = reflectAngle;
  3747. this.showBallWrongEft();
  3748. if (xGame.common.longHelpLine) {
  3749. this.delayReflectLine(target, reflectAngle);
  3750. }
  3751. }
  3752. }
  3753. getBorderDot(startX, startY, angle) {
  3754. let radius = 17;
  3755. let distance;
  3756. let isDone;
  3757. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3758. isDone = this.judgeUpDown(distance, angle, startX);
  3759. if (isDone != null) {
  3760. return isDone;
  3761. }
  3762. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3763. isDone = this.judgeUpDown(distance, angle, startX);
  3764. if (isDone != null) {
  3765. return isDone;
  3766. }
  3767. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3768. isDone = this.judgeLeftRight(distance, angle, startY);
  3769. if (isDone != null) {
  3770. return isDone;
  3771. }
  3772. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3773. isDone = this.judgeLeftRight(distance, angle, startY);
  3774. if (isDone != null) {
  3775. return isDone;
  3776. }
  3777. }
  3778. judgeUpDown(distance, angle, startX) {
  3779. let flag = Math.sin(angle * Math.PI / 180);
  3780. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3781. if (distance >= 0) {
  3782. if (flag > 0) {
  3783. if (temp < this.borderRect.x + this.borderRect.width) {
  3784. return distance;
  3785. }
  3786. }
  3787. else {
  3788. if (temp > this.borderRect.x) {
  3789. return distance;
  3790. }
  3791. }
  3792. }
  3793. }
  3794. judgeLeftRight(distance, angle, starY) {
  3795. let flag = -Math.cos(angle * Math.PI / 180);
  3796. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3797. if (distance >= 0) {
  3798. if (flag > 0) {
  3799. if (temp < this.borderRect.y + this.borderRect.height) {
  3800. return distance;
  3801. }
  3802. }
  3803. else {
  3804. if (temp > this.borderRect.y) {
  3805. return distance;
  3806. }
  3807. }
  3808. }
  3809. }
  3810. clearBallAllEft() {
  3811. let temp;
  3812. for (let index = 0; index < this.ballArr.length; index++) {
  3813. temp = this.ballArr[index];
  3814. temp.clearBallEft();
  3815. }
  3816. }
  3817. showBallRightEft() {
  3818. let gameMgr = xGame.common.gameMgr;
  3819. let temp;
  3820. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3821. if (targetArr.length <= 0)
  3822. return;
  3823. for (let index = 0; index < this.ballArr.length; index++) {
  3824. temp = this.ballArr[index];
  3825. if (targetArr.indexOf(temp.number) > -1) {
  3826. temp.showRightEft();
  3827. }
  3828. }
  3829. }
  3830. showBallWrongEft() {
  3831. let gameMgr = xGame.common.gameMgr;
  3832. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3833. if (targetArr.length <= 0)
  3834. return;
  3835. let temp;
  3836. for (let index = 0; index < this.ballArr.length; index++) {
  3837. temp = this.ballArr[index];
  3838. if (this.targetBall && this.targetBall.number == temp.number) {
  3839. if (targetArr.indexOf(temp.number) <= -1) {
  3840. temp.showWrongEft();
  3841. }
  3842. else {
  3843. temp.clearBallWrongEft();
  3844. }
  3845. }
  3846. else {
  3847. temp.clearBallWrongEft();
  3848. }
  3849. }
  3850. }
  3851. getColliPos(x, y, radius, angle) {
  3852. this.d2HelpLine.ui.x = x;
  3853. this.d2HelpLine.ui.y = y;
  3854. let dirX = x - this.rootBall.gameObj.x;
  3855. let dirY = y - this.rootBall.gameObj.y;
  3856. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3857. if (rectH <= 0)
  3858. rectH = 0;
  3859. this.d2HelpLine.ui.rect.height = 0;
  3860. this.d2HelpLine.ui.rect.height = rectH;
  3861. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3862. if (rectH < this.rootBall.gameObj.width) {
  3863. this.d2HelpLine.ui.rect.visible = false;
  3864. }
  3865. else {
  3866. this.d2HelpLine.ui.rect.visible = true;
  3867. }
  3868. this.d2HelpLine.ui.dir.visible = false;
  3869. this.d2HelpLine.ui.rootDir.visible = false;
  3870. }
  3871. getReflectLine(x, y, radius, target) {
  3872. this.d2HelpLine.ui.dir.visible = true;
  3873. let dirX = target.x - x;
  3874. let dirY = target.y - y;
  3875. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3876. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3877. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3878. this.d2HelpLine.ui.dir.height = 48;
  3879. this.d2HelpLine.ui.dir.rotation = angle;
  3880. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3881. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3882. return angle;
  3883. }
  3884. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3885. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3886. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3887. let targetX = target.gameObj.x;
  3888. let targetY = target.gameObj.y;
  3889. this.outDir.setValue(targetX - xx, targetY - yy);
  3890. this.rootDir.setValue(rtX - xx, rtY - yy);
  3891. let ver = Math.PI / 2;
  3892. let sin = Math.sin(ver);
  3893. let cos = Math.cos(ver);
  3894. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3895. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3896. this.outDir.setValue(outX, outY);
  3897. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3898. Laya.Vector2.normalize(this.outDir, this.outDir);
  3899. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3900. if (Math.abs(result) <= 0.08) {
  3901. this.d2HelpLine.ui.rootDir.visible = false;
  3902. return;
  3903. }
  3904. if (result > 0) {
  3905. angle += 90;
  3906. }
  3907. else if (result < 0) {
  3908. angle -= 90;
  3909. }
  3910. this.d2HelpLine.ui.rootDir.visible = true;
  3911. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3912. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3913. this.d2HelpLine.ui.rootDir.rotation = angle;
  3914. }
  3915. delayReflectLine(obj, angle) {
  3916. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3917. return;
  3918. }
  3919. this.isOnSameLine = false;
  3920. let startX = obj.gameObj.x;
  3921. let startY = obj.gameObj.y;
  3922. let dis = this.getBorderDot(startX, startY, angle);
  3923. if (dis == null) {
  3924. this.d2HelpLine.ui.dirDot.visible = false;
  3925. return;
  3926. }
  3927. this.d2HelpLine.ui.visible = true;
  3928. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3929. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3930. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3931. if (colliObj == null) {
  3932. this.setDelayLine(disX, disY, obj, angle);
  3933. }
  3934. else {
  3935. let radius = 16;
  3936. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3937. dis1 = Math.sqrt(dis1);
  3938. let realDis = colliObj.disHon - dis1;
  3939. let dir = colliObj.dir;
  3940. let xx = startX + dir.x * realDis;
  3941. let yy = startY + dir.y * realDis;
  3942. this.setDelayLine(xx, yy, obj, angle);
  3943. }
  3944. }
  3945. setDelayLine(x, y, obj, angle) {
  3946. let dirX = x - obj.gameObj.x;
  3947. let dirY = y - obj.gameObj.y;
  3948. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3949. if (rectH <= 0)
  3950. rectH = 0;
  3951. this.d2HelpLine.ui.dir.height = rectH;
  3952. this.d2HelpLine.ui.dirDot.visible = true;
  3953. this.d2HelpLine.ui.dirDot.x = 17;
  3954. this.d2HelpLine.ui.dirDot.y = 17;
  3955. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3956. ;
  3957. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3958. }
  3959. changePlayerView() {
  3960. if (Math.random() >= 0.7)
  3961. return;
  3962. if (!this.targetBall) {
  3963. return;
  3964. }
  3965. if (!xGame.common.gameMgr.selfTurn)
  3966. return;
  3967. switch (xGame.common.gameMode) {
  3968. case GameMode.classic:
  3969. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3970. if (this.targetBall.number != 8) {
  3971. return;
  3972. }
  3973. }
  3974. break;
  3975. case GameMode.bigMove:
  3976. return;
  3977. case GameMode.placeBall:
  3978. break;
  3979. default:
  3980. break;
  3981. }
  3982. let startX = this.targetBall.gameObj.x;
  3983. let startY = this.targetBall.gameObj.y;
  3984. let angle = this.reflectAngle;
  3985. let dis = this.getBorderDot(startX, startY, angle);
  3986. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3987. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3988. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3989. if (colliObj) {
  3990. return;
  3991. }
  3992. let offset = 40;
  3993. let posObj = xGame.common.gameMgr.posObj;
  3994. let temp;
  3995. let radius;
  3996. let tarX, tarY;
  3997. for (const key in posObj) {
  3998. temp = posObj[key];
  3999. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4000. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4001. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4002. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4003. xGame.common.showOneCamera("angle" + key);
  4004. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4005. Laya.physicsTimer.scale = 0.7;
  4006. break;
  4007. }
  4008. }
  4009. }
  4010. selectBestEnterOne(arr) {
  4011. this.aiLv = xGame.tools.random(1, 11);
  4012. this.aiLv = 10;
  4013. this.wBall = xGame.common.d2World.rootBall;
  4014. this.rootPos.x = this.wBall.gameObj.x;
  4015. this.rootPos.y = this.wBall.gameObj.y;
  4016. this.initHoleBall(arr);
  4017. return this.selectBall();
  4018. }
  4019. selectBall() {
  4020. let ball = null;
  4021. this.destRot = 0;
  4022. let ai = 110 - this.aiLv * 10;
  4023. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4024. let score = false;
  4025. if (this.scoreBall.length < 1) {
  4026. if (this.lineBall.length < 1) {
  4027. for (let i = 0; i < this.kickBall.length; i++) {
  4028. let list = [];
  4029. let bo = this.kickBall[i];
  4030. let bobj = bo.gameObj;
  4031. let rect = xGame.common.d2World.borderRect;
  4032. let mobj = this.wBall.gameObj;
  4033. let minb = bobj.y - rect.y - 20;
  4034. let minw = mobj.y - rect.y - 50;
  4035. if (minb > 0 && minw > 0) {
  4036. let dlenx = 0;
  4037. let dleny = mobj.y - rect.y;
  4038. let spx = mobj.x;
  4039. let spy = rect.y - dleny;
  4040. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4041. }
  4042. minb = rect.y + rect.height - bobj.y - 20;
  4043. minw = rect.y + rect.height - mobj.y - 50;
  4044. if (minb > 0 && minw > 0) {
  4045. let dlenx = 0;
  4046. let dleny = rect.y + rect.height - mobj.y;
  4047. let spx = mobj.x;
  4048. let spy = rect.y + rect.height + dleny;
  4049. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4050. }
  4051. minb = bobj.x - rect.x - 20;
  4052. minw = mobj.x - rect.x - 50;
  4053. if (minb > 0 && minw > 0) {
  4054. let dlenx = mobj.x - rect.x;
  4055. let dleny = 0;
  4056. let spx = rect.x - dlenx;
  4057. let spy = mobj.y;
  4058. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4059. }
  4060. minb = rect.x + rect.width - bobj.x - 20;
  4061. minw = rect.x + rect.width - mobj.x - 50;
  4062. if (minb > 0 && minw > 0) {
  4063. let dlenx = rect.x + rect.width - mobj.x;
  4064. let dleny = 0;
  4065. let spx = rect.x + rect.width + dlenx;
  4066. let spy = mobj.y;
  4067. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4068. }
  4069. list.sort(function (a, b) {
  4070. return a.order - b.order;
  4071. });
  4072. for (let i = 0; i < list.length; i++) {
  4073. let data = list[i];
  4074. let mx = mobj.x - bobj.x;
  4075. let my = mobj.y - bobj.y;
  4076. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4077. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4078. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4079. if (num > 1)
  4080. num = 1;
  4081. let cos = Math.acos(num);
  4082. if (cos > 1.57)
  4083. cos = 1.57;
  4084. else if (cos < 0.01)
  4085. cos = 0.01;
  4086. let tan = Math.tan(cos);
  4087. let dx = tan * data.dleny;
  4088. let dy = tan * data.dlenx;
  4089. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4090. if (Math.abs(bx - 667) < 40)
  4091. continue;
  4092. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4093. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4094. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4095. this.forceMax = dis * 0.08;
  4096. this.destRot += mis * 0.1;
  4097. this.setKick(bx, by);
  4098. return true;
  4099. }
  4100. }
  4101. }
  4102. }
  4103. else {
  4104. ball = xGame.common.getRandArrEle(this.lineBall);
  4105. }
  4106. }
  4107. else {
  4108. for (let i = 0; i < this.scoreBall.length; i++) {
  4109. if (i < this.scoreBall.length - 1) {
  4110. let rand = 70 + this.aiLv * 10 + i * 10;
  4111. if (xGame.tools.random(0, 100) < rand) {
  4112. ball = this.scoreBall[i];
  4113. break;
  4114. }
  4115. }
  4116. else {
  4117. ball = this.scoreBall[i];
  4118. break;
  4119. }
  4120. }
  4121. score = true;
  4122. this.selectNum++;
  4123. }
  4124. if (!ball)
  4125. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4126. let dx = ball.gameObj.x;
  4127. let dy = ball.gameObj.y;
  4128. let kickAngle = 0;
  4129. if (score) {
  4130. dx = ball.kickPos.x;
  4131. dy = ball.kickPos.y;
  4132. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4133. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4134. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4135. if (adot > 1)
  4136. adot = 1;
  4137. kickAngle = Math.acos(adot) * 57.3;
  4138. if (kickAngle > 45) {
  4139. let kdx = ball.kickPos.x - ball.gameObj.x;
  4140. let kdy = ball.kickPos.y - ball.gameObj.y;
  4141. dx = ball.kickPos.x - kdx * mis * 0.3;
  4142. dy = ball.kickPos.y - kdy * mis * 0.3;
  4143. }
  4144. else
  4145. this.destRot += mis;
  4146. }
  4147. else if (ball.poleAngle != 0) {
  4148. this.destRot += ball.poleAngle;
  4149. }
  4150. if (xGame.common.gameMode == 0) {
  4151. let af = kickAngle * 0.08;
  4152. this.forceMax = ball.hard * 0.1 + af * af;
  4153. }
  4154. this.setKick(dx, dy);
  4155. return ball;
  4156. }
  4157. initHoleBall(arr) {
  4158. this.kickBall = [];
  4159. this.lineBall = [];
  4160. this.scoreBall = [];
  4161. this.holeBall = [];
  4162. this.selectNum = 0;
  4163. this.forceNum = 0;
  4164. this.forceMax = 0;
  4165. this.turnNum = 0;
  4166. let list = arr;
  4167. let holes = xGame.common.gameMgr.holePosList;
  4168. let self = xGame.common.aiPlayer;
  4169. for (let i = 0; i < list.length; i++) {
  4170. let obj = list[i];
  4171. if (!obj)
  4172. continue;
  4173. obj.kickPos.x = 0;
  4174. obj.kickPos.y = 0;
  4175. obj.poleAngle = 0;
  4176. obj.hard = 0;
  4177. obj.borderDis = 0;
  4178. obj.kickAngle = 180;
  4179. let b = obj.gameObj;
  4180. let wbp = this.rootPos;
  4181. let bx = wbp.x - b.x;
  4182. let by = wbp.y - b.y;
  4183. obj.borderDis = xGame.tools.random(0, 100);
  4184. this.kickBall.push(obj);
  4185. if (!this.isLine(wbp, obj))
  4186. continue;
  4187. obj.kickAngle = xGame.tools.random(90, 180);
  4188. obj.kickPos.x = b.x;
  4189. obj.kickPos.y = b.y;
  4190. this.lineBall.push(obj);
  4191. let minDis = 999999;
  4192. let hole = false;
  4193. for (let j = 0; j < holes.length; j++) {
  4194. let hp = holes[j];
  4195. if (bx >= 0 && hp.x > b.x + 100)
  4196. continue;
  4197. if (bx <= 0 && hp.x < b.x - 100)
  4198. continue;
  4199. if (by < -10 && hp.y < wbp.y)
  4200. continue;
  4201. if (by > 10 && hp.y > wbp.y)
  4202. continue;
  4203. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4204. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4205. if (dis < minDis) {
  4206. let dx = b.x - this.tempDir1.x * this.ballSize;
  4207. let dy = b.y - this.tempDir1.y * this.ballSize;
  4208. this.tempDir3.x = this.tempDir1.x;
  4209. this.tempDir3.y = this.tempDir1.y;
  4210. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4211. obj.kickPos.x = dx;
  4212. obj.kickPos.y = dy;
  4213. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4214. if (num > 1)
  4215. num = 1;
  4216. obj.kickAngle = Math.acos(num) * 57.3;
  4217. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4218. dis = dis * 2;
  4219. if (Math.abs(hp.x - 600) < 100)
  4220. dis += 50;
  4221. obj.hard = dis + obj.kickAngle * 3;
  4222. hole = true;
  4223. }
  4224. }
  4225. }
  4226. }
  4227. if (hole) {
  4228. this.scoreBall.push(obj);
  4229. this.holeBall.push(obj);
  4230. }
  4231. }
  4232. this.scoreBall.sort(function (a, b) {
  4233. return a.hard - b.hard;
  4234. });
  4235. this.holeBall.sort(function (a, b) {
  4236. return a.kickAngle - b.kickAngle;
  4237. });
  4238. this.kickBall.sort(function (a, b) {
  4239. return a.borderDis - b.borderDis;
  4240. });
  4241. }
  4242. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4243. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4244. let balls = xGame.common.d2World.ballArr;
  4245. let max = xGame.tools.getDis(hx, hy, bx, by);
  4246. for (let index = 0; index < balls.length; index++) {
  4247. let obj = balls[index];
  4248. if (obj.number == 0)
  4249. continue;
  4250. if (obj.number == bn || obj.number == dn)
  4251. continue;
  4252. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4253. if (dis * dis > max)
  4254. continue;
  4255. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4256. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4257. if (num > 1)
  4258. num = 1;
  4259. if (num < 0)
  4260. continue;
  4261. let gap = Math.sin(Math.acos(num)) * dis;
  4262. if (gap < this.ballSize)
  4263. return true;
  4264. }
  4265. return false;
  4266. }
  4267. isLine(xy, ball) {
  4268. let bx = xy.x;
  4269. let by = xy.y;
  4270. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4271. let dis = ball.getDestDis(xy);
  4272. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4273. let sin = Math.sin(angle);
  4274. let cos = Math.cos(angle);
  4275. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4276. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4277. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4278. let dx = bx + this.tempDir2.x * dis;
  4279. let dy = by + this.tempDir2.y * dis;
  4280. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4281. sin = Math.sin(-angle);
  4282. cos = Math.cos(-angle);
  4283. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4284. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4285. dx = bx + this.tempDir2.x * dis;
  4286. dy = by + this.tempDir2.y * dis;
  4287. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4288. if (isr && isl)
  4289. return false;
  4290. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4291. }
  4292. return true;
  4293. }
  4294. setKick(dx, dy) {
  4295. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4296. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4297. this.tempDir1.x = 0;
  4298. this.tempDir1.y = 1;
  4299. this.tempDir2.y = -this.tempDir2.y;
  4300. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4301. if (num > 1)
  4302. num = 1;
  4303. let rot = Math.acos(num) * 57.3;
  4304. if (this.tempDir2.x < 0)
  4305. rot = 360 - rot;
  4306. this.destRot += rot;
  4307. }
  4308. }
  4309. class ui_UIGame extends fgui.GComponent {
  4310. static createInstance() {
  4311. return (fgui.UIPackage.createObject("game", "UIGame"));
  4312. }
  4313. onConstruct() {
  4314. this.c1 = this.getController("c1");
  4315. this.d3Root = (this.getChild("d3Root"));
  4316. this.clickNode = (this.getChild("clickNode"));
  4317. this.d2Root = (this.getChild("d2Root"));
  4318. this.topNode = (this.getChild("topNode"));
  4319. this.n72 = (this.getChild("n72"));
  4320. this.n40 = (this.getChild("n40"));
  4321. this.rulerNode = (this.getChild("rulerNode"));
  4322. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4323. this.n50 = (this.getChild("n50"));
  4324. this.keduNode = (this.getChild("keduNode"));
  4325. this.powerTxt = (this.getChild("powerTxt"));
  4326. this.powerNode = (this.getChild("powerNode"));
  4327. this.colorNode = (this.getChild("colorNode"));
  4328. this.powerEft = (this.getChild("powerEft"));
  4329. this.myPowerNode = (this.getChild("myPowerNode"));
  4330. this.ganNode = (this.getChild("ganNode"));
  4331. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4332. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4333. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4334. this.skillRod = (this.getChild("skillRod"));
  4335. this.border = (this.getChild("border"));
  4336. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4337. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4338. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4339. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4340. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4341. this.guanyuNode = (this.getChild("guanyuNode"));
  4342. this.helpBtn = (this.getChild("helpBtn"));
  4343. this.wordsBtn = (this.getChild("wordsBtn"));
  4344. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4345. this.returnBtn = (this.getChild("returnBtn"));
  4346. this.ballNode = (this.getChild("ballNode"));
  4347. this.whiteAni = (this.getChild("whiteAni"));
  4348. this.blackAni = (this.getChild("blackAni"));
  4349. this.selfTurn = (this.getChild("selfTurn"));
  4350. this.aiTurn = (this.getChild("aiTurn"));
  4351. this.deskNode = (this.getChild("deskNode"));
  4352. this.moveNode = (this.getChild("moveNode"));
  4353. this.selfTalk = (this.getChild("selfTalk"));
  4354. this.aiTalk = (this.getChild("aiTalk"));
  4355. this.d2Node = (this.getChild("d2Node"));
  4356. this.snowNode = (this.getChild("snowNode"));
  4357. this.guide2 = (this.getChild("guide2"));
  4358. this.guide1 = (this.getChild("guide1"));
  4359. this.guide3 = (this.getChild("guide3"));
  4360. this.guideNode = (this.getChild("guideNode"));
  4361. }
  4362. }
  4363. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4364. class ui_UIGameEnd extends fgui.GComponent {
  4365. static createInstance() {
  4366. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4367. }
  4368. onConstruct() {
  4369. this.c1 = this.getController("c1");
  4370. this.n22 = (this.getChild("n22"));
  4371. this.n2 = (this.getChild("n2"));
  4372. this.n52 = (this.getChild("n52"));
  4373. this.n53 = (this.getChild("n53"));
  4374. this.coinNode = (this.getChild("coinNode"));
  4375. this.closeNode = (this.getChild("closeNode"));
  4376. this.moneyNode = (this.getChild("moneyNode"));
  4377. this.secretary = (this.getChild("secretary"));
  4378. this.n27 = (this.getChild("n27"));
  4379. this.n29 = (this.getChild("n29"));
  4380. this.talkNode = (this.getChild("talkNode"));
  4381. this.n38 = (this.getChild("n38"));
  4382. this.n39 = (this.getChild("n39"));
  4383. this.n40 = (this.getChild("n40"));
  4384. this.awardNode = (this.getChild("awardNode"));
  4385. this.starNumNode = (this.getChild("starNumNode"));
  4386. this.n47 = (this.getChild("n47"));
  4387. this.conditionNode = (this.getChild("conditionNode"));
  4388. this.isGetAward = (this.getChild("isGetAward"));
  4389. this.leftBtn = (this.getChild("leftBtn"));
  4390. this.rightBtn = (this.getChild("rightBtn"));
  4391. this.btnNode = (this.getChild("btnNode"));
  4392. }
  4393. }
  4394. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4395. class ui_UIAddCoin extends fgui.GComponent {
  4396. static createInstance() {
  4397. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4398. }
  4399. onConstruct() {
  4400. this.n11 = (this.getChild("n11"));
  4401. this.myNode = (this.getChild("myNode"));
  4402. this.t0 = this.getTransition("t0");
  4403. }
  4404. }
  4405. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4406. class UIAddCoin extends UIBase {
  4407. constructor() {
  4408. super();
  4409. this.coinNum = 2000;
  4410. }
  4411. onConstructor() {
  4412. this.ui = ui_UIAddCoin.createInstance();
  4413. this.contentPane = this.ui;
  4414. this.isEject = false;
  4415. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4416. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4417. }
  4418. show() {
  4419. super.show();
  4420. this.ui.t0.play();
  4421. }
  4422. videoAddCoin() {
  4423. console.log('zh:qjff_AD_for_UIAddCoin');
  4424. if (Laya.Browser.onAndroid) {
  4425. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4426. if (!boo) {
  4427. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4428. return;
  4429. }
  4430. }
  4431. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4432. }
  4433. else {
  4434. console.log('zh:AD 失败,直接发放奖励');
  4435. this.qjff_AD_for_UIAddCoin();
  4436. }
  4437. }
  4438. qjff_AD_for_UIAddCoin() {
  4439. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4440. this.hide();
  4441. }
  4442. }
  4443. UIAddCoin.uiName = "UIAddCoin";
  4444. class ui_UIInvitation extends fgui.GComponent {
  4445. static createInstance() {
  4446. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4447. }
  4448. onConstruct() {
  4449. this.n14 = (this.getChild("n14"));
  4450. this.myNode = (this.getChild("myNode"));
  4451. this.t0 = this.getTransition("t0");
  4452. }
  4453. }
  4454. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4455. class UIInvitation extends UIBase {
  4456. constructor() {
  4457. super();
  4458. }
  4459. onConstructor() {
  4460. this.ui = ui_UIInvitation.createInstance();
  4461. this.contentPane = this.ui;
  4462. this.isEject = false;
  4463. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4464. }
  4465. show() {
  4466. super.show();
  4467. }
  4468. enterGame() {
  4469. xGame.common.gameMode = GameMode.classic;
  4470. DataMgr.setChallengeTimes(1);
  4471. xGame.common.passAwardCoin = 2000;
  4472. let need = xGame.common.classicNiceNeddCoin;
  4473. if (DataMgr.coinEnough(need)) {
  4474. DataMgr.setCoin(-need);
  4475. xGame.eventMgr.event(RESTART_GAME, true);
  4476. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4477. }
  4478. else {
  4479. xGame.eventMgr.event(RESTART_GAME, true);
  4480. }
  4481. this.hide();
  4482. }
  4483. hide() {
  4484. super.hide();
  4485. }
  4486. }
  4487. UIInvitation.uiName = "UIInvitation";
  4488. class ui_UIMain extends fgui.GComponent {
  4489. static createInstance() {
  4490. return (fgui.UIPackage.createObject("game", "UIMain"));
  4491. }
  4492. onConstruct() {
  4493. this.n47 = (this.getChild("n47"));
  4494. this.n10 = (this.getChild("n10"));
  4495. this.secretary = (this.getChild("secretary"));
  4496. this.shopBtn = (this.getChild("shopBtn"));
  4497. this.moneyNode = (this.getChild("moneyNode"));
  4498. this.headNode = (this.getChild("headNode"));
  4499. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4500. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4501. this.classicBtn = (this.getChild("classicBtn"));
  4502. this.globalBtn = (this.getChild("globalBtn"));
  4503. this.n44 = (this.getChild("n44"));
  4504. this.signBtn = (this.getChild("signBtn"));
  4505. this.drawBtn = (this.getChild("drawBtn"));
  4506. this.settingNode = (this.getChild("settingNode"));
  4507. this.n_fuli = (this.getChild("n_fuli"));
  4508. this.n45 = (this.getChild("n45"));
  4509. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4510. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4511. this.rankBtn = (this.getChild("rankBtn"));
  4512. this.n46 = (this.getChild("n46"));
  4513. this.liucheng1 = (this.getChild("liucheng1"));
  4514. this.rightBtn = (this.getChild("rightBtn"));
  4515. this.n75 = (this.getChild("n75"));
  4516. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4517. this.liucheng2 = (this.getChild("liucheng2"));
  4518. this.guideBtn = (this.getChild("guideBtn"));
  4519. this.n73 = (this.getChild("n73"));
  4520. this.wordsNode = (this.getChild("wordsNode"));
  4521. this.enterGuide = (this.getChild("enterGuide"));
  4522. this.talkNode = (this.getChild("talkNode"));
  4523. this.n83 = (this.getChild("n83"));
  4524. this.n84 = (this.getChild("n84"));
  4525. this.n_Logout = (this.getChild("n_Logout"));
  4526. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4527. this.n_dengLu = (this.getChild("n_dengLu"));
  4528. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4529. }
  4530. }
  4531. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4532. class ui_UIMoyu extends fgui.GComponent {
  4533. static createInstance() {
  4534. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4535. }
  4536. onConstruct() {
  4537. this.ageTip = (this.getChild("ageTip"));
  4538. this.mainBg = (this.getChild("mainBg"));
  4539. this.xyNode = (this.getChild("xyNode"));
  4540. this.rnNode = (this.getChild("rnNode"));
  4541. this.fcmNode = (this.getChild("fcmNode"));
  4542. this.ageNode = (this.getChild("ageNode"));
  4543. this.tipNode = (this.getChild("tipNode"));
  4544. this.msgNode = (this.getChild("msgNode"));
  4545. }
  4546. }
  4547. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4548. class MoyuMgr {
  4549. static initMoyu() {
  4550. this.moyuView = new MoyuView();
  4551. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4552. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4553. this.moyuView.ui.displayObject.zOrder = 1000;
  4554. this.moyuView.init();
  4555. this.moyuView.showTip(true);
  4556. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4557. window['XApk'] = this;
  4558. }
  4559. static showAge(show) {
  4560. if (this.moyuView)
  4561. this.moyuView.showAge(show);
  4562. }
  4563. static onPlatMsg(idx) {
  4564. if (!MoyuMgr.moyuView)
  4565. return;
  4566. if (idx == '0') {
  4567. MoyuMgr.moyuView.showTip(false);
  4568. }
  4569. }
  4570. static showAgree(call) {
  4571. if (this.moyuView)
  4572. this.moyuView.showAgree(call);
  4573. else
  4574. call && call();
  4575. }
  4576. static showXy(type = 1) {
  4577. if (this.moyuView)
  4578. this.moyuView.showXy(type);
  4579. }
  4580. }
  4581. MoyuMgr.isAdvise = false;
  4582. class MoyuView {
  4583. constructor() {
  4584. this.ysxyNum = 1;
  4585. this.ysJson = null;
  4586. this.ui = ui_UIMoyu.createInstance();
  4587. }
  4588. init() {
  4589. this.ui.mainBg.visible = false;
  4590. this.ui.xyNode.visible = false;
  4591. this.ui.ageNode.visible = false;
  4592. this.ui.tipNode.visible = false;
  4593. this.ui.rnNode.visible = false;
  4594. this.ui.fcmNode.visible = false;
  4595. this.ui.ageTip.visible = false;
  4596. this.ui.msgNode.visible = false;
  4597. this.ui.visible = false;
  4598. this.ui.xyNode.xyList.setVirtual();
  4599. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4600. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4601. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4602. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4603. this.ui.xyNode.btnKnown.visible = false;
  4604. this.ui.xyNode.xy1.visible = false;
  4605. this.ui.xyNode.xy2.visible = false;
  4606. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4607. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4608. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4609. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4610. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4611. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4612. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4613. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4614. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4615. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4616. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4617. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4618. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4619. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4620. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4621. this.ysxyNum = 2;
  4622. }
  4623. }
  4624. onClick(obj) {
  4625. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4626. switch (obj) {
  4627. case this.ui.ageTip:
  4628. if (Moyu.isTTApk) {
  4629. this.ui.ageNode.visible = true;
  4630. this.ui.mainBg.visible = true;
  4631. }
  4632. break;
  4633. case this.ui.tipNode:
  4634. this.showTip(false);
  4635. break;
  4636. case this.ui.ageNode.btnAge:
  4637. this.ui.ageNode.visible = false;
  4638. this.ui.mainBg.visible = false;
  4639. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4640. this.ui.visible = false;
  4641. break;
  4642. case this.ui.xyNode.btnXy3:
  4643. case this.ui.xyNode.btnXy1:
  4644. this.loadXy(1);
  4645. break;
  4646. case this.ui.xyNode.btnXy2:
  4647. this.loadXy(2);
  4648. break;
  4649. case this.ui.xyNode.btnBack:
  4650. this.ui.xyNode.xy1.visible = true;
  4651. this.ui.xyNode.xy2.visible = false;
  4652. break;
  4653. case this.ui.xyNode.btnKnown:
  4654. this.ui.xyNode.visible = false;
  4655. this.ui.mainBg.visible = false;
  4656. this.ui.visible = false;
  4657. break;
  4658. case this.ui.rnNode.btnCheck:
  4659. this.check();
  4660. break;
  4661. case this.ui.rnNode.btnExit:
  4662. case this.ui.xyNode.btnNo:
  4663. this.ysxyNum--;
  4664. if (this.ysxyNum > 0)
  4665. this.showMsg("Refuse to quit the game once again");
  4666. else {
  4667. Moyu.userAgree(false);
  4668. Moyu.exit();
  4669. }
  4670. break;
  4671. case this.ui.xyNode.btnSure:
  4672. case this.ui.xyNode.btnYes:
  4673. DataMgr.userData.isAgree = true;
  4674. DataMgr.saveUserData();
  4675. this.onAgree();
  4676. break;
  4677. case this.ui.rnNode.btnDone:
  4678. this.ui.rnNode.visible = false;
  4679. this.ui.visible = false;
  4680. break;
  4681. case this.ui.fcmNode.btnRn:
  4682. this.showRn();
  4683. break;
  4684. }
  4685. }
  4686. showTip(show) {
  4687. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4688. return;
  4689. if (show) {
  4690. MoyuMgr.isAdvise = true;
  4691. this.ui.visible = true;
  4692. this.ui.tipNode.visible = true;
  4693. this.ui.tipNode.alpha = 1;
  4694. Laya.timer.once(1000, this, this.showTip, [false]);
  4695. }
  4696. else {
  4697. this.ui.tipNode.alpha = 1;
  4698. this.ui.tipNode.visible = true;
  4699. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4700. this.ui.tipNode.visible = false;
  4701. MoyuMgr.isAdvise = false;
  4702. }), 1000);
  4703. }
  4704. }
  4705. showAge(show, px = 0, py = 0) {
  4706. if (Moyu.platType > 10 && !Moyu.isIos) {
  4707. this.ui.ageTip.x = px;
  4708. this.ui.ageTip.y = py;
  4709. this.ui.ageTip.visible = show;
  4710. if (show)
  4711. this.ui.visible = true;
  4712. }
  4713. }
  4714. showAgree(call) {
  4715. this.agreeCall = call;
  4716. this.onAgree();
  4717. return;
  4718. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4719. this.showXy(0);
  4720. }
  4721. else
  4722. this.onAgree();
  4723. }
  4724. onAgree() {
  4725. if (!this.ui.ageNode.visible)
  4726. this.ui.visible = false;
  4727. this.ui.xyNode.visible = false;
  4728. Moyu.userAgree(true);
  4729. this.showAge(false);
  4730. this.agreeCall && this.agreeCall();
  4731. this.showRn();
  4732. }
  4733. showMsg(txt) {
  4734. this.ui.msgNode.txtMsg.text = txt;
  4735. this.ui.msgNode.visible = true;
  4736. this.ui.msgNode.alpha = 1;
  4737. this.ui.visible = true;
  4738. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4739. this.ui.msgNode.visible = false;
  4740. }), 2500, true);
  4741. }
  4742. showRn() {
  4743. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4744. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4745. this.ui.rnNode.rn1.visible = true;
  4746. this.ui.rnNode.rn2.visible = false;
  4747. this.ui.rnNode.rn3.visible = false;
  4748. this.ui.rnNode.rn4.visible = false;
  4749. this.ui.rnNode.visible = true;
  4750. this.ui.mainBg.visible = true;
  4751. this.ui.rnNode.btnDone.visible = false;
  4752. this.ui.rnNode.btnExit.visible = true;
  4753. this.ui.rnNode.btnCheck.visible = true;
  4754. this.ui.fcmNode.visible = false;
  4755. this.ui.visible = true;
  4756. return;
  4757. }
  4758. }
  4759. this.showFcm();
  4760. }
  4761. showFcm() {
  4762. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4763. Moyu.initFCM(true);
  4764. if (Moyu.gameTime < 1)
  4765. this.fcmLoop();
  4766. else if (Moyu.gameTime < 999)
  4767. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4768. }
  4769. }
  4770. fcmLoop() {
  4771. if (Moyu.gameTime < 1) {
  4772. this.ui.rnNode.visible = false;
  4773. this.ui.fcmNode.visible = true;
  4774. this.ui.mainBg.visible = true;
  4775. this.ui.visible = true;
  4776. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4777. Laya.timer.clear(this.ui, this.fcmLoop);
  4778. }
  4779. }
  4780. check() {
  4781. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4782. this.ui.rnNode.rn1.visible = false;
  4783. this.ui.rnNode.rn2.visible = false;
  4784. this.ui.rnNode.rn4.visible = true;
  4785. }
  4786. else if (this.ui.rnNode.rn4.visible) {
  4787. let name = this.ui.rnNode.inputName.text;
  4788. let code = this.ui.rnNode.inputCode.text;
  4789. if (code && code.length == 18) {
  4790. this.ui.rnNode.rn1.visible = false;
  4791. this.ui.rnNode.rn4.visible = false;
  4792. Moyu.authenticate(name, code, (res) => {
  4793. this.ui.rnNode.rn2.visible = !res;
  4794. this.ui.rnNode.rn3.visible = res;
  4795. this.ui.rnNode.btnDone.visible = res;
  4796. this.ui.rnNode.btnExit.visible = !res;
  4797. this.ui.rnNode.btnCheck.visible = !res;
  4798. if (res)
  4799. this.showFcm();
  4800. });
  4801. }
  4802. else
  4803. this.showMsg("信息填写不完整");
  4804. }
  4805. }
  4806. loadXy(type = 0) {
  4807. this.ui.xyNode.xy1.visible = false;
  4808. this.ui.xyNode.xy2.visible = true;
  4809. this.ui.xyNode.xyList.scrollToView(0);
  4810. if (type == 1) {
  4811. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4812. }
  4813. else if (type == 2) {
  4814. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4815. }
  4816. }
  4817. showXy(type = 0) {
  4818. this.xyBtn();
  4819. if (type == 0) {
  4820. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4821. this.ui.xyNode.btnSure.visible = true;
  4822. }
  4823. else {
  4824. this.ui.xyNode.btnYes.visible = true;
  4825. this.ui.xyNode.btnNo.visible = true;
  4826. }
  4827. }
  4828. else {
  4829. this.ui.xyNode.btnKnown.visible = true;
  4830. this.ui.mainBg.visible = true;
  4831. }
  4832. this.ui.xyNode.xy1.visible = true;
  4833. this.ui.xyNode.xy2.visible = false;
  4834. this.ui.xyNode.visible = true;
  4835. this.ui.visible = true;
  4836. }
  4837. xyBtn() {
  4838. this.ui.xyNode.btnSure.visible = false;
  4839. this.ui.xyNode.btnYes.visible = false;
  4840. this.ui.xyNode.btnNo.visible = false;
  4841. this.ui.xyNode.btnKnown.visible = false;
  4842. {
  4843. this.ui.xyNode.btnXy3.visible = false;
  4844. this.ui.xyNode.btnXy2.visible = true;
  4845. this.ui.xyNode.btnXy1.visible = true;
  4846. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4847. }
  4848. }
  4849. createXY(json) {
  4850. this.ysJson = json.content;
  4851. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4852. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4853. this.ui.xyNode.xy2.visible = true;
  4854. }
  4855. renderListItem(idx, cell) {
  4856. let xy = this.ysJson[idx];
  4857. cell.height = xy.line * 30;
  4858. cell.xyItem.text = xy.text;
  4859. }
  4860. onDestroy() {
  4861. this.agreeCall = null;
  4862. }
  4863. }
  4864. class SettingNode {
  4865. constructor(ui) {
  4866. this.showSetting = false;
  4867. this.openSound = true;
  4868. this.openShake = true;
  4869. this.ui = ui;
  4870. this.ui.soundBtn.onClick(this, this.switchSound);
  4871. this.ui.shakeBtn.onClick(this, this.switchShake);
  4872. this.ui.xyBtn.onClick(this, this.onXy);
  4873. this.ui.clickNode.onClick(this, this.changeSetting);
  4874. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4875. this.ui.xyBtn.visible = false;
  4876. this.ui.shakeBtn.visible = false;
  4877. }
  4878. changeSetting() {
  4879. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4880. this.showSetting = !this.showSetting;
  4881. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4882. }
  4883. switchSound() {
  4884. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4885. this.openSound = !this.openSound;
  4886. Moyu.onSetting(this.openSound, this.openShake);
  4887. xGame.soundMgr.onSetting(this.openSound);
  4888. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4889. }
  4890. switchShake() {
  4891. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4892. this.openShake = !this.openShake;
  4893. Moyu.onSetting(this.openSound, this.openShake);
  4894. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4895. }
  4896. onXy() {
  4897. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4898. MoyuMgr.showXy(1);
  4899. }
  4900. }
  4901. class ui_UILevelDisplay extends fgui.GComponent {
  4902. static createInstance() {
  4903. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4904. }
  4905. onConstruct() {
  4906. this.n9 = (this.getChild("n9"));
  4907. this.myNode = (this.getChild("myNode"));
  4908. this.closeNode = (this.getChild("closeNode"));
  4909. }
  4910. }
  4911. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4912. class ui_UILevelProp extends fgui.GComponent {
  4913. static createInstance() {
  4914. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4915. }
  4916. onConstruct() {
  4917. this.n16 = (this.getChild("n16"));
  4918. this.myNode = (this.getChild("myNode"));
  4919. this.closeBtn = (this.getChild("closeBtn"));
  4920. this.moneyNode = (this.getChild("moneyNode"));
  4921. this.t1 = this.getTransition("t1");
  4922. }
  4923. }
  4924. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4925. class ui_ShowItem extends fgui.GComponent {
  4926. static createInstance() {
  4927. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4928. }
  4929. onConstruct() {
  4930. this.myImg = (this.getChild("myImg"));
  4931. }
  4932. }
  4933. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4934. class ShowItem {
  4935. constructor() {
  4936. this.ui = ui_ShowItem.createInstance();
  4937. }
  4938. destroySelf() {
  4939. if (!this.ui.isDisposed) {
  4940. this.ui.removeFromParent();
  4941. this.ui.dispose();
  4942. }
  4943. }
  4944. setParent(parent) {
  4945. parent.addChild(this.ui);
  4946. }
  4947. setPos(x, y) {
  4948. this.ui.x = x;
  4949. this.ui.y = y;
  4950. }
  4951. setUrl(index) {
  4952. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4953. }
  4954. }
  4955. class ui_UIPower extends fgui.GComponent {
  4956. static createInstance() {
  4957. return (fgui.UIPackage.createObject("game", "UIPower"));
  4958. }
  4959. onConstruct() {
  4960. this.n11 = (this.getChild("n11"));
  4961. this.myNode = (this.getChild("myNode"));
  4962. this.t0 = this.getTransition("t0");
  4963. }
  4964. }
  4965. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4966. class UIPower extends UIBase {
  4967. constructor() {
  4968. super();
  4969. }
  4970. onConstructor() {
  4971. this.ui = ui_UIPower.createInstance();
  4972. this.contentPane = this.ui;
  4973. this.isEject = false;
  4974. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4975. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4976. }
  4977. show() {
  4978. super.show();
  4979. this.ui.t0.play();
  4980. }
  4981. videoGetPower() {
  4982. console.log('zh:qjff_AD_for_uipower');
  4983. if (Laya.Browser.onAndroid) {
  4984. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4985. if (!boo) {
  4986. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4987. return;
  4988. }
  4989. }
  4990. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4991. }
  4992. else {
  4993. console.log('zh:AD 失败,直接发放奖励');
  4994. this.qjff_AD_for_uipower();
  4995. }
  4996. }
  4997. qjff_AD_for_uipower() {
  4998. DataMgr.setPower(xGame.common.videoPower, true);
  4999. xGame.eventMgr.event(POWER_TIME);
  5000. this.hide();
  5001. }
  5002. }
  5003. UIPower.uiName = "UIPower";
  5004. class UILevelProp extends UIBase {
  5005. constructor() {
  5006. super();
  5007. this.firstPos = 385;
  5008. this.secondPos = 467;
  5009. this.showItemArr = [];
  5010. }
  5011. onFontLoaded() {
  5012. try {
  5013. this.ui.myNode.conditionTxt.font = "arial";
  5014. console.log("zh: onFontLoaded 设置arial字体成功");
  5015. }
  5016. catch (error) {
  5017. console.log("zh: constructor onFontLoaded加载arial字体失败");
  5018. }
  5019. }
  5020. onConstructor() {
  5021. this.ui = ui_UILevelProp.createInstance();
  5022. this.contentPane = this.ui;
  5023. this.isEject = false;
  5024. this.addUIClick(this.ui.closeBtn, this.hide);
  5025. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5026. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5027. }
  5028. show(level) {
  5029. super.show();
  5030. this.ui.t1.play();
  5031. this.level = level;
  5032. this.data = cfgTable.placeballData[this.level];
  5033. this.updateSelf();
  5034. this.showPreView();
  5035. this.moneyNode.ui.c1.selectedIndex = 2;
  5036. this.moneyNode.checkPowerTime();
  5037. this.moneyNode.powerChange();
  5038. }
  5039. showPreView() {
  5040. let item;
  5041. let data;
  5042. for (let index = 0; index < this.showItemArr.length; index++) {
  5043. item = this.showItemArr[index];
  5044. item.destroySelf();
  5045. }
  5046. this.showItemArr = [];
  5047. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5048. for (const key in cfgData) {
  5049. data = cfgData[key];
  5050. item = new ShowItem();
  5051. item.setParent(this.ui.myNode.displayRoot);
  5052. item.setPos(data.x, data.y);
  5053. item.setUrl(data.value);
  5054. this.showItemArr.push(item);
  5055. }
  5056. }
  5057. updateSelf() {
  5058. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5059. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5060. if (this.data.ball == -1) {
  5061. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5062. }
  5063. else {
  5064. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5065. }
  5066. let localData = DataMgr.getPlaceBallLevel(this.level);
  5067. let getAward = localData.getAward;
  5068. let cfg = cfgTable.placeballData[this.level];
  5069. let coin = this.data.award[0];
  5070. let diamond = this.data.award[1];
  5071. if (cfg.type == PlaceBallType.challenge) {
  5072. diamond = 0;
  5073. coin = 100;
  5074. }
  5075. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5076. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5077. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5078. if (cfg.type == PlaceBallType.challenge) {
  5079. this.ui.myNode.coinNode.numTxt.text = "";
  5080. }
  5081. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5082. if (coin > 0 && diamond > 0) {
  5083. this.ui.myNode.diamondNode.x = 385;
  5084. this.ui.myNode.coinNode.x = 467;
  5085. }
  5086. else {
  5087. this.ui.myNode.diamondNode.x = 385;
  5088. this.ui.myNode.coinNode.x = 385;
  5089. }
  5090. if (!getAward) {
  5091. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5092. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5093. }
  5094. else {
  5095. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5096. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5097. }
  5098. }
  5099. startGame() {
  5100. if (DataMgr.powerEnough()) {
  5101. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5102. this.ui.myNode.startBtn.touchable = false;
  5103. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5104. console.log('zh:startGame ');
  5105. this.ui.myNode.startBtn.touchable = true;
  5106. DataMgr.setPower(-1);
  5107. xGame.eventMgr.event(POWER_TIME);
  5108. xGame.common.gameMode = GameMode.placeBall;
  5109. xGame.common.placeBallCurLevel = this.level;
  5110. xGame.uiMgr.Show(UIGame);
  5111. this.logEventForChallenge_level_start(this.level);
  5112. xGame.uiMgr.Hide(UILevelDisplay);
  5113. xGame.uiMgr.Hide(UIMain);
  5114. this.hide();
  5115. }));
  5116. }
  5117. else {
  5118. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5119. xGame.uiMgr.Show(UIPower);
  5120. }
  5121. }
  5122. logEventForChallenge_level_start(level) {
  5123. let keyStr = 'sjmd_challenge_level_start';
  5124. let jsonStr = {
  5125. "count": 1,
  5126. "gold_balance ": DataMgr.getCoin(),
  5127. "level": level,
  5128. "diamond_balance ": DataMgr.getDiamond()
  5129. };
  5130. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5131. const d = LocalStorageManager.getItem(keyStr);
  5132. if (level > d.level) {
  5133. jsonStr.count = d.count + 1;
  5134. LocalStorageManager.setItem(keyStr, jsonStr);
  5135. }
  5136. else {
  5137. }
  5138. }
  5139. else {
  5140. LocalStorageManager.setItem(keyStr, jsonStr);
  5141. }
  5142. const reqStr = JSON.stringify(jsonStr);
  5143. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5144. }
  5145. hide() {
  5146. super.hide();
  5147. }
  5148. }
  5149. UILevelProp.uiName = "UILevelProp";
  5150. class PutBallLevelDisplay {
  5151. constructor(ui, index) {
  5152. this.index = 0;
  5153. this.ui = ui;
  5154. this.index = index;
  5155. this.ui.onClick(this, this.clickSelf);
  5156. this.updateSelf();
  5157. this.ui.levelTxt.text = (this.index + 1) + "";
  5158. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5159. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5160. }
  5161. updateSelf() {
  5162. let level = this.index + 1;
  5163. this.data = DataMgr.getPlaceBallLevel(level);
  5164. this.ui.starNode.c1.selectedIndex = this.data.star;
  5165. let isChallenge = cfgTable.placeballData[level].type;
  5166. if (this.data.isCur) {
  5167. if (isChallenge) {
  5168. this.ui.c1.selectedIndex = 5;
  5169. }
  5170. else {
  5171. this.ui.c1.selectedIndex = 2;
  5172. }
  5173. }
  5174. else {
  5175. if (this.data.play) {
  5176. if (this.data.star == 3) {
  5177. this.ui.c1.selectedIndex = 0;
  5178. }
  5179. else {
  5180. this.ui.c1.selectedIndex = 1;
  5181. }
  5182. }
  5183. else {
  5184. if (isChallenge) {
  5185. this.ui.c1.selectedIndex = 4;
  5186. }
  5187. else {
  5188. this.ui.c1.selectedIndex = 3;
  5189. }
  5190. }
  5191. }
  5192. }
  5193. clickSelf() {
  5194. if (!this.data.play)
  5195. return;
  5196. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5197. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5198. }
  5199. }
  5200. class UILevelDisplay extends UIBase {
  5201. constructor() {
  5202. super();
  5203. }
  5204. onConstructor() {
  5205. this.ui = ui_UILevelDisplay.createInstance();
  5206. this.contentPane = this.ui;
  5207. this.isEject = false;
  5208. this.myList = this.ui.myNode.myList;
  5209. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5210. this.levelItemArr = [];
  5211. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5212. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5213. this.myList.numItems = levelNum;
  5214. if (Moyu.isKs)
  5215. this.ui.closeNode.closeBtn.x += 100;
  5216. }
  5217. levelItemRender(index, target) {
  5218. let item = new PutBallLevelDisplay(target, index);
  5219. this.levelItemArr.push(item);
  5220. }
  5221. show() {
  5222. super.show();
  5223. this.updateLevel();
  5224. this.scrollToPlace();
  5225. }
  5226. updateLevel() {
  5227. let temp;
  5228. for (let index = 0; index < this.levelItemArr.length; index++) {
  5229. temp = this.levelItemArr[index];
  5230. temp.updateSelf();
  5231. }
  5232. }
  5233. scrollToPlace() {
  5234. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5235. let passArr = DataMgr.getPlaceBallLevelList();
  5236. let offest = passArr.length;
  5237. if (offest >= maxNum - 1)
  5238. offest = maxNum - 1;
  5239. this.myList.scrollToView(offest, true, true);
  5240. }
  5241. hide() {
  5242. super.hide();
  5243. }
  5244. }
  5245. UILevelDisplay.uiName = "UILevelDisplay";
  5246. class ui_UIMatching extends fgui.GComponent {
  5247. static createInstance() {
  5248. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5249. }
  5250. onConstruct() {
  5251. this.n5 = (this.getChild("n5"));
  5252. this.n49 = (this.getChild("n49"));
  5253. this.n51 = (this.getChild("n51"));
  5254. this.n64 = (this.getChild("n64"));
  5255. this.n2 = (this.getChild("n2"));
  5256. this.n53 = (this.getChild("n53"));
  5257. this.n54 = (this.getChild("n54"));
  5258. this.n56 = (this.getChild("n56"));
  5259. this.n58 = (this.getChild("n58"));
  5260. this.n59 = (this.getChild("n59"));
  5261. this.n57 = (this.getChild("n57"));
  5262. this.n60 = (this.getChild("n60"));
  5263. this.n62 = (this.getChild("n62"));
  5264. this.awardTxt = (this.getChild("awardTxt"));
  5265. this.n61 = (this.getChild("n61"));
  5266. this.selfHead = (this.getChild("selfHead"));
  5267. this.aiHead = (this.getChild("aiHead"));
  5268. this.n82 = (this.getChild("n82"));
  5269. this.n84 = (this.getChild("n84"));
  5270. this.n83 = (this.getChild("n83"));
  5271. this.t1 = this.getTransition("t1");
  5272. this.t2 = this.getTransition("t2");
  5273. this.t3 = this.getTransition("t3");
  5274. this.t4 = this.getTransition("t4");
  5275. }
  5276. }
  5277. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5278. class UIMatching extends UIBase {
  5279. constructor() {
  5280. super();
  5281. }
  5282. onConstructor() {
  5283. this.ui = ui_UIMatching.createInstance();
  5284. this.contentPane = this.ui;
  5285. this.isEject = false;
  5286. }
  5287. show(callback) {
  5288. super.show();
  5289. PlatMgr.showBanner(true);
  5290. this.callback = callback;
  5291. let user = Moyu.getUserInfo();
  5292. if (!this.selfPot) {
  5293. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5294. }
  5295. if (!this.aiPot) {
  5296. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5297. }
  5298. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5299. this.ui.selfHead.nameTxt.text = user.nickName;
  5300. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5301. this.ui.aiHead.nameTxt.text = "???";
  5302. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5303. this.ui.selfHead.c1.selectedIndex = 0;
  5304. this.ui.aiHead.c1.selectedIndex = 0;
  5305. this.ui.selfHead.x = this.selfPot.x;
  5306. this.ui.selfHead.y = this.selfPot.y;
  5307. this.ui.aiHead.x = this.aiPot.x;
  5308. this.ui.aiHead.y = this.aiPot.y;
  5309. switch (xGame.common.gameMode) {
  5310. case GameMode.classic:
  5311. break;
  5312. case GameMode.bigMove:
  5313. this.initSkillData();
  5314. break;
  5315. default:
  5316. break;
  5317. }
  5318. this.ui.t1.play(Laya.Handler.create(this, () => {
  5319. this.ui.t2.play(Laya.Handler.create(this, () => {
  5320. switch (xGame.common.gameMode) {
  5321. case GameMode.classic:
  5322. this.waitingPeople();
  5323. break;
  5324. case GameMode.bigMove:
  5325. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5326. break;
  5327. default:
  5328. break;
  5329. }
  5330. }));
  5331. }));
  5332. }
  5333. initSkillData() {
  5334. this.skillSelectData = [];
  5335. let skillUrl = xGame.common.skillIconList;
  5336. let skillName = xGame.common.skillNameList;
  5337. let skillLevel = DataMgr.getBigSkillList();
  5338. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5339. for (let index = 0; index < 5; index++) {
  5340. let obj = {};
  5341. obj.skillImg = skillUrl[index];
  5342. obj.skillName = skillName[index];
  5343. obj.skillType = skillType[index];
  5344. obj.skillLevel = skillLevel[index];
  5345. this.skillSelectData.push(obj);
  5346. }
  5347. }
  5348. getAISkillLevel(myLevel) {
  5349. let video = xGame.common.upSkillLevel;
  5350. let aiLevel;
  5351. let temp;
  5352. if (video) {
  5353. temp = xGame.common.randomNum(-2, -1);
  5354. }
  5355. else {
  5356. if (myLevel <= 5) {
  5357. temp = xGame.common.randomNum(1, 3);
  5358. }
  5359. else if (myLevel <= 9) {
  5360. temp = xGame.common.randomNum(-2, 1);
  5361. }
  5362. else {
  5363. temp = xGame.common.randomNum(-4, 0);
  5364. }
  5365. }
  5366. aiLevel = temp + myLevel;
  5367. if (aiLevel <= 1)
  5368. aiLevel = 1;
  5369. if (aiLevel >= 10)
  5370. aiLevel = 10;
  5371. return aiLevel;
  5372. }
  5373. getAISkillType() {
  5374. return xGame.common.randomNum(1, 4);
  5375. let successTimes = DataMgr.getSkillSuccessTimes();
  5376. let info = cfgTable.aiskillData[successTimes];
  5377. if (!info) {
  5378. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5379. info = cfgTable.aiskillData[max];
  5380. }
  5381. let dataArr = info.skillselect;
  5382. let myCfg = {};
  5383. for (let index = 0; index < dataArr.length; index++) {
  5384. let temp = dataArr[index].split('-');
  5385. myCfg[temp[0]] = {};
  5386. myCfg[temp[0]].id = parseInt(temp[0]);
  5387. myCfg[temp[0]].weight = parseInt(temp[1]);
  5388. }
  5389. let aiCfg = xGame.common.initWeight(myCfg);
  5390. let curData = xGame.common.getRandomWeightData(aiCfg);
  5391. return parseInt(curData.id);
  5392. }
  5393. getAISkillData(index) {
  5394. let myLevel = this.skillSelectData[index].skillLevel;
  5395. let aiLevel = this.getAISkillLevel(myLevel);
  5396. let aiType = this.getAISkillType() - 1;
  5397. return { aiLevel, aiType } = { aiLevel, aiType };
  5398. }
  5399. skillSelectFinish(index) {
  5400. let aiInfo = this.getAISkillData(index);
  5401. xGame.common.gameMgr.selfCurSkill = index;
  5402. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5403. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5404. this.ui.selfHead.c1.selectedIndex = 1;
  5405. this.ui.aiHead.c1.selectedIndex = 1;
  5406. let myData = this.skillSelectData[index];
  5407. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5408. let guide = DataMgr.getSkillGuide();
  5409. if (guide == 0) {
  5410. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5411. }
  5412. else {
  5413. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5414. }
  5415. let aiData = this.skillSelectData[aiInfo.aiType];
  5416. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5417. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5418. this.waitingPeople();
  5419. }
  5420. waitingPeople() {
  5421. let time = xGame.common.randomNum(1000, 3000);
  5422. time += 1000;
  5423. Laya.timer.once(time, this, () => {
  5424. this.matchingSuccess();
  5425. });
  5426. }
  5427. matchingSuccess() {
  5428. let gameUI = xGame.common.gameUI;
  5429. let name = gameUI.ui.topNode.aiNameTxt.text;
  5430. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5431. this.ui.aiHead.nameTxt.text = name;
  5432. this.ui.aiHead.headImg.url = url;
  5433. name = gameUI.ui.topNode.selfNameTxt.text;
  5434. url = gameUI.ui.topNode.selfHeadLoader.url;
  5435. this.ui.selfHead.nameTxt.text = name;
  5436. this.ui.selfHead.headImg.url = url;
  5437. this.ui.t3.play(Laya.Handler.create(this, () => {
  5438. this.callback && this.callback();
  5439. this.ui.t4.play(Laya.Handler.create(this, () => {
  5440. this.destroySelf();
  5441. }));
  5442. }));
  5443. }
  5444. destroySelf() {
  5445. this.callback = null;
  5446. this.skillSelectData = null;
  5447. this.selfPot = null;
  5448. this.aiPot = null;
  5449. if (!this.ui.isDisposed) {
  5450. this.ui.removeFromParent();
  5451. this.ui.dispose();
  5452. }
  5453. xGame.uiMgr.destroyUI(this);
  5454. }
  5455. }
  5456. UIMatching.uiName = "UIMatching";
  5457. class ui_UIRanking extends fgui.GComponent {
  5458. static createInstance() {
  5459. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5460. }
  5461. onConstruct() {
  5462. this.n26 = (this.getChild("n26"));
  5463. this.myNode = (this.getChild("myNode"));
  5464. }
  5465. }
  5466. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5467. class UIRanking extends UIBase {
  5468. constructor() {
  5469. super();
  5470. this.showSelf = true;
  5471. this.rankType = 1;
  5472. this.rankList = [];
  5473. this.topX = 10;
  5474. this.myIndex = this.topX + 1;
  5475. this.myStar = 0;
  5476. }
  5477. onConstructor() {
  5478. this.ui = ui_UIRanking.createInstance();
  5479. this.contentPane = this.ui;
  5480. this.isEject = false;
  5481. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5482. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5483. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5484. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5485. this.ui.myNode.myList.setVirtual();
  5486. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5487. }
  5488. show() {
  5489. super.show();
  5490. this.getPaiHangBangDataFormJosnFile();
  5491. this.updateSelf();
  5492. let self = Moyu.getUserInfo();
  5493. if (!self.isAuth) {
  5494. Moyu.initUser(this, () => {
  5495. DataMgr.upRankData();
  5496. });
  5497. }
  5498. }
  5499. getPaiHangBangDataFormJosnFile() {
  5500. const rankingList = cfgTable.paiHangBangData.list;
  5501. this.updateItemData(rankingList);
  5502. }
  5503. updateSelfItem() {
  5504. console.log('zh:Moyu.platType =' + Moyu.platType);
  5505. let self = Moyu.getUserInfo();
  5506. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5507. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5508. if (this.myIndex > this.topX) {
  5509. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5510. }
  5511. else {
  5512. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5513. }
  5514. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5515. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5516. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5517. }
  5518. updateItemData(data) {
  5519. this.myStar = xGame.common.getAllStarNum();
  5520. if (this.rankList.length < 2) {
  5521. this.rankList = data;
  5522. let self = Moyu.getUserInfo();
  5523. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5524. self.headIcon = self.headIcon;
  5525. for (let i = 0; i < data.length; i++) {
  5526. let data = this.rankList[i];
  5527. if (data.userId == self.userId) {
  5528. this.rankList.splice(i, 1);
  5529. break;
  5530. }
  5531. }
  5532. for (let i = 0; i < data.length; i++) {
  5533. let data = this.rankList[i];
  5534. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5535. this.myIndex = i + 1;
  5536. let user = { headIcon: self.headIcon, nickName: "myself" };
  5537. let ud = { user: user, data: {} };
  5538. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5539. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5540. if (Moyu.platType < 11) {
  5541. user.headIcon = self.headIcon;
  5542. user.nickName = self.nickName;
  5543. }
  5544. this.rankList.splice(i, 0, md);
  5545. break;
  5546. }
  5547. }
  5548. }
  5549. this.updateSelfItem();
  5550. this.ui.myNode.myList.numItems = this.rankList.length;
  5551. }
  5552. updateItemUI(index, obj) {
  5553. let data = this.rankList[index];
  5554. let userData = JSON.parse(data.userData).user;
  5555. obj.nameTxt.text = userData.nickName.toString();
  5556. obj.valueTxt.text = data.rankScore;
  5557. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5558. obj.rankTxt.text = index + 1;
  5559. switch (index) {
  5560. case 0:
  5561. this.setImg(obj, 1, 0, 0);
  5562. obj.rankTxt.color = "#FFC047";
  5563. break;
  5564. case 1:
  5565. this.setImg(obj, 0, 1, 0);
  5566. obj.rankTxt.color = "#ACACAC";
  5567. break;
  5568. case 2:
  5569. this.setImg(obj, 0, 0, 1);
  5570. obj.rankTxt.color = "#D09672";
  5571. break;
  5572. default:
  5573. this.setImg(obj, 0, 0, 0);
  5574. obj.rankTxt.color = "#496FAB";
  5575. break;
  5576. }
  5577. }
  5578. setImg(obj, a, b, c) {
  5579. obj.img1.visible = a ? true : false;
  5580. obj.img2.visible = b ? true : false;
  5581. obj.img3.visible = c ? true : false;
  5582. }
  5583. changeList(type) {
  5584. this.rankType = type;
  5585. this.updateSelf();
  5586. }
  5587. changeSelfNode() {
  5588. this.showSelf = !this.showSelf;
  5589. this.updateSelf();
  5590. }
  5591. updateSelf() {
  5592. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5593. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5594. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5595. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5596. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5597. }
  5598. }
  5599. UIRanking.uiName = "UIRanking";
  5600. class ui_UISecretary extends fgui.GComponent {
  5601. static createInstance() {
  5602. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5603. }
  5604. onConstruct() {
  5605. this.n0 = (this.getChild("n0"));
  5606. this.myNode = (this.getChild("myNode"));
  5607. this.closeBtn = (this.getChild("closeBtn"));
  5608. this.t0 = this.getTransition("t0");
  5609. }
  5610. }
  5611. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5612. class UISecretary extends UIBase {
  5613. constructor() {
  5614. super();
  5615. this.curIndex = 1;
  5616. }
  5617. onConstructor() {
  5618. this.ui = ui_UISecretary.createInstance();
  5619. this.contentPane = this.ui;
  5620. this.isEject = false;
  5621. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5622. this.nodeObj = { left: null, right: null, cur: null };
  5623. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5624. }
  5625. show() {
  5626. super.show();
  5627. this.ui.t0.play();
  5628. this.updateData();
  5629. }
  5630. addSecretarySpine(node, spineName) {
  5631. if (spineName == "mishu") {
  5632. if (this.secretarySpine1) {
  5633. node.displayObject.destroyChildren();
  5634. this.playWoman(this.secretarySpine1, node.displayObject);
  5635. }
  5636. else {
  5637. let spine1 = new SpineMgr("mishu", () => {
  5638. this.secretarySpine1 = spine1;
  5639. this.playWoman(this.secretarySpine1, node.displayObject);
  5640. });
  5641. }
  5642. }
  5643. else {
  5644. if (this.secretarySpine2) {
  5645. node.displayObject.destroyChildren();
  5646. this.playWoman(this.secretarySpine2, node.displayObject);
  5647. }
  5648. else {
  5649. let spine2 = new SpineMgr("xiaomishu2", () => {
  5650. this.secretarySpine2 = spine2;
  5651. this.playWoman(this.secretarySpine2, node.displayObject);
  5652. });
  5653. }
  5654. }
  5655. }
  5656. playWoman(node, parent) {
  5657. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5658. let yy = this.ui.myNode.gameNode3.secretary.height;
  5659. let scale = 1.5;
  5660. if (node == this.secretarySpine2) {
  5661. scale = 1.2;
  5662. }
  5663. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5664. node.play(data, 0, true, parent);
  5665. }
  5666. turnLeft() {
  5667. this.curIndex--;
  5668. if (this.curIndex < 1) {
  5669. this.curIndex = 2;
  5670. }
  5671. let left = this.nodeObj.left;
  5672. let right = this.nodeObj.right;
  5673. let cur = this.nodeObj.cur;
  5674. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5675. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5676. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5677. this.updateData();
  5678. }));
  5679. this.ui.myNode.setChildIndex(right, 2);
  5680. this.nodeObj.left = cur;
  5681. this.nodeObj.right = left;
  5682. this.nodeObj.cur = right;
  5683. }
  5684. turnRight() {
  5685. this.curIndex++;
  5686. if (this.curIndex > 2) {
  5687. this.curIndex = 1;
  5688. }
  5689. let left = this.nodeObj.left;
  5690. let right = this.nodeObj.right;
  5691. let cur = this.nodeObj.cur;
  5692. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5693. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5694. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5695. this.updateData();
  5696. }));
  5697. this.ui.myNode.setChildIndex(left, 2);
  5698. this.nodeObj.left = right;
  5699. this.nodeObj.right = cur;
  5700. this.nodeObj.cur = left;
  5701. }
  5702. updateData() {
  5703. console.log('zh: updateData FFFFFFFFFF');
  5704. let data = cfgTable.secretaryshopData;
  5705. let children = this.ui.myNode._children;
  5706. let temp;
  5707. let curData;
  5708. for (let index = 0; index < children.length; index++) {
  5709. temp = children[index];
  5710. curData = data[1];
  5711. temp.heightTxt.text = curData.height;
  5712. temp.foodTxt.text = curData.food;
  5713. temp.historyTxt.text = curData.history;
  5714. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5715. this.addSecretarySpine(temp.secretary, curData.spine);
  5716. let womanIndex = curData.id - 1;
  5717. let getWoman = DataMgr.getSecretary(womanIndex);
  5718. let curUse = DataMgr.getCurSecretary();
  5719. if (getWoman) {
  5720. if (curUse == womanIndex) {
  5721. temp.purchaseBtn.c1.selectedIndex = 1;
  5722. }
  5723. else {
  5724. temp.purchaseBtn.c1.selectedIndex = 2;
  5725. }
  5726. }
  5727. else {
  5728. temp.purchaseBtn.c1.selectedIndex = 0;
  5729. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5730. }
  5731. temp.purchaseBtn.visible = false;
  5732. }
  5733. }
  5734. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5735. console.log('zh: 点击了clickSecretary ');
  5736. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5737. if (getWoman) {
  5738. if (curUse != womanIndex) {
  5739. console.log();
  5740. DataMgr.setCurSecretary(womanIndex);
  5741. this.updateData();
  5742. }
  5743. }
  5744. else {
  5745. console.log('zh:点击购买了');
  5746. let need = needDiamond;
  5747. if (DataMgr.diamondEnough(need)) {
  5748. DataMgr.setDiamond(-need);
  5749. DataMgr.setSecretary(womanIndex, 1);
  5750. DataMgr.setCurSecretary(womanIndex);
  5751. this.updateData();
  5752. }
  5753. else {
  5754. xGame.uiMgr.Show(UIAddProp, 1);
  5755. }
  5756. }
  5757. }
  5758. closeSelf() {
  5759. this.hide();
  5760. }
  5761. }
  5762. UISecretary.uiName = "UISecretary";
  5763. class ui_UIShop extends fgui.GComponent {
  5764. static createInstance() {
  5765. return (fgui.UIPackage.createObject("game", "UIShop"));
  5766. }
  5767. onConstruct() {
  5768. this.n48 = (this.getChild("n48"));
  5769. this.n0 = (this.getChild("n0"));
  5770. this.secretary = (this.getChild("secretary"));
  5771. this.talkNode = (this.getChild("talkNode"));
  5772. this.closeNode = (this.getChild("closeNode"));
  5773. this.moneyNode = (this.getChild("moneyNode"));
  5774. this.myNode = (this.getChild("myNode"));
  5775. }
  5776. }
  5777. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5778. class ui_UIMsg extends fgui.GComponent {
  5779. static createInstance() {
  5780. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5781. }
  5782. onConstruct() {
  5783. this.tipsNode = (this.getChild("tipsNode"));
  5784. }
  5785. }
  5786. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5787. class UIMsg extends UIBase {
  5788. constructor() {
  5789. super();
  5790. }
  5791. onConstructor() {
  5792. this.ui = ui_UIMsg.createInstance();
  5793. this.contentPane = this.ui;
  5794. this.isEject = false;
  5795. this.isMuti = true;
  5796. }
  5797. show(msg, callback) {
  5798. super.show();
  5799. this.ui.tipsNode.msgTxt.text = msg;
  5800. this.ui.alpha = 1;
  5801. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5802. this.hide();
  5803. callback && callback();
  5804. }), 1000);
  5805. }
  5806. }
  5807. UIMsg.uiName = "UIMsg";
  5808. class BallRodDisplay {
  5809. constructor(ui, index) {
  5810. this.index = 0;
  5811. this.uiIndex = 0;
  5812. this.ui = ui;
  5813. this.index = index;
  5814. this.initData();
  5815. }
  5816. initData() {
  5817. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5818. let data = cfgTable.ballrodData[this.index + 1];
  5819. this.ui.nameTxt.text = data.name;
  5820. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5821. this.ui.levelNode.c1.selectedIndex = data.quality;
  5822. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5823. if (data.spine) {
  5824. this.mySpine = new SpineMgr(data.spine, () => {
  5825. let xx = 150;
  5826. let yy = 70;
  5827. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5828. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5829. });
  5830. }
  5831. }
  5832. updateSelf() {
  5833. console.log('zh:updateSelf -------------- ');
  5834. let get = DataMgr.getBallRod(this.index);
  5835. if (get == null)
  5836. get = 1;
  5837. let curUse = DataMgr.getCurBallRod();
  5838. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5839. if (get) {
  5840. if (curUse == this.index) {
  5841. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5842. }
  5843. else {
  5844. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5845. }
  5846. }
  5847. else {
  5848. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5849. }
  5850. }
  5851. buyBallRod() {
  5852. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5853. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5854. switch (selectedIndex) {
  5855. case 0:
  5856. break;
  5857. case 1:
  5858. console.log('zh:点击了 USE THIS');
  5859. DataMgr.setCurBallRod(this.index);
  5860. let curUse = DataMgr.getCurBallRod();
  5861. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5862. let ui = xGame.uiMgr.getUI(UIShop);
  5863. ui.updateBallRod();
  5864. break;
  5865. case 2:
  5866. let data = cfgTable.ballrodData[this.index + 1];
  5867. let need = data.price;
  5868. if (DataMgr.diamondEnough(need)) {
  5869. this.buyQiuGan(data);
  5870. DataMgr.setDiamond(-need);
  5871. DataMgr.setBallRod(this.index, 1);
  5872. DataMgr.setCurBallRod(this.index);
  5873. let ui = xGame.uiMgr.getUI(UIShop);
  5874. ui.updateBallRod();
  5875. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5876. }
  5877. else {
  5878. xGame.uiMgr.Show(UIAddProp, 1);
  5879. }
  5880. break;
  5881. default:
  5882. break;
  5883. }
  5884. }
  5885. buyQiuGan(qgItem) {
  5886. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5887. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5888. if (userInfo == null) {
  5889. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5890. return;
  5891. }
  5892. let reqData = xGame.httpMgr.getReqData();
  5893. let pd = JSON.parse(reqData);
  5894. pd.qiuGanData = qgItem;
  5895. reqData = JSON.stringify(pd);
  5896. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5897. try {
  5898. console.log('zh:buySp res = ' + JSON.stringify(res));
  5899. let code = res.code;
  5900. let msg = res.msg;
  5901. if (code == 401) {
  5902. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5903. alert(TIP_MSG_key.loginTimeOut);
  5904. xGame.uiMgr.Show(UIMsg, msg);
  5905. return;
  5906. }
  5907. if (code == 200) {
  5908. xGame.uiMgr.Show(UIMsg, msg);
  5909. DataMgr.getUserZiChanInfo();
  5910. }
  5911. else {
  5912. xGame.uiMgr.Show(UIMsg, msg);
  5913. }
  5914. }
  5915. catch (error) {
  5916. console.log('error=' + error);
  5917. alert(error);
  5918. }
  5919. finally {
  5920. }
  5921. });
  5922. }
  5923. logEventForGouMaiGan(qiuGanName) {
  5924. const ev = {
  5925. value: qiuGanName
  5926. };
  5927. const jsonStr = JSON.stringify(ev);
  5928. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5929. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5930. }
  5931. }
  5932. class DaoJuDisplay {
  5933. constructor(ui, index) {
  5934. this.index = 0;
  5935. this.uiIndex = 0;
  5936. this.ggSpid = "";
  5937. this.spid = 0;
  5938. this.ui = ui;
  5939. this.index = index;
  5940. this.initData();
  5941. }
  5942. initData() {
  5943. this.ui.btn_buy.onClick(this, this.gotoBuy);
  5944. let data = cfgTable.daoJuData[this.index + 1];
  5945. console.log('zh:' + JSON.stringify(data));
  5946. this.ui.nameTxt.text = data.spbt;
  5947. this.ui.n_jiaGe.text = data.spjg + "";
  5948. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5949. this.ggSpid = data.ggSpid;
  5950. this.spid = data.spid;
  5951. let baseUrl = "asset/sound/ogg/";
  5952. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5953. }
  5954. gotoBuy() {
  5955. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5956. if (userInfo != null) {
  5957. let token = userInfo.token;
  5958. let ggSpid = this.ggSpid;
  5959. let spid = this.spid;
  5960. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  5961. console.log('zh:gotoBuy1 spid =' + spid);
  5962. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  5963. return;
  5964. }
  5965. else {
  5966. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5967. }
  5968. }
  5969. gotoBuy1() {
  5970. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5971. let djItem = cfgTable.daoJuData[this.index + 1];
  5972. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5973. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5974. if (userInfo == null) {
  5975. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5976. return;
  5977. }
  5978. let reqData = xGame.httpMgr.getReqData();
  5979. let pd = JSON.parse(reqData);
  5980. pd.spItem = djItem;
  5981. reqData = JSON.stringify(pd);
  5982. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5983. try {
  5984. console.log('zh:buySp res = ' + JSON.stringify(res));
  5985. let code = res.code;
  5986. let msg = res.msg;
  5987. if (code == 401) {
  5988. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5989. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5990. return;
  5991. }
  5992. if (code == 200) {
  5993. xGame.uiMgr.Show(UIMsg, msg);
  5994. DataMgr.getUserZiChanInfo();
  5995. }
  5996. else {
  5997. xGame.uiMgr.Show(UIMsg, msg);
  5998. }
  5999. }
  6000. catch (error) {
  6001. console.log('error=' + error);
  6002. alert(error);
  6003. }
  6004. finally {
  6005. }
  6006. });
  6007. }
  6008. }
  6009. class UIShop extends UIBase {
  6010. constructor() {
  6011. super();
  6012. this.itemNums = 0;
  6013. this.itemNumsForDj = 0;
  6014. this.curType = "";
  6015. }
  6016. onConstructor() {
  6017. this.ui = ui_UIShop.createInstance();
  6018. this.contentPane = this.ui;
  6019. this.isEject = false;
  6020. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6021. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6022. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6023. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6024. this.addUIClick(this.ui, this.interuptSecretary);
  6025. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6026. this.ballRodArr = [];
  6027. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6028. this.ui.myNode.myList.numItems = this.itemNums;
  6029. this.loadDjdata_old();
  6030. }
  6031. loadDjdata_old() {
  6032. let fff = cfgTable.daoJuData;
  6033. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6034. this.daoJuArr = [];
  6035. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6036. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6037. }
  6038. getProductList() {
  6039. let reqData = xGame.httpMgr.getReqData();
  6040. let pd = JSON.parse(reqData);
  6041. pd.splx = "Consumable";
  6042. reqData = JSON.stringify(pd);
  6043. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6044. try {
  6045. let code = res.code;
  6046. let msg = res.msg;
  6047. if (code == 401) {
  6048. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6049. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6050. return;
  6051. }
  6052. if (code == 200) {
  6053. let data = res.data;
  6054. for (let index = 0; index < data.length; index++) {
  6055. let element = data[index];
  6056. cfgTable.daoJuData[element.spid] = element;
  6057. }
  6058. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6059. }
  6060. else {
  6061. xGame.uiMgr.Show(UIMsg, msg);
  6062. }
  6063. }
  6064. catch (error) {
  6065. console.log('error=' + error);
  6066. alert(error);
  6067. }
  6068. finally {
  6069. }
  6070. });
  6071. }
  6072. show(type) {
  6073. super.show();
  6074. this.curType = type == 0 ? "qiugan" : "daoju";
  6075. this.switchBtn("qiugan");
  6076. this.playSecretaryIdle();
  6077. this.updateBallRod();
  6078. }
  6079. test123() {
  6080. console.log('zh:test123 ');
  6081. }
  6082. switchBtn(type) {
  6083. console.log('zh:1111切換 sel type=' + type);
  6084. if (type == "") {
  6085. type = this.curType;
  6086. }
  6087. else {
  6088. if (this.curType == type) {
  6089. return;
  6090. }
  6091. else {
  6092. this.curType = type;
  6093. }
  6094. }
  6095. if (type == "qiugan") {
  6096. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6097. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6098. this.ui.myNode.c1.selectedIndex = 0;
  6099. this.ui.myNode.myList.visible = true;
  6100. this.ui.myNode.djList.visible = false;
  6101. }
  6102. else {
  6103. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6104. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6105. this.ui.myNode.c1.selectedIndex = 1;
  6106. this.ui.myNode.myList.visible = false;
  6107. this.ui.myNode.djList.visible = true;
  6108. }
  6109. }
  6110. updateBallRod() {
  6111. for (let index = 0; index < this.ballRodArr.length; index++) {
  6112. this.ballRodArr[index].updateSelf();
  6113. }
  6114. }
  6115. renderBallRod(sort, obj) {
  6116. let index = this.getIndexBySort(sort + 1) - 1;
  6117. let ballRod = new BallRodDisplay(obj, index);
  6118. this.ballRodArr.push(ballRod);
  6119. }
  6120. renderDaoJu(idx, obj) {
  6121. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6122. let b = new DaoJuDisplay(obj, index);
  6123. this.daoJuArr.push(b);
  6124. }
  6125. getIndexBySort(sort) {
  6126. let object = cfgTable.ballrodData;
  6127. for (const key in object) {
  6128. if (object[key].sort == sort) {
  6129. return parseInt(key);
  6130. }
  6131. }
  6132. }
  6133. getIndexBySortForDj(idx) {
  6134. let object = cfgTable.daoJuData;
  6135. for (const key in object) {
  6136. if (object[key].idx == idx) {
  6137. return parseInt(key);
  6138. }
  6139. }
  6140. }
  6141. playSecretaryIdle() {
  6142. let parent = this.ui.secretary.displayObject;
  6143. parent.destroyChildren();
  6144. let xx = this.ui.secretary.width / 2;
  6145. let yy = this.ui.secretary.height;
  6146. let scale = xGame.common.getSecretaryScale();
  6147. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6148. xGame.common.secretary.play(data, 0, true, parent);
  6149. }
  6150. interuptSecretary() {
  6151. Laya.timer.clearAll(this);
  6152. this.playSecretaryRandomSound();
  6153. }
  6154. playSecretaryRandomSound() {
  6155. if (this.isHide)
  6156. return;
  6157. let time = xGame.common.randomNum(45000, 60000);
  6158. Laya.timer.once(time, this, () => {
  6159. if (this.isHide)
  6160. return;
  6161. let index = xGame.common.randomNum(4, 7);
  6162. xGame.soundMgr.playSound("s_main0" + index);
  6163. let words = 1;
  6164. switch (index) {
  6165. case 4:
  6166. words = 5;
  6167. break;
  6168. case 5:
  6169. words = 3;
  6170. break;
  6171. case 6:
  6172. words = 6;
  6173. break;
  6174. case 7:
  6175. words = 7;
  6176. break;
  6177. default:
  6178. break;
  6179. }
  6180. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6181. this.playSecretaryRandomSound();
  6182. });
  6183. }
  6184. closeSelf() {
  6185. this.hide();
  6186. }
  6187. }
  6188. UIShop.uiName = "UIShop";
  6189. class ui_UISign extends fgui.GComponent {
  6190. static createInstance() {
  6191. return (fgui.UIPackage.createObject("game", "UISign"));
  6192. }
  6193. onConstruct() {
  6194. this.n6 = (this.getChild("n6"));
  6195. this.closeNode = (this.getChild("closeNode"));
  6196. this.myNode = (this.getChild("myNode"));
  6197. this.moneyNode = (this.getChild("moneyNode"));
  6198. this.secretary = (this.getChild("secretary"));
  6199. this.talkNode = (this.getChild("talkNode"));
  6200. this.tripleBtn = (this.getChild("tripleBtn"));
  6201. this.normalBtn = (this.getChild("normalBtn"));
  6202. this.tipsNode = (this.getChild("tipsNode"));
  6203. this.againBtn = (this.getChild("againBtn"));
  6204. this.t0 = this.getTransition("t0");
  6205. }
  6206. }
  6207. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6208. class SignMax {
  6209. constructor(ui) {
  6210. this.ui = ui;
  6211. }
  6212. updateSelf(index, sameDay, curDayIndex) {
  6213. let data = cfgTable.signData[index + 1];
  6214. this.ui.titleTxt.text = data.title;
  6215. let arr1 = data.award[0].split('-');
  6216. let arr2 = data.award[1].split('-');
  6217. let num1 = parseInt(arr1[1]);
  6218. let num2 = parseInt(arr2[1]);
  6219. this.ui.numTxt1.text = num1 + "";
  6220. this.ui.numTxt2.text = num2 + "";
  6221. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6222. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6223. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6224. this.ui.numTxt1.visible = false;
  6225. }
  6226. else {
  6227. this.ui.numTxt1.visible = true;
  6228. }
  6229. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6230. this.ui.numTxt2.visible = false;
  6231. }
  6232. else {
  6233. this.ui.numTxt2.visible = true;
  6234. }
  6235. if (index < curDayIndex) {
  6236. this.ui.c1.selectedIndex = 1;
  6237. }
  6238. else if (index == curDayIndex) {
  6239. if (sameDay) {
  6240. this.ui.c1.selectedIndex = 2;
  6241. }
  6242. else {
  6243. this.ui.c1.selectedIndex = 2;
  6244. }
  6245. }
  6246. else {
  6247. this.ui.c1.selectedIndex = 0;
  6248. }
  6249. }
  6250. }
  6251. class SignNormal {
  6252. constructor(ui) {
  6253. this.ui = ui;
  6254. }
  6255. updateSelf(index, sameDay, curDayIndex) {
  6256. let data = cfgTable.signData[index + 1];
  6257. this.ui.titleTxt.text = data.title;
  6258. let arr = data.award[0].split('-');
  6259. let type = parseInt(arr[0]);
  6260. let num = parseInt(arr[1]);
  6261. this.ui.numTxt.text = num + "";
  6262. if (type > 2) {
  6263. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6264. this.ui.myIcon.rotation = 0;
  6265. }
  6266. else {
  6267. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6268. this.ui.myIcon.rotation = 0;
  6269. }
  6270. if (xGame.common.signAwardContainsRod(data.award)) {
  6271. this.ui.numTxt.visible = false;
  6272. }
  6273. else {
  6274. this.ui.numTxt.visible = true;
  6275. }
  6276. if (index < curDayIndex) {
  6277. this.ui.c1.selectedIndex = 1;
  6278. }
  6279. else if (index == curDayIndex) {
  6280. if (sameDay) {
  6281. this.ui.c1.selectedIndex = 2;
  6282. }
  6283. else {
  6284. this.ui.c1.selectedIndex = 2;
  6285. }
  6286. }
  6287. else {
  6288. this.ui.c1.selectedIndex = 0;
  6289. }
  6290. }
  6291. }
  6292. class UISign extends UIBase {
  6293. constructor() {
  6294. super();
  6295. this.curDayIndex = 0;
  6296. this.starX = 0;
  6297. }
  6298. onConstructor() {
  6299. this.ui = ui_UISign.createInstance();
  6300. this.contentPane = this.ui;
  6301. this.isEject = false;
  6302. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6303. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6304. this.initSignItem();
  6305. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6306. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6307. }
  6308. show() {
  6309. super.show();
  6310. this.ui.t0.play();
  6311. this.playSecretaryIdle();
  6312. this.updateSign();
  6313. }
  6314. initSignItem() {
  6315. this.signArr = [];
  6316. for (let index = 0; index < 6; index++) {
  6317. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6318. this.signArr.push(temp);
  6319. }
  6320. this.signMax = new SignMax(this.ui.myNode.day7);
  6321. if (Moyu.isKs)
  6322. this.ui.closeNode.closeBtn.x += 100;
  6323. }
  6324. updateSign() {
  6325. let sameDay = xGame.common.judgeSameDay();
  6326. let max = 7;
  6327. this.curDayIndex = DataMgr.getSignData();
  6328. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6329. this.curDayIndex = 0;
  6330. if (!sameDay) {
  6331. this.ui.normalBtn.visible = true;
  6332. this.ui.tipsNode.visible = false;
  6333. this.ui.againBtn.visible = false;
  6334. }
  6335. else {
  6336. this.ui.normalBtn.visible = false;
  6337. let again = DataMgr.getExtraSign();
  6338. let isCurrency = false;
  6339. let index = this.curDayIndex;
  6340. if (index == 0)
  6341. index = 7;
  6342. let award = cfgTable.signData[index].award;
  6343. let num = award[0].split("-")[0];
  6344. if (num == "1" || num == "2")
  6345. isCurrency = true;
  6346. let showAgain = again == 0 && isCurrency;
  6347. this.ui.againBtn.visible = showAgain;
  6348. this.ui.tipsNode.visible = !showAgain;
  6349. }
  6350. for (let index = 0; index < this.signArr.length; index++) {
  6351. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6352. }
  6353. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6354. }
  6355. playSecretaryIdle() {
  6356. let parent = this.ui.secretary.displayObject;
  6357. parent.destroyChildren();
  6358. let xx = this.ui.secretary.width / 2;
  6359. let yy = this.ui.secretary.height;
  6360. let scale = xGame.common.getSecretaryScale();
  6361. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6362. xGame.common.secretary.play(data, 0, true, parent);
  6363. }
  6364. closeSelf() {
  6365. this.hide();
  6366. }
  6367. normalGetAward() {
  6368. let sameDay = xGame.common.judgeSameDay();
  6369. if (!sameDay) {
  6370. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6371. let temp;
  6372. let type;
  6373. let num;
  6374. let arr = [];
  6375. for (let index = 0; index < award.length; index++) {
  6376. temp = award[index].split("-");
  6377. type = parseInt(temp[0]);
  6378. num = parseInt(temp[1]);
  6379. let awardType = new AwardType();
  6380. awardType.num = num;
  6381. awardType.type = type;
  6382. arr.push(awardType);
  6383. }
  6384. xGame.common.getAward(arr, (watchVideo) => {
  6385. this.curDayIndex++;
  6386. if (this.curDayIndex > 7)
  6387. this.curDayIndex = 0;
  6388. DataMgr.setSignData(this.curDayIndex);
  6389. DataMgr.setSignTime(new Date().getTime());
  6390. if (watchVideo) {
  6391. DataMgr.setExtraSign(1);
  6392. Moyu.sendDataEvent("signIn1");
  6393. }
  6394. this.updateSign();
  6395. });
  6396. }
  6397. }
  6398. againGetAward() {
  6399. Moyu.sendDataEvent("signIn2");
  6400. console.log('zh:qjff_AD_for_uisign');
  6401. if (Laya.Browser.onAndroid) {
  6402. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6403. if (!boo) {
  6404. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6405. return;
  6406. }
  6407. }
  6408. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6409. }
  6410. else {
  6411. console.log('zh:AD 失败,直接发放奖励');
  6412. this.qjff_AD_for_uisign();
  6413. }
  6414. }
  6415. qjff_AD_for_uisign() {
  6416. let index = this.curDayIndex;
  6417. if (index == 0)
  6418. index = 7;
  6419. let award = cfgTable.signData[index].award;
  6420. let temp;
  6421. let type;
  6422. let num;
  6423. for (let index = 0; index < award.length; index++) {
  6424. temp = award[index].split("-");
  6425. type = parseInt(temp[0]);
  6426. num = parseInt(temp[1]) * 3;
  6427. xGame.common.playObjFlyAnim(num, type);
  6428. }
  6429. DataMgr.setExtraSign(1);
  6430. this.updateSign();
  6431. }
  6432. }
  6433. UISign.uiName = "UISign";
  6434. class ui_UISkill extends fgui.GComponent {
  6435. static createInstance() {
  6436. return (fgui.UIPackage.createObject("game", "UISkill"));
  6437. }
  6438. onConstruct() {
  6439. this.n48 = (this.getChild("n48"));
  6440. this.n0 = (this.getChild("n0"));
  6441. this.secretary = (this.getChild("secretary"));
  6442. this.talkNode = (this.getChild("talkNode"));
  6443. this.closeNode = (this.getChild("closeNode"));
  6444. this.moneyNode = (this.getChild("moneyNode"));
  6445. this.skillNode = (this.getChild("skillNode"));
  6446. this.guideNode = (this.getChild("guideNode"));
  6447. }
  6448. }
  6449. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6450. class SkillDisplay {
  6451. constructor(ui, data, uiIndex) {
  6452. this.starX = 0;
  6453. this.starY = 0;
  6454. this.index = 0;
  6455. this.ui = ui;
  6456. this.data = data;
  6457. this.index = uiIndex;
  6458. this.initSelf();
  6459. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6460. }
  6461. initSelf() {
  6462. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6463. this.ui.nameTxt.text = this.data.name;
  6464. this.ui.describeTxt.text = this.data.describe;
  6465. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6466. this.ui.startBtn.onClick(this, this.startGame);
  6467. this.updateSelf();
  6468. }
  6469. updateSelf() {
  6470. this.checkTry();
  6471. let level = DataMgr.getBigSkillByIndex(this.index);
  6472. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6473. }
  6474. checkTry() {
  6475. let index = this.index;
  6476. let level = DataMgr.getBigSkillByIndex(index);
  6477. if (level == null) {
  6478. DataMgr.setBigSkill(index, 1, false);
  6479. level = 1;
  6480. }
  6481. this.ui.levelTxt.text = "LV." + level;
  6482. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6483. this.ui.tryNode.visible = true;
  6484. else
  6485. this.ui.tryNode.visible = false;
  6486. }
  6487. clickAddLevel() {
  6488. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6489. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6490. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6491. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6492. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6493. }
  6494. else {
  6495. console.log('zh:AD 失败,直接发放奖励');
  6496. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6497. }
  6498. }
  6499. qjff_AD_for_skilldisplay_clickAddLevel() {
  6500. DataMgr.setBigSkill(this.data.index, 1);
  6501. this.updateSelf();
  6502. xGame.common.upSkillLevel = true;
  6503. }
  6504. startGame() {
  6505. console.log('zh:rod skill startgame');
  6506. if (this.data.index == 3) {
  6507. alert('Coming soon!');
  6508. return;
  6509. }
  6510. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6511. let needCoin = xGame.common.bigMoveNeedCoin;
  6512. xGame.common.passAwardCoin = 2000;
  6513. let guide = DataMgr.getSkillGuide();
  6514. console.log('zh:startGame guide=' + guide);
  6515. xGame.common.temSelfLevel = 0;
  6516. if (guide == 0) {
  6517. needCoin = 0;
  6518. xGame.common.temSelfLevel = 100;
  6519. }
  6520. if (DataMgr.coinEnough(needCoin)) {
  6521. DataMgr.setCoin(-needCoin);
  6522. xGame.common.curPlayerSkillType = this.index;
  6523. if (guide == 0)
  6524. xGame.common.curPlayerSkillType = 0;
  6525. console.log('zh: skilldisplay 1');
  6526. xGame.uiMgr.Show(UIGame);
  6527. xGame.uiMgr.Hide(UIMain);
  6528. xGame.uiMgr.Show(UIMatching, () => {
  6529. xGame.common.gameUI.ui.alpha = 1;
  6530. xGame.common.gameUI.startGame();
  6531. xGame.uiMgr.Hide(UISkill);
  6532. });
  6533. this.logEventForRod_start();
  6534. }
  6535. else {
  6536. console.log('zh: skilldisplay 2');
  6537. xGame.uiMgr.Show(UIAddProp, 0);
  6538. Moyu.sendDataEvent("AddCoinVideo");
  6539. }
  6540. }
  6541. logEventForRod_start() {
  6542. let gfmsIdx = xGame.common.curPlayerSkillType;
  6543. console.log('zh:选择的技能=' + gfmsIdx);
  6544. let gfmc = 'Skyfall Shot';
  6545. if (gfmsIdx == 0) {
  6546. gfmc = 'Skyfall Shot';
  6547. }
  6548. if (gfmsIdx == 1) {
  6549. gfmc = 'Surging break';
  6550. }
  6551. if (gfmsIdx == 2) {
  6552. gfmc = 'Frost Lock';
  6553. }
  6554. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6555. let jsonStr = {
  6556. "count": 0,
  6557. "name": gfmc
  6558. };
  6559. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6560. const d = LocalStorageManager.getItem(keyStr);
  6561. jsonStr.count = d.count + 1;
  6562. LocalStorageManager.setItem(keyStr, jsonStr);
  6563. }
  6564. else {
  6565. LocalStorageManager.setItem(keyStr, jsonStr);
  6566. }
  6567. const reqStr = JSON.stringify(jsonStr);
  6568. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6569. }
  6570. }
  6571. class UISkill extends UIBase {
  6572. constructor() {
  6573. super();
  6574. this.skillData = [];
  6575. }
  6576. onConstructor() {
  6577. this.ui = ui_UISkill.createInstance();
  6578. this.contentPane = this.ui;
  6579. this.isEject = false;
  6580. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6581. this.initSkillData();
  6582. console.log('zh:aaaaaa1111111111');
  6583. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6584. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6585. console.log('zh:aaaaaa22222222');
  6586. this.displayList = [];
  6587. this.ui.skillNode.skillList.numItems = 3;
  6588. this.addUIClick(this.ui, this.interuptSecretary);
  6589. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6590. this.ui.talkNode.visible = false;
  6591. if (Moyu.isKs)
  6592. this.ui.closeNode.closeBtn.x += 100;
  6593. }
  6594. show() {
  6595. super.show();
  6596. this.playSecretaryIdle();
  6597. this.moneyNode.ui.c1.selectedIndex = 1;
  6598. Laya.timer.clearAll(this);
  6599. xGame.soundMgr.playSound("s_start");
  6600. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6601. let guide = DataMgr.getSkillGuide();
  6602. this.ui.guideNode.visible = guide == 0;
  6603. let item = this.getSkillItemByUIIndex(0);
  6604. if (guide == 0) {
  6605. item.ui.c1.selectedIndex = 1;
  6606. }
  6607. else {
  6608. item.ui.c1.selectedIndex = 0;
  6609. }
  6610. this.ui.guideNode.guideBtn.visible = guide == 0;
  6611. for (let index = 0; index < this.displayList.length; index++) {
  6612. this.displayList[index].checkTry();
  6613. }
  6614. }
  6615. getSkillItemByUIIndex(cur) {
  6616. for (let index = 0; index < this.displayList.length; index++) {
  6617. if (this.displayList[index].index == cur) {
  6618. return this.displayList[index];
  6619. }
  6620. }
  6621. }
  6622. enterGuideLevel() {
  6623. let item = this.getSkillItemByUIIndex(0);
  6624. item.startGame();
  6625. if (DataMgr.getNewUser())
  6626. Moyu.sendDataEvent("gameStart1");
  6627. }
  6628. initSkillData() {
  6629. this.skillData = [];
  6630. let nameList = xGame.common.skillNameList;
  6631. let iconList = xGame.common.skillIconList;
  6632. let describeList = [
  6633. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6634. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6635. "The power of frost descends—freezing the flow and taking full control of the game!"
  6636. ];
  6637. console.log('zh:initSkillData 111111111');
  6638. let data;
  6639. for (let index = 0; index < nameList.length; index++) {
  6640. data = {};
  6641. data.name = nameList[index];
  6642. data.icon = iconList[index];
  6643. data.describe = describeList[index];
  6644. data.index = index;
  6645. this.skillData.push(data);
  6646. }
  6647. }
  6648. updateSkillItem(index, target) {
  6649. if (this.displayList[index] == null) {
  6650. let uiIndex;
  6651. switch (index) {
  6652. case 0:
  6653. uiIndex = 1;
  6654. break;
  6655. case 1:
  6656. uiIndex = 0;
  6657. break;
  6658. case 2:
  6659. uiIndex = 2;
  6660. break;
  6661. case 3:
  6662. uiIndex = 3;
  6663. break;
  6664. default:
  6665. break;
  6666. }
  6667. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6668. this.displayList.push(temp);
  6669. }
  6670. }
  6671. playSecretaryIdle() {
  6672. let parent = this.ui.secretary.displayObject;
  6673. parent.destroyChildren();
  6674. let xx = this.ui.secretary.width / 2;
  6675. let yy = this.ui.secretary.height;
  6676. let scale = xGame.common.getSecretaryScale();
  6677. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6678. xGame.common.secretary.play(data, 0, true, parent);
  6679. }
  6680. returnUIMain() {
  6681. this.hide();
  6682. xGame.common.stopGirlPop(this.ui.talkNode);
  6683. xGame.uiMgr.Show(UIMain);
  6684. }
  6685. interuptSecretary() {
  6686. Laya.timer.clearAll(this);
  6687. this.playSecretaryRandomSound();
  6688. }
  6689. playSecretaryRandomSound() {
  6690. if (this.isHide)
  6691. return;
  6692. let time = xGame.common.randomNum(45000, 60000);
  6693. Laya.timer.once(time, this, () => {
  6694. if (this.isHide)
  6695. return;
  6696. let index = xGame.common.randomNum(4, 7);
  6697. xGame.soundMgr.playSound("s_main0" + index);
  6698. let words = 1;
  6699. switch (index) {
  6700. case 4:
  6701. words = 5;
  6702. break;
  6703. case 5:
  6704. words = 3;
  6705. break;
  6706. case 6:
  6707. words = 6;
  6708. break;
  6709. case 7:
  6710. words = 7;
  6711. break;
  6712. default:
  6713. break;
  6714. }
  6715. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6716. this.playSecretaryRandomSound();
  6717. });
  6718. }
  6719. }
  6720. UISkill.uiName = "UISkill";
  6721. class ui_UIModeSelection extends fgui.GComponent {
  6722. static createInstance() {
  6723. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6724. }
  6725. onConstruct() {
  6726. this.n19 = (this.getChild("n19"));
  6727. this.closeBtn = (this.getChild("closeBtn"));
  6728. this.myNode = (this.getChild("myNode"));
  6729. this.t0 = this.getTransition("t0");
  6730. }
  6731. }
  6732. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6733. class UIModeSelection extends UIBase {
  6734. constructor() {
  6735. super();
  6736. }
  6737. onConstructor() {
  6738. this.ui = ui_UIModeSelection.createInstance();
  6739. this.contentPane = this.ui;
  6740. this.isEject = false;
  6741. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6742. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6743. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6744. this.addUIClick(this.ui.closeBtn, this.hide);
  6745. this.peopleArr = [65, 990, 580];
  6746. this.peopleOffest = [5, 10, 10];
  6747. }
  6748. show(callback) {
  6749. this.updateSelf();
  6750. super.show();
  6751. this.ui.t0.play();
  6752. this.callback = callback;
  6753. }
  6754. updateSelf() {
  6755. let cfg = cfgTable.modeselectData;
  6756. for (let index = 1; index <= 3; index++) {
  6757. let node = this.ui.myNode["type" + index];
  6758. node.need.text = cfg[index].need;
  6759. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6760. node.peopleTxt.text = this.getRandPeople(index - 1);
  6761. }
  6762. }
  6763. enterGame(type) {
  6764. console.log('zh: 进入经典模式 type: ' + type);
  6765. xGame.common.classicRoomType = type;
  6766. let cfg = cfgTable.modeselectData[type];
  6767. let need = cfg.need;
  6768. xGame.common.passAwardCoin = cfg.award;
  6769. if (DataMgr.coinEnough(need)) {
  6770. DataMgr.setCoin(-need);
  6771. this.ui.myNode["type" + type].t0.play();
  6772. Laya.timer.once(200, this, () => {
  6773. this.callback && this.callback();
  6774. });
  6775. this.logEventForClassic_start();
  6776. }
  6777. else {
  6778. Moyu.sendDataEvent("AddCoinVideo");
  6779. xGame.uiMgr.Show(UIAddProp, 0);
  6780. }
  6781. }
  6782. getRandPeople(index) {
  6783. let rand = this.peopleOffest[index];
  6784. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6785. }
  6786. logEventForClassic_start() {
  6787. let rtype = xGame.common.classicRoomType;
  6788. let msmc = '';
  6789. if (rtype == 1) {
  6790. msmc = 'beginner';
  6791. }
  6792. if (rtype == 2) {
  6793. msmc = 'expert';
  6794. }
  6795. if (rtype == 3) {
  6796. msmc = 'master';
  6797. }
  6798. let keyStr = 'sjmd_classic_start_' + rtype;
  6799. let jsonStr = {
  6800. "difficulty": msmc,
  6801. "classic_count": 1,
  6802. "difficulty_count": 1
  6803. };
  6804. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6805. const d = LocalStorageManager.getItem(keyStr);
  6806. jsonStr.classic_count = d.classic_count + 1;
  6807. jsonStr.difficulty_count = d.difficulty_count + 1;
  6808. LocalStorageManager.setItem(keyStr, jsonStr);
  6809. }
  6810. else {
  6811. LocalStorageManager.setItem(keyStr, jsonStr);
  6812. }
  6813. const reqStr = JSON.stringify(jsonStr);
  6814. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6815. }
  6816. }
  6817. UIModeSelection.uiName = "UIModeSelection";
  6818. class ui_UIReg extends fgui.GComponent {
  6819. static createInstance() {
  6820. return (fgui.UIPackage.createObject("game", "UIReg"));
  6821. }
  6822. onConstruct() {
  6823. this.n38 = (this.getChild("n38"));
  6824. this.n9 = (this.getChild("n9"));
  6825. this.n14 = (this.getChild("n14"));
  6826. this.n15 = (this.getChild("n15"));
  6827. this.n34 = (this.getChild("n34"));
  6828. this.closeBtn = (this.getChild("closeBtn"));
  6829. this.lab_tip = (this.getChild("lab_tip"));
  6830. this.n43 = (this.getChild("n43"));
  6831. this.txt_ua = (this.getChild("txt_ua"));
  6832. this.n44 = (this.getChild("n44"));
  6833. this.txt_up1 = (this.getChild("txt_up1"));
  6834. this.n45 = (this.getChild("n45"));
  6835. this.txt_up2 = (this.getChild("txt_up2"));
  6836. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6837. this.btn_reg = (this.getChild("btn_reg"));
  6838. this.n50 = (this.getChild("n50"));
  6839. }
  6840. }
  6841. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6842. class ui_UILogin extends fgui.GComponent {
  6843. static createInstance() {
  6844. return (fgui.UIPackage.createObject("game", "UILogin"));
  6845. }
  6846. onConstruct() {
  6847. this.c1 = this.getController("c1");
  6848. this.n18 = (this.getChild("n18"));
  6849. this.n7 = (this.getChild("n7"));
  6850. this.n5 = (this.getChild("n5"));
  6851. this.n6 = (this.getChild("n6"));
  6852. this.closeBtn = (this.getChild("closeBtn"));
  6853. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6854. this.btn_login = (this.getChild("btn_login"));
  6855. this.n30 = (this.getChild("n30"));
  6856. this.n31 = (this.getChild("n31"));
  6857. this.txt_up = (this.getChild("txt_up"));
  6858. this.n32 = (this.getChild("n32"));
  6859. this.txt_ua = (this.getChild("txt_ua"));
  6860. }
  6861. }
  6862. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6863. class UILogin extends UIBase {
  6864. constructor() {
  6865. super();
  6866. }
  6867. onConstructor() {
  6868. this.ui = ui_UILogin.createInstance();
  6869. this.contentPane = this.ui;
  6870. this.isEject = false;
  6871. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6872. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6873. this.addUIClick(this.ui.btn_login, this.userLogin);
  6874. }
  6875. show() {
  6876. super.show();
  6877. this.x = (Laya.stage.width - this.width) / 2;
  6878. this.y = (Laya.stage.height - this.height) / 2;
  6879. }
  6880. closeSelf() {
  6881. this.hide();
  6882. }
  6883. userLogin() {
  6884. let ua = this.ui.txt_ua.text;
  6885. let up = this.ui.txt_up.text;
  6886. if (ua && up) {
  6887. let reqData = JSON.stringify({
  6888. username: ua.trim(),
  6889. password: up.trim(),
  6890. fromMark: 'app_game'
  6891. });
  6892. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6893. try {
  6894. console.log('zh:res = ' + JSON.stringify(res));
  6895. let code = res.code;
  6896. let msg = res.msg;
  6897. if (code == 200) {
  6898. let keyStr = keyForLoginInfo;
  6899. let jsonStr = {
  6900. "username": res.username,
  6901. "token": res.token,
  6902. "buySpids": { 1: false, 7: false }
  6903. };
  6904. LocalStorageManager.setItem(keyStr, jsonStr);
  6905. xGame.uiMgr.Show(UIMsg, msg);
  6906. DataMgr.getUserZiChanInfo();
  6907. this.closeSelf();
  6908. }
  6909. else {
  6910. xGame.uiMgr.Show(UIMsg, msg);
  6911. }
  6912. }
  6913. catch (error) {
  6914. console.log('error=' + error);
  6915. alert(error);
  6916. }
  6917. finally {
  6918. }
  6919. });
  6920. }
  6921. else {
  6922. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6923. }
  6924. }
  6925. gotoRegPage() {
  6926. this.closeSelf();
  6927. xGame.uiMgr.Show(UIReg);
  6928. }
  6929. }
  6930. UILogin.uiName = "UILogin";
  6931. class UIReg extends UIBase {
  6932. constructor() {
  6933. super();
  6934. }
  6935. onConstructor() {
  6936. this.ui = ui_UIReg.createInstance();
  6937. this.contentPane = this.ui;
  6938. this.isEject = false;
  6939. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6940. this.addUIClick(this.ui.btn_reg, this.regUser);
  6941. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6942. }
  6943. show() {
  6944. super.show();
  6945. this.x = (Laya.stage.width - this.width) / 2;
  6946. this.y = (Laya.stage.height - this.height) / 2;
  6947. }
  6948. closeSelf() {
  6949. this.hide();
  6950. }
  6951. regUser() {
  6952. this.ui.lab_tip.visible = false;
  6953. let ua = this.ui.txt_ua.text;
  6954. let up1 = this.ui.txt_up1.text;
  6955. let up2 = this.ui.txt_up2.text;
  6956. if (ua && up1 && up2 && up1 == up2) {
  6957. let reqData = JSON.stringify({
  6958. username: ua.trim(),
  6959. password: up1.trim(),
  6960. fromMark: 'app_game'
  6961. });
  6962. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6963. try {
  6964. console.log('zh:res = ' + JSON.stringify(res));
  6965. let code = res.code;
  6966. let msg = res.msg;
  6967. xGame.uiMgr.Show(UIMsg, msg);
  6968. if (code == 200) {
  6969. this.ui.lab_tip.color = "#FFFFFF";
  6970. xGame.uiMgr.Show(UIMsg, msg);
  6971. this.closeSelf();
  6972. }
  6973. else {
  6974. this.ui.lab_tip.color = "#FF0000";
  6975. xGame.uiMgr.Show(UIMsg, msg);
  6976. }
  6977. }
  6978. catch (error) {
  6979. console.log('error=' + error);
  6980. alert(error);
  6981. }
  6982. finally {
  6983. }
  6984. });
  6985. }
  6986. else {
  6987. if (up1 != up2) {
  6988. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6989. }
  6990. else {
  6991. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6992. }
  6993. }
  6994. }
  6995. gotoLogin() {
  6996. this.closeSelf();
  6997. xGame.uiMgr.Show(UILogin);
  6998. }
  6999. }
  7000. UIReg.uiName = "UIReg";
  7001. class ui_UIFuli1 extends fgui.GComponent {
  7002. static createInstance() {
  7003. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7004. }
  7005. onConstruct() {
  7006. this.n1 = (this.getChild("n1"));
  7007. this.n2 = (this.getChild("n2"));
  7008. }
  7009. }
  7010. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7011. class UIFuli1 extends UIBase {
  7012. constructor() {
  7013. super();
  7014. }
  7015. onConstructor() {
  7016. this.ui = ui_UIFuli1.createInstance();
  7017. this.contentPane = this.ui;
  7018. this.isEject = false;
  7019. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7020. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7021. }
  7022. show() {
  7023. super.show();
  7024. this.x = (Laya.stage.width - this.width) / 2;
  7025. this.y = (Laya.stage.height - this.height) / 2;
  7026. }
  7027. closeSelf() {
  7028. this.hide();
  7029. }
  7030. gotoBuy() {
  7031. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7032. if (userInfo != null) {
  7033. let token = userInfo.token;
  7034. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7035. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7036. return;
  7037. }
  7038. else {
  7039. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7040. }
  7041. }
  7042. gotoBuy2() {
  7043. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7044. if (userInfo == null) {
  7045. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7046. return;
  7047. }
  7048. let reqData = xGame.httpMgr.getReqData();
  7049. let pd = JSON.parse(reqData);
  7050. pd.productId = 1;
  7051. reqData = JSON.stringify(pd);
  7052. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7053. try {
  7054. console.log('zh:buySp res = ' + JSON.stringify(res));
  7055. let code = res.code;
  7056. let msg = res.msg;
  7057. if (code == 401) {
  7058. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7059. alert(TIP_MSG_key.loginTimeOut);
  7060. xGame.uiMgr.Show(UIMsg, msg);
  7061. return;
  7062. }
  7063. if (code == 200) {
  7064. xGame.uiMgr.Show(UIMsg, msg);
  7065. DataMgr.getUserZiChanInfo();
  7066. this.closeSelf();
  7067. }
  7068. else {
  7069. xGame.uiMgr.Show(UIMsg, msg);
  7070. }
  7071. }
  7072. catch (error) {
  7073. console.log('error=' + error);
  7074. alert(error);
  7075. }
  7076. finally {
  7077. }
  7078. });
  7079. }
  7080. }
  7081. UIFuli1.uiName = "UIFuli1";
  7082. class ui_UIFuli2 extends fgui.GComponent {
  7083. static createInstance() {
  7084. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7085. }
  7086. onConstruct() {
  7087. this.n1 = (this.getChild("n1"));
  7088. this.n0 = (this.getChild("n0"));
  7089. }
  7090. }
  7091. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7092. class UIFuli2 extends UIBase {
  7093. constructor() {
  7094. super();
  7095. }
  7096. onConstructor() {
  7097. this.ui = ui_UIFuli2.createInstance();
  7098. this.contentPane = this.ui;
  7099. this.isEject = false;
  7100. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7101. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7102. }
  7103. show() {
  7104. super.show();
  7105. this.x = (Laya.stage.width - this.width) / 2;
  7106. this.y = (Laya.stage.height - this.height) / 2;
  7107. }
  7108. closeSelf() {
  7109. this.hide();
  7110. }
  7111. gotoBuy() {
  7112. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7113. if (userInfo != null) {
  7114. let token = userInfo.token;
  7115. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7116. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7117. return;
  7118. }
  7119. else {
  7120. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7121. }
  7122. }
  7123. gotoBuy1() {
  7124. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7125. if (userInfo == null) {
  7126. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7127. return;
  7128. }
  7129. let reqData = xGame.httpMgr.getReqData();
  7130. let pd = JSON.parse(reqData);
  7131. pd.productId = 2;
  7132. reqData = JSON.stringify(pd);
  7133. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7134. try {
  7135. console.log('zh:buySp res = ' + JSON.stringify(res));
  7136. let code = res.code;
  7137. let msg = res.msg;
  7138. if (code == 401) {
  7139. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7140. alert(TIP_MSG_key.loginTimeOut);
  7141. xGame.uiMgr.Show(UIMsg, msg);
  7142. return;
  7143. }
  7144. if (code == 200) {
  7145. xGame.uiMgr.Show(UIMsg, msg);
  7146. DataMgr.getUserZiChanInfo();
  7147. this.closeSelf();
  7148. }
  7149. else {
  7150. xGame.uiMgr.Show(UIMsg, msg);
  7151. }
  7152. }
  7153. catch (error) {
  7154. console.log('error=' + error);
  7155. alert(error);
  7156. }
  7157. finally {
  7158. }
  7159. });
  7160. }
  7161. }
  7162. UIFuli2.uiName = "UIFuli2";
  7163. class ui_UIGetAward extends fgui.GComponent {
  7164. static createInstance() {
  7165. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7166. }
  7167. onConstruct() {
  7168. this.n4 = (this.getChild("n4"));
  7169. this.n0 = (this.getChild("n0"));
  7170. this.myList = (this.getChild("myList"));
  7171. this.n1 = (this.getChild("n1"));
  7172. this.eftNode = (this.getChild("eftNode"));
  7173. this.btnNode = (this.getChild("btnNode"));
  7174. this.t0 = this.getTransition("t0");
  7175. }
  7176. }
  7177. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7178. class UIGetAward extends UIBase {
  7179. constructor() {
  7180. super();
  7181. this.showTriple = true;
  7182. }
  7183. onConstructor() {
  7184. this.ui = ui_UIGetAward.createInstance();
  7185. this.contentPane = this.ui;
  7186. this.isEject = false;
  7187. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7188. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7189. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7190. }
  7191. show(arr, showTriple, callback) {
  7192. super.show();
  7193. this.ui.t0.play();
  7194. this.ui.eftNode.visible = true;
  7195. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7196. this.ui.eftNode.visible = false;
  7197. }), 1, 0, 0, 0.9);
  7198. this.awardArr = arr;
  7199. this.showTriple = showTriple;
  7200. this.callback = callback;
  7201. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7202. this.ui.myList.numItems = arr.length;
  7203. xGame.soundMgr.playSound("getaward");
  7204. }
  7205. updateSelf(index, obj) {
  7206. let temp = this.awardArr[index];
  7207. let icon = this.getIcon(temp.type);
  7208. let str = icon;
  7209. if (temp.type > 2) {
  7210. str = "s" + icon;
  7211. }
  7212. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7213. obj.myIcon.rotation = 0;
  7214. obj.numTxt.text = temp.num + "";
  7215. obj.numTxt.visible = temp.type > 2 ? false : true;
  7216. obj.nameTxt.text = this.getNameStr(temp.type);
  7217. }
  7218. renderItem(index, obj) {
  7219. this.updateSelf(index, obj);
  7220. }
  7221. tripleGetAward() {
  7222. console.log('zh:qjff_AD_for_uigetAward');
  7223. if (Laya.Browser.onAndroid) {
  7224. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7225. if (!boo) {
  7226. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7227. return;
  7228. }
  7229. }
  7230. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7231. }
  7232. else {
  7233. console.log('zh:AD 失败,直接发放奖励');
  7234. this.qjff_AD_for_uigetAward();
  7235. }
  7236. }
  7237. qjff_AD_for_uigetAward() {
  7238. this.getAward(3);
  7239. }
  7240. normalGetAward() {
  7241. if (PlatMgr.isMisVideo())
  7242. this.tripleGetAward();
  7243. else
  7244. this.getAward();
  7245. }
  7246. getAward(times = 1) {
  7247. this.hide();
  7248. for (let index = 0; index < this.awardArr.length; index++) {
  7249. this.awardArr[index].num *= times;
  7250. }
  7251. this.callback && this.callback(times != 1);
  7252. }
  7253. getIcon(type) {
  7254. switch (type) {
  7255. case Prop.diamond:
  7256. return "ty_zs";
  7257. case Prop.coin:
  7258. return "ty_jb";
  7259. case Prop.gan1:
  7260. return "qg1";
  7261. case Prop.gan2:
  7262. return "qg2";
  7263. case Prop.gan3:
  7264. return "qg3";
  7265. case Prop.gan4:
  7266. return "qg4";
  7267. default:
  7268. break;
  7269. }
  7270. }
  7271. getNameStr(type) {
  7272. switch (type) {
  7273. case Prop.diamond:
  7274. return "Diamond";
  7275. case Prop.coin:
  7276. return "Coins";
  7277. case Prop.gan1:
  7278. case Prop.gan2:
  7279. case Prop.gan3:
  7280. case Prop.gan4:
  7281. return cfgTable.ballrodData[type - 1].name;
  7282. default:
  7283. break;
  7284. }
  7285. }
  7286. }
  7287. UIGetAward.uiName = "UIGetAward";
  7288. class ui_UIRepentProp extends fgui.GComponent {
  7289. static createInstance() {
  7290. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7291. }
  7292. onConstruct() {
  7293. this.c1 = this.getController("c1");
  7294. this.n11 = (this.getChild("n11"));
  7295. this.regretNode = (this.getChild("regretNode"));
  7296. this.helpLineNode = (this.getChild("helpLineNode"));
  7297. this.t0 = this.getTransition("t0");
  7298. }
  7299. }
  7300. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7301. class UIRepentProp extends UIBase {
  7302. constructor() {
  7303. super();
  7304. this.viewType = 0;
  7305. this.regretType = 0;
  7306. }
  7307. onConstructor() {
  7308. this.ui = ui_UIRepentProp.createInstance();
  7309. this.contentPane = this.ui;
  7310. this.isEject = false;
  7311. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7312. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7313. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7314. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7315. }
  7316. show(viewType, regretType, callback) {
  7317. PlatMgr.showInsert(true);
  7318. this.viewType = viewType;
  7319. this.regretType = regretType;
  7320. this.callback = callback;
  7321. super.show();
  7322. this.ui.t0.play();
  7323. this.ui.c1.selectedIndex = this.viewType;
  7324. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7325. if (this.viewType == 0) {
  7326. let guide = DataMgr.getGuideHelpLine();
  7327. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7328. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7329. }
  7330. xGame.common.gameMgr.gamePause = true;
  7331. }
  7332. hideSelf() {
  7333. xGame.common.gameMgr.gamePause = false;
  7334. this.callback && this.callback(false);
  7335. this.hide();
  7336. }
  7337. videoRegret() {
  7338. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7339. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7340. }
  7341. else {
  7342. console.log('zh:AD 失败,直接发放奖励');
  7343. this.qjff_AD_for_UIrepentProp_videoRegret();
  7344. }
  7345. }
  7346. qjff_AD_for_UIrepentProp_videoRegret() {
  7347. this.callback && this.callback(true);
  7348. this.hideSelf();
  7349. }
  7350. videoAddHelpLine() {
  7351. let guide = DataMgr.getGuideHelpLine();
  7352. if (guide == 0) {
  7353. this.callback && this.callback(true);
  7354. this.hideSelf();
  7355. DataMgr.setGuideHelpLine();
  7356. xGame.common.gameUI.ui.guideNode.visible = false;
  7357. }
  7358. else {
  7359. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7360. if (Laya.Browser.onAndroid) {
  7361. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7362. if (!boo) {
  7363. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7364. return;
  7365. }
  7366. }
  7367. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7368. }
  7369. else {
  7370. console.log('zh:AD 失败,直接发放奖励');
  7371. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7372. }
  7373. }
  7374. }
  7375. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7376. this.callback && this.callback(true);
  7377. this.hideSelf();
  7378. }
  7379. }
  7380. UIRepentProp.uiName = "UIRepentProp";
  7381. class UIMain extends UIBase {
  7382. constructor() {
  7383. super();
  7384. this.firstEnter = true;
  7385. }
  7386. nativeCallJs(msg) {
  7387. let t = msg;
  7388. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7389. switch (t) {
  7390. case 'qjff_chouJiang':
  7391. let dui = xGame.uiMgr.getUI(UIDraw);
  7392. dui.qjff_chouJiang();
  7393. break;
  7394. case 'qjff_AD_for_uisign':
  7395. let dui2 = xGame.uiMgr.getUI(UISign);
  7396. dui2.qjff_AD_for_uisign();
  7397. break;
  7398. case 'qjff_AD_for_uitry':
  7399. let dui3 = xGame.uiMgr.getUI(UITry);
  7400. dui3.qjff_AD_for_uitry();
  7401. break;
  7402. case 'qjff_AD_for_uipower':
  7403. let dui4 = xGame.uiMgr.getUI(UIPower);
  7404. dui4.qjff_AD_for_uipower();
  7405. break;
  7406. case 'qjff_AD_for_uigetAward':
  7407. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7408. dui5.qjff_AD_for_uigetAward();
  7409. break;
  7410. case 'qjff_AD_for_uiGameEnd':
  7411. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7412. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7413. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7414. break;
  7415. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7416. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7417. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7418. break;
  7419. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7420. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7421. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7422. break;
  7423. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7424. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7425. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7426. break;
  7427. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7428. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7429. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7430. break;
  7431. case 'qjff_AD_for_UIBOX_onOpenBox':
  7432. let dui11 = xGame.uiMgr.getUI(UIBox);
  7433. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7434. break;
  7435. case 'qjff_AD_for_UIAddCoin':
  7436. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7437. dui12.qjff_AD_for_UIAddCoin();
  7438. break;
  7439. case '111a':
  7440. let dui14 = xGame.uiMgr.getUI(UISign);
  7441. dui14.qjff_AD_for_uisign();
  7442. break;
  7443. case '222a':
  7444. let dui15 = xGame.uiMgr.getUI(UISign);
  7445. dui15.qjff_AD_for_uisign();
  7446. break;
  7447. case '333a':
  7448. let dui16 = xGame.uiMgr.getUI(UISign);
  7449. dui16.qjff_AD_for_uisign();
  7450. break;
  7451. default:
  7452. console.log('zh:未知的方法名字' + t);
  7453. break;
  7454. }
  7455. }
  7456. onConstructor() {
  7457. console.log('zh: UIMain onConstructor');
  7458. this.ui = ui_UIMain.createInstance();
  7459. this.contentPane = this.ui;
  7460. this.isEject = false;
  7461. this.addEvent();
  7462. this.addClickSpine();
  7463. this.settingNode = new SettingNode(this.ui.settingNode);
  7464. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7465. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7466. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7467. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7468. let curUse = DataMgr.getCurSecretary();
  7469. this.changeSecretary(curUse);
  7470. this.ui.talkNode.visible = false;
  7471. let guide = DataMgr.getSkillGuide();
  7472. if (xGame.common.isNewDay && guide == 1) {
  7473. xGame.common.isNewDay = false;
  7474. xGame.soundMgr.playSound("s_main01");
  7475. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7476. console.log("zh:播放小秘书每天语音");
  7477. }
  7478. this.onGetUserInfo();
  7479. DataMgr.getUserZiChanInfo();
  7480. this.ui.n83.visible = false;
  7481. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7482. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7483. let ua = d.username;
  7484. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7485. }
  7486. this.c_btn_for_user();
  7487. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7488. this.loadUserSpOrderForAd();
  7489. }
  7490. Logout() {
  7491. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7492. LocalStorageManager.removeItem(keyForLoginInfo);
  7493. this.freshUser();
  7494. }
  7495. JSBridgeUtils.instance.loginOutForApp();
  7496. }
  7497. gotoLogin() {
  7498. xGame.uiMgr.Show(UILogin);
  7499. }
  7500. gotoRegUser() {
  7501. xGame.uiMgr.Show(UIReg);
  7502. }
  7503. showFuLiSp1() {
  7504. console.log('zh:福利1');
  7505. this.checkForShowFuLi17(1);
  7506. }
  7507. showFuLiSp7() {
  7508. console.log('zh:福利7');
  7509. this.checkForShowFuLi17(7);
  7510. }
  7511. loadUserSpOrderForAd() {
  7512. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7513. if (userInfo == null) {
  7514. return;
  7515. }
  7516. let reqData = xGame.httpMgr.getReqData();
  7517. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  7518. try {
  7519. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  7520. let code = res.code;
  7521. let msg = res.msg;
  7522. if (code == 401) {
  7523. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7524. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7525. return;
  7526. }
  7527. if (code == 200) {
  7528. let data = res.data;
  7529. let buy_spid1 = false;
  7530. let buy_spid7 = false;
  7531. for (let index = 0; index < data.length; index++) {
  7532. let element = data[index];
  7533. console.log('zh:list element.spid = ' + element.spid);
  7534. if (element.spid == 1) {
  7535. buy_spid1 = true;
  7536. }
  7537. if (element.spid == 7) {
  7538. buy_spid7 = true;
  7539. }
  7540. }
  7541. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  7542. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  7543. }
  7544. else {
  7545. xGame.uiMgr.Show(UIMsg, msg);
  7546. }
  7547. }
  7548. catch (error) {
  7549. console.log('error=' + error);
  7550. alert(error);
  7551. }
  7552. finally {
  7553. }
  7554. });
  7555. }
  7556. checkForShowFuLi17(spid) {
  7557. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7558. if (userInfo == null) {
  7559. console.log('zh:没有登录就不显示福利弹框了');
  7560. return;
  7561. }
  7562. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7563. let reqData = xGame.httpMgr.getReqData();
  7564. let pd = JSON.parse(reqData);
  7565. pd.productId = spid;
  7566. reqData = JSON.stringify(pd);
  7567. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7568. try {
  7569. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7570. let code = res.code;
  7571. let msg = res.msg;
  7572. if (code == 401) {
  7573. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7574. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7575. return;
  7576. }
  7577. if (code == 200) {
  7578. let isBuyOk = res.data;
  7579. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7580. if (isBuyOk === false) {
  7581. if (spid === 1) {
  7582. xGame.uiMgr.Show(UIFuli1);
  7583. }
  7584. if (spid === 7) {
  7585. xGame.uiMgr.Show(UIFuli2);
  7586. }
  7587. }
  7588. else {
  7589. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7590. }
  7591. }
  7592. else {
  7593. xGame.uiMgr.Show(UIMsg, msg);
  7594. }
  7595. }
  7596. catch (error) {
  7597. console.log('error=' + error);
  7598. alert(error);
  7599. }
  7600. finally {
  7601. }
  7602. });
  7603. }
  7604. c_btn_for_user() {
  7605. this.ui.n_Logout.visible = false;
  7606. this.ui.n_dengLu.visible = false;
  7607. this.ui.n_zhuCe.visible = false;
  7608. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7609. this.ui.n_Logout.visible = true;
  7610. }
  7611. else {
  7612. this.ui.n_dengLu.visible = true;
  7613. }
  7614. }
  7615. changeSecretary(curUse) {
  7616. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7617. xGame.common.secretary && xGame.common.secretary.dispose();
  7618. this.addSecretarySpine(name);
  7619. }
  7620. addSecretarySpine(name) {
  7621. let spine = new SpineMgr(name, () => {
  7622. this.playSecretaryIdle();
  7623. });
  7624. xGame.common.secretary = spine;
  7625. }
  7626. addClickSpine() {
  7627. let clickSpine = new SpineMgr("dianji", () => {
  7628. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7629. let parent = Laya.stage;
  7630. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7631. clickSpine.play(data, 0, false, parent, (spine) => {
  7632. spine.destroy(true);
  7633. });
  7634. });
  7635. });
  7636. }
  7637. addEvent() {
  7638. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7639. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7640. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7641. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7642. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7643. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7644. this.addUIClick(this.ui, this.interuptSecretary);
  7645. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7646. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7647. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7648. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7649. this.addUIClick(this.ui.signBtn, this.openSignView);
  7650. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7651. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7652. this.addUIClick(this.ui.n_Logout, this.Logout);
  7653. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7654. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7655. this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
  7656. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7657. }
  7658. show(showFailWords) {
  7659. super.show();
  7660. this.loadUserSpOrderForAd();
  7661. this.moneyNode.ui.c1.selectedIndex = 1;
  7662. this.playSecretaryIdle();
  7663. xGame.soundMgr.playMusic("caromhall01", 0);
  7664. Laya.timer.clearAll(this);
  7665. this.playSecretaryRandomSound();
  7666. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7667. if (showFailWords) {
  7668. console.log('zh:uimain.ts ');
  7669. setTimeout(() => {
  7670. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7671. let words = -1;
  7672. if (str == "s_main02") {
  7673. words = 2;
  7674. }
  7675. else {
  7676. words = 3;
  7677. }
  7678. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7679. xGame.soundMgr.playSound(str);
  7680. }, 300);
  7681. }
  7682. this.showGuide();
  7683. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7684. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7685. let guide = DataMgr.getSkillGuide();
  7686. if (guide == 1) {
  7687. let randTime = xGame.common.randomNum(300, 800);
  7688. if (this.firstEnter) {
  7689. console.log("zh: firstEnter");
  7690. this.firstEnter = false;
  7691. randTime += 900;
  7692. }
  7693. else {
  7694. console.log("zh: no firstEnter");
  7695. }
  7696. Laya.timer.once(randTime, this, () => {
  7697. });
  7698. }
  7699. }
  7700. checkActive(show) {
  7701. }
  7702. showGuide() {
  7703. let guide = DataMgr.getSkillGuide();
  7704. this.ui.guideBtn.visible = guide == 0;
  7705. this.ui.enterGuide.visible = false;
  7706. this.ui.secretaryGuide.visible = guide == 0;
  7707. if (guide == 0) {
  7708. console.log("zh:显示引导");
  7709. xGame.soundMgr.playSound("s_guide");
  7710. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7711. }
  7712. else {
  7713. console.log("zh:不需要显示引导");
  7714. }
  7715. }
  7716. ensureSecretary() {
  7717. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7718. this.ui.secretaryGuide.visible = false;
  7719. this.ui.enterGuide.visible = true;
  7720. this.ui.wordsNode.t0.play();
  7721. if (DataMgr.getNewUser())
  7722. Moyu.sendDataEvent("gameReady");
  7723. }
  7724. playSecretaryIdle() {
  7725. let parent = this.ui.secretary.displayObject;
  7726. parent.destroyChildren();
  7727. let xx = this.ui.secretary.width / 2;
  7728. let yy = this.ui.secretary.height;
  7729. let scale = xGame.common.getSecretaryScale();
  7730. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7731. xGame.common.secretary.play(data, 0, true, parent);
  7732. }
  7733. startGame(type) {
  7734. if (!this.isReadyForLoadNetSource()) {
  7735. return;
  7736. }
  7737. xGame.common.gameMode = type;
  7738. Moyu.sendDataEvent("PlayGame", { type: type });
  7739. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7740. switch (xGame.common.gameMode) {
  7741. case GameMode.classic:
  7742. console.log('zh:进入经典模式111111111');
  7743. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7744. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7745. console.log('zh:classic db_over_lev=', db_over_lev);
  7746. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7747. console.log('zh:判断是否可以玩该模式classic =NO');
  7748. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7749. xGame.uiMgr.Show(UIMsg, tipStr);
  7750. return;
  7751. }
  7752. else {
  7753. console.log('zh:可以玩该模式classic 66666666666666');
  7754. this.beginGame();
  7755. }
  7756. }
  7757. else {
  7758. console.log('zh:不需要判断是否可以玩该classic');
  7759. let challengeTimes = DataMgr.getChallengeTimes();
  7760. if (challengeTimes == 0) {
  7761. xGame.uiMgr.Show(UIInvitation);
  7762. }
  7763. else {
  7764. this.beginGame();
  7765. }
  7766. break;
  7767. }
  7768. case GameMode.bigMove:
  7769. console.error('zh:bigMove check');
  7770. let guide = DataMgr.getSkillGuide();
  7771. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7772. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7773. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7774. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7775. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7776. xGame.uiMgr.Show(UIMsg, tipStr);
  7777. return;
  7778. }
  7779. else {
  7780. console.log('zh:可以玩该模式 bigMove');
  7781. this.beginGame();
  7782. if (DataMgr.getNewUser())
  7783. Moyu.sendDataEvent("gameStart0");
  7784. }
  7785. }
  7786. else {
  7787. this.beginGame();
  7788. if (DataMgr.getNewUser())
  7789. Moyu.sendDataEvent("gameStart0");
  7790. }
  7791. break;
  7792. default:
  7793. console.error('zh:未知错误!!!!');
  7794. break;
  7795. }
  7796. }
  7797. beginGame(isNice = false) {
  7798. console.log('zh:beginGame ');
  7799. let guide = DataMgr.getSkillGuide();
  7800. if (guide == 1) {
  7801. console.log('zh:非新手引导,showInternAd ');
  7802. JSBridgeUtils.instance.showInternAd('beginGame');
  7803. }
  7804. else {
  7805. console.log('zh:新手引导,不显示AD ');
  7806. }
  7807. console.log('zh:beginGame 2 go');
  7808. if (xGame.common.gameMode == GameMode.classic) {
  7809. if (isNice) {
  7810. this.enterClassic();
  7811. }
  7812. else {
  7813. xGame.uiMgr.Show(UIModeSelection, () => {
  7814. console.log('zh:BBBBBBBBBBBBBBB');
  7815. this.enterClassic();
  7816. });
  7817. }
  7818. }
  7819. else if (xGame.common.gameMode == GameMode.bigMove) {
  7820. this.ui.enterGuide.visible = false;
  7821. xGame.uiMgr.Show(UISkill);
  7822. }
  7823. }
  7824. enterClassic() {
  7825. xGame.uiMgr.Show(UIGame);
  7826. xGame.uiMgr.Show(UIMatching, () => {
  7827. if (!this.isHide)
  7828. this.hide();
  7829. xGame.common.gameUI.ui.alpha = 1;
  7830. xGame.common.gameUI.startGame();
  7831. xGame.uiMgr.Hide(UIGameEnd);
  7832. });
  7833. }
  7834. start_debug_for_moni_payOk() {
  7835. console.log('zh:start_debug_for_moni_payOk');
  7836. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7837. if (userInfo != null) {
  7838. let token = userInfo.token;
  7839. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7840. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7841. alert('模拟支付OK');
  7842. return;
  7843. }
  7844. else {
  7845. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7846. }
  7847. }
  7848. startGlobal() {
  7849. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7850. }
  7851. startWeekly() {
  7852. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7853. }
  7854. zhouSaiMonth() {
  7855. console.log('zh: zhouSaiMonth 被调用');
  7856. }
  7857. isReadyForLoadNetSource() {
  7858. let reqCount = xGame.cfgMgr.httpReqCount;
  7859. let ok = xGame.cfgMgr.httpReqOkCount;
  7860. if (reqCount > ok) {
  7861. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7862. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7863. Laya.timer.once(5000, this, () => {
  7864. let retryCount = 0;
  7865. const maxRetries = 3;
  7866. const tryFetchConfig = () => {
  7867. try {
  7868. xGame.cfgMgr.getConfigFromServer();
  7869. }
  7870. catch (error) {
  7871. if (retryCount < maxRetries) {
  7872. retryCount++;
  7873. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7874. Laya.timer.once(5000, this, tryFetchConfig);
  7875. }
  7876. else {
  7877. console.error("❌ 达到最大重试次数,配置获取失败");
  7878. }
  7879. }
  7880. };
  7881. tryFetchConfig();
  7882. });
  7883. return false;
  7884. }
  7885. return true;
  7886. }
  7887. startPlaceBall() {
  7888. if (!this.isReadyForLoadNetSource()) {
  7889. return;
  7890. }
  7891. xGame.uiMgr.Show(UILevelDisplay);
  7892. }
  7893. hide() {
  7894. console.log('zh:uimain hide ...');
  7895. super.hide();
  7896. xGame.common.stopGirlPop(this.ui.talkNode);
  7897. }
  7898. onGetUserInfo(force = false) {
  7899. if (Moyu.isWx) {
  7900. let info = Moyu.getSystemInfo();
  7901. if (info)
  7902. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7903. }
  7904. else {
  7905. Moyu.initUser(this, this.freshUser, force);
  7906. }
  7907. this.freshUser();
  7908. }
  7909. freshUser() {
  7910. let user = Moyu.getUserInfo();
  7911. if (!user.isAuth) {
  7912. user.headIcon = 'res/ty_touxiang.png';
  7913. }
  7914. else {
  7915. DataMgr.upRankData();
  7916. }
  7917. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7918. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7919. let keyStr = keyForLoginInfo;
  7920. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7921. const d = LocalStorageManager.getItem(keyStr);
  7922. let ua = d.username;
  7923. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7924. }
  7925. else {
  7926. }
  7927. this.c_btn_for_user();
  7928. }
  7929. interuptSecretary() {
  7930. Laya.timer.clearAll(this);
  7931. this.playSecretaryRandomSound();
  7932. }
  7933. playSecretaryRandomSound() {
  7934. if (this.isHide)
  7935. return;
  7936. let time = xGame.common.randomNum(45000, 60000);
  7937. Laya.timer.once(time, this, () => {
  7938. if (this.isHide)
  7939. return;
  7940. let index = xGame.common.randomNum(4, 7);
  7941. xGame.soundMgr.playSound("s_main0" + index);
  7942. let words = 1;
  7943. switch (index) {
  7944. case 4:
  7945. words = 5;
  7946. break;
  7947. case 5:
  7948. words = 3;
  7949. break;
  7950. case 6:
  7951. words = 6;
  7952. break;
  7953. case 7:
  7954. words = 7;
  7955. break;
  7956. default:
  7957. break;
  7958. }
  7959. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7960. this.playSecretaryRandomSound();
  7961. });
  7962. }
  7963. openSecretaryView() {
  7964. xGame.uiMgr.Show(UISecretary);
  7965. Moyu.sendDataEvent("secretary");
  7966. }
  7967. openShopView() {
  7968. xGame.uiMgr.Show(UIShop, 0);
  7969. }
  7970. openSignView() {
  7971. xGame.uiMgr.Show(UISign);
  7972. }
  7973. openDrawView() {
  7974. xGame.uiMgr.Show(UIDraw);
  7975. }
  7976. openRanking() {
  7977. console.log('zh:phb openRanking');
  7978. xGame.uiMgr.Show(UIRanking);
  7979. Moyu.sendDataEvent("rankingList");
  7980. }
  7981. }
  7982. UIMain.uiName = "UIMain";
  7983. class UIGameEnd extends UIBase {
  7984. constructor() {
  7985. super();
  7986. this.success = false;
  7987. this.awardCoinNum = 1000;
  7988. this.awardDiamondNum = 10;
  7989. }
  7990. onConstructor() {
  7991. this.ui = ui_UIGameEnd.createInstance();
  7992. this.contentPane = this.ui;
  7993. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7994. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7995. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7996. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7997. this.ui.talkNode.visible = false;
  7998. if (Moyu.isKs)
  7999. this.ui.closeNode.closeBtn.x += 100;
  8000. }
  8001. updateType() {
  8002. switch (xGame.common.gameMode) {
  8003. case GameMode.classic:
  8004. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8005. this.ui.coinNode.visible = this.success;
  8006. if (!this.success) {
  8007. Laya.timer.once(500, this, () => {
  8008. xGame.uiMgr.Show(UIAddCoin);
  8009. });
  8010. }
  8011. else {
  8012. this.logEventForClassic_win();
  8013. }
  8014. this.logEventForClassic_complete();
  8015. this.ui.isGetAward.visible = false;
  8016. this.ui.leftBtn.c1.selectedIndex = 3;
  8017. this.ui.rightBtn.c1.selectedIndex = 0;
  8018. this.moneyNode.ui.c1.selectedIndex = 1;
  8019. break;
  8020. case GameMode.bigMove:
  8021. console.log('zh:招法模式 aaaaaa bigMove');
  8022. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8023. this.ui.coinNode.visible = this.success;
  8024. if (xGame.common.gameMode == GameMode.bigMove) {
  8025. if (this.success) {
  8026. DataMgr.setSkillSuccessTimes(1, true);
  8027. DataMgr.setSkillAccTimes(1);
  8028. }
  8029. else {
  8030. DataMgr.setSkillSuccessTimes(0, false);
  8031. }
  8032. }
  8033. this.logEventForRod_complete_N();
  8034. if (!this.success) {
  8035. Laya.timer.once(500, this, () => {
  8036. xGame.uiMgr.Show(UIAddCoin);
  8037. });
  8038. }
  8039. else {
  8040. this.logEventForRod_win();
  8041. }
  8042. this.ui.isGetAward.visible = false;
  8043. this.ui.leftBtn.c1.selectedIndex = 3;
  8044. this.ui.rightBtn.c1.selectedIndex = 0;
  8045. this.moneyNode.ui.c1.selectedIndex = 1;
  8046. break;
  8047. case GameMode.placeBall:
  8048. this.ui.coinNode.visible = false;
  8049. if (this.success) {
  8050. if (xGame.common.placeBallStarNum == 3) {
  8051. this.ui.c1.selectedIndex = 2;
  8052. }
  8053. else {
  8054. this.ui.c1.selectedIndex = 3;
  8055. }
  8056. let level = xGame.common.placeBallCurLevel;
  8057. if (level > 59) {
  8058. this.logEventForChallenge_level_complete(level);
  8059. }
  8060. else {
  8061. this.logEventForChallenge_level_N(level);
  8062. }
  8063. }
  8064. else {
  8065. this.ui.c1.selectedIndex = 4;
  8066. }
  8067. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8068. if (cfg.type == PlaceBallType.challenge) {
  8069. this.ui.c1.selectedIndex = 2;
  8070. }
  8071. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8072. this.updatePlaceBallBtn();
  8073. this.updatePlaceBallStarNum();
  8074. this.updatePlaceBallAwardState();
  8075. this.moneyNode.ui.c1.selectedIndex = 2;
  8076. this.moneyNode.checkPowerTime();
  8077. this.moneyNode.powerChange();
  8078. DataMgr.upRankData();
  8079. break;
  8080. default:
  8081. break;
  8082. }
  8083. }
  8084. logEventForRod_complete_N() {
  8085. let gfmsIdx = xGame.common.curPlayerSkillType;
  8086. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8087. let gfmc = 'Skyfall Shot';
  8088. if (gfmsIdx == 0) {
  8089. gfmc = 'Skyfall Shot';
  8090. }
  8091. if (gfmsIdx == 1) {
  8092. gfmc = 'Surging break';
  8093. }
  8094. if (gfmsIdx == 2) {
  8095. gfmc = 'Frost Lock';
  8096. }
  8097. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8098. console.log('zh:logEventForRod_complete_N level = ' + level);
  8099. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8100. let jsonStr = {
  8101. "count": 0,
  8102. "name": gfmc
  8103. };
  8104. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8105. const d = LocalStorageManager.getItem(keyStr);
  8106. jsonStr.count = d.count + 1;
  8107. LocalStorageManager.setItem(keyStr, jsonStr);
  8108. }
  8109. else {
  8110. LocalStorageManager.setItem(keyStr, jsonStr);
  8111. }
  8112. const d2 = LocalStorageManager.getItem(keyStr);
  8113. let count = d2.count;
  8114. console.log('zh:logEventForRod_complete_N count = ' + count);
  8115. if (count % 5 == 0) {
  8116. const reqStr = JSON.stringify(jsonStr);
  8117. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8118. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8119. }
  8120. }
  8121. logEventForRod_win() {
  8122. console.log('zh:logEventForRod_win,胜利');
  8123. let gfmsIdx = xGame.common.curPlayerSkillType;
  8124. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8125. let gfmc = 'Skyfall Shot';
  8126. if (gfmsIdx == 0) {
  8127. gfmc = 'Skyfall Shot';
  8128. }
  8129. if (gfmsIdx == 1) {
  8130. gfmc = 'Surging break';
  8131. }
  8132. if (gfmsIdx == 2) {
  8133. gfmc = 'Frost Lock';
  8134. }
  8135. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8136. console.log('zh:logEventForRod_win level = ' + level);
  8137. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8138. let jsonStr = {
  8139. "count": 1,
  8140. "name": gfmc + ' Lev' + level
  8141. };
  8142. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8143. const d = LocalStorageManager.getItem(keyStr);
  8144. jsonStr.count = d.count + 1;
  8145. LocalStorageManager.setItem(keyStr, jsonStr);
  8146. }
  8147. else {
  8148. LocalStorageManager.setItem(keyStr, jsonStr);
  8149. }
  8150. const reqStr = JSON.stringify(jsonStr);
  8151. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8152. }
  8153. logEventForClassic_win() {
  8154. console.log('zh:logEventForClassic_win,胜利');
  8155. let rtype = xGame.common.classicRoomType;
  8156. let msmc = '';
  8157. if (rtype == 1) {
  8158. msmc = 'beginner';
  8159. }
  8160. if (rtype == 2) {
  8161. msmc = 'expert';
  8162. }
  8163. if (rtype == 3) {
  8164. msmc = 'master';
  8165. }
  8166. let keyStr = 'sjmd_classic_win_' + rtype;
  8167. let jsonStr = {
  8168. "difficulty": msmc,
  8169. "classic_count": 1,
  8170. "difficulty_count": 1
  8171. };
  8172. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8173. const d = LocalStorageManager.getItem(keyStr);
  8174. jsonStr.classic_count = d.classic_count + 1;
  8175. jsonStr.difficulty_count = d.difficulty_count + 1;
  8176. LocalStorageManager.setItem(keyStr, jsonStr);
  8177. }
  8178. else {
  8179. LocalStorageManager.setItem(keyStr, jsonStr);
  8180. }
  8181. const reqStr = JSON.stringify(jsonStr);
  8182. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8183. }
  8184. logEventForClassic_complete() {
  8185. console.log('zh:logEventForClassic_complete,胜利');
  8186. let rtype = xGame.common.classicRoomType;
  8187. let msmc = '';
  8188. if (rtype == 1) {
  8189. msmc = 'beginner';
  8190. }
  8191. if (rtype == 2) {
  8192. msmc = 'expert';
  8193. }
  8194. if (rtype == 3) {
  8195. msmc = 'master';
  8196. }
  8197. let keyStr = 'sjmd_classic_complete_' + rtype;
  8198. let jsonStr = {
  8199. "msmc": msmc,
  8200. "count": 0
  8201. };
  8202. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8203. const d = LocalStorageManager.getItem(keyStr);
  8204. jsonStr.count = d.count + 1;
  8205. LocalStorageManager.setItem(keyStr, jsonStr);
  8206. }
  8207. else {
  8208. LocalStorageManager.setItem(keyStr, jsonStr);
  8209. }
  8210. if (jsonStr.count % 5 == 0) {
  8211. const reqStr = JSON.stringify(jsonStr);
  8212. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8213. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8214. }
  8215. }
  8216. updatePlaceBallBtn() {
  8217. this.ui.leftBtn.c1.selectedIndex = 5;
  8218. if (this.success) {
  8219. this.ui.rightBtn.c1.selectedIndex = 14;
  8220. }
  8221. else {
  8222. if (xGame.common.placeBallStarNum == 3) {
  8223. this.ui.rightBtn.c1.selectedIndex = 14;
  8224. }
  8225. else {
  8226. this.ui.rightBtn.c1.selectedIndex = 1;
  8227. }
  8228. }
  8229. }
  8230. updatePlaceBallStarNum() {
  8231. let starNum = xGame.common.placeBallStarNum;
  8232. if (starNum == 0)
  8233. this.ui.starNumNode.c1.selectedIndex = 3;
  8234. else {
  8235. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8236. }
  8237. }
  8238. updatePlaceBallAwardState() {
  8239. let level = xGame.common.placeBallCurLevel;
  8240. let starNum = xGame.common.placeBallStarNum;
  8241. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8242. let data = cfgTable.placeballData[level].award;
  8243. let cfg = cfgTable.placeballData[level];
  8244. this.awardDiamondNum = data[1];
  8245. this.awardCoinNum = data[0];
  8246. if (cfg.type == PlaceBallType.challenge) {
  8247. this.awardDiamondNum = 0;
  8248. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8249. }
  8250. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8251. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8252. if (cfg.type == PlaceBallType.challenge) {
  8253. this.ui.awardNode.coinNode.visible = true;
  8254. }
  8255. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8256. this.ui.awardNode.diamondNode.x = 265;
  8257. this.ui.awardNode.coinNode.x = 354;
  8258. }
  8259. else {
  8260. this.ui.awardNode.diamondNode.x = 291;
  8261. this.ui.awardNode.coinNode.x = 291;
  8262. }
  8263. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8264. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8265. if (this.awardCoinNum == 0) {
  8266. this.ui.awardNode.coinNode.numTxt.text = "";
  8267. }
  8268. if (getAward) {
  8269. this.ui.isGetAward.visible = true;
  8270. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8271. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8272. }
  8273. else {
  8274. this.ui.isGetAward.visible = false;
  8275. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8276. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8277. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8278. }
  8279. else {
  8280. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8281. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8282. }
  8283. }
  8284. }
  8285. show(success) {
  8286. super.show();
  8287. xGame.eventMgr.event(RESET_GAME);
  8288. this.success = success;
  8289. Laya.timer.clearAll(this);
  8290. this.playSecretaryAni();
  8291. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8292. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8293. offsetTime = Math.floor(offsetTime / 1000);
  8294. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8295. this.updateType();
  8296. Laya.timer.once(200, this, () => {
  8297. this.addAward(() => {
  8298. this.updateType();
  8299. Laya.timer.once(500, this, () => {
  8300. this.showChallengeLevel();
  8301. });
  8302. });
  8303. });
  8304. if (this.success) {
  8305. JSBridgeUtils.instance.showInternAd('gameend_success');
  8306. console.log('zh:game end 成功');
  8307. xGame.soundMgr.playSound('slots_roll01');
  8308. xGame.soundMgr.playSound("s_win");
  8309. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8310. this.diyGameDataUtilForGameWin();
  8311. }
  8312. else {
  8313. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8314. console.log('zh:game end失败');
  8315. xGame.soundMgr.playSound('matchwin01');
  8316. xGame.soundMgr.playSound("s_lose");
  8317. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8318. }
  8319. let challengeNum = DataMgr.getChallengeTimes();
  8320. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8321. DataMgr.setChallengeTimes(1);
  8322. }
  8323. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8324. DataMgr.setClassicTimes();
  8325. }
  8326. }
  8327. diyGameDataUtilForGameWin() {
  8328. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8329. switch (xGame.common.gameMode) {
  8330. case GameMode.classic:
  8331. console.log('zh:DiyGameDataUtilForGameWin 111');
  8332. case GameMode.bigMove:
  8333. console.log('zh:DiyGameDataUtilForGameWin 222');
  8334. this.restartGame();
  8335. break;
  8336. case GameMode.placeBall:
  8337. console.log('zh:DiyGameDataUtilForGameWin 333');
  8338. var level = xGame.common.placeBallCurLevel;
  8339. console.log('zh:练习模式 联系了多少LEV=' + level);
  8340. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8341. if (level > db_over_lev) {
  8342. DataMgr.setChallengeMode_overLev(level);
  8343. }
  8344. break;
  8345. default:
  8346. console.log('zh:DiyGameDataUtilForGameWin 444');
  8347. break;
  8348. }
  8349. }
  8350. showChallengeLevel() {
  8351. if (DataMgr.getChallengeTimes() != 0)
  8352. return;
  8353. let skill = DataMgr.getSkillAccTimes();
  8354. let put = DataMgr.getPlaceBallLevelList().length;
  8355. if (skill >= 3 || put >= 5) {
  8356. xGame.uiMgr.Show(UIInvitation);
  8357. this.hide();
  8358. }
  8359. }
  8360. addAward(callback) {
  8361. if (!this.success) {
  8362. callback && callback();
  8363. return;
  8364. }
  8365. switch (xGame.common.gameMode) {
  8366. case GameMode.classic:
  8367. this.awardCoinNum = xGame.common.passAwardCoin;
  8368. this.awardDiamondNum = 0;
  8369. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8370. break;
  8371. case GameMode.bigMove:
  8372. this.awardCoinNum = xGame.common.passAwardCoin;
  8373. this.awardDiamondNum = 0;
  8374. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8375. callback && callback();
  8376. break;
  8377. case GameMode.placeBall:
  8378. let level = xGame.common.placeBallCurLevel;
  8379. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8380. if (xGame.common.placeBallStarNum != 3) {
  8381. callback && callback();
  8382. return;
  8383. }
  8384. else {
  8385. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8386. if (getAward) {
  8387. callback && callback();
  8388. return;
  8389. }
  8390. }
  8391. let cfg = cfgTable.placeballData[level];
  8392. let data = cfgTable.placeballData[level].award;
  8393. this.awardCoinNum = data[0];
  8394. this.awardDiamondNum = data[1];
  8395. if (cfg.type == PlaceBallType.challenge) {
  8396. this.awardDiamondNum = 0;
  8397. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8398. }
  8399. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8400. let diamondAward;
  8401. if (this.awardDiamondNum > 0) {
  8402. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8403. xGame.common.getAward([diamondAward, coinAward], callback);
  8404. }
  8405. else {
  8406. xGame.common.getAward([coinAward], callback);
  8407. }
  8408. if (cfg.type == PlaceBallType.normal) {
  8409. DataMgr.setPlaceBallAward(level);
  8410. }
  8411. break;
  8412. default:
  8413. break;
  8414. }
  8415. }
  8416. playSecretaryAni_old() {
  8417. let parent = this.ui.secretary.displayObject;
  8418. parent.destroyChildren();
  8419. let xx = this.ui.secretary.width / 2;
  8420. let yy = this.ui.secretary.height;
  8421. let scale = xGame.common.getSecretaryScale();
  8422. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8423. if (this.success) {
  8424. let rand = Math.random() <= 0.5 ? 2 : 3;
  8425. xGame.common.secretary.play(data, rand, false, parent, () => {
  8426. xGame.common.secretary.play(data, 1, true, parent);
  8427. });
  8428. }
  8429. else {
  8430. xGame.common.secretary.play(data, 0, true, parent);
  8431. }
  8432. }
  8433. playSecretaryAni() {
  8434. let parent = this.ui.secretary.displayObject;
  8435. parent.destroyChildren();
  8436. let xx = this.ui.secretary.width / 2;
  8437. let yy = this.ui.secretary.height;
  8438. let scale = xGame.common.getSecretaryScale();
  8439. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8440. if (this.success) {
  8441. let rand = 0;
  8442. xGame.common.secretary.play(data, 0, true, parent);
  8443. }
  8444. else {
  8445. xGame.common.secretary.play(data, 0, true, parent);
  8446. }
  8447. }
  8448. restartGame() {
  8449. switch (xGame.common.gameMode) {
  8450. case GameMode.classic:
  8451. xGame.eventMgr.event(RESTART_GAME);
  8452. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8453. break;
  8454. case GameMode.bigMove:
  8455. this.hide();
  8456. xGame.eventMgr.event(RESTART_GAME);
  8457. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8458. break;
  8459. default:
  8460. break;
  8461. }
  8462. }
  8463. hide() {
  8464. super.hide();
  8465. xGame.common.stopGirlPop(this.ui.talkNode);
  8466. PlatMgr.showBanner(false);
  8467. }
  8468. returnHome() {
  8469. this.hide();
  8470. let showFailWords = !this.success;
  8471. xGame.uiMgr.Show(UIMain, showFailWords);
  8472. }
  8473. clickLeftBtn() {
  8474. switch (xGame.common.gameMode) {
  8475. case GameMode.classic:
  8476. case GameMode.bigMove:
  8477. this.returnHome();
  8478. break;
  8479. case GameMode.placeBall:
  8480. let level = xGame.common.placeBallCurLevel;
  8481. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8482. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8483. break;
  8484. default:
  8485. break;
  8486. }
  8487. }
  8488. powerStartPlaceBallLevel(level, btn) {
  8489. if (DataMgr.powerEnough()) {
  8490. btn.touchable = false;
  8491. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8492. btn.touchable = true;
  8493. DataMgr.setPower(-1);
  8494. xGame.eventMgr.event(POWER_TIME);
  8495. this.startPlaceBallLevel(level);
  8496. this.logEventForChallenge_level_start(level);
  8497. }));
  8498. }
  8499. else {
  8500. xGame.uiMgr.Show(UIPower, 0);
  8501. }
  8502. }
  8503. clickRightBtn() {
  8504. switch (xGame.common.gameMode) {
  8505. case GameMode.classic:
  8506. console.log('zh:clickRightBtn 111');
  8507. case GameMode.bigMove:
  8508. console.log('zh:clickRightBtn 222');
  8509. this.restartGame();
  8510. break;
  8511. case GameMode.placeBall:
  8512. console.log('zh:clickRightBtn 333');
  8513. let level = xGame.common.placeBallCurLevel;
  8514. let data = DataMgr.getPlaceBallLevel(level);
  8515. let curPss = data.play && !data.isCur;
  8516. if (curPss) {
  8517. console.log('zh:clickRightBtn 333-111');
  8518. console.log('zh:当前LV=' + level);
  8519. if (level == 60) {
  8520. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8521. Laya.timer.once(3000, this, () => {
  8522. this.returnHome();
  8523. });
  8524. }
  8525. else {
  8526. let lev = level + 1;
  8527. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8528. }
  8529. }
  8530. else {
  8531. console.log('zh:clickRightBtn 333-000');
  8532. Moyu.sendDataEvent("placeBallNextLevel");
  8533. console.log('zh:qjff_AD_for_uiGameEnd');
  8534. if (Laya.Browser.onAndroid) {
  8535. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8536. if (!boo) {
  8537. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8538. return;
  8539. }
  8540. }
  8541. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8542. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8543. }
  8544. else {
  8545. console.log('zh:AD 失败,直接发放奖励');
  8546. this.qjff_AD_for_uiGameEnd(level);
  8547. }
  8548. }
  8549. break;
  8550. default:
  8551. console.log('zh:clickRightBtn 444');
  8552. break;
  8553. }
  8554. }
  8555. logEventForChallenge_level_start(level) {
  8556. let keyStr = 'sjmd_challenge_level_start';
  8557. let jsonStr = {
  8558. "count": 0,
  8559. "gold_balance ": DataMgr.getCoin(),
  8560. "level": level,
  8561. "diamond_balance ": DataMgr.getDiamond()
  8562. };
  8563. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8564. const d = LocalStorageManager.getItem(keyStr);
  8565. if (level > d.level) {
  8566. jsonStr.count = d.count + 1;
  8567. LocalStorageManager.setItem(keyStr, jsonStr);
  8568. }
  8569. else {
  8570. }
  8571. }
  8572. else {
  8573. LocalStorageManager.setItem(keyStr, jsonStr);
  8574. }
  8575. const reqStr = JSON.stringify(jsonStr);
  8576. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8577. }
  8578. qjff_AD_for_uiGameEnd(level) {
  8579. DataMgr.setPlaceBallLevel(level, 1);
  8580. this.startPlaceBallLevel(level + 1);
  8581. }
  8582. startPlaceBallLevel(level) {
  8583. xGame.common.gameMode = GameMode.placeBall;
  8584. xGame.common.placeBallCurLevel = level;
  8585. xGame.uiMgr.Show(UIGame);
  8586. this.hide();
  8587. }
  8588. logEventForChallenge_level_complete(level) {
  8589. let keyStr = 'sjmd_challenge_level_complete';
  8590. let jsonStr = {
  8591. "count": 1,
  8592. "gold_balance ": DataMgr.getCoin(),
  8593. "level": level,
  8594. "diamond_balance ": DataMgr.getDiamond()
  8595. };
  8596. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8597. const d = LocalStorageManager.getItem(keyStr);
  8598. jsonStr.count = d.count + 1;
  8599. LocalStorageManager.setItem(keyStr, jsonStr);
  8600. }
  8601. else {
  8602. LocalStorageManager.setItem(keyStr, jsonStr);
  8603. }
  8604. const reqStr = JSON.stringify(jsonStr);
  8605. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8606. }
  8607. logEventForChallenge_level_N(level) {
  8608. console.log('zh:logEventForChallenge_level_N ' + level);
  8609. let keyStr = 'sjmd_challenge_level_N';
  8610. if (LocalStorageManager.hasKey(keyStr)) {
  8611. let lev = LocalStorageManager.getItem(keyStr);
  8612. if (level > lev) {
  8613. LocalStorageManager.setItem(keyStr, level);
  8614. }
  8615. if ((level) % 5 == 0) {
  8616. console.log('zh:每5关上报1次');
  8617. let sjmc = 'challenge_level_' + level;
  8618. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8619. let sjmcForFirebase = 'challenge_level_' + level;
  8620. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8621. }
  8622. else {
  8623. console.log('zh:5 no 上报');
  8624. }
  8625. }
  8626. else {
  8627. LocalStorageManager.setItem(keyStr, level);
  8628. }
  8629. }
  8630. }
  8631. UIGameEnd.uiName = "UIGameEnd";
  8632. class ui_UIVideoShare extends fgui.GComponent {
  8633. static createInstance() {
  8634. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8635. }
  8636. onConstruct() {
  8637. this.n10 = (this.getChild("n10"));
  8638. this.myNode = (this.getChild("myNode"));
  8639. this.t0 = this.getTransition("t0");
  8640. }
  8641. }
  8642. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8643. class UIVideoShare extends UIBase {
  8644. constructor() {
  8645. super();
  8646. this.success = false;
  8647. this.awardNum = 0;
  8648. this.isShared = true;
  8649. }
  8650. onConstructor() {
  8651. this.ui = ui_UIVideoShare.createInstance();
  8652. this.contentPane = this.ui;
  8653. this.isEject = false;
  8654. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8655. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8656. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8657. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8658. }
  8659. show(success) {
  8660. super.show();
  8661. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8662. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8663. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8664. this.success = success;
  8665. let time = xGame.common.randomNum(600, 1500);
  8666. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8667. if (success)
  8668. xGame.soundMgr.playSound("applause");
  8669. this.ui.t0.play();
  8670. this.checkShareState();
  8671. let times = DataMgr.getDailyVideoShareTimes();
  8672. this.awardNum = times == 0 ? 2000 : 200;
  8673. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8674. }
  8675. checkShareState() {
  8676. if (PlatMgr.forceShare == 0) {
  8677. this.ui.myNode.closeBtn.visible = true;
  8678. this.ui.myNode.tipsNode.visible = false;
  8679. this.ui.myNode.closeBtn.x = 90;
  8680. this.ui.myNode.shareBtn.x = 342;
  8681. }
  8682. else if (PlatMgr.forceShare == 1) {
  8683. this.ui.myNode.closeBtn.visible = false;
  8684. this.ui.myNode.tipsNode.visible = true;
  8685. this.ui.myNode.shareBtn.x = 218;
  8686. this.isShared = true;
  8687. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8688. }
  8689. }
  8690. checkForceShare() {
  8691. this.isShared = !this.isShared;
  8692. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8693. }
  8694. videoShare() {
  8695. if (PlatMgr.forceShare == 1) {
  8696. if (this.isShared) {
  8697. this.shareGame();
  8698. }
  8699. else {
  8700. this.hideSelf();
  8701. }
  8702. }
  8703. else {
  8704. this.shareGame();
  8705. }
  8706. }
  8707. shareGame() {
  8708. Moyu.sendDataEvent("VideoShare");
  8709. if (Moyu.canShare() > 100) {
  8710. Moyu.shareGame((success) => {
  8711. if (success) {
  8712. DataMgr.setDailyVideoShareTimes(1);
  8713. DataMgr.setCoin(this.awardNum);
  8714. }
  8715. this.hideSelf();
  8716. }, this);
  8717. }
  8718. else {
  8719. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8720. this.hideSelf();
  8721. }
  8722. }
  8723. hideSelf() {
  8724. this.hide();
  8725. xGame.uiMgr.Show(UIGameEnd, this.success);
  8726. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8727. xGame.common.screenImg.destroy();
  8728. xGame.common.screenImg = null;
  8729. }
  8730. }
  8731. }
  8732. UIVideoShare.uiName = "UIVideoShare";
  8733. class ui_UITips extends fgui.GComponent {
  8734. static createInstance() {
  8735. return (fgui.UIPackage.createObject("game", "UITips"));
  8736. }
  8737. onConstruct() {
  8738. this.n0 = (this.getChild("n0"));
  8739. this.myNode = (this.getChild("myNode"));
  8740. this.t0 = this.getTransition("t0");
  8741. }
  8742. }
  8743. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8744. class UITips extends UIBase {
  8745. constructor() {
  8746. super();
  8747. this.type = 0;
  8748. }
  8749. onConstructor() {
  8750. this.ui = ui_UITips.createInstance();
  8751. this.contentPane = this.ui;
  8752. this.isEject = false;
  8753. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8754. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8755. }
  8756. show(tipsTxt, womanTxt, type) {
  8757. super.show();
  8758. this.ui.t0.play();
  8759. this.ui.myNode.tipsTxt.text = tipsTxt;
  8760. this.ui.myNode.womanTxt.text = womanTxt;
  8761. PlatMgr.showInsert(true);
  8762. this.ui.myNode.c1.selectedIndex = type;
  8763. this.type = type;
  8764. switch (this.type) {
  8765. case TipsType.exitGame:
  8766. xGame.common.gameMgr.gamePause = true;
  8767. break;
  8768. case TipsType.foul:
  8769. Laya.timer.once(200, this, () => {
  8770. xGame.common.gameMgr.gamePause = true;
  8771. });
  8772. break;
  8773. default:
  8774. break;
  8775. }
  8776. }
  8777. clickLeftBtn() {
  8778. this.hide();
  8779. xGame.common.gameMgr.gamePause = false;
  8780. switch (this.type) {
  8781. case TipsType.exitGame:
  8782. break;
  8783. case TipsType.foul:
  8784. break;
  8785. default:
  8786. break;
  8787. }
  8788. }
  8789. clickRightBtn() {
  8790. this.hide();
  8791. switch (this.type) {
  8792. case TipsType.exitGame:
  8793. xGame.eventMgr.event(RESET_GAME);
  8794. xGame.uiMgr.Show(UIMain);
  8795. Moyu.recordEnd(this, null);
  8796. xGame.common.longHelpLine = false;
  8797. break;
  8798. case TipsType.foul:
  8799. xGame.common.gameMgr.gamePause = false;
  8800. Laya.timer.clearAll(this);
  8801. break;
  8802. default:
  8803. break;
  8804. }
  8805. }
  8806. }
  8807. UITips.uiName = "UITips";
  8808. class GameMgr {
  8809. constructor() {
  8810. this.selfCamp = "";
  8811. this.selfFoulNum = 0;
  8812. this.selfBallArr = [];
  8813. this.selfTimer = 0;
  8814. this.selfScore = 0;
  8815. this.aiCamp = "";
  8816. this.aiFoulNum = 0;
  8817. this.aiBallArr = [];
  8818. this.aiTimer = 0;
  8819. this.aiScore = 0;
  8820. this.aiSkillLevelNum = 1;
  8821. this.targertScore = 0;
  8822. this.setTime = 30;
  8823. this.selfTurnRate = 0.5;
  8824. this.accTime = 0;
  8825. this.curFoul = "";
  8826. this.maxFoulTimes = 3;
  8827. this.isFirstInGame = true;
  8828. this.firstColliObj = null;
  8829. this.inHoleBalls = [];
  8830. this.blackNum = 8;
  8831. this.success = false;
  8832. this.holePosList = [];
  8833. this.posObj = {};
  8834. this._selfTurn = false;
  8835. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8836. this.ensureBallType = false;
  8837. this.isOpenBall = true;
  8838. this.finishOneShoot = true;
  8839. this.isEnd = false;
  8840. this.isChangeTurn = false;
  8841. this.isInterrupt = false;
  8842. this.aiPlayedBreakArmy = false;
  8843. this.isTouchedBall = false;
  8844. this.finishBalls = 0;
  8845. this.needBalls = 0;
  8846. this.allBallNum = 0;
  8847. this.placeBallPosData = {};
  8848. this.curHP = 0;
  8849. this.showLongView = false;
  8850. this.firstShoot = true;
  8851. this._gamePause = false;
  8852. this.trunCount = 0;
  8853. this.isBlackInHole = false;
  8854. this.isEnter = true;
  8855. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8856. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8857. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8858. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8859. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8860. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8861. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8862. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8863. }
  8864. get gamePause() {
  8865. return this._gamePause;
  8866. }
  8867. set gamePause(v) {
  8868. if (v) {
  8869. Laya.physicsTimer.pause();
  8870. }
  8871. else {
  8872. Laya.physicsTimer.resume();
  8873. }
  8874. this._gamePause = v;
  8875. }
  8876. get selfTurn() {
  8877. return this._selfTurn;
  8878. }
  8879. set selfTurn(val) {
  8880. this.trunCount++;
  8881. this._selfTurn = val;
  8882. if (val) {
  8883. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8884. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8885. }
  8886. else {
  8887. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8888. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8889. if (this.trunCount > 1)
  8890. PlatMgr.openBox();
  8891. }
  8892. }
  8893. resetGame() {
  8894. this.inHoleBalls = [];
  8895. this.isFirstInGame = true;
  8896. this.firstColliObj = null;
  8897. this.aiCamp = "";
  8898. this.selfCamp = "";
  8899. this.aiFoulNum = 0;
  8900. this.selfFoulNum = 0;
  8901. this.selfBallArr = [];
  8902. this.aiBallArr = [];
  8903. this.gamePause = false;
  8904. this.ensureBallType = false;
  8905. this.isInterrupt = false;
  8906. this.updateLeftBall();
  8907. this.clearTime();
  8908. this.aiPlayedBreakArmy = false;
  8909. this.isBlackInHole = false;
  8910. this.placeBallPosData = {};
  8911. if (xGame.common.d3World.knifeRoot) {
  8912. xGame.common.d3World.knifeRoot.destroyChildren();
  8913. }
  8914. }
  8915. gameReady() {
  8916. this.trunCount = 0;
  8917. this.firstColliObj = null;
  8918. this.isFirstInGame = true;
  8919. this.selfTurn = Math.random() <= this.selfTurnRate;
  8920. let challengeNum = DataMgr.getChallengeTimes();
  8921. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8922. this.selfTurn = true;
  8923. }
  8924. if (xGame.common.gameMode == GameMode.placeBall)
  8925. this.selfTurn = true;
  8926. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8927. this.selfTurn = true;
  8928. }
  8929. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8930. this.checkGuide();
  8931. if (xGame.common.uiRodMethod)
  8932. xGame.common.uiRodMethod.resetRod();
  8933. xGame.common.d2World.getHelpLine();
  8934. this.isOpenBall = true;
  8935. this.isTouchedBall = false;
  8936. xGame.common.aiPlayer.stopRun();
  8937. this.setTime = 30;
  8938. let ui = xGame.common.gameUI.ui;
  8939. switch (xGame.common.gameMode) {
  8940. case GameMode.classic:
  8941. xGame.common.aiPlayer.init();
  8942. this.blackNum = 8;
  8943. this.placeRootBall();
  8944. this.peoplePlay(9, 10);
  8945. ui.wordsBtn.visible = true;
  8946. ui.aiWordsBtn.visible = true;
  8947. xGame.common.talkMgr.changeAIState(true);
  8948. DataMgr.gameData.gameCount++;
  8949. DataMgr.saveGameData();
  8950. break;
  8951. case GameMode.bigMove:
  8952. this.blackNum = -1;
  8953. this.selfScore = 0;
  8954. this.aiScore = 0;
  8955. xGame.common.aiPlayer.init();
  8956. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8957. this.updateSelfScore();
  8958. this.updateAIScore();
  8959. this.updateTargetSroce();
  8960. this.placeRootBall();
  8961. this.peoplePlay(9, 10);
  8962. ui.wordsBtn.visible = true;
  8963. ui.aiWordsBtn.visible = true;
  8964. xGame.common.talkMgr.changeAIState(true);
  8965. if (DataMgr.getSkillGuide() < 1)
  8966. DataMgr.gameData.gameCount = 0;
  8967. else {
  8968. DataMgr.gameData.gameCount++;
  8969. DataMgr.saveGameData();
  8970. PlatMgr.openTry();
  8971. }
  8972. if (xGame.common.d3World.knifeRoot) {
  8973. xGame.common.d3World.knifeRoot.destroyChildren();
  8974. }
  8975. break;
  8976. case GameMode.placeBall:
  8977. this.blackNum = -1;
  8978. this.selfTurn = true;
  8979. this.setTime = 10000;
  8980. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8981. this.curHP = this.placeBallData.hp;
  8982. if (this.placeBallData.ball == -1)
  8983. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8984. else
  8985. this.needBalls = this.placeBallData.ball;
  8986. console.log("需要的进球数目", this.needBalls);
  8987. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8988. this.finishBalls = 0;
  8989. this.placeBallPosData = {};
  8990. this.updatePlaceBallPos();
  8991. this.updatePlaceBallState();
  8992. this.finishOneShoot = true;
  8993. xGame.common.gameUI.ui.moveNode.visible = false;
  8994. this.isOpenBall = false;
  8995. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8996. ui.wordsBtn.visible = false;
  8997. ui.aiWordsBtn.visible = false;
  8998. xGame.common.talkMgr.changeAIState(false);
  8999. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9000. PlatMgr.openBox();
  9001. });
  9002. break;
  9003. default:
  9004. break;
  9005. }
  9006. this.showLongView = false;
  9007. xGame.common.wordsMgr.comboTimes = 1;
  9008. let guide = DataMgr.getSkillGuide();
  9009. if (guide)
  9010. xGame.eventMgr.event(WAIT_SHOOT);
  9011. xGame.common.upSkillLevel = false;
  9012. xGame.common.gameStartTime = new Date().getTime();
  9013. this.firstShoot = true;
  9014. }
  9015. checkGuide() {
  9016. let guide = DataMgr.getSkillGuide();
  9017. let gameUI = xGame.common.gameUI.ui;
  9018. gameUI.guide1.visible = false;
  9019. gameUI.guide2.visible = false;
  9020. gameUI.guide3.visible = false;
  9021. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9022. this.selfTurn = true;
  9023. }
  9024. else {
  9025. return;
  9026. }
  9027. let oneBall = this.getOneBall();
  9028. gameUI.guide1.visible = true;
  9029. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9030. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9031. }
  9032. getOneBall() {
  9033. let arr = xGame.common.d2World.ballArr;
  9034. for (let index = 0; index < arr.length; index++) {
  9035. if (arr[index].number == 0)
  9036. continue;
  9037. return arr[index];
  9038. }
  9039. }
  9040. updateSelfScore() {
  9041. let ui = xGame.common.gameUI.ui.topNode;
  9042. ui.selfScoreTxt.text = this.selfScore + "";
  9043. }
  9044. updateAIScore() {
  9045. let ui = xGame.common.gameUI.ui.topNode;
  9046. ui.aiScoreTxt.text = this.aiScore + "";
  9047. }
  9048. updateTargetSroce() {
  9049. let ui = xGame.common.gameUI.ui.topNode;
  9050. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9051. }
  9052. updateLeftBall() {
  9053. let topUI = xGame.common.gameUI.ui.topNode;
  9054. topUI.selfBallList.numItems = this.selfBallArr.length;
  9055. topUI.aiBallList.numItems = this.aiBallArr.length;
  9056. }
  9057. ballShoot() {
  9058. this.clearTime();
  9059. this.finishOneShoot = false;
  9060. xGame.common.gameUI.ui.moveNode.visible = false;
  9061. if (xGame.common.gameUI.ui.guideNode.visible) {
  9062. xGame.common.gameUI.ui.guideNode.visible = false;
  9063. }
  9064. if (this.firstShoot) {
  9065. this.firstShoot = false;
  9066. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9067. }
  9068. }
  9069. ensureCamp(number) {
  9070. this.ensureBallType = true;
  9071. this.isOpenBall = false;
  9072. if (xGame.common.gameMode != GameMode.classic)
  9073. return;
  9074. let full = [1, 2, 3, 4, 5, 6, 7];
  9075. let flower = [9, 10, 11, 12, 13, 14, 15];
  9076. let sayWords = "";
  9077. if (this.selfTurn) {
  9078. if (number <= 7) {
  9079. this.selfCamp = ballCamp.full;
  9080. this.selfBallArr = full;
  9081. this.aiCamp = ballCamp.flower;
  9082. this.aiBallArr = flower;
  9083. sayWords = cfgTable.wordsData[3].msg;
  9084. }
  9085. else {
  9086. this.selfCamp = ballCamp.flower;
  9087. this.selfBallArr = flower;
  9088. this.aiCamp = ballCamp.full;
  9089. this.aiBallArr = full;
  9090. sayWords = cfgTable.wordsData[4].msg;
  9091. }
  9092. }
  9093. else {
  9094. if (number <= 7) {
  9095. this.selfCamp = ballCamp.flower;
  9096. this.selfBallArr = flower;
  9097. this.aiCamp = ballCamp.full;
  9098. this.aiBallArr = full;
  9099. sayWords = cfgTable.wordsData[2].msg;
  9100. }
  9101. else {
  9102. this.selfCamp = ballCamp.full;
  9103. this.selfBallArr = full;
  9104. this.aiCamp = ballCamp.flower;
  9105. this.aiBallArr = flower;
  9106. sayWords = cfgTable.wordsData[1].msg;
  9107. }
  9108. }
  9109. this.updateLeftBall();
  9110. xGame.uiMgr.Show(UIMsg, sayWords);
  9111. }
  9112. updatePlaceBallState() {
  9113. let ui = xGame.common.gameUI.ui;
  9114. switch (this.placeBallData.type) {
  9115. case PlaceBallType.normal:
  9116. let normal = ui.placeNormalNode;
  9117. normal.hpTxt.text = this.curHP + "";
  9118. this.updatePlaceBallStar(normal);
  9119. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9120. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9121. break;
  9122. case PlaceBallType.challenge:
  9123. let challenge = ui.placeChallengeNode;
  9124. challenge.hpTxt.text = "Shots:" + this.curHP;
  9125. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9126. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9127. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9128. break;
  9129. default:
  9130. break;
  9131. }
  9132. }
  9133. playSubHpAni() {
  9134. let ui = xGame.common.gameUI.ui;
  9135. switch (this.placeBallData.type) {
  9136. case PlaceBallType.normal:
  9137. let normal = ui.placeNormalNode;
  9138. normal.hpTxt.visible = false;
  9139. normal.starAni.c1.selectedIndex = 1;
  9140. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9141. normal.hpTxt.visible = true;
  9142. normal.starAni.c1.selectedIndex = 0;
  9143. }));
  9144. break;
  9145. default:
  9146. break;
  9147. }
  9148. }
  9149. getEndStarNum() {
  9150. let num;
  9151. let level = xGame.common.placeBallCurLevel;
  9152. if (this.curHP == this.placeBallData.hp) {
  9153. num = 3;
  9154. }
  9155. else if (this.curHP <= 1) {
  9156. num = 1;
  9157. }
  9158. else {
  9159. num = 2;
  9160. }
  9161. if (!this.success) {
  9162. num = 0;
  9163. }
  9164. else {
  9165. DataMgr.setPlaceBallLevel(level, num);
  9166. }
  9167. let myType = cfgTable.placeballData[level].type;
  9168. if (this.success && myType == 1) {
  9169. num = 3;
  9170. }
  9171. xGame.common.placeBallStarNum = num;
  9172. }
  9173. updatePlaceBallStar(node) {
  9174. let star = 0;
  9175. if (this.curHP == this.placeBallData.hp) {
  9176. star = 3;
  9177. }
  9178. else if (this.curHP >= 2) {
  9179. star = 2;
  9180. }
  9181. else if (this.curHP == 1) {
  9182. star = 1;
  9183. }
  9184. else {
  9185. star = 0;
  9186. }
  9187. let temp;
  9188. for (let index = 1; index <= 3; index++) {
  9189. temp = node["star" + index];
  9190. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9191. }
  9192. node.myProgress.value = (star / 3) * 100;
  9193. }
  9194. openRegretView(isFoul, GoalNum, challenge = false) {
  9195. let regretType = -1;
  9196. if (isFoul) {
  9197. regretType = 1;
  9198. }
  9199. else {
  9200. if (GoalNum <= 0) {
  9201. regretType = 0;
  9202. }
  9203. }
  9204. if (challenge) {
  9205. regretType = 1;
  9206. }
  9207. if (regretType != -1) {
  9208. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9209. if (success) {
  9210. this.curHP++;
  9211. this.updatePlaceBallState();
  9212. this.setPlaceBallAllPos();
  9213. xGame.common.gameUI.ui.moveNode.visible = false;
  9214. }
  9215. else {
  9216. if (this.curHP <= 0) {
  9217. this.success = false;
  9218. this.gameEnd();
  9219. }
  9220. this.playSubHpAni();
  9221. }
  9222. this.updatePlaceBallState();
  9223. this.updatePlaceBallPos();
  9224. });
  9225. }
  9226. }
  9227. setPlaceBallAllPos() {
  9228. let allBall = xGame.common.d2World.ballArr;
  9229. let cfgArr = this.placeBallPosData;
  9230. let temp;
  9231. let obj;
  9232. for (let index = 0; index < allBall.length; index++) {
  9233. temp = allBall[index];
  9234. if (temp.destroyed)
  9235. continue;
  9236. obj = cfgArr[temp.myUNID];
  9237. if (obj && obj.src && !obj.src.destroyed) {
  9238. temp.gameObj.x = obj.posX;
  9239. temp.gameObj.y = obj.posY;
  9240. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9241. }
  9242. }
  9243. xGame.common.d2World.getHelpLine();
  9244. }
  9245. updatePlaceBallPos() {
  9246. let arr = xGame.common.d2World.ballArr;
  9247. let temp;
  9248. for (let index = 0; index < arr.length; index++) {
  9249. temp = arr[index];
  9250. if (!this.placeBallPosData[temp.myUNID]) {
  9251. this.placeBallPosData[temp.myUNID] = {
  9252. src: temp,
  9253. posX: temp.gameObj.x,
  9254. posY: temp.gameObj.y
  9255. };
  9256. }
  9257. else {
  9258. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9259. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9260. }
  9261. }
  9262. let check;
  9263. for (const key in this.placeBallPosData) {
  9264. check = this.placeBallPosData[key];
  9265. if (check.src.destroyed) {
  9266. delete this.placeBallPosData[key];
  9267. }
  9268. }
  9269. }
  9270. gameRun(type) {
  9271. if (this.gamePause)
  9272. return;
  9273. this.curFoul = this.getFoulType();
  9274. if (type) {
  9275. xGame.common.d2World.d2Gan.shoot();
  9276. xGame.common.gameUI.forceCancel();
  9277. this.curFoul = type;
  9278. }
  9279. this.isEnd = false;
  9280. this.isChangeTurn = true;
  9281. if (xGame.common.gameMode == GameMode.classic) {
  9282. this.judgeClassic(this.curFoul);
  9283. this.checkClassicWords(() => {
  9284. xGame.common.destroyClassicEmotion();
  9285. if (this.isEnd) {
  9286. if (this.isBlackInHole) {
  9287. xGame.common.gameUI.ui.blackAni.visible = true;
  9288. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9289. xGame.common.gameUI.ui.blackAni.visible = false;
  9290. this.gameEnd();
  9291. }));
  9292. }
  9293. else {
  9294. this.gameEnd();
  9295. }
  9296. }
  9297. else {
  9298. this.waitShoot();
  9299. xGame.eventMgr.event(WAIT_SHOOT);
  9300. }
  9301. });
  9302. }
  9303. else if (xGame.common.gameMode == GameMode.bigMove) {
  9304. xGame.common.aiPlayer.stopRun();
  9305. let scoreArr = this.getScore(this.curFoul);
  9306. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9307. this.isEnd = true;
  9308. }
  9309. this.checkBigSkillWords(() => {
  9310. if (this.isEnd) {
  9311. this.gameEnd();
  9312. }
  9313. else {
  9314. this.waitShoot();
  9315. xGame.eventMgr.event(WAIT_SHOOT);
  9316. }
  9317. });
  9318. }
  9319. else if (xGame.common.gameMode == GameMode.placeBall) {
  9320. xGame.common.destroyAwardSpine();
  9321. let isFoul = this.curFoul == FoulType.rootHole;
  9322. let GoalNum = this.inHoleBalls.length;
  9323. if (this.inHoleBalls.indexOf(0) > -1)
  9324. GoalNum -= 1;
  9325. if (isFoul) {
  9326. this.placeRootBall();
  9327. }
  9328. console.log("neeballs", this.needBalls);
  9329. console.log("当前完成的goalNum", GoalNum);
  9330. this.finishBalls += GoalNum;
  9331. console.log("当前完成的finishballs", this.finishBalls);
  9332. let need = this.needBalls;
  9333. if (this.placeBallData.type == PlaceBallType.challenge) {
  9334. need += 100;
  9335. }
  9336. if (this.finishBalls >= need) {
  9337. this.success = true;
  9338. this.gameEnd();
  9339. }
  9340. else {
  9341. switch (this.placeBallData.type) {
  9342. case PlaceBallType.normal:
  9343. if (!isFoul && GoalNum > 0) {
  9344. this.updatePlaceBallPos();
  9345. this.updatePlaceBallState();
  9346. }
  9347. else {
  9348. this.curHP--;
  9349. this.openRegretView(isFoul, GoalNum);
  9350. }
  9351. this.waitShoot();
  9352. xGame.eventMgr.event(WAIT_SHOOT);
  9353. break;
  9354. case PlaceBallType.challenge:
  9355. this.curHP--;
  9356. this.updatePlaceBallState();
  9357. if (isFoul) {
  9358. this.openRegretView(isFoul, GoalNum, true);
  9359. }
  9360. else {
  9361. this.updatePlaceBallPos();
  9362. if (this.curHP <= 0) {
  9363. this.success = true;
  9364. this.gameEnd();
  9365. }
  9366. }
  9367. this.waitShoot();
  9368. xGame.eventMgr.event(WAIT_SHOOT);
  9369. break;
  9370. default:
  9371. break;
  9372. }
  9373. }
  9374. }
  9375. }
  9376. checkClassicWords(callback) {
  9377. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9378. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9379. let type = this.getClassicWordsType();
  9380. if (condition && type != -1) {
  9381. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9382. xGame.soundMgr.playSound(str);
  9383. xGame.common.wordsMgr.playClassicWords(type, callback);
  9384. }
  9385. else {
  9386. Laya.timer.once(300, this, () => {
  9387. callback && callback();
  9388. });
  9389. }
  9390. }
  9391. getClassicWordsType() {
  9392. let d2world = xGame.common.d2World;
  9393. let type = -1;
  9394. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9395. type = ClassicWordsType.perfectShow;
  9396. return type;
  9397. }
  9398. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9399. type = ClassicWordsType.directShoot;
  9400. return type;
  9401. }
  9402. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9403. type = ClassicWordsType.anotherShoot;
  9404. return type;
  9405. }
  9406. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9407. type = ClassicWordsType.bigPower;
  9408. return type;
  9409. }
  9410. let minSpeed = 1;
  9411. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9412. type = ClassicWordsType.hardShoot;
  9413. return type;
  9414. }
  9415. if (this.inHoleBalls.length > 0) {
  9416. type = ClassicWordsType.directShoot;
  9417. return type;
  9418. }
  9419. return type;
  9420. }
  9421. checkBigSkillWords(callback) {
  9422. if (this.curFoul == FoulType.timeOut) {
  9423. callback && callback();
  9424. }
  9425. else {
  9426. let playSkill = false;
  9427. if (this.selfTurn) {
  9428. playSkill = true;
  9429. }
  9430. else {
  9431. if (!this.aiPlayedBreakArmy) {
  9432. this.aiPlayedBreakArmy = true;
  9433. playSkill = true;
  9434. }
  9435. if (this.aiCurSkill != SkillType.breakArmy) {
  9436. playSkill = true;
  9437. }
  9438. }
  9439. if (xGame.common.skillMgr.playedLastSkill) {
  9440. xGame.common.skillMgr.playedLastSkill = false;
  9441. playSkill = false;
  9442. }
  9443. if (playSkill) {
  9444. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9445. let selfExtra = 0;
  9446. let aiExtra = 0;
  9447. if (this.selfTurn)
  9448. selfExtra += extraScore;
  9449. else
  9450. aiExtra += extraScore;
  9451. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9452. this.isEnd = true;
  9453. }
  9454. this.playBigSkillTimes(callback);
  9455. });
  9456. }
  9457. else {
  9458. this.playBigSkillTimes(callback);
  9459. }
  9460. }
  9461. }
  9462. playBigSkillTimes(callback) {
  9463. let length = this.inHoleBalls.length;
  9464. if (this.inHoleBalls.indexOf(0) > -1) {
  9465. length = this.inHoleBalls.length - 1;
  9466. }
  9467. if (length <= 0) {
  9468. callback && callback();
  9469. return;
  9470. }
  9471. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9472. callback && callback();
  9473. });
  9474. }
  9475. playSkillTips() {
  9476. let levelNum = 0;
  9477. let curType;
  9478. if (this.selfTurn) {
  9479. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9480. curType = this.selfCurSkill;
  9481. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9482. levelNum += 5;
  9483. }
  9484. }
  9485. else {
  9486. levelNum = this.aiSkillLevelNum;
  9487. curType = this.aiCurSkill;
  9488. }
  9489. let str = ``;
  9490. switch (curType) {
  9491. case SkillType.highSpace:
  9492. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9493. break;
  9494. case SkillType.breakArmy:
  9495. str = `You pocketed ${levelNum} extra balls`;
  9496. break;
  9497. case SkillType.ice:
  9498. str = `${levelNum * 2} extra balls were frozen`;
  9499. break;
  9500. case SkillType.fireworks:
  9501. str = `${levelNum} extra balls exploded `;
  9502. break;
  9503. case SkillType.GuanYu:
  9504. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9505. break;
  9506. default:
  9507. break;
  9508. }
  9509. xGame.uiMgr.Show(UIMsg, str);
  9510. }
  9511. getFoulType() {
  9512. let foulType = "";
  9513. if (this.firstColliObj == null) {
  9514. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9515. return FoulType.rootHole;
  9516. }
  9517. return FoulType.notTouch;
  9518. }
  9519. else {
  9520. if (this.selfTurn) {
  9521. if (this.selfBallArr.length > 0) {
  9522. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9523. foulType = FoulType.wrongTouch;
  9524. }
  9525. }
  9526. else {
  9527. if (this.ensureBallType) {
  9528. }
  9529. else {
  9530. if (this.firstColliObj == this.blackNum) {
  9531. foulType = FoulType.wrongTouch;
  9532. }
  9533. }
  9534. }
  9535. }
  9536. else {
  9537. if (this.aiBallArr.length > 0) {
  9538. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9539. foulType = FoulType.wrongTouch;
  9540. }
  9541. }
  9542. else {
  9543. if (this.ensureBallType) {
  9544. }
  9545. else {
  9546. if (this.firstColliObj == this.blackNum) {
  9547. foulType = FoulType.wrongTouch;
  9548. }
  9549. }
  9550. }
  9551. }
  9552. if (this.inHoleBalls.length <= 0) {
  9553. return foulType;
  9554. }
  9555. let temp;
  9556. if (this.inHoleBalls.indexOf(0) > -1) {
  9557. foulType = FoulType.rootHole;
  9558. }
  9559. else {
  9560. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9561. temp = this.inHoleBalls[index];
  9562. if (this.selfTurn) {
  9563. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9564. foulType = FoulType.wrongHole;
  9565. break;
  9566. }
  9567. }
  9568. else {
  9569. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9570. foulType = FoulType.wrongHole;
  9571. break;
  9572. }
  9573. }
  9574. }
  9575. }
  9576. let foo;
  9577. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9578. temp = this.inHoleBalls[index];
  9579. foo = this.selfBallArr.indexOf(temp);
  9580. if (foo > -1) {
  9581. this.selfBallArr.splice(foo, 1);
  9582. }
  9583. foo = this.aiBallArr.indexOf(temp);
  9584. if (foo > -1) {
  9585. this.aiBallArr.splice(foo, 1);
  9586. }
  9587. }
  9588. this.updateLeftBall();
  9589. }
  9590. return foulType;
  9591. }
  9592. judgeGameEndByBlack(arr) {
  9593. if (this.selfTurn) {
  9594. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9595. this.selfFoulNum = this.maxFoulTimes;
  9596. return true;
  9597. }
  9598. }
  9599. else {
  9600. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9601. this.aiFoulNum = this.maxFoulTimes;
  9602. return true;
  9603. }
  9604. }
  9605. }
  9606. judgeClassic(type) {
  9607. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9608. xGame.common.aiPlayer.stopRun();
  9609. if (this.judgeNormalSuccess()) {
  9610. this.isEnd = true;
  9611. return;
  9612. }
  9613. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9614. if (this.selfTurn) {
  9615. if (isFoul) {
  9616. this.selfFoulNum++;
  9617. }
  9618. if (this.selfFoulNum >= this.maxFoulTimes) {
  9619. this.success = false;
  9620. this.isEnd = true;
  9621. return;
  9622. }
  9623. }
  9624. else {
  9625. if (isFoul)
  9626. this.aiFoulNum++;
  9627. if (this.aiFoulNum >= this.maxFoulTimes) {
  9628. this.success = true;
  9629. this.isEnd = true;
  9630. return;
  9631. }
  9632. }
  9633. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9634. this.isChangeTurn = false;
  9635. }
  9636. else {
  9637. this.isInterrupt = true;
  9638. }
  9639. }
  9640. waitShoot() {
  9641. if (xGame.common.gameMode == GameMode.classic) {
  9642. switch (this.curFoul) {
  9643. case FoulType.timeOut:
  9644. case FoulType.rootHole:
  9645. this.selfTurn = !this.selfTurn;
  9646. this.peoplePlay(5, 6, true);
  9647. break;
  9648. case FoulType.notTouch:
  9649. this.selfTurn = !this.selfTurn;
  9650. this.peoplePlay(7, 7);
  9651. break;
  9652. case FoulType.wrongHole:
  9653. this.selfTurn = !this.selfTurn;
  9654. this.peoplePlay(11, 11);
  9655. break;
  9656. default:
  9657. if (this.inHoleBalls.length > 0) {
  9658. this.peoplePlay(0, 0, false, false);
  9659. }
  9660. else {
  9661. this.selfTurn = !this.selfTurn;
  9662. this.peoplePlay(7, 7);
  9663. }
  9664. break;
  9665. }
  9666. }
  9667. else if (xGame.common.gameMode == GameMode.bigMove) {
  9668. if (this.curFoul == FoulType.timeOut) {
  9669. this.selfTurn = !this.selfTurn;
  9670. this.peoplePlay(14, 15);
  9671. this.placeRootBall();
  9672. }
  9673. else {
  9674. this.selfTurn = !this.selfTurn;
  9675. if (this.curFoul == FoulType.rootHole) {
  9676. this.peoplePlay(12, 13);
  9677. this.placeRootBall();
  9678. }
  9679. else {
  9680. this.peoplePlay(0, 0, false, false);
  9681. }
  9682. }
  9683. }
  9684. else if (xGame.common.gameMode == GameMode.placeBall) {
  9685. this.finishOneShoot = true;
  9686. }
  9687. this.gameResult();
  9688. }
  9689. gameResult() {
  9690. this.firstColliObj = null;
  9691. this.inHoleBalls = [];
  9692. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9693. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9694. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9695. if (xGame.common.uiRodMethod)
  9696. xGame.common.uiRodMethod.resetRod();
  9697. xGame.common.d2World.rootBall.showSelf();
  9698. this.clearIceSkill();
  9699. if (this.selfTurn) {
  9700. PlatMgr.gameInsert();
  9701. }
  9702. xGame.common.d3World.knifeRoot.destroyChildren();
  9703. if (this.selfTurn) {
  9704. xGame.common.gameUI.showHelpLineGuide();
  9705. xGame.common.gameUI.setTurnAlpha(true);
  9706. }
  9707. else {
  9708. xGame.common.gameUI.setTurnAlpha(false);
  9709. }
  9710. }
  9711. getScore(type) {
  9712. let selfAdd = 0;
  9713. let aiAdd = 0;
  9714. if (type == FoulType.timeOut) {
  9715. if (this.selfTurn)
  9716. aiAdd += 3;
  9717. else
  9718. selfAdd += 3;
  9719. }
  9720. else {
  9721. if (this.inHoleBalls.length > 0) {
  9722. if (this.selfTurn) {
  9723. if (type == FoulType.rootHole) {
  9724. aiAdd += 3;
  9725. if (this.inHoleBalls.length - 1 > 0) {
  9726. selfAdd += this.inHoleBalls.length - 1;
  9727. }
  9728. }
  9729. else {
  9730. selfAdd += this.inHoleBalls.length;
  9731. }
  9732. }
  9733. else {
  9734. if (type == FoulType.rootHole) {
  9735. selfAdd += 3;
  9736. if (this.inHoleBalls.length - 1 > 0) {
  9737. aiAdd += this.inHoleBalls.length - 1;
  9738. }
  9739. }
  9740. else {
  9741. aiAdd += this.inHoleBalls.length;
  9742. }
  9743. }
  9744. }
  9745. }
  9746. return [selfAdd, aiAdd];
  9747. }
  9748. judgeScoreEnd(selfAdd, aiAdd) {
  9749. this.selfScore += selfAdd;
  9750. this.aiScore += aiAdd;
  9751. this.updateAIScore();
  9752. this.updateSelfScore();
  9753. if (this.selfScore >= this.targertScore) {
  9754. this.success = true;
  9755. return true;
  9756. }
  9757. if (this.aiScore >= this.targertScore) {
  9758. this.success = false;
  9759. return true;
  9760. }
  9761. let ballArr = xGame.common.d2World.ballArr;
  9762. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9763. if (this.selfScore > this.aiScore) {
  9764. this.success = true;
  9765. return true;
  9766. }
  9767. else if (this.selfScore < this.aiScore) {
  9768. this.success = false;
  9769. return true;
  9770. }
  9771. else {
  9772. if (this.selfTurn) {
  9773. this.success = false;
  9774. }
  9775. else {
  9776. this.success = true;
  9777. }
  9778. return true;
  9779. }
  9780. }
  9781. }
  9782. clearIceSkill() {
  9783. let arr = xGame.common.d2World.ballArr;
  9784. let temp;
  9785. if (this.selfTurn) {
  9786. if (this.selfCurSkill == SkillType.ice) {
  9787. for (let index = 0; index < arr.length; index++) {
  9788. temp = arr[index];
  9789. if (temp.ballFunc == "ice") {
  9790. temp.setBallFunc("normal", "self");
  9791. }
  9792. }
  9793. }
  9794. }
  9795. else {
  9796. if (this.aiCurSkill == SkillType.ice) {
  9797. for (let index = 0; index < arr.length; index++) {
  9798. temp = arr[index];
  9799. if (temp.ballFunc == "ice") {
  9800. temp.setBallFunc("normal", "ai");
  9801. }
  9802. }
  9803. }
  9804. }
  9805. }
  9806. judgeNormalSuccess() {
  9807. if (this.selfTurn) {
  9808. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9809. this.success = true;
  9810. return true;
  9811. }
  9812. }
  9813. else {
  9814. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9815. this.success = false;
  9816. return true;
  9817. }
  9818. }
  9819. }
  9820. gameEnd() {
  9821. if (Moyu.isTT) {
  9822. xGame.common.screenImg = getScreenImg();
  9823. }
  9824. console.log("游戏结束", this.success);
  9825. xGame.common.aiPlayer.stopRun();
  9826. if (xGame.common.gameMode == GameMode.placeBall) {
  9827. this.getEndStarNum();
  9828. this.updatePlaceBallState();
  9829. }
  9830. this.isEnter = false;
  9831. Moyu.recordEnd(this, () => {
  9832. if (this.isEnter)
  9833. return;
  9834. this.isEnter = true;
  9835. console.log("进入录结束回调");
  9836. this.enterNext();
  9837. });
  9838. Laya.timer.once(1000, this, () => {
  9839. if (this.isEnter)
  9840. return;
  9841. this.isEnter = true;
  9842. this.enterNext();
  9843. });
  9844. xGame.common.longHelpLine = false;
  9845. }
  9846. enterNext() {
  9847. Laya.timer.clearAll(this);
  9848. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9849. xGame.uiMgr.Show(UIVideoShare, this.success);
  9850. }
  9851. else {
  9852. xGame.uiMgr.Show(UIGameEnd, this.success);
  9853. }
  9854. }
  9855. aiLeave() {
  9856. let ui = xGame.common.gameUI.ui;
  9857. ui.topNode.aiNameTxt.text = "offline";
  9858. }
  9859. aiGameEnd(suc) {
  9860. this.success = suc;
  9861. xGame.common.aiPlayer.stopRun();
  9862. if (this.success) {
  9863. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9864. Laya.timer.once(1000, this, () => {
  9865. this.clearTime();
  9866. this.gameEnd();
  9867. });
  9868. }
  9869. }
  9870. openTimer() {
  9871. let src = xGame.common.gameUI;
  9872. if (this.selfTurn) {
  9873. src.ui.topNode.selfProgress.visible = true;
  9874. src.ui.topNode.aiProgress.visible = false;
  9875. this.curTimer = src.ui.topNode.selfProgress;
  9876. }
  9877. else {
  9878. src.ui.topNode.selfProgress.visible = false;
  9879. src.ui.topNode.aiProgress.visible = true;
  9880. this.curTimer = src.ui.topNode.aiProgress;
  9881. }
  9882. this.accTime = 0;
  9883. Laya.timer.clearAll(this);
  9884. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9885. this.curTimer.value = 100;
  9886. }
  9887. updateTime(dt) {
  9888. if (this.gamePause)
  9889. return;
  9890. this.accTime += dt;
  9891. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9892. if (this.accTime >= this.setTime) {
  9893. this.clearTime();
  9894. console.log("时钟进入了gameRun");
  9895. this.gameRun(FoulType.timeOut);
  9896. }
  9897. }
  9898. clearTime() {
  9899. let src = xGame.common.gameUI;
  9900. src.ui.topNode.selfProgress.visible = false;
  9901. src.ui.topNode.aiProgress.visible = false;
  9902. Laya.timer.clearAll(this);
  9903. }
  9904. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9905. let ui = xGame.common.gameUI.ui;
  9906. let selfMsg, aiMsg;
  9907. if (sayWords) {
  9908. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9909. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9910. if (Foul) {
  9911. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9912. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9913. this.placeRootBall();
  9914. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9915. if (this.curFoul == FoulType.rootHole) {
  9916. if (!DataMgr.getRootBallFoul()) {
  9917. DataMgr.setRootBallFoul();
  9918. aiMsg = "";
  9919. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9920. let woman = "Boss, pay attention next time~";
  9921. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9922. }
  9923. }
  9924. else if (this.curFoul == FoulType.timeOut) {
  9925. if (!DataMgr.getTimeoutFoul()) {
  9926. DataMgr.setTimeoutFoul();
  9927. aiMsg = "";
  9928. let tips = "Game timeout, 3 fouls, this game failed.";
  9929. let woman = "Boss, pay attention to the timeline~";
  9930. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9931. }
  9932. }
  9933. }
  9934. }
  9935. }
  9936. if (this.selfTurn) {
  9937. if (sayWords) {
  9938. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9939. ui.selfTurn.visible = true;
  9940. ui.aiTurn.visible = false;
  9941. ui.selfTurn.t0.play();
  9942. Moyu.vibration();
  9943. });
  9944. }
  9945. }
  9946. else {
  9947. let aiNum = xGame.tools.random(1, 11);
  9948. let challengeNum = DataMgr.getChallengeTimes();
  9949. let delay = false;
  9950. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9951. aiNum = 9;
  9952. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9953. aiNum = 3;
  9954. if (challengeNum == 3) {
  9955. if (!this.showLongView) {
  9956. this.showLongView = true;
  9957. delay = true;
  9958. }
  9959. }
  9960. }
  9961. }
  9962. if (delay) {
  9963. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9964. if (success) {
  9965. xGame.common.longHelpLine = true;
  9966. xGame.common.d2World.getHelpLine();
  9967. }
  9968. else {
  9969. aiNum = 10;
  9970. }
  9971. xGame.common.aiPlayer.setAiLevel(aiNum);
  9972. if (sayWords) {
  9973. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9974. xGame.common.aiPlayer.runAI();
  9975. ui.selfTurn.visible = false;
  9976. ui.aiTurn.visible = true;
  9977. ui.aiTurn.t0.play();
  9978. });
  9979. }
  9980. else {
  9981. xGame.common.aiPlayer.runAI();
  9982. }
  9983. this.openTimer();
  9984. this.finishOneShoot = true;
  9985. if (this.selfTurn) {
  9986. ui.topNode.selfKuang.visible = true;
  9987. ui.topNode.aiKuang.visible = false;
  9988. ui.topNode.selfTips.visible = true;
  9989. ui.topNode.aiTips.visible = false;
  9990. }
  9991. else {
  9992. ui.topNode.selfKuang.visible = false;
  9993. ui.topNode.aiKuang.visible = true;
  9994. ui.topNode.selfTips.visible = false;
  9995. ui.topNode.aiTips.visible = true;
  9996. }
  9997. });
  9998. return;
  9999. }
  10000. if (xGame.common.gameMode == GameMode.classic) {
  10001. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10002. if (cfg) {
  10003. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10004. aiNum = aiLevel;
  10005. }
  10006. }
  10007. xGame.common.aiPlayer.setAiLevel(aiNum);
  10008. if (sayWords) {
  10009. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10010. xGame.common.aiPlayer.runAI();
  10011. ui.selfTurn.visible = false;
  10012. ui.aiTurn.visible = true;
  10013. ui.aiTurn.t0.play();
  10014. });
  10015. }
  10016. else {
  10017. xGame.common.aiPlayer.runAI();
  10018. }
  10019. }
  10020. this.openTimer();
  10021. this.finishOneShoot = true;
  10022. if (this.selfTurn) {
  10023. ui.topNode.selfKuang.visible = true;
  10024. ui.topNode.aiKuang.visible = false;
  10025. ui.topNode.selfTips.visible = true;
  10026. ui.topNode.aiTips.visible = false;
  10027. }
  10028. else {
  10029. ui.topNode.selfKuang.visible = false;
  10030. ui.topNode.aiKuang.visible = true;
  10031. ui.topNode.selfTips.visible = false;
  10032. ui.topNode.aiTips.visible = true;
  10033. }
  10034. }
  10035. placeRootBall() {
  10036. let rootBall = xGame.common.d2World.rootBall;
  10037. if (!rootBall)
  10038. return;
  10039. rootBall.gameObj.x = this.lastRootBallPos.x;
  10040. rootBall.gameObj.y = this.lastRootBallPos.y;
  10041. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10042. let moveNode = xGame.common.gameUI.ui.moveNode;
  10043. moveNode.visible = true;
  10044. moveNode.x = this.lastRootBallPos.x;
  10045. moveNode.y = this.lastRootBallPos.y;
  10046. if (!this.selfTurn) {
  10047. xGame.common.aiPlayer.resetRoot();
  10048. }
  10049. }
  10050. }
  10051. class ui_guanyuAni extends fgui.GComponent {
  10052. static createInstance() {
  10053. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10054. }
  10055. onConstruct() {
  10056. this.n0 = (this.getChild("n0"));
  10057. }
  10058. }
  10059. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10060. class UIFireworks extends UIBase {
  10061. constructor() {
  10062. super();
  10063. }
  10064. onConstructor() {
  10065. this.isEject = false;
  10066. }
  10067. show(callback) {
  10068. super.show();
  10069. }
  10070. }
  10071. UIFireworks.uiName = "UIFireworks";
  10072. class ui_UIGuanYu extends fgui.GComponent {
  10073. static createInstance() {
  10074. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10075. }
  10076. onConstruct() {
  10077. this.n2 = (this.getChild("n2"));
  10078. this.n1 = (this.getChild("n1"));
  10079. this.n3 = (this.getChild("n3"));
  10080. this.n4 = (this.getChild("n4"));
  10081. this.n5 = (this.getChild("n5"));
  10082. this.n6 = (this.getChild("n6"));
  10083. this.n8 = (this.getChild("n8"));
  10084. this.n7 = (this.getChild("n7"));
  10085. this.t0 = this.getTransition("t0");
  10086. }
  10087. }
  10088. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10089. class UIGuanYu extends UIBase {
  10090. constructor() {
  10091. super();
  10092. }
  10093. onConstructor() {
  10094. this.ui = ui_UIGuanYu.createInstance();
  10095. this.contentPane = this.ui;
  10096. this.isEject = false;
  10097. }
  10098. show(callback) {
  10099. super.show();
  10100. this.ui.t0.play(Laya.Handler.create(this, () => {
  10101. callback && callback();
  10102. this.hide();
  10103. }));
  10104. }
  10105. }
  10106. UIGuanYu.uiName = "UIGuanYu";
  10107. class SkillMgr {
  10108. constructor() {
  10109. this.leveNum = 0;
  10110. this.extraScore = 0;
  10111. this.selfTurn = false;
  10112. this.playedLastSkill = false;
  10113. this.tweenArr = [];
  10114. this._finishNum = 0;
  10115. this._curFinish = 0;
  10116. this._rootX = 0;
  10117. this._rootY = 0;
  10118. this.knifeTimes = 0;
  10119. this.knifeV2 = new Laya.Vector2();
  10120. this.knifeV3 = new Laya.Vector3();
  10121. this.rtStarX = 0;
  10122. this.rtStarY = 0;
  10123. this.addBigSkillSpine();
  10124. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10125. }
  10126. addBigSkillSpine() {
  10127. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10128. console.log("extra2 success");
  10129. });
  10130. }
  10131. runBigSkill(callback) {
  10132. this.tweenArr = [];
  10133. this.callback = callback;
  10134. this.judgeSkill();
  10135. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10136. let guide = DataMgr.getSkillGuide();
  10137. if (!xGame.common.gameMgr.selfTurn) {
  10138. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10139. }
  10140. else {
  10141. if (xGame.common.temSelfLevel != 0) {
  10142. this.leveNum = xGame.common.temSelfLevel;
  10143. }
  10144. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10145. this.leveNum += 5;
  10146. }
  10147. }
  10148. if (guide == 0) {
  10149. DataMgr.setSkillGuide(1);
  10150. if (DataMgr.getNewUser()) {
  10151. Moyu.sendDataEvent("gameFirstPlay");
  10152. DataMgr.setNewUser();
  10153. }
  10154. }
  10155. this.playSpineAni(() => {
  10156. switch (this.curSkill) {
  10157. case SkillType.highSpace:
  10158. this.runHighSpace();
  10159. break;
  10160. case SkillType.breakArmy:
  10161. this.runBreakArmy();
  10162. break;
  10163. case SkillType.ice:
  10164. this.runIce();
  10165. break;
  10166. case SkillType.fireworks:
  10167. this.runFireworks();
  10168. break;
  10169. case SkillType.GuanYu:
  10170. this.runGuanYu();
  10171. break;
  10172. default:
  10173. break;
  10174. }
  10175. });
  10176. }
  10177. judgeSkill() {
  10178. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10179. let gameMgr = xGame.common.gameMgr;
  10180. let type;
  10181. for (let index = 0; index < typeArr.length; index++) {
  10182. type = typeArr[index];
  10183. if (gameMgr.selfTurn) {
  10184. if (gameMgr.selfCurSkill == type) {
  10185. this.selfTurn = true;
  10186. this.curSkill = type;
  10187. return;
  10188. }
  10189. }
  10190. else {
  10191. if (gameMgr.aiCurSkill == type) {
  10192. this.selfTurn = false;
  10193. this.curSkill = type;
  10194. return;
  10195. }
  10196. }
  10197. }
  10198. }
  10199. playSpineAni(callback) {
  10200. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10201. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10202. parent.destroyChildren();
  10203. let aniIndex = 0;
  10204. let skillSpine;
  10205. switch (this.curSkill) {
  10206. case SkillType.highSpace:
  10207. aniIndex = 1;
  10208. xGame.soundMgr.playSound("skill01");
  10209. skillSpine = this.skillSpine2;
  10210. data.scaleX = 0.5;
  10211. data.scaleY = 0.5;
  10212. skillSpine.play(data, 1, false, parent, () => {
  10213. callback && callback();
  10214. });
  10215. break;
  10216. case SkillType.breakArmy:
  10217. aniIndex = 2;
  10218. xGame.soundMgr.playSound("skill02");
  10219. skillSpine = this.skillSpine2;
  10220. data.scaleX = 0.5;
  10221. data.scaleY = 0.5;
  10222. skillSpine.play(data, 2, false, parent, () => {
  10223. callback && callback();
  10224. });
  10225. break;
  10226. case SkillType.ice:
  10227. aniIndex = 0;
  10228. xGame.soundMgr.playSound("skill03");
  10229. skillSpine = this.skillSpine2;
  10230. data.scaleX = 0.5;
  10231. data.scaleY = 0.5;
  10232. skillSpine.play(data, 0, false, parent, () => {
  10233. callback && callback();
  10234. });
  10235. break;
  10236. case SkillType.fireworks:
  10237. xGame.soundMgr.playSound("skill_04_01");
  10238. xGame.soundMgr.playSound("skill04");
  10239. xGame.uiMgr.Show(UIFireworks, callback);
  10240. break;
  10241. case SkillType.GuanYu:
  10242. xGame.soundMgr.playSound("skill05_1");
  10243. xGame.soundMgr.playSound("skill05");
  10244. xGame.uiMgr.Show(UIGuanYu, callback);
  10245. break;
  10246. default:
  10247. break;
  10248. }
  10249. }
  10250. getAllBallArr() {
  10251. let arr = xGame.common.d2World.ballArr;
  10252. let outArr = [];
  10253. for (let index = 0; index < arr.length; index++) {
  10254. if (arr[index] instanceof D2RootBallSrc)
  10255. continue;
  10256. if (arr[index].ballFunc == "ice")
  10257. continue;
  10258. if (arr[index].destroyed)
  10259. continue;
  10260. outArr.push(arr[index]);
  10261. }
  10262. return outArr;
  10263. }
  10264. getOneArr(deletObj) {
  10265. let allArr = this.getAllBallArr();
  10266. let temp;
  10267. for (let index = 0; index < allArr.length; index++) {
  10268. temp = allArr[index];
  10269. if (temp.id == deletObj.id) {
  10270. allArr.splice(index, 1);
  10271. break;
  10272. }
  10273. }
  10274. return allArr;
  10275. }
  10276. getNearBallBag(ball) {
  10277. let ui = xGame.common.gameUI.ui;
  10278. let circleArr = [];
  10279. for (let index = 1; index <= 6; index++) {
  10280. circleArr.push(ui.border["circle" + index]);
  10281. }
  10282. let outIndex = 0;
  10283. let temp;
  10284. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10285. ;
  10286. let dis = 0;
  10287. for (let index = 1; index < circleArr.length; index++) {
  10288. temp = circleArr[index];
  10289. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10290. if (dis < min) {
  10291. min = dis;
  10292. outIndex = index;
  10293. }
  10294. }
  10295. return [circleArr[outIndex], outIndex];
  10296. }
  10297. ballFlyToBag(ballArr, time = 300) {
  10298. let temp;
  10299. let hole;
  10300. this._finishNum = ballArr.length;
  10301. this._curFinish = 0;
  10302. let holeObj = {};
  10303. let holeCfg = {
  10304. "1": 0,
  10305. "2": 0,
  10306. "3": 0,
  10307. "4": 0,
  10308. "5": 0,
  10309. "6": 0
  10310. };
  10311. for (let index = 0; index < ballArr.length; index++) {
  10312. temp = ballArr[index];
  10313. temp.outColli.isSensor = true;
  10314. temp.innerColli.isSensor = true;
  10315. temp.isRunSkillAni = true;
  10316. let holeArr = this.getNearBallBag(temp);
  10317. hole = holeArr[0];
  10318. holeObj[index] = holeArr[1];
  10319. temp.d3BallSrc.scaleXYZ = 0.5;
  10320. this.tweenArr.push(temp.d3BallSrc, temp);
  10321. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10322. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10323. }));
  10324. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10325. let mIndex = holeObj[this._curFinish];
  10326. let isDone = holeCfg[mIndex];
  10327. if (isDone) {
  10328. ballArr[this._curFinish].checkWrongBall(false);
  10329. }
  10330. else {
  10331. holeCfg[mIndex] = 1;
  10332. ballArr[this._curFinish].checkWrongBall();
  10333. }
  10334. this._curFinish++;
  10335. if (this._curFinish >= this._finishNum) {
  10336. if (this.curSkill == SkillType.highSpace) {
  10337. }
  10338. else if (this.curSkill == SkillType.breakArmy) {
  10339. let rootBall = xGame.common.d2World.rootBall;
  10340. rootBall.gameObj.x = this._rootX;
  10341. rootBall.gameObj.y = this._rootY;
  10342. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10343. xGame.common.d2World.d2Gan.ui.visible = true;
  10344. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10345. xGame.common.d2World.getHelpLine();
  10346. this.callback && this.callback(this.extraScore);
  10347. }
  10348. }
  10349. }));
  10350. }
  10351. }
  10352. runHighSpace() {
  10353. let rootBall = xGame.common.d2World.rootBall;
  10354. rootBall.showSelf();
  10355. let d3Src = rootBall.d3BallSrc;
  10356. let allArr = this.getAllBallArr();
  10357. if (allArr.length <= 0) {
  10358. this.callback && this.callback(0);
  10359. return;
  10360. }
  10361. let selectBall = xGame.common.d2World.targetBall;
  10362. let wrong = selectBall && selectBall.destroyed;
  10363. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10364. selectBall = xGame.common.getRandArrEle(allArr);
  10365. }
  10366. let targetD3Src = selectBall.d3BallSrc;
  10367. xGame.common.d2World.d2Gan.ui.visible = false;
  10368. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10369. d3Src.scaleXYZ = 0.5;
  10370. this.tweenArr.push(d3Src);
  10371. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10372. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10373. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10374. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10375. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10376. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10377. let outArr = [selectBall];
  10378. let other = this.leveNum - 1;
  10379. if (other > 0) {
  10380. let nearArr = this.getOneArr(selectBall);
  10381. if (nearArr.length > 0) {
  10382. xGame.common.botherArr(nearArr);
  10383. if (other >= nearArr.length)
  10384. other = nearArr.length;
  10385. for (let index = 0; index < other; index++) {
  10386. outArr.push(nearArr[index]);
  10387. }
  10388. }
  10389. }
  10390. xGame.common.extraMoveNum = other + 1;
  10391. this.extraScore = other + 1;
  10392. this._rootX = selectBall.gameObj.x;
  10393. this._rootY = selectBall.gameObj.y;
  10394. rootBall.gameObj.x = this._rootX;
  10395. rootBall.gameObj.y = this._rootY;
  10396. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10397. Laya.Tween.clearAll(d3Src);
  10398. this.addRandomForce(outArr);
  10399. }));
  10400. }));
  10401. }
  10402. addRandomForce(outArr) {
  10403. if (outArr.length > 0) {
  10404. xGame.common.d2World.openCheckStill = true;
  10405. this.playedLastSkill = true;
  10406. }
  10407. let temp;
  10408. for (let index = 0; index < outArr.length; index++) {
  10409. let angle = xGame.common.randomNum(0, 360);
  10410. let linearPercent = xGame.common.randomNum(65, 100);
  10411. temp = outArr[index];
  10412. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10413. }
  10414. }
  10415. setLinearSpeed(angle, rigy, linearPercent) {
  10416. let sin = Math.sin(angle * Math.PI / 180);
  10417. let cos = Math.cos(angle * Math.PI / 180);
  10418. let maxSpeed = 4;
  10419. let speed = new Laya.Vector2();
  10420. speed.x = maxSpeed * linearPercent * sin;
  10421. speed.y = -maxSpeed * linearPercent * cos;
  10422. rigy.applyLinearImpulseToCenter(speed);
  10423. }
  10424. runBreakArmy() {
  10425. xGame.common.d2World.d2Gan.ui.visible = false;
  10426. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10427. let gameUI = xGame.common.gameUI.ui;
  10428. gameUI.skillRod.visible = true;
  10429. gameUI.skillRod.rotation = 110;
  10430. let outArr = this.getAllBallArr();
  10431. if (outArr.length <= 0) {
  10432. gameUI.skillRod.visible = false;
  10433. this.callback && this.callback(0);
  10434. return;
  10435. }
  10436. xGame.common.botherArr(outArr);
  10437. if (this.leveNum >= outArr.length)
  10438. this.leveNum = outArr.length;
  10439. let deleteNum = outArr.length - this.leveNum;
  10440. outArr.splice(0, deleteNum);
  10441. this.extraScore = this.leveNum;
  10442. let potX = gameUI.skillRod.x;
  10443. let potY = gameUI.skillRod.y;
  10444. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10445. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10446. let disArr = [];
  10447. for (let index = 0; index < outArr.length; index++) {
  10448. let obj = outArr[index];
  10449. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10450. dis = Math.pow(dis, 0.5);
  10451. disArr.push(dis);
  10452. }
  10453. this.tweenArr.push(gameUI.skillRod);
  10454. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10455. })).update = Laya.Handler.create(this, (e, t, c) => {
  10456. let angle = gameUI.skillRod.rotation;
  10457. let xx;
  10458. let yy;
  10459. let temp;
  10460. for (let index = 0; index < outArr.length; index++) {
  10461. temp = outArr[index];
  10462. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10463. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10464. yy -= 20;
  10465. temp.gameObj.x = xx;
  10466. temp.gameObj.y = yy;
  10467. temp.d3BallSrc.setTransPos(xx, yy);
  10468. }
  10469. if (angle <= 60) {
  10470. Laya.Tween.clearAll(gameUI.skillRod);
  10471. this.ballFlyToBag(outArr, 150);
  10472. gameUI.skillRod.visible = false;
  10473. }
  10474. }, null, false);
  10475. }
  10476. runIce() {
  10477. let ballArr = xGame.common.d2World.ballArr;
  10478. this.leveNum *= 2;
  10479. if (this.leveNum >= ballArr.length - 1)
  10480. this.leveNum = ballArr.length - 1;
  10481. let tempArr = [];
  10482. let outArr = [];
  10483. for (let index = 0; index < ballArr.length; index++) {
  10484. if (ballArr[index] instanceof D2RootBallSrc)
  10485. continue;
  10486. tempArr.push(ballArr[index]);
  10487. }
  10488. if (tempArr.length <= 0) {
  10489. this.callback && this.callback(0);
  10490. return;
  10491. }
  10492. xGame.common.botherArr(tempArr);
  10493. for (let index = 0; index < this.leveNum; index++) {
  10494. outArr.push(tempArr[index]);
  10495. }
  10496. this.extraScore = this.leveNum;
  10497. let temp;
  10498. for (let index = 0; index < outArr.length; index++) {
  10499. temp = outArr[index];
  10500. temp.d3BallSrc.playIceEft();
  10501. }
  10502. Laya.timer.once(2000, this, () => {
  10503. for (let index = 0; index < outArr.length; index++) {
  10504. temp = outArr[index];
  10505. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10506. temp.setBallFunc("ice", str);
  10507. }
  10508. this.callback && this.callback(0);
  10509. });
  10510. }
  10511. runFireworks() {
  10512. let allArr = this.getAllBallArr();
  10513. if (allArr.length <= 0) {
  10514. this.callback && this.callback(0);
  10515. return;
  10516. }
  10517. xGame.common.d2World.d2Gan.ui.visible = false;
  10518. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10519. let outArr = [];
  10520. let other = this.leveNum;
  10521. if (other > 0) {
  10522. if (allArr.length > 0) {
  10523. xGame.common.botherArr(allArr);
  10524. if (other >= allArr.length)
  10525. other = allArr.length;
  10526. for (let index = 0; index < other; index++) {
  10527. outArr.push(allArr[index]);
  10528. }
  10529. }
  10530. }
  10531. xGame.common.extraMoveNum = other;
  10532. this.extraScore = other;
  10533. this.addRandmomFireworks(outArr);
  10534. }
  10535. addRandmomFireworks(outArr) {
  10536. Laya.timer.once(1100, this, () => {
  10537. if (outArr.length > 0) {
  10538. xGame.common.d2World.openCheckStill = true;
  10539. this.playedLastSkill = true;
  10540. }
  10541. });
  10542. xGame.soundMgr.playSound("skill_04_02");
  10543. let temp;
  10544. let delay = -200;
  10545. for (let index = 0; index < outArr.length; index++) {
  10546. temp = outArr[index];
  10547. delay += 200;
  10548. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10549. let angle = xGame.common.randomNum(0, 360);
  10550. angle = this.getFireworksAngle(obj);
  10551. let linearPercent = xGame.common.randomNum(45, 80);
  10552. if (!obj.destroyed)
  10553. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10554. });
  10555. }
  10556. }
  10557. getFireworksAngle(obj) {
  10558. let rootBall = xGame.common.d2World.rootBall;
  10559. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10560. }
  10561. resetGame() {
  10562. Laya.timer.clearAll(this);
  10563. if (this.tweenArr) {
  10564. for (let index = 0; index < this.tweenArr.length; index++) {
  10565. Laya.Tween.clearAll(this.tweenArr[index]);
  10566. }
  10567. }
  10568. this.tweenArr = null;
  10569. }
  10570. runGuanYu() {
  10571. xGame.common.d2World.d2Gan.ui.visible = false;
  10572. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10573. let rootBall = xGame.common.d2World.rootBall;
  10574. if (rootBall.isInHole) {
  10575. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10576. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10577. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10578. rootBall.showSelf();
  10579. }
  10580. this.rtStarX = rootBall.gameObj.x;
  10581. this.rtStarY = rootBall.gameObj.y;
  10582. this.knifeTimes = 0;
  10583. this.playedLastSkill = true;
  10584. rootBall.forceRun = true;
  10585. rootBall.rigy.type = "static";
  10586. xGame.common.d2World.openCheckStill = true;
  10587. this.guanyuRandomKnife();
  10588. }
  10589. guanyuRandomKnife() {
  10590. let rootBall = xGame.common.d2World.rootBall;
  10591. let dir = this.getRandDir();
  10592. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10593. console.log("当前angle", angle);
  10594. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10595. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10596. let dis = 324;
  10597. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10598. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10599. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10600. this.rtStarX = rootBall.gameObj.x;
  10601. this.rtStarY = rootBall.gameObj.y;
  10602. this.knifeTimes++;
  10603. let skillLevel;
  10604. if (xGame.common.gameMgr.selfTurn) {
  10605. skillLevel = DataMgr.getBigSkillByIndex(4);
  10606. }
  10607. else {
  10608. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10609. }
  10610. if (!skillLevel)
  10611. skillLevel = 1;
  10612. skillLevel += 2;
  10613. if (this.knifeTimes < skillLevel) {
  10614. Laya.timer.once(400, this, () => {
  10615. this.guanyuRandomKnife();
  10616. });
  10617. }
  10618. else {
  10619. rootBall.forceRun = false;
  10620. rootBall.rigy.type = "dynamic";
  10621. xGame.common.extraMoveNum = skillLevel;
  10622. }
  10623. }));
  10624. }
  10625. getRandDir() {
  10626. let rootBall = xGame.common.d2World.rootBall;
  10627. let allBall = this.getAllBallArr();
  10628. let target = xGame.common.getRandArrEle(allBall);
  10629. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10630. return this.knifeV2;
  10631. }
  10632. cloneKnife(x, y, rotation) {
  10633. let parent = xGame.common.d3World.knifeRoot;
  10634. let prefab = xGame.common.d3World.knife;
  10635. let clone = prefab.clone();
  10636. parent.addChild(clone);
  10637. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10638. clone.transform.localPositionX = this.knifeV3.x;
  10639. clone.transform.localPositionY = 0;
  10640. clone.transform.localPositionZ = this.knifeV3.z;
  10641. clone.transform.localRotationEulerX = 0;
  10642. clone.transform.localRotationEulerY = rotation;
  10643. clone.transform.localRotationEulerZ = 0;
  10644. clone.active = true;
  10645. return clone;
  10646. }
  10647. cloneGuanYuEft(x, y, angle) {
  10648. return;
  10649. let parent = xGame.common.gameUI.ui.guanyuNode;
  10650. let eft = new ui_guanyuAni();
  10651. eft.parent = parent;
  10652. eft.x = x;
  10653. eft.y = y;
  10654. eft.rotation = angle;
  10655. }
  10656. }
  10657. class ui_UIWordsList extends fgui.GComponent {
  10658. static createInstance() {
  10659. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10660. }
  10661. onConstruct() {
  10662. this.c1 = this.getController("c1");
  10663. this.n74 = (this.getChild("n74"));
  10664. this.clickNode = (this.getChild("clickNode"));
  10665. this.myNode = (this.getChild("myNode"));
  10666. this.n68 = (this.getChild("n68"));
  10667. this.n66 = (this.getChild("n66"));
  10668. this.n55 = (this.getChild("n55"));
  10669. this.wordsBtn = (this.getChild("wordsBtn"));
  10670. this.emotionBtn = (this.getChild("emotionBtn"));
  10671. this.mybggg = (this.getChild("mybggg"));
  10672. this.wordsList = (this.getChild("wordsList"));
  10673. this.emotionList = (this.getChild("emotionList"));
  10674. this.myRoot = (this.getChild("myRoot"));
  10675. }
  10676. }
  10677. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10678. class EmotionDisplay {
  10679. constructor(index, ui) {
  10680. this.ui = ui;
  10681. this.index = index;
  10682. this.ui.onClick(this, this.clickSelf);
  10683. this.updateSelf();
  10684. }
  10685. updateSelf() {
  10686. let data = cfgTable.emotionData[this.index + 1];
  10687. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10688. }
  10689. clickSelf() {
  10690. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10691. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10692. xGame.common.talkMgr.closeTalkView();
  10693. }
  10694. }
  10695. class WordsDisplay {
  10696. constructor(index, ui) {
  10697. this.ui = ui;
  10698. this.index = index;
  10699. this.ui.onClick(this, this.clickSelf);
  10700. this.updateSelf();
  10701. }
  10702. updateSelf() {
  10703. let data = cfgTable.talkwordsData[this.index + 1];
  10704. this.ui.txt.text = data.msg;
  10705. }
  10706. clickSelf() {
  10707. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10708. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10709. xGame.common.talkMgr.closeTalkView();
  10710. }
  10711. }
  10712. class UIWordsList extends UIBase {
  10713. constructor() {
  10714. super();
  10715. }
  10716. onConstructor() {
  10717. this.ui = ui_UIWordsList.createInstance();
  10718. this.contentPane = this.ui;
  10719. this.isEject = false;
  10720. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10721. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10722. this.addUIClick(this.ui.clickNode, this.hide);
  10723. this.initTalkList();
  10724. this.initEmotionList();
  10725. }
  10726. show() {
  10727. super.show();
  10728. }
  10729. initTalkList() {
  10730. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10731. let data = cfgTable.talkwordsData;
  10732. let length = Object.keys(data).length;
  10733. this.ui.wordsList.numItems = length;
  10734. }
  10735. initEmotionList() {
  10736. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10737. let data = cfgTable.emotionData;
  10738. let length = Object.keys(data).length;
  10739. this.ui.emotionList.numItems = length;
  10740. }
  10741. renderTalkItem(index, obj) {
  10742. let temp = new WordsDisplay(index, obj);
  10743. }
  10744. renderEmotionItem(index, obj) {
  10745. let temp = new EmotionDisplay(index, obj);
  10746. }
  10747. openTalkList() {
  10748. this.ui.c1.selectedIndex = 0;
  10749. }
  10750. openEmotionList() {
  10751. this.ui.c1.selectedIndex = 1;
  10752. }
  10753. }
  10754. UIWordsList.uiName = "UIWordsList";
  10755. class TalkMgr {
  10756. constructor() {
  10757. this.aiSpeak = true;
  10758. this.emotionList = [];
  10759. this.talkList = [];
  10760. this.addEvent();
  10761. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10762. this.emotionList = [];
  10763. this.talkList = [];
  10764. for (let k in cfgTable.emotionData) {
  10765. this.emotionList.push(cfgTable.emotionData[k].id);
  10766. }
  10767. for (let k in cfgTable.talkwordsData) {
  10768. this.talkList.push(cfgTable.talkwordsData[k].id);
  10769. }
  10770. }
  10771. addEvent() {
  10772. let ui = xGame.common.gameUI.ui;
  10773. ui.wordsBtn.visible = true;
  10774. ui.wordsBtn.onClick(this, this.openTalkView);
  10775. ui.aiWordsBtn.visible = true;
  10776. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10777. }
  10778. openTalkView() {
  10779. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10780. xGame.uiMgr.Show(UIWordsList);
  10781. }
  10782. closeTalkView() {
  10783. xGame.uiMgr.Hide(UIWordsList);
  10784. }
  10785. clickAIState() {
  10786. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10787. this.aiSpeak = !this.aiSpeak;
  10788. this.changeAIState(this.aiSpeak);
  10789. }
  10790. changeAIState(speak) {
  10791. this.aiSpeak = speak;
  10792. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10793. if (speak) {
  10794. btn.c1.selectedIndex = 0;
  10795. }
  10796. else {
  10797. btn.c1.selectedIndex = 1;
  10798. }
  10799. }
  10800. showSelfTalk(wordsId) {
  10801. let ui = xGame.common.gameUI.ui;
  10802. ui.selfTalk.visible = true;
  10803. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10804. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10805. ui.selfTalk.t0.play();
  10806. }
  10807. showSelfEmotion(emotionId) {
  10808. let ui = xGame.common.gameUI.ui;
  10809. ui.selfTalk.visible = true;
  10810. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10811. this.selfSpine && this.selfSpine.dispose();
  10812. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10813. let spineData = cfgTable.emotionData[emotionId].spine;
  10814. this.selfSpine = new SpineMgr(spineData, () => {
  10815. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10816. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10817. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10818. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10819. });
  10820. ui.selfTalk.t0.play();
  10821. }
  10822. showAITalk(wordsId) {
  10823. if (!this.aiSpeak)
  10824. return;
  10825. if (DataMgr.gameData.gameCount < 2)
  10826. return;
  10827. if (wordsId < 1)
  10828. wordsId = this.getRandTalk();
  10829. let ui = xGame.common.gameUI.ui;
  10830. ui.aiTalk.visible = true;
  10831. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10832. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10833. ui.aiTalk.t0.play();
  10834. }
  10835. getRandTalk() {
  10836. let rand = xGame.tools.random(0, this.talkList.length);
  10837. return this.emotionList[rand];
  10838. }
  10839. getRandEmotion() {
  10840. let rand = xGame.tools.random(0, this.emotionList.length);
  10841. return this.emotionList[rand];
  10842. }
  10843. showAIEmotion(emotionId) {
  10844. if (!this.aiSpeak)
  10845. return;
  10846. if (DataMgr.gameData.gameCount < 2)
  10847. return;
  10848. if (emotionId < 1)
  10849. emotionId = this.getRandEmotion();
  10850. let ui = xGame.common.gameUI.ui;
  10851. ui.aiTalk.visible = true;
  10852. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10853. this.aiSpine && this.aiSpine.dispose();
  10854. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10855. let spineData = cfgTable.emotionData[emotionId].spine;
  10856. this.aiSpine = new SpineMgr(spineData, () => {
  10857. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10858. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10859. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10860. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10861. });
  10862. ui.aiTalk.t0.play();
  10863. }
  10864. resetGame() {
  10865. let ui = xGame.common.gameUI.ui;
  10866. ui.aiTalk.visible = false;
  10867. ui.selfTalk.visible = false;
  10868. this.aiSpine && this.aiSpine.dispose();
  10869. this.selfSpine && this.selfSpine.dispose();
  10870. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10871. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10872. this.closeTalkView();
  10873. }
  10874. }
  10875. class WordsMgr {
  10876. constructor() {
  10877. this.comboTimes = 1;
  10878. this.skillTimes = 0;
  10879. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10880. this.comboSpine = new SpineMgr("yxz_liangan");
  10881. this.skillSpine = new SpineMgr("yiganxqiu");
  10882. this.scoreSpine = new SpineMgr("defen");
  10883. }
  10884. setClassicCombo(isInterrupt) {
  10885. if (isInterrupt) {
  10886. this.comboTimes = 0;
  10887. }
  10888. }
  10889. playClassicWords(type, callback) {
  10890. this.callback = callback;
  10891. let aniIndex = type;
  10892. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10893. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10894. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10895. mySpine.destroy(true);
  10896. this.playClassicTimes();
  10897. });
  10898. }
  10899. playClassicTimes() {
  10900. this.comboTimes++;
  10901. if (this.comboTimes <= 1) {
  10902. this.callback && this.callback();
  10903. }
  10904. else {
  10905. let aniIndex = this.comboTimes - 1;
  10906. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10907. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10908. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10909. mySpine.destroy(true);
  10910. this.callback && this.callback();
  10911. });
  10912. }
  10913. }
  10914. playBigSkillTimes(times, callback) {
  10915. if (times <= 0) {
  10916. callback && callback();
  10917. return;
  10918. }
  10919. this.callback = callback;
  10920. let pre = "sz_0";
  10921. let aniIndex = 0;
  10922. this.getWordsImg(times, pre, () => {
  10923. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10924. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10925. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10926. let r1 = ``;
  10927. let r2 = ``;
  10928. if (times <= 9) {
  10929. r1 = `res/d2Res/${pre}${times}.png`;
  10930. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10931. aniIndex = 0;
  10932. }
  10933. else {
  10934. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10935. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10936. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10937. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10938. aniIndex = 1;
  10939. }
  10940. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10941. mySpine.destroy(true);
  10942. xGame.common.gameMgr.playSkillTips();
  10943. this.playScore(times);
  10944. xGame.common.playRandomMutiBallBigSkillSound();
  10945. }, mySpine);
  10946. });
  10947. }
  10948. playScore(score) {
  10949. let pre = "sz_";
  10950. let aniIndex = 0;
  10951. this.getWordsImg(score, pre, () => {
  10952. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10953. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10954. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10955. let r1 = ``;
  10956. let r2 = ``;
  10957. if (score <= 9) {
  10958. r1 = `res/d2Res/${pre}${score}.png`;
  10959. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10960. aniIndex = 0;
  10961. }
  10962. else {
  10963. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10964. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10965. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10966. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10967. aniIndex = 1;
  10968. }
  10969. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10970. mySpine.destroy(true);
  10971. this.callback && this.callback();
  10972. }, mySpine);
  10973. });
  10974. }
  10975. getWordsImg(number, pre = "", callback) {
  10976. let arr = [];
  10977. if (number <= 9) {
  10978. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10979. }
  10980. else {
  10981. 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 });
  10982. }
  10983. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10984. callback && callback();
  10985. }));
  10986. }
  10987. }
  10988. class ui_UIRodMethod extends fgui.GComponent {
  10989. static createInstance() {
  10990. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10991. }
  10992. onConstruct() {
  10993. this.n24 = (this.getChild("n24"));
  10994. this.white = (this.getChild("white"));
  10995. this.dot = (this.getChild("dot"));
  10996. this.sureBtn = (this.getChild("sureBtn"));
  10997. this.n20 = (this.getChild("n20"));
  10998. this.n21 = (this.getChild("n21"));
  10999. this.n22 = (this.getChild("n22"));
  11000. this.n23 = (this.getChild("n23"));
  11001. this.n5 = (this.getChild("n5"));
  11002. this.n14 = (this.getChild("n14"));
  11003. this.t0 = this.getTransition("t0");
  11004. }
  11005. }
  11006. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11007. class UIRodMethod extends UIBase {
  11008. constructor() {
  11009. super();
  11010. this.isPressd = false;
  11011. }
  11012. onConstructor() {
  11013. this.ui = ui_UIRodMethod.createInstance();
  11014. this.contentPane = this.ui;
  11015. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11016. this.moveDir = new Laya.Vector2();
  11017. this.moveDest = new Laya.Vector2();
  11018. this.centerPos = new Laya.Vector2();
  11019. xGame.common.uiRodMethod = this;
  11020. }
  11021. show() {
  11022. super.show();
  11023. xGame.common.gameMgr.gamePause = true;
  11024. this.openPressDotEvent();
  11025. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11026. this.centerPos.x = this.ui.white.x;
  11027. this.centerPos.y = this.ui.white.y;
  11028. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11029. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11030. this.setDot();
  11031. }
  11032. setDot() {
  11033. this.ui.dot.x = this.moveDest.x;
  11034. this.ui.dot.y = this.moveDest.y;
  11035. }
  11036. closeSelf() {
  11037. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11038. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11039. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11040. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11041. xGame.common.gameMgr.gamePause = false;
  11042. this.hide();
  11043. }
  11044. openPressDotEvent() {
  11045. this.closePressDotEvent();
  11046. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11047. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11048. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11049. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11050. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11051. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11052. }
  11053. closePressDotEvent() {
  11054. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11055. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11056. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11057. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11058. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11059. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11060. }
  11061. onDown(e) {
  11062. if (e.type == Laya.Event.MOUSE_DOWN)
  11063. this.isPressd = true;
  11064. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11065. this.isPressd = false;
  11066. if (!this.isPressd)
  11067. return;
  11068. this.moveDest.x = e.stageX;
  11069. this.moveDest.y = e.stageY;
  11070. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11071. if (dis > 6724) {
  11072. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11073. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11074. }
  11075. this.setDot();
  11076. }
  11077. resetRod() {
  11078. this.ui.dot.x = this.ui.white.x;
  11079. this.ui.dot.y = this.ui.white.y;
  11080. this.gameRod.dot.x = this.gameRod.bg.x;
  11081. this.gameRod.dot.y = this.gameRod.bg.y;
  11082. xGame.common.rodOffest.x = 0;
  11083. xGame.common.rodOffest.y = 0;
  11084. }
  11085. }
  11086. UIRodMethod.uiName = "UIRodMethod";
  11087. class UIGame extends UIBase {
  11088. constructor() {
  11089. super();
  11090. this.powerNum = 0;
  11091. this.isD3Inited = false;
  11092. this.isPrePlay = false;
  11093. this.isMoveRod = false;
  11094. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11095. this.rulerDis = 20;
  11096. this.rulerOffset = 0;
  11097. }
  11098. onConstructor() {
  11099. this.ui = ui_UIGame.createInstance();
  11100. this.contentPane = this.ui;
  11101. this.ui.x += xGame.common.sysOffestNum;
  11102. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11103. this.isEject = false;
  11104. xGame.common.gameUI = this;
  11105. this.initSelf();
  11106. }
  11107. isTurnSelf() {
  11108. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11109. return true;
  11110. }
  11111. }
  11112. initSelf() {
  11113. let topUI = this.ui.topNode;
  11114. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11115. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11116. this.barInfo = {};
  11117. this.barInfo.curY = 0;
  11118. this.barInfo.height = this.ui.powerNode.height;
  11119. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11120. this.barInfo.powerStartY = this.ui.powerNode.y;
  11121. xGame.common.aiPlayer = new AIPlayer();
  11122. xGame.common.gameMgr = new GameMgr();
  11123. xGame.common.skillMgr = new SkillMgr();
  11124. xGame.common.wordsMgr = new WordsMgr();
  11125. xGame.common.talkMgr = new TalkMgr();
  11126. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11127. console.log("加载经典模式表情文件chenggon !");
  11128. });
  11129. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11130. console.log("挑战模式奖励模式spine加载成功!");
  11131. });
  11132. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11133. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11134. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11135. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11136. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11137. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11138. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11139. }
  11140. getGanZiImg() {
  11141. let index = DataMgr.getCurBallRod();
  11142. let data = cfgTable.ballrodData[index + 1];
  11143. let gan_url = xGame.common.getGameIconUrl(data.img);
  11144. console.log('zh:getGanZiImg gan_url==' + gan_url);
  11145. this.ui.powerNode.showImg.url = gan_url;
  11146. console.log('zh:修改杆子图标O K');
  11147. }
  11148. returnHome() {
  11149. let tips = "Are you sure to exit the game?";
  11150. let woman = "Boss, why don't you play for a while longer?";
  11151. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11152. }
  11153. addRodMethodClick() {
  11154. if (this.isTurnSelf()) {
  11155. xGame.uiMgr.Show(UIRodMethod);
  11156. }
  11157. }
  11158. clickHelpLineBtn(force = false) {
  11159. if (!this.isTurnSelf())
  11160. return;
  11161. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11162. if (success) {
  11163. xGame.common.longHelpLine = true;
  11164. xGame.common.d2World.getHelpLine();
  11165. Moyu.sendDataEvent("guideNum");
  11166. }
  11167. else {
  11168. }
  11169. });
  11170. }
  11171. renderSelfDisplayBalls(index, target) {
  11172. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11173. target.myImg.url = xGame.common.getGameIconUrl(str);
  11174. }
  11175. renderAIDisplayBalls(index, target) {
  11176. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11177. target.myImg.url = xGame.common.getGameIconUrl(str);
  11178. ;
  11179. }
  11180. updateMode() {
  11181. if (xGame.common.gameMode == GameMode.classic) {
  11182. this.ui.topNode.scoreNode.visible = false;
  11183. }
  11184. else if (xGame.common.gameMode == GameMode.bigMove) {
  11185. this.ui.topNode.scoreNode.visible = true;
  11186. }
  11187. }
  11188. show() {
  11189. super.show();
  11190. console.log("zh:uigame show AADD");
  11191. this.ui.alpha = 0;
  11192. this.updateSelf();
  11193. xGame.common.gameMgr.gamePause = false;
  11194. xGame.common.gameUI.ui.blackAni.visible = false;
  11195. xGame.common.gameUI.ui.whiteAni.visible = false;
  11196. this.ui.powerEft.visible = false;
  11197. this.ui.colorNode.visible = false;
  11198. this.updateHead();
  11199. let curUse = DataMgr.getCurBallRod();
  11200. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11201. this.getGanZiImg();
  11202. }
  11203. updateSelf() {
  11204. if (xGame.common.gameMode == GameMode.classic) {
  11205. this.ui.c1.selectedIndex = 0;
  11206. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11207. this.ui.topNode.middleNode.visible = true;
  11208. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11209. }
  11210. else if (xGame.common.gameMode == GameMode.bigMove) {
  11211. this.ui.c1.selectedIndex = 0;
  11212. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11213. this.ui.topNode.middleNode.visible = false;
  11214. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11215. let rand = xGame.common.randomNum(1, max);
  11216. let guide = DataMgr.getSkillGuide();
  11217. if (guide == 0)
  11218. rand = 1;
  11219. xGame.common.bigMoveLevelIndex = rand;
  11220. }
  11221. else if (xGame.common.gameMode == GameMode.placeBall) {
  11222. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11223. this.ui.c1.selectedIndex = 1 + data.type;
  11224. this.ui.alpha = 1;
  11225. this.startGame();
  11226. }
  11227. this.updateMode();
  11228. this.initD3world();
  11229. this.initD2world();
  11230. }
  11231. startGame() {
  11232. this.ui.snowNode.visible = Math.random() <= 0.1;
  11233. this.ui.d2Node.visible = false;
  11234. xGame.common.d3World.d3Hand.gameObj.active = false;
  11235. xGame.common.d3World.tableSrc.init();
  11236. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11237. this.cameraViewChange(() => {
  11238. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11239. switch (xGame.common.gameMode) {
  11240. case GameMode.classic:
  11241. xGame.common.d3World.d3Hand.gameObj.active = true;
  11242. this.playPutBallD3Ani();
  11243. break;
  11244. case GameMode.bigMove:
  11245. this.enterGame();
  11246. Laya.timer.once(500, this, () => {
  11247. this.ui.topNode.middleNode.visible = true;
  11248. this.ui.topNode.middleNode.t0.play();
  11249. });
  11250. break;
  11251. case GameMode.placeBall:
  11252. this.enterGame();
  11253. break;
  11254. default:
  11255. break;
  11256. }
  11257. });
  11258. PlatMgr.showBanner(false);
  11259. }
  11260. enterGame() {
  11261. this.ui.d2Node.visible = true;
  11262. xGame.common.d3World.d3Hand.gameObj.active = false;
  11263. xGame.common.showOneCamera("mainCamera");
  11264. Moyu.recordGame(30, true);
  11265. if (!this.isPrePlay) {
  11266. this.isPrePlay = true;
  11267. xGame.common.d3World.prePlayEft();
  11268. }
  11269. xGame.common.gameMgr.gameReady();
  11270. this.openAllEvent();
  11271. this.ui.snowNode.visible = false;
  11272. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11273. this.ui.helpBtn.visible = condition;
  11274. }
  11275. showHelpLineGuide() {
  11276. let longGuide = DataMgr.getGuideHelpLine();
  11277. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11278. this.ui.helpBtn.visible = true;
  11279. this.ui.guideNode.visible = true;
  11280. }
  11281. }
  11282. setTurnAlpha(alpha) {
  11283. this.ui.keduNode.alpha = alpha;
  11284. this.ui.ganNode.alpha = alpha;
  11285. this.ui.rodMethodNode.alpha = alpha;
  11286. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11287. }
  11288. cameraViewChange(callback) {
  11289. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11290. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11291. xGame.common.showOneCamera("visitAngle");
  11292. cameraSrc.localRotationEulerY = 180;
  11293. cameraSrc.localRotationEulerZ = 0;
  11294. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11295. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11296. callback && callback();
  11297. }));
  11298. }));
  11299. }
  11300. playPutBallD3Ani() {
  11301. xGame.common.showOneCamera("mainCamera");
  11302. let handSrc = xGame.common.d3World.d3Hand;
  11303. handSrc.gameObj.active = true;
  11304. handSrc.transform.localPositionZ = 3;
  11305. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11306. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11307. handSrc.gameObj.active = false;
  11308. this.enterGame();
  11309. }), 400);
  11310. }));
  11311. }
  11312. updateHead() {
  11313. let user = Moyu.getUserInfo();
  11314. this.ui.topNode.selfNameTxt.text = user.nickName;
  11315. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11316. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11317. if (DataMgr.getSkillGuide() < 1) {
  11318. this.ui.topNode.aiNameTxt.text = 'billiards';
  11319. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11320. }
  11321. else {
  11322. this.ui.topNode.aiNameTxt.text = aiData.name;
  11323. let randNo = Math.floor(Math.random() * 10) + 1;
  11324. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11325. }
  11326. }
  11327. initD2world() {
  11328. let node = this.ui.d2Root.displayObject;
  11329. let src = node.getComponent(D2World);
  11330. if (!src) {
  11331. xGame.common.d2World = node.addComponent(D2World);
  11332. }
  11333. xGame.common.d2World.initSelf();
  11334. }
  11335. initD3world() {
  11336. if (this.isD3Inited)
  11337. return;
  11338. this.isD3Inited = true;
  11339. let scene3D = xGame.common.d3Scene;
  11340. this.ui.d3Root.displayObject.addChild(scene3D);
  11341. scene3D.active = true;
  11342. xGame.common.d3World.tableSrc.setBorderPos();
  11343. }
  11344. onRootMove(e) {
  11345. let rootBall = xGame.common.d2World.rootBall;
  11346. this.ui.moveNode.x = e.x;
  11347. this.ui.moveNode.y = e.y;
  11348. rootBall.gameObj.x = e.x;
  11349. rootBall.gameObj.y = e.y;
  11350. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11351. }
  11352. aiRootMove(move) {
  11353. if (move)
  11354. this.hideBallUI();
  11355. else {
  11356. this.showBallUI();
  11357. xGame.common.d2World.getHelpLine();
  11358. }
  11359. }
  11360. aiForce(type, force = 0) {
  11361. this.pressTarget = PressType.powerNode;
  11362. if (type == 1)
  11363. this.onEventUp({ force: true });
  11364. else if (type == 2)
  11365. this.onEventMove({ stageY: force, force: true });
  11366. }
  11367. onEventPress(e) {
  11368. if (e.stopPropagation)
  11369. e.stopPropagation();
  11370. if (!this.isTurnSelf())
  11371. return;
  11372. let target = e.target;
  11373. switch (target) {
  11374. case this.ui.myPowerNode.displayObject:
  11375. this.pressTarget = PressType.powerNode;
  11376. this.barInfo.curY = e.stageY;
  11377. this.updateBarInfo();
  11378. break;
  11379. case this.ui.moveNode.displayObject:
  11380. this.pressTarget = PressType.moveNode;
  11381. this.hideBallUI();
  11382. this.eventObj.curX = this.ui.moveNode.x;
  11383. this.eventObj.curY = this.ui.moveNode.y;
  11384. this.ui.moveNode.finger.visible = false;
  11385. this.eventObj.lastX = e.stageX;
  11386. this.eventObj.lastY = e.stageY;
  11387. break;
  11388. case this.ui.rulerClickNode.displayObject:
  11389. this.pressTarget = PressType.rulerNode;
  11390. this.eventObj.lastY = e.stageY;
  11391. break;
  11392. case this.ui.d2Root.displayObject:
  11393. this.pressTarget = PressType.d2Root;
  11394. this.eventObj.lastX = e.stageX;
  11395. this.eventObj.lastY = e.stageY;
  11396. this.eventObj.starX = e.stageX;
  11397. this.eventObj.starY = e.stageY;
  11398. this.eventObj.curX = 0;
  11399. this.eventObj.curY = 0;
  11400. xGame.common.d2World.d2Gan.setGanLastInfo();
  11401. this.rulerOffset = 0;
  11402. break;
  11403. default:
  11404. break;
  11405. }
  11406. }
  11407. onEventMove(e) {
  11408. if (e.stopPropagation)
  11409. e.stopPropagation();
  11410. if (e && e.force) {
  11411. }
  11412. else {
  11413. if (!this.isTurnSelf())
  11414. return;
  11415. }
  11416. switch (this.pressTarget) {
  11417. case PressType.powerNode:
  11418. this.barInfo.curY = e.stageY;
  11419. this.updateBarInfo();
  11420. this.isMoveRod = true;
  11421. break;
  11422. case PressType.moveNode:
  11423. let rootBall = xGame.common.d2World.rootBall;
  11424. let radius = rootBall.gameObj.width / 2;
  11425. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11426. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11427. let border = xGame.common.d2World.borderRect;
  11428. if (curX <= border.x + radius)
  11429. curX = border.x + radius;
  11430. else if (curX >= border.x + border.width - radius)
  11431. curX = border.x + border.width - radius;
  11432. if (curY <= border.y + radius)
  11433. curY = border.y + radius;
  11434. else if (curY >= border.y + border.height - radius)
  11435. curY = border.y + border.height - radius;
  11436. if (xGame.common.gameMgr.isOpenBall) {
  11437. if (curX >= border.x + border.openBallW - radius)
  11438. curX = border.x + border.openBallW - radius;
  11439. }
  11440. this.ui.moveNode.x = curX;
  11441. this.ui.moveNode.y = curY;
  11442. rootBall.gameObj.x = curX;
  11443. rootBall.gameObj.y = curY;
  11444. rootBall.d3BallSrc.setTransPos(curX, curY);
  11445. this.isMoveRod = true;
  11446. break;
  11447. case PressType.rulerNode:
  11448. let yy = e.stageY - this.eventObj.lastY;
  11449. this.eventObj.lastY = e.stageY;
  11450. let ruler1 = this.ui.rulerNode.img1;
  11451. let ruler2 = this.ui.rulerNode.img2;
  11452. ruler1.y += yy;
  11453. ruler2.y += yy;
  11454. this.rulerOffset += yy;
  11455. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11456. this.rulerOffset = 0;
  11457. xGame.soundMgr.playSound("inch", 1, 10);
  11458. }
  11459. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11460. let h = ruler1.height;
  11461. this.checkGuide();
  11462. this.isMoveRod = true;
  11463. if (ruler1.y >= h) {
  11464. ruler1.y = -h;
  11465. ruler2.y = 0;
  11466. return;
  11467. }
  11468. else if (ruler1.y <= -h) {
  11469. ruler1.y = h;
  11470. ruler2.y = 0;
  11471. return;
  11472. }
  11473. if (ruler2.y >= h) {
  11474. ruler2.y = -h;
  11475. ruler1.y = 0;
  11476. return;
  11477. }
  11478. else if (ruler2.y <= -h) {
  11479. ruler2.y = h;
  11480. ruler1.y = 0;
  11481. return;
  11482. }
  11483. break;
  11484. case PressType.d2Root:
  11485. this.eventObj.curX = e.stageX;
  11486. this.eventObj.curY = e.stageY;
  11487. let offset = this.checkRodMoveDir();
  11488. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11489. this.eventObj.lastX = e.stageX;
  11490. this.eventObj.lastY = e.stageY;
  11491. break;
  11492. default:
  11493. break;
  11494. }
  11495. }
  11496. onEventUp(e) {
  11497. if (e.stopPropagation)
  11498. e.stopPropagation();
  11499. if (e && e.force) {
  11500. }
  11501. else {
  11502. if (!this.isTurnSelf())
  11503. return;
  11504. }
  11505. switch (this.pressTarget) {
  11506. case PressType.powerNode:
  11507. this.ui.powerNode.value = 0;
  11508. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11509. this.ui.powerTxt.text = "";
  11510. if (this.powerNum > 0) {
  11511. xGame.eventMgr.event(BALL_SHOOT);
  11512. xGame.common.d2World.shoot(this.powerNum);
  11513. xGame.common.d2World.d2Gan.shoot();
  11514. xGame.common.d2World.d2HelpLine.shoot();
  11515. this.finishGuide();
  11516. this.ui.powerEft.visible = false;
  11517. this.ui.colorNode.visible = false;
  11518. let ganStr = "";
  11519. if (this.powerNum <= 30) {
  11520. ganStr = "gan_30";
  11521. }
  11522. else if (this.powerNum <= 60) {
  11523. ganStr = "gan_50";
  11524. }
  11525. else {
  11526. ganStr = "gan_80";
  11527. }
  11528. xGame.soundMgr.playSound(ganStr);
  11529. }
  11530. break;
  11531. case PressType.moveNode:
  11532. let rootBall = xGame.common.d2World.rootBall;
  11533. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11534. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11535. let isIntersect = this.judgeBallIntersect();
  11536. if (isIntersect) {
  11537. this.ui.moveNode.x = lastX;
  11538. this.ui.moveNode.y = lastY;
  11539. rootBall.gameObj.x = lastX;
  11540. rootBall.gameObj.y = lastY;
  11541. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11542. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11543. }
  11544. else {
  11545. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11546. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11547. }
  11548. this.showBallUI();
  11549. this.ui.moveNode.finger.visible = true;
  11550. xGame.common.d2World.getHelpLine();
  11551. break;
  11552. case PressType.rulerNode:
  11553. break;
  11554. case PressType.d2Root:
  11555. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11556. if (dis <= 25) {
  11557. this.moveToClickDot(e);
  11558. }
  11559. break;
  11560. default:
  11561. break;
  11562. }
  11563. this.pressTarget = -1;
  11564. }
  11565. checkGuide() {
  11566. let guide = DataMgr.getSkillGuide();
  11567. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11568. xGame.common.guideStep++;
  11569. xGame.common.gameUI.ui.guide2.visible = false;
  11570. xGame.common.gameUI.ui.guide3.visible = true;
  11571. }
  11572. }
  11573. finishGuide() {
  11574. let guide = DataMgr.getSkillGuide();
  11575. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11576. xGame.common.guideStep = 10;
  11577. this.closeAllGuide();
  11578. console.log('zh: 新手引导完毕');
  11579. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11580. }
  11581. }
  11582. closeAllGuide() {
  11583. xGame.common.gameUI.ui.guide1.visible = false;
  11584. xGame.common.gameUI.ui.guide2.visible = false;
  11585. xGame.common.gameUI.ui.guide3.visible = false;
  11586. }
  11587. updateBarInfo() {
  11588. let star = this.ui.powerNode.y;
  11589. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11590. if (rate >= 1)
  11591. rate = 1;
  11592. if (rate <= 0)
  11593. rate = 0;
  11594. this.powerNum = Math.ceil(rate * 100);
  11595. this.ui.powerNode.value = this.powerNum;
  11596. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11597. this.ui.colorNode.value = this.powerNum;
  11598. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11599. this.ui.powerEft.visible = this.powerNum != 0;
  11600. this.ui.colorNode.visible = this.powerNum != 0;
  11601. this.ui.powerTxt.text = this.powerNum + "";
  11602. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11603. }
  11604. forceCancel() {
  11605. this.ui.powerNode.value = 0;
  11606. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11607. this.ui.powerTxt.text = "";
  11608. }
  11609. checkRodMoveDir() {
  11610. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11611. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11612. if (tempX >= 0 && tempY <= 0) {
  11613. return this.checkDir();
  11614. }
  11615. else if (tempX < 0 && tempY < 0) {
  11616. return this.checkDir(1, -1);
  11617. }
  11618. else if (tempX < 0 && tempY > 0) {
  11619. return this.checkDir(-1, -1);
  11620. }
  11621. else {
  11622. return this.checkDir(-1, 1);
  11623. }
  11624. }
  11625. checkDir(flagX = 1, flagY = 1) {
  11626. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11627. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11628. if (offsetY == 0) {
  11629. return offsetX * flagX;
  11630. }
  11631. if (offsetX == 0) {
  11632. return offsetY * flagY;
  11633. }
  11634. let angle = offsetY / offsetX;
  11635. if (Math.abs(angle) >= 1) {
  11636. return offsetY * flagY;
  11637. }
  11638. else {
  11639. return offsetX * flagX;
  11640. }
  11641. }
  11642. judgeBallIntersect() {
  11643. let rootBall = xGame.common.d2World.rootBall;
  11644. let ballArr = xGame.common.d2World.ballArr;
  11645. let radius = rootBall.gameObj.width / 2;
  11646. let temp;
  11647. let isIntersect = false;
  11648. for (let index = 0; index < ballArr.length; index++) {
  11649. temp = ballArr[index];
  11650. if (temp.number == rootBall.number)
  11651. continue;
  11652. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11653. if (isIntersect) {
  11654. break;
  11655. }
  11656. }
  11657. return isIntersect;
  11658. }
  11659. hideBallUI() {
  11660. let d2Gan = xGame.common.d2World.d2Gan;
  11661. if (!d2Gan.ui.isDisposed)
  11662. d2Gan.ui.visible = false;
  11663. let d2Help = xGame.common.d2World.d2HelpLine;
  11664. if (!d2Help.ui.isDisposed)
  11665. d2Help.ui.visible = false;
  11666. let rootBall = xGame.common.d2World.rootBall;
  11667. if (!rootBall.destroyed) {
  11668. rootBall.gameObj.active = false;
  11669. }
  11670. }
  11671. showBallUI() {
  11672. let d2Gan = xGame.common.d2World.d2Gan;
  11673. if (!d2Gan.ui.isDisposed)
  11674. d2Gan.ui.visible = true;
  11675. let d2Help = xGame.common.d2World.d2HelpLine;
  11676. if (!d2Help.ui.isDisposed)
  11677. d2Help.ui.visible = true;
  11678. let rootBall = xGame.common.d2World.rootBall;
  11679. if (!rootBall.destroyed) {
  11680. rootBall.gameObj.active = true;
  11681. }
  11682. }
  11683. moveToClickDot(e) {
  11684. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11685. let root = xGame.common.d2World.rootBall.gameObj;
  11686. let xx = e.stageX - xGame.common.sysOffestNum;
  11687. let yy = e.stageY;
  11688. let x = xx - root.x;
  11689. let y = yy - root.y;
  11690. let angle = xGame.common.getfguiRotation(x, y);
  11691. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11692. xGame.common.d2World.getHelpLine();
  11693. }
  11694. this.isMoveRod = false;
  11695. xGame.common.clickedBall = false;
  11696. }
  11697. openAllEvent() {
  11698. this.closeAllEvent();
  11699. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11700. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11701. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11702. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11703. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11704. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11705. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11706. }
  11707. closeAllEvent() {
  11708. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11709. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11710. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11711. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11712. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11713. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11714. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11715. }
  11716. resetGame() {
  11717. this.closeAllEvent();
  11718. this.hideBallUI();
  11719. xGame.common.gameMgr.gamePause = true;
  11720. }
  11721. }
  11722. UIGame.uiName = "UIGame";
  11723. class UIAddProp extends UIBase {
  11724. constructor() {
  11725. super();
  11726. this.curType = "";
  11727. }
  11728. onConstructor() {
  11729. this.ui = ui_UIAddProp.createInstance();
  11730. this.contentPane = this.ui;
  11731. this.isEject = false;
  11732. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11733. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11734. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11735. this.updateUI();
  11736. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11737. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11738. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11739. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11740. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11741. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11742. }
  11743. show(type) {
  11744. super.show();
  11745. this.curType = type == 0 ? "coin" : "diamond";
  11746. this.switchBtn("");
  11747. this.ui.t0.play();
  11748. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11749. PlatMgr.showInsert(true);
  11750. }
  11751. closeSelf() {
  11752. this.hide();
  11753. }
  11754. updateUI() {
  11755. let data = cfgTable.moneyData;
  11756. let temp;
  11757. let obj;
  11758. for (const key in data) {
  11759. temp = data[key];
  11760. obj = this.ui.myNode["node" + key];
  11761. if (parseInt(key) <= 2) {
  11762. obj.diamondTxt.text = "+" + temp.num;
  11763. }
  11764. else {
  11765. obj.coinTxt.text = temp.num;
  11766. obj.diamondTxt.text = temp.get.split('_')[1];
  11767. }
  11768. }
  11769. this.updateDiamondShare();
  11770. }
  11771. updateDiamondShare() {
  11772. let data = DataMgr.getShareDiamondTimes();
  11773. if (data >= xGame.common.maxShareDiamondTimes) {
  11774. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11775. this.ui.myNode.node1.touchable = false;
  11776. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11777. }
  11778. else {
  11779. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11780. this.ui.myNode.node1.touchable = true;
  11781. }
  11782. }
  11783. switchBtn(type) {
  11784. if (type == "")
  11785. type = this.curType;
  11786. else {
  11787. if (this.curType == type) {
  11788. return;
  11789. }
  11790. else {
  11791. this.curType = type;
  11792. }
  11793. }
  11794. if (type == "coin") {
  11795. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11796. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11797. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11798. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11799. this.ui.myNode.c1.selectedIndex = 0;
  11800. }
  11801. else {
  11802. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11803. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11804. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11805. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11806. this.ui.myNode.c1.selectedIndex = 1;
  11807. }
  11808. }
  11809. convertCoin(index) {
  11810. let data = cfgTable.moneyData[index];
  11811. let coinNum = data.num;
  11812. let str = data.get.split('_')[1];
  11813. let needDiamond = parseInt(str);
  11814. if (DataMgr.diamondEnough(needDiamond)) {
  11815. DataMgr.setDiamond(-needDiamond);
  11816. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11817. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11818. }
  11819. else {
  11820. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11821. this.switchBtn("diamond");
  11822. }
  11823. }
  11824. videoGetDiamond() {
  11825. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11826. if (Laya.Browser.onAndroid) {
  11827. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11828. if (!boo) {
  11829. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11830. return;
  11831. }
  11832. }
  11833. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11834. }
  11835. else {
  11836. console.log('zh:AD 失败,直接发放奖励');
  11837. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11838. }
  11839. }
  11840. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11841. let num = cfgTable.moneyData[2].num;
  11842. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11843. this.closeSelf();
  11844. }
  11845. videoGetCoin() {
  11846. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11847. if (Laya.Browser.onAndroid) {
  11848. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11849. if (!boo) {
  11850. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11851. return;
  11852. }
  11853. }
  11854. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11855. }
  11856. else {
  11857. console.log('zh:AD 失败,直接发放奖励');
  11858. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11859. }
  11860. }
  11861. qjff_AD_for_uiAddProp_videoGetCoin() {
  11862. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11863. this.closeSelf();
  11864. }
  11865. shareGetDiamond() {
  11866. let times = DataMgr.getShareDiamondTimes();
  11867. if (times >= xGame.common.maxShareDiamondTimes) {
  11868. console.log('zh: 233333333333 maxShareDiamondTimes');
  11869. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11870. }
  11871. else {
  11872. console.log('zh:33333333333333ad');
  11873. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11874. if (Laya.Browser.onAndroid) {
  11875. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11876. if (!boo) {
  11877. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11878. return;
  11879. }
  11880. }
  11881. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11882. }
  11883. else {
  11884. console.log('zh:AD 失败,直接发放奖励');
  11885. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11886. }
  11887. }
  11888. }
  11889. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11890. let diamond = xGame.common.randomNum(50, 100);
  11891. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11892. DataMgr.setShareDiamondTimes(1);
  11893. this.updateDiamondShare();
  11894. }
  11895. openPutBallView() {
  11896. let end = xGame.uiMgr.getUI(UIGameEnd);
  11897. let skill = xGame.uiMgr.getUI(UISkill);
  11898. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11899. let uigame = xGame.uiMgr.getUI(UIGame);
  11900. if (end && !end.isHide) {
  11901. xGame.uiMgr.Hide(UIGameEnd);
  11902. xGame.uiMgr.Show(UIMain);
  11903. }
  11904. if (skill && !skill.isHide)
  11905. xGame.uiMgr.Hide(UISkill);
  11906. if (uigame && !uigame.isHide)
  11907. xGame.uiMgr.Hide(UIGame);
  11908. if (level && !level.isHide) {
  11909. }
  11910. else {
  11911. xGame.uiMgr.Show(UILevelDisplay);
  11912. }
  11913. this.closeSelf();
  11914. }
  11915. }
  11916. UIAddProp.uiName = "UIAddProp";
  11917. class MoneyNode {
  11918. constructor(ui) {
  11919. this.leftTime = 0;
  11920. this.ui = ui;
  11921. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11922. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11923. this.ui.addPowerBtn.onClick(this, this.addPower);
  11924. this.ui.c1.selectedIndex = 1;
  11925. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11926. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11927. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11928. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11929. this.coinChange();
  11930. this.diamondChange();
  11931. this.powerChange();
  11932. }
  11933. addPower() {
  11934. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11935. xGame.uiMgr.Show(UIPower);
  11936. }
  11937. powerChange() {
  11938. let powerNum = DataMgr.getPower();
  11939. this.ui.powerTxt.text = powerNum + "";
  11940. }
  11941. checkPowerTime() {
  11942. let cur = new Date().getTime();
  11943. let last = DataMgr.getPowerTime();
  11944. if (last == 0) {
  11945. last = cur;
  11946. DataMgr.setPowerTime(cur);
  11947. }
  11948. let power = DataMgr.getPower();
  11949. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11950. Laya.timer.clearAll(this);
  11951. if (power >= xGame.common.natureMaxPower) {
  11952. this.ui.powerTimeTxt.text = "";
  11953. DataMgr.setPowerTime(cur);
  11954. return;
  11955. }
  11956. if (power + offset >= xGame.common.natureMaxPower) {
  11957. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11958. this.ui.powerTimeTxt.text = "";
  11959. DataMgr.setPowerTime(cur);
  11960. }
  11961. else {
  11962. if (offset > 0) {
  11963. DataMgr.setPower(offset);
  11964. DataMgr.setPowerTime(cur);
  11965. }
  11966. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11967. this.leftTime = xGame.common.powerRecoverNum - time;
  11968. if (this.leftTime <= 0)
  11969. this.leftTime = 0;
  11970. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11971. Laya.timer.loop(1000, this, this.updatePowerTime);
  11972. }
  11973. }
  11974. updatePowerTime() {
  11975. this.leftTime -= 1;
  11976. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11977. if (this.leftTime <= 0) {
  11978. this.checkPowerTime();
  11979. }
  11980. }
  11981. coinChange() {
  11982. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11983. }
  11984. diamondChange() {
  11985. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11986. }
  11987. addCoin() {
  11988. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11989. Moyu.sendDataEvent("AddCoinBtn");
  11990. xGame.uiMgr.Show(UIAddProp, 0);
  11991. }
  11992. addDiamond() {
  11993. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11994. Moyu.sendDataEvent("AddDiamondBtn");
  11995. xGame.uiMgr.Show(UIAddProp, 1);
  11996. }
  11997. }
  11998. class UIDraw extends UIBase {
  11999. constructor() {
  12000. super();
  12001. this.curKey = 0;
  12002. }
  12003. onConstructor() {
  12004. this.ui = ui_UIDraw.createInstance();
  12005. this.contentPane = this.ui;
  12006. this.isEject = false;
  12007. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12008. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12009. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12010. this.initDraw();
  12011. this.initUI();
  12012. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12013. if (Moyu.isKs)
  12014. this.ui.closeNode.closeBtn.x += 100;
  12015. }
  12016. show() {
  12017. super.show();
  12018. this.ui.t0.play();
  12019. this.playSecretaryIdle();
  12020. this.updateDraw();
  12021. this.checkFree();
  12022. if (PlatMgr.bannerDelay > 0) {
  12023. this.ui.closeNode.closeBtn.visible = false;
  12024. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12025. this.ui.closeNode.closeBtn.visible = true;
  12026. });
  12027. }
  12028. PlatMgr.showRateBanner();
  12029. }
  12030. hide() {
  12031. Laya.timer.clearAll(this);
  12032. super.hide();
  12033. }
  12034. checkFree() {
  12035. let isFree = DataMgr.getDailyfreeDrawTimes();
  12036. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12037. }
  12038. initDraw() {
  12039. this.drawObj = [];
  12040. let data = cfgTable.drawData;
  12041. let temp;
  12042. let weight = 0;
  12043. for (const key in data) {
  12044. temp = data[key];
  12045. weight += temp.weight;
  12046. this.drawObj.push(weight);
  12047. }
  12048. this.allWeight = weight;
  12049. }
  12050. initUI() {
  12051. let data = cfgTable.drawData;
  12052. let temp;
  12053. let img;
  12054. let txt;
  12055. for (const key in data) {
  12056. temp = data[key];
  12057. img = this.ui.myNode.rotNode["img" + key];
  12058. txt = this.ui.myNode.rotNode["txt" + key];
  12059. img.url = xGame.common.getGameIconUrl(temp.icon);
  12060. txt.visible = true;
  12061. if (temp.award > 2) {
  12062. img.rotation = 0;
  12063. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12064. }
  12065. else {
  12066. img.rotation = temp.rotation;
  12067. txt.text = temp.num;
  12068. }
  12069. }
  12070. }
  12071. getCurkey() {
  12072. let rand = Math.random() * this.allWeight;
  12073. let temp;
  12074. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12075. temp = this.drawObj[index];
  12076. if (index == 0) {
  12077. if (rand < temp) {
  12078. return index + 1;
  12079. }
  12080. }
  12081. else {
  12082. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12083. return index + 1;
  12084. }
  12085. }
  12086. }
  12087. return 2;
  12088. }
  12089. startDraw() {
  12090. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12091. if (freeTimes > 0) {
  12092. this.beginDraw();
  12093. DataMgr.setDailyfreeDrawTimes(0);
  12094. this.checkFree();
  12095. }
  12096. else {
  12097. if (Laya.Browser.onAndroid) {
  12098. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12099. if (!boo) {
  12100. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12101. return;
  12102. }
  12103. }
  12104. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12105. }
  12106. else {
  12107. console.log('zh:AD 失败,直接发放奖励');
  12108. this.qjff_chouJiang();
  12109. }
  12110. }
  12111. }
  12112. qjff_chouJiang() {
  12113. this.beginDraw();
  12114. }
  12115. beginDraw() {
  12116. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12117. this.ui.drawBtn.touchable = false;
  12118. this.curKey = this.getCurkey();
  12119. console.log("当前key", this.curKey);
  12120. let cell = 60;
  12121. let lap = 3;
  12122. let angle = cell * (this.curKey - 1) + lap * 360;
  12123. let target = this.ui.myNode.rotNode;
  12124. target.rotation = 0;
  12125. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12126. console.log("旋转完成");
  12127. this.ui.drawBtn.touchable = true;
  12128. this.getAward();
  12129. }));
  12130. }
  12131. getAward() {
  12132. let data = cfgTable.drawData[this.curKey];
  12133. let temp = new AwardType();
  12134. temp.type = data.award;
  12135. temp.num = data.num;
  12136. xGame.common.getAward([temp], () => {
  12137. DataMgr.setDrawTimes(1);
  12138. this.updateDraw();
  12139. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12140. });
  12141. }
  12142. updateDraw() {
  12143. let drawTimes = DataMgr.getDrawTimes();
  12144. let awardTimes = DataMgr.getDrawAwardTimes();
  12145. if (Math.floor(drawTimes / 3) > awardTimes) {
  12146. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12147. this.ui.extraNode.boxBtn.touchable = true;
  12148. this.ui.extraNode.tipsTxt.text = "3/3";
  12149. this.ui.extraNode.barNode.width = 265;
  12150. this.getExtraAward();
  12151. }
  12152. else {
  12153. this.ui.extraNode.boxBtn.t0.stop();
  12154. this.ui.extraNode.boxBtn.touchable = false;
  12155. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12156. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12157. }
  12158. let data = cfgTable.drawData[1];
  12159. if (awardTimes == 0) {
  12160. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12161. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12162. this.ui.myNode.rotNode.img1.rotation = 0;
  12163. }
  12164. else {
  12165. let award = data.nextid;
  12166. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12167. this.ui.myNode.rotNode.txt1.text = award[1];
  12168. this.ui.myNode.rotNode.img1.rotation = 0;
  12169. }
  12170. }
  12171. getExtraAward() {
  12172. let drawTimes = DataMgr.getDrawTimes();
  12173. let awardTimes = DataMgr.getDrawAwardTimes();
  12174. let data = cfgTable.drawData[1];
  12175. let award = new AwardType();
  12176. if (awardTimes == 0) {
  12177. award.num = data.num;
  12178. award.type = data.award;
  12179. xGame.common.getAward([award], () => {
  12180. let all = Math.floor(drawTimes / 3);
  12181. DataMgr.setDrawAwardTimes(all);
  12182. this.updateDraw();
  12183. });
  12184. }
  12185. else {
  12186. award.num = parseInt(data.nextid[1]);
  12187. award.type = parseInt(data.nextid[0]);
  12188. xGame.common.getAward([award], () => {
  12189. let all = Math.floor(drawTimes / 3);
  12190. DataMgr.setDrawAwardTimes(all);
  12191. this.updateDraw();
  12192. });
  12193. }
  12194. }
  12195. closeSelf() {
  12196. this.hide();
  12197. }
  12198. playSecretaryIdle() {
  12199. let parent = this.ui.secretary.displayObject;
  12200. parent.destroyChildren();
  12201. let xx = this.ui.secretary.width / 2;
  12202. let yy = this.ui.secretary.height;
  12203. let scale = xGame.common.getSecretaryScale();
  12204. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12205. xGame.common.secretary.play(data, 0, true, parent);
  12206. }
  12207. }
  12208. UIDraw.uiName = "UIDraw";
  12209. class ui_UIFlyEft extends fgui.GComponent {
  12210. static createInstance() {
  12211. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12212. }
  12213. onConstruct() {
  12214. this.n0 = (this.getChild("n0"));
  12215. this.n1 = (this.getChild("n1"));
  12216. this.n2 = (this.getChild("n2"));
  12217. this.n3 = (this.getChild("n3"));
  12218. this.n4 = (this.getChild("n4"));
  12219. this.n5 = (this.getChild("n5"));
  12220. this.n6 = (this.getChild("n6"));
  12221. this.n7 = (this.getChild("n7"));
  12222. this.iconNode = (this.getChild("iconNode"));
  12223. this.txt = (this.getChild("txt"));
  12224. this.txtNode = (this.getChild("txtNode"));
  12225. }
  12226. }
  12227. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12228. class UIFlyEft extends UIBase {
  12229. constructor() {
  12230. super();
  12231. this.max = 8;
  12232. this.delay = 0;
  12233. }
  12234. onConstructor() {
  12235. this.ui = ui_UIFlyEft.createInstance();
  12236. this.contentPane = this.ui;
  12237. this.isEject = false;
  12238. this.isMuti = true;
  12239. this.ui.x += xGame.common.sysOffestNum;
  12240. }
  12241. getArrPos() {
  12242. if (this.iconPos && this.iconPos.length > 0)
  12243. return;
  12244. this.iconPos = [];
  12245. let temp;
  12246. for (let index = 0; index < this.max; index++) {
  12247. temp = this.ui["n" + index];
  12248. this.iconPos.push([temp.x, temp.y]);
  12249. }
  12250. }
  12251. show(stPos, edPos, num, type, callback) {
  12252. super.show();
  12253. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12254. this.getArrPos();
  12255. this.updateUI(type);
  12256. this.updatePos();
  12257. this.runFly(edPos, callback);
  12258. this.runWorlds(stPos, num);
  12259. }
  12260. updateUI(type) {
  12261. let temp;
  12262. let str;
  12263. for (let index = 0; index < this.max; index++) {
  12264. temp = this.ui["n" + index];
  12265. str = this.getIconStr(type);
  12266. temp.url = xGame.common.getGameIconUrl(str);
  12267. }
  12268. }
  12269. getIconStr(type) {
  12270. switch (type) {
  12271. case Prop.diamond:
  12272. return "ty_zs";
  12273. case Prop.coin:
  12274. return "ty_jb";
  12275. default:
  12276. break;
  12277. }
  12278. }
  12279. updatePos() {
  12280. let temp;
  12281. for (let index = 0; index < this.max; index++) {
  12282. temp = this.ui["n" + index];
  12283. temp.x = this.iconPos[index][0];
  12284. temp.y = this.iconPos[index][1];
  12285. }
  12286. }
  12287. runFly(endPos, callback) {
  12288. let all = 0;
  12289. let temp;
  12290. for (let index = 0; index < this.max; index++) {
  12291. temp = this.ui["n" + index];
  12292. temp.visible = true;
  12293. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12294. temp.visible = false;
  12295. all++;
  12296. if (all >= this.max) {
  12297. callback && callback();
  12298. }
  12299. }), 20 * index);
  12300. }
  12301. }
  12302. runWorlds(stPos, num) {
  12303. let str = "+" + num;
  12304. this.ui.txt.text = str;
  12305. let starX = stPos.x;
  12306. let starY = stPos.y + 50;
  12307. this.ui.txt.x = starX;
  12308. this.ui.txt.y = starY;
  12309. this.ui.txt.visible = true;
  12310. this.ui.txt.alpha = 1;
  12311. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12312. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12313. this.ui.txt.visible = false;
  12314. this.hide();
  12315. }));
  12316. }));
  12317. }
  12318. }
  12319. UIFlyEft.uiName = "UIFlyEft";
  12320. class Common {
  12321. constructor() {
  12322. this.convertNum = 0.025;
  12323. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12324. this.scaleV3One = new Laya.Vector3();
  12325. this.scaleV3Two = new Laya.Vector3();
  12326. this.posV4 = new Laya.Vector4();
  12327. this.showDebug = false;
  12328. this.openGuide = true;
  12329. this.rodOffest = new Laya.Vector2(0, 0);
  12330. this.rodAngle = 0;
  12331. this.gameMode = GameMode.classic;
  12332. this.bigMoveLevelIndex = 1;
  12333. this.bigMoveNeedCoin = 1000;
  12334. this.classicNiceNeddCoin = 1000;
  12335. this.passAwardCoin = 2000;
  12336. this.classicRoomType = 1;
  12337. this.maxPower = 20;
  12338. this.natureMaxPower = 5;
  12339. this.videoPower = 2;
  12340. this.powerRecoverNum = 900;
  12341. this.curPlayerSkillType = 0;
  12342. this.isNewDay = false;
  12343. this.clickedBall = false;
  12344. this.placeBallCurLevel = 0;
  12345. this.placeBallStarNum = 0;
  12346. this.longHelpLine = false;
  12347. this.maxShareDiamondTimes = 3;
  12348. this.guideStep = 0;
  12349. this.temSelfLevel = 0;
  12350. this.extraMoveNum = 0;
  12351. this.curRankID = 0;
  12352. this.rankID = {
  12353. normalStar: 12000,
  12354. wxStar: 12001
  12355. };
  12356. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12357. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12358. this.btnClickStr = "buttonclick";
  12359. this.maxSkillLevel = 10;
  12360. this.upSkillLevel = false;
  12361. this.gameStartTime = 0;
  12362. this._sysOffestNum = 0;
  12363. this.angleV2 = new Laya.Vector2();
  12364. this.rootV = new Laya.Vector2(0, 1);
  12365. this.tempDir1 = new Laya.Vector2();
  12366. this.tempDir2 = new Laya.Vector2();
  12367. this.ballSize = 33;
  12368. this.stPos = new Laya.Point();
  12369. this.edPos = new Laya.Point();
  12370. Common._instance = this;
  12371. window["common"] = this;
  12372. }
  12373. static getInstance() {
  12374. if (!this._instance) {
  12375. this._instance = new Common();
  12376. }
  12377. return this._instance;
  12378. }
  12379. get sysOffestNum() {
  12380. if (this._sysOffestNum == 0) {
  12381. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12382. }
  12383. return this._sysOffestNum;
  12384. }
  12385. testShader() {
  12386. let test = new LightShader();
  12387. test.texture = "res/d3Res/ballTexture/ball1.png";
  12388. Laya.stage.addChild(test);
  12389. }
  12390. playScale(node) {
  12391. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12392. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12393. }));
  12394. }));
  12395. }
  12396. setGroup(colli, ...group) {
  12397. let out = 0;
  12398. for (let index = 0; index < group.length; index++) {
  12399. if (index == 0) {
  12400. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12401. }
  12402. else {
  12403. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12404. }
  12405. }
  12406. colli.collisionGroup = out;
  12407. }
  12408. setCanGroupWith(colli, ...group) {
  12409. let out = 0;
  12410. for (let index = 0; index < group.length; index++) {
  12411. if (index == 0) {
  12412. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12413. }
  12414. else {
  12415. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12416. }
  12417. }
  12418. colli.canCollideWith = out;
  12419. }
  12420. loadPrefab(name, callback) {
  12421. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12422. let prefab = new Laya.Prefab();
  12423. prefab.json = obj;
  12424. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12425. callback && callback(img);
  12426. }));
  12427. }
  12428. pos2to3Convert(x, y, d3Pos) {
  12429. x = x + this.sysOffestNum;
  12430. d3Pos.setValue(x, y, 0);
  12431. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12432. if (success) {
  12433. }
  12434. else {
  12435. console.error("转换出错了。。。。。。。。");
  12436. }
  12437. }
  12438. scale2to3Convert(num) {
  12439. this.scaleV3One.setValue(0, 0, 0);
  12440. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12441. this.scaleV3Two.setValue(0, num, 0);
  12442. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12443. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12444. return outNum;
  12445. }
  12446. pos3to2Convert(d3Pos) {
  12447. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12448. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12449. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12450. d3Pos.x -= this.sysOffestNum;
  12451. }
  12452. scale3to2Convert(num) {
  12453. let scale = this.scale2to3Convert(1);
  12454. let d2Out = num / scale;
  12455. return d2Out;
  12456. }
  12457. getCollider(type, restitution = 0.9, density = 10) {
  12458. let colli;
  12459. if (type == "box")
  12460. colli = new Laya.BoxCollider();
  12461. else
  12462. colli = new Laya.CircleCollider();
  12463. colli.friction = 0;
  12464. colli.restitution = restitution;
  12465. colli.density = density;
  12466. return colli;
  12467. }
  12468. getRigbody() {
  12469. let rigy = new Laya.RigidBody();
  12470. rigy.bullet = true;
  12471. rigy.allowRotation = false;
  12472. rigy.allowSleep = false;
  12473. rigy.gravityScale = 0;
  12474. return rigy;
  12475. }
  12476. getfguiRotation(x, y) {
  12477. this.angleV2.setValue(x, y);
  12478. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12479. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12480. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12481. angle = -angle;
  12482. }
  12483. return 180 + angle;
  12484. }
  12485. getAngle(x, y) {
  12486. this.angleV2.setValue(x, y);
  12487. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12488. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12489. return angle;
  12490. }
  12491. randomNum(a, b) {
  12492. return a + Math.floor((b - a + 1) * Math.random());
  12493. }
  12494. getRandArrEle(arr) {
  12495. return arr[Math.floor(arr.length * Math.random())];
  12496. }
  12497. getSign(val) {
  12498. return val >= 0 ? 1 : -1;
  12499. }
  12500. botherArr(arr) {
  12501. let times = arr.length + 2;
  12502. let length = arr.length;
  12503. let a;
  12504. let b;
  12505. let temp;
  12506. for (let index = 0; index < times; index++) {
  12507. a = Math.floor(Math.random() * length);
  12508. b = Math.floor(Math.random() * length);
  12509. temp = arr[a];
  12510. arr[a] = arr[b];
  12511. arr[b] = temp;
  12512. }
  12513. }
  12514. getGameIconUrl(id) {
  12515. return "ui://game/" + id;
  12516. }
  12517. getComponentUrl(id) {
  12518. return "ui://game/" + id;
  12519. }
  12520. getAnimation() {
  12521. }
  12522. judgeSkillType(type = SkillType.highSpace) {
  12523. if (this.gameMode == GameMode.classic)
  12524. return;
  12525. let gameMgr = this.gameMgr;
  12526. if (gameMgr.selfTurn) {
  12527. if (gameMgr.selfCurSkill == type) {
  12528. return true;
  12529. }
  12530. }
  12531. else {
  12532. if (gameMgr.aiCurSkill == type) {
  12533. return true;
  12534. }
  12535. }
  12536. }
  12537. ballColliHole(collider) {
  12538. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12539. xGame.common.gameMgr.isFirstInGame = false;
  12540. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12541. }
  12542. collider.owner.mySrc.checkWrongBall();
  12543. }
  12544. getArrMaxEle(arr) {
  12545. let max = -Infinity;
  12546. for (let index = 0; index < arr.length; index++) {
  12547. max = Math.max(arr[index], max);
  12548. }
  12549. return max;
  12550. }
  12551. getArrMinEle(arr) {
  12552. let min = Infinity;
  12553. for (let index = 0; index < arr.length; index++) {
  12554. min = Math.min(arr[index], min);
  12555. }
  12556. return min;
  12557. }
  12558. playRandomMutiBallBigSkillSound() {
  12559. if (Math.random() <= 0.5)
  12560. return;
  12561. let rand = this.randomNum(1, 6);
  12562. let str = "ganfa0" + rand;
  12563. xGame.soundMgr.playSound(str);
  12564. }
  12565. showOneCamera(type) {
  12566. let object = xGame.common.d3World.cameraObj;
  12567. for (const key in object) {
  12568. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12569. object[key].init();
  12570. object[key].owner.active = key == type;
  12571. }
  12572. }
  12573. }
  12574. checkBallOverBorder(x, y) {
  12575. let radius = 17;
  12576. let condition = this._checkBorder(x + radius, y) ||
  12577. this._checkBorder(x - radius, y) ||
  12578. this._checkBorder(x, y + radius) ||
  12579. this._checkBorder(x, y - radius);
  12580. if (condition) {
  12581. return true;
  12582. }
  12583. }
  12584. _checkBorder(x, y) {
  12585. let borderRect = this.d2World.borderRect;
  12586. let xOffest = 20;
  12587. let yOffest = 20;
  12588. if (y <= borderRect.y - yOffest) {
  12589. return true;
  12590. }
  12591. if (y >= borderRect.y + borderRect.height + yOffest) {
  12592. return true;
  12593. }
  12594. if (x <= borderRect.x - xOffest) {
  12595. return true;
  12596. }
  12597. if (x >= borderRect.x + borderRect.width + xOffest) {
  12598. return true;
  12599. }
  12600. }
  12601. initWeight(cfg) {
  12602. let allCfgData = { data: {}, allWeightNum: 0 };
  12603. let weightCfg = allCfgData.data;
  12604. let weight = 0;
  12605. for (const key in cfg) {
  12606. weightCfg[key] = {};
  12607. weightCfg[key].id = cfg[key].id;
  12608. weightCfg[key].minWeight = weight;
  12609. weight += cfg[key].weight;
  12610. weightCfg[key].maxWeight = weight;
  12611. }
  12612. allCfgData.allWeightNum = weight;
  12613. return allCfgData;
  12614. }
  12615. getRandomWeightData(cfg) {
  12616. let weightCfg = cfg.data;
  12617. let allWeightNum = cfg.allWeightNum;
  12618. let rand = Math.floor(Math.random() * allWeightNum);
  12619. for (const key in weightCfg) {
  12620. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12621. return weightCfg[key];
  12622. }
  12623. }
  12624. return weightCfg[1];
  12625. }
  12626. showGirlTalkPop(wordsIndex, node, msgNode) {
  12627. node.visible = true;
  12628. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12629. node.t0.play(Laya.Handler.create(this, () => {
  12630. node.visible = false;
  12631. }));
  12632. }
  12633. stopGirlPop(node) {
  12634. node.t0.stop();
  12635. node.visible = false;
  12636. }
  12637. createHead(loader, url, size = 107) {
  12638. if (Laya.Browser.name == "Browser") {
  12639. loader.url = url;
  12640. return;
  12641. }
  12642. else {
  12643. console.log('zh:url=', url);
  12644. loader.url = url;
  12645. }
  12646. }
  12647. addTestCoin(num) {
  12648. DataMgr.setCoin(num);
  12649. }
  12650. addTestDiamond(num) {
  12651. DataMgr.setDiamond(num);
  12652. }
  12653. addTestSkill() {
  12654. DataMgr.setBigSkill(0, 99);
  12655. DataMgr.setBigSkill(1, 99);
  12656. DataMgr.setBigSkill(2, 99);
  12657. }
  12658. playClassicEmotion(number, x, y) {
  12659. if (this.gameMode == GameMode.bigMove)
  12660. return;
  12661. let randIndex = this.randomNum(0, 2);
  12662. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12663. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12664. if (this.gameMgr.selfTurn) {
  12665. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12666. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12667. }
  12668. else {
  12669. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12670. }
  12671. else {
  12672. if (number == this.gameMgr.blackNum) {
  12673. if (this.gameMgr.selfBallArr.length == 0) {
  12674. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12675. }
  12676. else {
  12677. }
  12678. }
  12679. else {
  12680. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12681. }
  12682. }
  12683. }
  12684. }
  12685. else {
  12686. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12687. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12688. }
  12689. else {
  12690. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12691. }
  12692. else {
  12693. if (number == this.gameMgr.blackNum) {
  12694. if (this.gameMgr.aiBallArr.length == 0) {
  12695. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12696. }
  12697. else {
  12698. }
  12699. }
  12700. else {
  12701. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12702. }
  12703. }
  12704. }
  12705. }
  12706. }
  12707. playHappySound(number) {
  12708. if (this.gameMode != GameMode.classic)
  12709. return;
  12710. if (number == 8)
  12711. return;
  12712. let play = false;
  12713. if (this.gameMgr.selfTurn) {
  12714. if (this.gameMgr.ensureBallType) {
  12715. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12716. play = true;
  12717. }
  12718. }
  12719. else {
  12720. play = true;
  12721. }
  12722. }
  12723. else {
  12724. if (this.gameMgr.ensureBallType) {
  12725. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12726. play = true;
  12727. }
  12728. }
  12729. else {
  12730. play = true;
  12731. }
  12732. }
  12733. if (play)
  12734. xGame.soundMgr.playSound("applause");
  12735. }
  12736. destroyClassicEmotion() {
  12737. if (this.gameMode == GameMode.bigMove)
  12738. return;
  12739. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12740. parent.destroyChildren();
  12741. }
  12742. playAwardSpine(x, y) {
  12743. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12744. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12745. this.awardSpine.play(data, 0, false, parent);
  12746. }
  12747. destroyAwardSpine() {
  12748. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12749. parent.destroyChildren();
  12750. }
  12751. isBlock(bx, by, hx, hy, except = null) {
  12752. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12753. let balls = xGame.common.d2World.ballArr;
  12754. let outArr = [];
  12755. for (let index = 0; index < balls.length; index++) {
  12756. let obj = balls[index];
  12757. if (obj.number == 0)
  12758. continue;
  12759. if (obj == except)
  12760. continue;
  12761. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12762. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12763. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12764. if (num >= 1)
  12765. num = 1;
  12766. if (num < 0)
  12767. continue;
  12768. let gap = Math.sin(Math.acos(num)) * dis;
  12769. if (gap < this.ballSize) {
  12770. outArr.push({
  12771. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12772. disHon: Math.cos(Math.acos(num)) * dis,
  12773. disVer: Math.sin(Math.acos(num)) * dis,
  12774. src: balls[index],
  12775. dir: this.tempDir1
  12776. });
  12777. }
  12778. }
  12779. if (outArr.length > 0) {
  12780. outArr.sort((a, b) => { return a.dis - b.dis; });
  12781. return outArr[0];
  12782. }
  12783. }
  12784. AngleBetween(vector1, vector2) {
  12785. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12786. return rad * (180 / Math.PI);
  12787. }
  12788. getSecretaryScale() {
  12789. if (this.secretary.spineName == "mishu") {
  12790. return 1.28;
  12791. }
  12792. else {
  12793. return 1.024;
  12794. }
  12795. }
  12796. signAwardContainsRod(arr) {
  12797. let temp;
  12798. for (let index = 0; index < arr.length; index++) {
  12799. temp = arr[index].split('-')[0];
  12800. if (parseInt(temp) > 2) {
  12801. return true;
  12802. }
  12803. }
  12804. }
  12805. judgeSameDay() {
  12806. let lastTime = DataMgr.getSignTime();
  12807. let curTime = new Date().getTime();
  12808. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12809. return true;
  12810. }
  12811. return false;
  12812. }
  12813. getAward(arr, callback) {
  12814. let showTriple = arr[0].type <= 2;
  12815. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12816. let temp;
  12817. for (let index = 0; index < arr.length; index++) {
  12818. temp = arr[index];
  12819. switch (temp.type) {
  12820. case 1:
  12821. this.playObjFlyAnim(temp.num, temp.type);
  12822. break;
  12823. case 2:
  12824. this.playObjFlyAnim(temp.num, temp.type);
  12825. break;
  12826. case 3:
  12827. case 4:
  12828. case 5:
  12829. case 6:
  12830. DataMgr.setBallRod(temp.type - 2, 1);
  12831. DataMgr.setCurBallRod(temp.type - 2);
  12832. break;
  12833. default:
  12834. break;
  12835. }
  12836. }
  12837. callback && callback(watchVideo);
  12838. });
  12839. }
  12840. getMoneyNode() {
  12841. let moneyNode;
  12842. let sign = xGame.uiMgr.getUI(UISign);
  12843. let draw = xGame.uiMgr.getUI(UIDraw);
  12844. let end = xGame.uiMgr.getUI(UIGameEnd);
  12845. let skill = xGame.uiMgr.getUI(UISkill);
  12846. if (sign && !sign.isHide)
  12847. moneyNode = sign.ui.moneyNode;
  12848. if (draw && !draw.isHide)
  12849. moneyNode = draw.ui.moneyNode;
  12850. if (end && !end.isHide)
  12851. moneyNode = end.ui.moneyNode;
  12852. if (skill && !skill.isHide)
  12853. moneyNode = skill.ui.moneyNode;
  12854. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12855. let main = xGame.uiMgr.getUI(UIMain);
  12856. if (condition1 && main && !main.isHide) {
  12857. moneyNode = main.ui.moneyNode;
  12858. }
  12859. return moneyNode;
  12860. }
  12861. playObjFlyAnim(num, type, callback = null) {
  12862. this.stPos.x = Laya.stage.width / 2;
  12863. this.stPos.y = Laya.stage.height / 2;
  12864. let moneyNode = this.getMoneyNode();
  12865. switch (type) {
  12866. case Prop.diamond:
  12867. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12868. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12869. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12870. this.edPos.x /= 2;
  12871. this.edPos.y /= 2;
  12872. break;
  12873. case Prop.coin:
  12874. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12875. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12876. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12877. this.edPos.x /= 2;
  12878. this.edPos.y /= 2;
  12879. break;
  12880. default:
  12881. break;
  12882. }
  12883. xGame.soundMgr.playSound("coinbag");
  12884. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12885. switch (type) {
  12886. case Prop.diamond:
  12887. DataMgr.setDiamond(num);
  12888. break;
  12889. case Prop.coin:
  12890. DataMgr.setCoin(num);
  12891. break;
  12892. default:
  12893. break;
  12894. }
  12895. callback && callback();
  12896. });
  12897. }
  12898. autoPopUIView() {
  12899. let arr = [];
  12900. let sign = this.judgeSameDay() ? false : true;
  12901. if (sign)
  12902. arr.push("sign");
  12903. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12904. if (draw)
  12905. arr.push("draw");
  12906. if (arr.length <= 0)
  12907. return;
  12908. let str = this.getRandArrEle(arr);
  12909. switch (str) {
  12910. case "sign":
  12911. xGame.uiMgr.Show(UISign);
  12912. break;
  12913. case "draw":
  12914. xGame.uiMgr.Show(UIDraw);
  12915. break;
  12916. default:
  12917. break;
  12918. }
  12919. }
  12920. getMSTime(time) {
  12921. let min = Math.floor(time / 60);
  12922. let sec = Math.floor((time - min * 60));
  12923. if (sec < 10)
  12924. sec = "0" + sec;
  12925. if (min < 10)
  12926. min = "0" + min;
  12927. return `${min}:${sec}`;
  12928. }
  12929. testPower() {
  12930. DataMgr.setPower(0, false);
  12931. }
  12932. getAllStarNum() {
  12933. let data = DataMgr.getPlaceBallLevelList();
  12934. let out = 0;
  12935. for (let index = 0; index < data.length; index++) {
  12936. out += data[index].star;
  12937. }
  12938. return out;
  12939. }
  12940. recoverCameraView() {
  12941. Laya.timer.once(900, this, () => {
  12942. xGame.common.showOneCamera("mainCamera");
  12943. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12944. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12945. xGame.common.gameUI.ui.border.alpha = 0;
  12946. if (Laya.physicsTimer.scale < 1) {
  12947. Laya.physicsTimer.scale = 1;
  12948. }
  12949. }
  12950. });
  12951. }
  12952. getClassicLevel() {
  12953. let successTimes = DataMgr.getClassicTimes();
  12954. let needKey = "";
  12955. let lastKey = "";
  12956. let cfg = cfgTable.classictimesData;
  12957. let data;
  12958. for (const key in cfg) {
  12959. data = cfg[key];
  12960. if (successTimes <= data.times) {
  12961. needKey = key;
  12962. }
  12963. lastKey = key;
  12964. }
  12965. if (needKey == "")
  12966. needKey = lastKey;
  12967. return cfg[needKey];
  12968. }
  12969. }
  12970. Common._instance = null;
  12971. class ui_Component92 extends fgui.GComponent {
  12972. static createInstance() {
  12973. return (fgui.UIPackage.createObject("game", "Component92"));
  12974. }
  12975. onConstruct() {
  12976. this.n0 = (this.getChild("n0"));
  12977. }
  12978. }
  12979. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12980. class ui_Component129 extends fgui.GProgressBar {
  12981. static createInstance() {
  12982. return (fgui.UIPackage.createObject("game", "Component129"));
  12983. }
  12984. onConstruct() {
  12985. this.bar_v = (this.getChild("bar_v"));
  12986. this.n84 = (this.getChild("n84"));
  12987. }
  12988. }
  12989. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12990. class ui_Component130 extends fgui.GComponent {
  12991. static createInstance() {
  12992. return (fgui.UIPackage.createObject("game", "Component130"));
  12993. }
  12994. onConstruct() {
  12995. this.ani = (this.getChild("ani"));
  12996. this.t0 = this.getTransition("t0");
  12997. }
  12998. }
  12999. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13000. class ui_powerEft extends fgui.GComponent {
  13001. static createInstance() {
  13002. return (fgui.UIPackage.createObject("game", "powerEft"));
  13003. }
  13004. onConstruct() {
  13005. this.ani = (this.getChild("ani"));
  13006. this.n88 = (this.getChild("n88"));
  13007. this.n89 = (this.getChild("n89"));
  13008. }
  13009. }
  13010. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13011. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13012. static createInstance() {
  13013. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13014. }
  13015. onConstruct() {
  13016. this.c1 = this.getController("c1");
  13017. this.n2 = (this.getChild("n2"));
  13018. this.n22 = (this.getChild("n22"));
  13019. this.n23 = (this.getChild("n23"));
  13020. this.n15 = (this.getChild("n15"));
  13021. this.challenge = (this.getChild("challenge"));
  13022. this.n17 = (this.getChild("n17"));
  13023. this.n3 = (this.getChild("n3"));
  13024. this.starNode = (this.getChild("starNode"));
  13025. this.levelTxt = (this.getChild("levelTxt"));
  13026. this.n14 = (this.getChild("n14"));
  13027. this.n19 = (this.getChild("n19"));
  13028. this.n20 = (this.getChild("n20"));
  13029. this.n21 = (this.getChild("n21"));
  13030. this.special = (this.getChild("special"));
  13031. }
  13032. }
  13033. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13034. class ui_Component79 extends fgui.GComponent {
  13035. static createInstance() {
  13036. return (fgui.UIPackage.createObject("game", "Component79"));
  13037. }
  13038. onConstruct() {
  13039. this.c1 = this.getController("c1");
  13040. this.n7 = (this.getChild("n7"));
  13041. this.n8 = (this.getChild("n8"));
  13042. this.n9 = (this.getChild("n9"));
  13043. this.n10 = (this.getChild("n10"));
  13044. this.n11 = (this.getChild("n11"));
  13045. this.n12 = (this.getChild("n12"));
  13046. }
  13047. }
  13048. ui_Component79.URL = "ui://isxx5ak7avag477";
  13049. class ui_Component80 extends fgui.GComponent {
  13050. static createInstance() {
  13051. return (fgui.UIPackage.createObject("game", "Component80"));
  13052. }
  13053. onConstruct() {
  13054. this.n0 = (this.getChild("n0"));
  13055. this.n1 = (this.getChild("n1"));
  13056. this.myList = (this.getChild("myList"));
  13057. this.t0 = this.getTransition("t0");
  13058. }
  13059. }
  13060. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13061. class ui_SignNormal extends fgui.GComponent {
  13062. static createInstance() {
  13063. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13064. }
  13065. onConstruct() {
  13066. this.c1 = this.getController("c1");
  13067. this.n7 = (this.getChild("n7"));
  13068. this.n15 = (this.getChild("n15"));
  13069. this.titleTxt = (this.getChild("titleTxt"));
  13070. this.n8 = (this.getChild("n8"));
  13071. this.myIcon = (this.getChild("myIcon"));
  13072. this.numTxt = (this.getChild("numTxt"));
  13073. this.n12 = (this.getChild("n12"));
  13074. this.n13 = (this.getChild("n13"));
  13075. this.n17 = (this.getChild("n17"));
  13076. this.n14 = (this.getChild("n14"));
  13077. }
  13078. }
  13079. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13080. class ui_Button_reg extends fgui.GButton {
  13081. static createInstance() {
  13082. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13083. }
  13084. onConstruct() {
  13085. this.button = this.getController("button");
  13086. this.n6 = (this.getChild("n6"));
  13087. this.n4 = (this.getChild("n4"));
  13088. }
  13089. }
  13090. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13091. class ui_screenNode extends fgui.GComponent {
  13092. static createInstance() {
  13093. return (fgui.UIPackage.createObject("game", "screenNode"));
  13094. }
  13095. onConstruct() {
  13096. this.n9 = (this.getChild("n9"));
  13097. this.screenImg = (this.getChild("screenImg"));
  13098. }
  13099. }
  13100. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13101. class ui_GetAwrad_com1 extends fgui.GComponent {
  13102. static createInstance() {
  13103. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13104. }
  13105. onConstruct() {
  13106. this.n38 = (this.getChild("n38"));
  13107. this.n39 = (this.getChild("n39"));
  13108. this.n40 = (this.getChild("n40"));
  13109. this.t0 = this.getTransition("t0");
  13110. this.t1 = this.getTransition("t1");
  13111. }
  13112. }
  13113. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13114. class ui_GetAwrad_com2 extends fgui.GComponent {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13117. }
  13118. onConstruct() {
  13119. this.n39 = (this.getChild("n39"));
  13120. this.n40 = (this.getChild("n40"));
  13121. this.t0 = this.getTransition("t0");
  13122. }
  13123. }
  13124. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13125. class ui_Component128 extends fgui.GComponent {
  13126. static createInstance() {
  13127. return (fgui.UIPackage.createObject("game", "Component128"));
  13128. }
  13129. onConstruct() {
  13130. this.n38 = (this.getChild("n38"));
  13131. this.n40 = (this.getChild("n40"));
  13132. }
  13133. }
  13134. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13135. class ui_Component100_1 extends fgui.GComponent {
  13136. static createInstance() {
  13137. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13138. }
  13139. onConstruct() {
  13140. this.myNode = (this.getChild("myNode"));
  13141. this.t0 = this.getTransition("t0");
  13142. }
  13143. }
  13144. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13145. class ui_Component142 extends fgui.GComponent {
  13146. static createInstance() {
  13147. return (fgui.UIPackage.createObject("game", "Component142"));
  13148. }
  13149. onConstruct() {
  13150. this.n41 = (this.getChild("n41"));
  13151. this.n42 = (this.getChild("n42"));
  13152. }
  13153. }
  13154. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13155. class ui_main_guang extends fgui.GComponent {
  13156. static createInstance() {
  13157. return (fgui.UIPackage.createObject("game", "main_guang"));
  13158. }
  13159. onConstruct() {
  13160. this.n1 = (this.getChild("n1"));
  13161. this.n2 = (this.getChild("n2"));
  13162. this.n3 = (this.getChild("n3"));
  13163. this.n4 = (this.getChild("n4"));
  13164. this.n5 = (this.getChild("n5"));
  13165. this.n6 = (this.getChild("n6"));
  13166. this.n8 = (this.getChild("n8"));
  13167. this.t0 = this.getTransition("t0");
  13168. }
  13169. }
  13170. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13171. class ui_try_com1 extends fgui.GComponent {
  13172. static createInstance() {
  13173. return (fgui.UIPackage.createObject("game", "try_com1"));
  13174. }
  13175. onConstruct() {
  13176. this.c1 = this.getController("c1");
  13177. this.n0 = (this.getChild("n0"));
  13178. this.n2 = (this.getChild("n2"));
  13179. this.cancelBtn = (this.getChild("cancelBtn"));
  13180. this.videoBtn = (this.getChild("videoBtn"));
  13181. this.n9 = (this.getChild("n9"));
  13182. this.n24 = (this.getChild("n24"));
  13183. this.titleTxt = (this.getChild("titleTxt"));
  13184. this.n32 = (this.getChild("n32"));
  13185. this.n29 = (this.getChild("n29"));
  13186. this.n36 = (this.getChild("n36"));
  13187. this.txtTime = (this.getChild("txtTime"));
  13188. this.t0 = this.getTransition("t0");
  13189. }
  13190. }
  13191. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13192. class ui_try_com2 extends fgui.GComponent {
  13193. static createInstance() {
  13194. return (fgui.UIPackage.createObject("game", "try_com2"));
  13195. }
  13196. onConstruct() {
  13197. this.skillicon = (this.getChild("skillicon"));
  13198. this.n35 = (this.getChild("n35"));
  13199. this.n31 = (this.getChild("n31"));
  13200. this.n32 = (this.getChild("n32"));
  13201. this.n33 = (this.getChild("n33"));
  13202. this.n34 = (this.getChild("n34"));
  13203. }
  13204. }
  13205. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13206. class ui_try_com3 extends fgui.GComponent {
  13207. static createInstance() {
  13208. return (fgui.UIPackage.createObject("game", "try_com3"));
  13209. }
  13210. onConstruct() {
  13211. this.n33 = (this.getChild("n33"));
  13212. this.n34 = (this.getChild("n34"));
  13213. this.n35 = (this.getChild("n35"));
  13214. this.t0 = this.getTransition("t0");
  13215. }
  13216. }
  13217. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13218. class ui_huihe1 extends fgui.GComponent {
  13219. static createInstance() {
  13220. return (fgui.UIPackage.createObject("game", "huihe1"));
  13221. }
  13222. onConstruct() {
  13223. this.n0 = (this.getChild("n0"));
  13224. this.n1 = (this.getChild("n1"));
  13225. this.t0 = this.getTransition("t0");
  13226. }
  13227. }
  13228. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13229. class ui_huihe2 extends fgui.GComponent {
  13230. static createInstance() {
  13231. return (fgui.UIPackage.createObject("game", "huihe2"));
  13232. }
  13233. onConstruct() {
  13234. this.n0 = (this.getChild("n0"));
  13235. this.n1 = (this.getChild("n1"));
  13236. this.t0 = this.getTransition("t0");
  13237. }
  13238. }
  13239. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13240. class ui_Component143 extends fgui.GComponent {
  13241. static createInstance() {
  13242. return (fgui.UIPackage.createObject("game", "Component143"));
  13243. }
  13244. onConstruct() {
  13245. this.n3 = (this.getChild("n3"));
  13246. this.n4 = (this.getChild("n4"));
  13247. this.n5 = (this.getChild("n5"));
  13248. this.n6 = (this.getChild("n6"));
  13249. this.n7 = (this.getChild("n7"));
  13250. this.n8 = (this.getChild("n8"));
  13251. this.n9 = (this.getChild("n9"));
  13252. this.n10 = (this.getChild("n10"));
  13253. this.t0 = this.getTransition("t0");
  13254. }
  13255. }
  13256. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13257. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13258. static createInstance() {
  13259. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13260. }
  13261. onConstruct() {
  13262. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13263. }
  13264. }
  13265. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13266. class ui_dh_jingbi2 extends fgui.GComponent {
  13267. static createInstance() {
  13268. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13269. }
  13270. onConstruct() {
  13271. this.n0 = (this.getChild("n0"));
  13272. this.n1 = (this.getChild("n1"));
  13273. this.n2 = (this.getChild("n2"));
  13274. this.n3 = (this.getChild("n3"));
  13275. this.n4 = (this.getChild("n4"));
  13276. this.n5 = (this.getChild("n5"));
  13277. this.n6 = (this.getChild("n6"));
  13278. this.n8 = (this.getChild("n8"));
  13279. this.n10 = (this.getChild("n10"));
  13280. this.t0 = this.getTransition("t0");
  13281. }
  13282. }
  13283. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13284. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13285. static createInstance() {
  13286. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13287. }
  13288. onConstruct() {
  13289. this.n1 = (this.getChild("n1"));
  13290. this.n4 = (this.getChild("n4"));
  13291. this.t0 = this.getTransition("t0");
  13292. }
  13293. }
  13294. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13295. class ui_dh_jingbi3 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13298. }
  13299. onConstruct() {
  13300. this.n0 = (this.getChild("n0"));
  13301. this.n1 = (this.getChild("n1"));
  13302. this.n2 = (this.getChild("n2"));
  13303. this.n3 = (this.getChild("n3"));
  13304. this.n4 = (this.getChild("n4"));
  13305. this.n5 = (this.getChild("n5"));
  13306. this.n6 = (this.getChild("n6"));
  13307. this.n8 = (this.getChild("n8"));
  13308. this.n10 = (this.getChild("n10"));
  13309. this.t0 = this.getTransition("t0");
  13310. }
  13311. }
  13312. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13313. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13314. static createInstance() {
  13315. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13316. }
  13317. onConstruct() {
  13318. this.n3 = (this.getChild("n3"));
  13319. this.n1 = (this.getChild("n1"));
  13320. this.t0 = this.getTransition("t0");
  13321. }
  13322. }
  13323. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13324. class ui_hb_jinbi1 extends fgui.GButton {
  13325. static createInstance() {
  13326. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13327. }
  13328. onConstruct() {
  13329. this.n20 = (this.getChild("n20"));
  13330. this.n25 = (this.getChild("n25"));
  13331. this.coinTxt = (this.getChild("coinTxt"));
  13332. this.n28 = (this.getChild("n28"));
  13333. this.n32 = (this.getChild("n32"));
  13334. this.n38 = (this.getChild("n38"));
  13335. this.n45 = (this.getChild("n45"));
  13336. this.getTips = (this.getChild("getTips"));
  13337. this.n39 = (this.getChild("n39"));
  13338. this.diamondTxt = (this.getChild("diamondTxt"));
  13339. this.n41 = (this.getChild("n41"));
  13340. this.n42 = (this.getChild("n42"));
  13341. this.n46 = (this.getChild("n46"));
  13342. this.n47 = (this.getChild("n47"));
  13343. this.n48 = (this.getChild("n48"));
  13344. this.t0 = this.getTransition("t0");
  13345. }
  13346. }
  13347. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13348. class ui_hb_jinbi2 extends fgui.GButton {
  13349. static createInstance() {
  13350. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13351. }
  13352. onConstruct() {
  13353. this.n20 = (this.getChild("n20"));
  13354. this.n25 = (this.getChild("n25"));
  13355. this.coinTxt = (this.getChild("coinTxt"));
  13356. this.n28 = (this.getChild("n28"));
  13357. this.n32 = (this.getChild("n32"));
  13358. this.n38 = (this.getChild("n38"));
  13359. this.n39 = (this.getChild("n39"));
  13360. this.diamondTxt = (this.getChild("diamondTxt"));
  13361. this.n41 = (this.getChild("n41"));
  13362. this.n42 = (this.getChild("n42"));
  13363. this.n43 = (this.getChild("n43"));
  13364. this.n44 = (this.getChild("n44"));
  13365. this.n45 = (this.getChild("n45"));
  13366. this.t0 = this.getTransition("t0");
  13367. }
  13368. }
  13369. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13370. class ui_hb_jinbi3 extends fgui.GButton {
  13371. static createInstance() {
  13372. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13373. }
  13374. onConstruct() {
  13375. this.n20 = (this.getChild("n20"));
  13376. this.n25 = (this.getChild("n25"));
  13377. this.coinTxt = (this.getChild("coinTxt"));
  13378. this.n28 = (this.getChild("n28"));
  13379. this.n32 = (this.getChild("n32"));
  13380. this.n38 = (this.getChild("n38"));
  13381. this.n39 = (this.getChild("n39"));
  13382. this.diamondTxt = (this.getChild("diamondTxt"));
  13383. this.n41 = (this.getChild("n41"));
  13384. this.n42 = (this.getChild("n42"));
  13385. this.n43 = (this.getChild("n43"));
  13386. this.n44 = (this.getChild("n44"));
  13387. this.n45 = (this.getChild("n45"));
  13388. this.t0 = this.getTransition("t0");
  13389. }
  13390. }
  13391. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13392. class ui_Component104 extends fgui.GComponent {
  13393. static createInstance() {
  13394. return (fgui.UIPackage.createObject("game", "Component104"));
  13395. }
  13396. onConstruct() {
  13397. this.c1 = this.getController("c1");
  13398. this.n12 = (this.getChild("n12"));
  13399. this.coinBtn = (this.getChild("coinBtn"));
  13400. this.diamondBtn = (this.getChild("diamondBtn"));
  13401. this.node3 = (this.getChild("node3"));
  13402. this.node4 = (this.getChild("node4"));
  13403. this.node5 = (this.getChild("node5"));
  13404. this.node1 = (this.getChild("node1"));
  13405. this.node2 = (this.getChild("node2"));
  13406. this.node6 = (this.getChild("node6"));
  13407. this.t0 = this.getTransition("t0");
  13408. }
  13409. }
  13410. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13411. class ui_Component105 extends fgui.GButton {
  13412. static createInstance() {
  13413. return (fgui.UIPackage.createObject("game", "Component105"));
  13414. }
  13415. onConstruct() {
  13416. this.c1 = this.getController("c1");
  13417. this.n49 = (this.getChild("n49"));
  13418. this.n18 = (this.getChild("n18"));
  13419. this.n46 = (this.getChild("n46"));
  13420. this.n48 = (this.getChild("n48"));
  13421. }
  13422. }
  13423. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13424. class ui_Component106 extends fgui.GButton {
  13425. static createInstance() {
  13426. return (fgui.UIPackage.createObject("game", "Component106"));
  13427. }
  13428. onConstruct() {
  13429. this.c1 = this.getController("c1");
  13430. this.n49 = (this.getChild("n49"));
  13431. this.n18 = (this.getChild("n18"));
  13432. this.n46 = (this.getChild("n46"));
  13433. this.n48 = (this.getChild("n48"));
  13434. }
  13435. }
  13436. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13437. class ui_hb_zs1 extends fgui.GButton {
  13438. static createInstance() {
  13439. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13440. }
  13441. onConstruct() {
  13442. this.c1 = this.getController("c1");
  13443. this.n20 = (this.getChild("n20"));
  13444. this.n21 = (this.getChild("n21"));
  13445. this.n26 = (this.getChild("n26"));
  13446. this.n27 = (this.getChild("n27"));
  13447. this.shareTxt = (this.getChild("shareTxt"));
  13448. this.n32 = (this.getChild("n32"));
  13449. this.n38 = (this.getChild("n38"));
  13450. this.n39 = (this.getChild("n39"));
  13451. this.n44 = (this.getChild("n44"));
  13452. this.diamondTxt = (this.getChild("diamondTxt"));
  13453. this.n41 = (this.getChild("n41"));
  13454. this.n45 = (this.getChild("n45"));
  13455. this.n47 = (this.getChild("n47"));
  13456. this.n48 = (this.getChild("n48"));
  13457. this.randTxt = (this.getChild("randTxt"));
  13458. this.n50 = (this.getChild("n50"));
  13459. this.t0 = this.getTransition("t0");
  13460. }
  13461. }
  13462. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13463. class ui_dh_zs1 extends fgui.GComponent {
  13464. static createInstance() {
  13465. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13466. }
  13467. onConstruct() {
  13468. this.n10 = (this.getChild("n10"));
  13469. this.n9 = (this.getChild("n9"));
  13470. this.n1 = (this.getChild("n1"));
  13471. this.n2 = (this.getChild("n2"));
  13472. this.n3 = (this.getChild("n3"));
  13473. this.n4 = (this.getChild("n4"));
  13474. this.n5 = (this.getChild("n5"));
  13475. this.n6 = (this.getChild("n6"));
  13476. this.n8 = (this.getChild("n8"));
  13477. this.n11 = (this.getChild("n11"));
  13478. this.t0 = this.getTransition("t0");
  13479. }
  13480. }
  13481. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13482. class ui_dh_zs1_1 extends fgui.GComponent {
  13483. static createInstance() {
  13484. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13485. }
  13486. onConstruct() {
  13487. this.n3 = (this.getChild("n3"));
  13488. this.n1 = (this.getChild("n1"));
  13489. this.t0 = this.getTransition("t0");
  13490. }
  13491. }
  13492. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13493. class ui_hb_zs2 extends fgui.GButton {
  13494. static createInstance() {
  13495. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13496. }
  13497. onConstruct() {
  13498. this.n20 = (this.getChild("n20"));
  13499. this.n21 = (this.getChild("n21"));
  13500. this.n26 = (this.getChild("n26"));
  13501. this.n27 = (this.getChild("n27"));
  13502. this.n32 = (this.getChild("n32"));
  13503. this.n38 = (this.getChild("n38"));
  13504. this.n39 = (this.getChild("n39"));
  13505. this.n44 = (this.getChild("n44"));
  13506. this.diamondTxt = (this.getChild("diamondTxt"));
  13507. this.n41 = (this.getChild("n41"));
  13508. this.n45 = (this.getChild("n45"));
  13509. this.t0 = this.getTransition("t0");
  13510. }
  13511. }
  13512. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13513. class ui_hb_zs3 extends fgui.GButton {
  13514. static createInstance() {
  13515. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13516. }
  13517. onConstruct() {
  13518. this.n20 = (this.getChild("n20"));
  13519. this.n21 = (this.getChild("n21"));
  13520. this.n26 = (this.getChild("n26"));
  13521. this.n27 = (this.getChild("n27"));
  13522. this.n32 = (this.getChild("n32"));
  13523. this.n38 = (this.getChild("n38"));
  13524. this.n47 = (this.getChild("n47"));
  13525. this.t0 = this.getTransition("t0");
  13526. }
  13527. }
  13528. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13529. class ui_dh_zs2 extends fgui.GComponent {
  13530. static createInstance() {
  13531. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13532. }
  13533. onConstruct() {
  13534. this.n10 = (this.getChild("n10"));
  13535. this.n9 = (this.getChild("n9"));
  13536. this.n1 = (this.getChild("n1"));
  13537. this.n2 = (this.getChild("n2"));
  13538. this.n3 = (this.getChild("n3"));
  13539. this.n4 = (this.getChild("n4"));
  13540. this.n5 = (this.getChild("n5"));
  13541. this.n6 = (this.getChild("n6"));
  13542. this.n8 = (this.getChild("n8"));
  13543. this.n11 = (this.getChild("n11"));
  13544. this.t0 = this.getTransition("t0");
  13545. }
  13546. }
  13547. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13548. class ui_dh_zs2_1 extends fgui.GComponent {
  13549. static createInstance() {
  13550. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13551. }
  13552. onConstruct() {
  13553. this.n3 = (this.getChild("n3"));
  13554. this.n1 = (this.getChild("n1"));
  13555. this.t0 = this.getTransition("t0");
  13556. }
  13557. }
  13558. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13559. class ui_dh_zs3 extends fgui.GComponent {
  13560. static createInstance() {
  13561. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13562. }
  13563. onConstruct() {
  13564. this.n10 = (this.getChild("n10"));
  13565. this.n9 = (this.getChild("n9"));
  13566. this.n1 = (this.getChild("n1"));
  13567. this.n2 = (this.getChild("n2"));
  13568. this.n3 = (this.getChild("n3"));
  13569. this.n4 = (this.getChild("n4"));
  13570. this.n5 = (this.getChild("n5"));
  13571. this.n6 = (this.getChild("n6"));
  13572. this.n8 = (this.getChild("n8"));
  13573. this.n11 = (this.getChild("n11"));
  13574. this.t0 = this.getTransition("t0");
  13575. }
  13576. }
  13577. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13578. class ui_dh_zs3_1 extends fgui.GComponent {
  13579. static createInstance() {
  13580. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13581. }
  13582. onConstruct() {
  13583. this.n3 = (this.getChild("n3"));
  13584. this.n1 = (this.getChild("n1"));
  13585. this.t0 = this.getTransition("t0");
  13586. }
  13587. }
  13588. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13589. class ui_Component107 extends fgui.GComponent {
  13590. static createInstance() {
  13591. return (fgui.UIPackage.createObject("game", "Component107"));
  13592. }
  13593. onConstruct() {
  13594. this.n18 = (this.getChild("n18"));
  13595. this.n19 = (this.getChild("n19"));
  13596. this.n20 = (this.getChild("n20"));
  13597. this.n21 = (this.getChild("n21"));
  13598. this.n22 = (this.getChild("n22"));
  13599. this.levelTxt = (this.getChild("levelTxt"));
  13600. this.t0 = this.getTransition("t0");
  13601. }
  13602. }
  13603. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13604. class ui_box_com1 extends fgui.GComponent {
  13605. static createInstance() {
  13606. return (fgui.UIPackage.createObject("game", "box_com1"));
  13607. }
  13608. onConstruct() {
  13609. this.n14 = (this.getChild("n14"));
  13610. this.n6 = (this.getChild("n6"));
  13611. this.t0 = this.getTransition("t0");
  13612. }
  13613. }
  13614. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13615. class ui_box_com2 extends fgui.GProgressBar {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "box_com2"));
  13618. }
  13619. onConstruct() {
  13620. this.bg0 = (this.getChild("bg0"));
  13621. this.bg = (this.getChild("bg"));
  13622. this.bar = (this.getChild("bar"));
  13623. this.n7 = (this.getChild("n7"));
  13624. this.n8 = (this.getChild("n8"));
  13625. this.n10 = (this.getChild("n10"));
  13626. this.n11 = (this.getChild("n11"));
  13627. this.n12 = (this.getChild("n12"));
  13628. }
  13629. }
  13630. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13631. class ui_box_com4 extends fgui.GComponent {
  13632. static createInstance() {
  13633. return (fgui.UIPackage.createObject("game", "box_com4"));
  13634. }
  13635. onConstruct() {
  13636. this.n8 = (this.getChild("n8"));
  13637. this.t0 = this.getTransition("t0");
  13638. }
  13639. }
  13640. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13641. class ui_box_com3 extends fgui.GComponent {
  13642. static createInstance() {
  13643. return (fgui.UIPackage.createObject("game", "box_com3"));
  13644. }
  13645. onConstruct() {
  13646. this.n2 = (this.getChild("n2"));
  13647. this.n3 = (this.getChild("n3"));
  13648. this.n4 = (this.getChild("n4"));
  13649. this.n5 = (this.getChild("n5"));
  13650. this.t0 = this.getTransition("t0");
  13651. this.t1 = this.getTransition("t1");
  13652. }
  13653. }
  13654. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13655. class ui_Component97 extends fgui.GComponent {
  13656. static createInstance() {
  13657. return (fgui.UIPackage.createObject("game", "Component97"));
  13658. }
  13659. onConstruct() {
  13660. this.c1 = this.getController("c1");
  13661. this.n46 = (this.getChild("n46"));
  13662. this.diamondNode = (this.getChild("diamondNode"));
  13663. this.coinNode = (this.getChild("coinNode"));
  13664. this.t0 = this.getTransition("t0");
  13665. }
  13666. }
  13667. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13668. class ui_Component98 extends fgui.GButton {
  13669. static createInstance() {
  13670. return (fgui.UIPackage.createObject("game", "Component98"));
  13671. }
  13672. onConstruct() {
  13673. this.n8 = (this.getChild("n8"));
  13674. this.n40 = (this.getChild("n40"));
  13675. }
  13676. }
  13677. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13678. class ui_Component28_11 extends fgui.GButton {
  13679. static createInstance() {
  13680. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13681. }
  13682. onConstruct() {
  13683. this.c1 = this.getController("c1");
  13684. this.n12 = (this.getChild("n12"));
  13685. this.n17 = (this.getChild("n17"));
  13686. this.n13 = (this.getChild("n13"));
  13687. this.diamondTxt = (this.getChild("diamondTxt"));
  13688. this.n15 = (this.getChild("n15"));
  13689. this.n16 = (this.getChild("n16"));
  13690. }
  13691. }
  13692. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13693. class ui_Component58_11 extends fgui.GComponent {
  13694. static createInstance() {
  13695. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13696. }
  13697. onConstruct() {
  13698. this.c1 = this.getController("c1");
  13699. this.n23 = (this.getChild("n23"));
  13700. this.n41 = (this.getChild("n41"));
  13701. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13702. this.n_daoju = (this.getChild("n_daoju"));
  13703. this.myList = (this.getChild("myList"));
  13704. this.djList = (this.getChild("djList"));
  13705. this.t0 = this.getTransition("t0");
  13706. }
  13707. }
  13708. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13709. class ui_Component100 extends fgui.GComponent {
  13710. static createInstance() {
  13711. return (fgui.UIPackage.createObject("game", "Component100"));
  13712. }
  13713. onConstruct() {
  13714. this.c1 = this.getController("c1");
  13715. this.n75 = (this.getChild("n75"));
  13716. this.n76 = (this.getChild("n76"));
  13717. this.n80 = (this.getChild("n80"));
  13718. this.txt = (this.getChild("txt"));
  13719. this.spineRoot = (this.getChild("spineRoot"));
  13720. }
  13721. }
  13722. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13723. class ui_Component101 extends fgui.GComponent {
  13724. static createInstance() {
  13725. return (fgui.UIPackage.createObject("game", "Component101"));
  13726. }
  13727. onConstruct() {
  13728. this.c1 = this.getController("c1");
  13729. this.n36 = (this.getChild("n36"));
  13730. this.n35 = (this.getChild("n35"));
  13731. this.n33 = (this.getChild("n33"));
  13732. this.n34 = (this.getChild("n34"));
  13733. }
  13734. }
  13735. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13736. class ui_Component53 extends fgui.GComponent {
  13737. static createInstance() {
  13738. return (fgui.UIPackage.createObject("game", "Component53"));
  13739. }
  13740. onConstruct() {
  13741. this.n0 = (this.getChild("n0"));
  13742. this.n1 = (this.getChild("n1"));
  13743. this.n2 = (this.getChild("n2"));
  13744. this.n3 = (this.getChild("n3"));
  13745. this.n4 = (this.getChild("n4"));
  13746. this.n5 = (this.getChild("n5"));
  13747. this.n6 = (this.getChild("n6"));
  13748. this.n7 = (this.getChild("n7"));
  13749. this.n8 = (this.getChild("n8"));
  13750. this.n9 = (this.getChild("n9"));
  13751. this.n10 = (this.getChild("n10"));
  13752. this.n11 = (this.getChild("n11"));
  13753. this.n12 = (this.getChild("n12"));
  13754. this.n13 = (this.getChild("n13"));
  13755. this.n14 = (this.getChild("n14"));
  13756. this.n15 = (this.getChild("n15"));
  13757. this.n16 = (this.getChild("n16"));
  13758. this.n19 = (this.getChild("n19"));
  13759. this.n20 = (this.getChild("n20"));
  13760. this.n21 = (this.getChild("n21"));
  13761. this.n22 = (this.getChild("n22"));
  13762. this.n23 = (this.getChild("n23"));
  13763. this.n24 = (this.getChild("n24"));
  13764. this.n25 = (this.getChild("n25"));
  13765. this.n26 = (this.getChild("n26"));
  13766. this.n27 = (this.getChild("n27"));
  13767. this.n28 = (this.getChild("n28"));
  13768. this.n29 = (this.getChild("n29"));
  13769. this.n30 = (this.getChild("n30"));
  13770. this.n31 = (this.getChild("n31"));
  13771. this.n32 = (this.getChild("n32"));
  13772. this.n33 = (this.getChild("n33"));
  13773. this.n34 = (this.getChild("n34"));
  13774. this.n35 = (this.getChild("n35"));
  13775. this.t0 = this.getTransition("t0");
  13776. }
  13777. }
  13778. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13779. class ui_Component58 extends fgui.GComponent {
  13780. static createInstance() {
  13781. return (fgui.UIPackage.createObject("game", "Component58"));
  13782. }
  13783. onConstruct() {
  13784. this.n23 = (this.getChild("n23"));
  13785. this.n41 = (this.getChild("n41"));
  13786. this.n8 = (this.getChild("n8"));
  13787. this.skillList = (this.getChild("skillList"));
  13788. this.t0 = this.getTransition("t0");
  13789. }
  13790. }
  13791. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13792. class ui_Component59 extends fgui.GComponent {
  13793. static createInstance() {
  13794. return (fgui.UIPackage.createObject("game", "Component59"));
  13795. }
  13796. onConstruct() {
  13797. this.n3 = (this.getChild("n3"));
  13798. this.msgTxt = (this.getChild("msgTxt"));
  13799. this.t0 = this.getTransition("t0");
  13800. }
  13801. }
  13802. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13803. class ui_RulerNode extends fgui.GComponent {
  13804. static createInstance() {
  13805. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13806. }
  13807. onConstruct() {
  13808. this.n6 = (this.getChild("n6"));
  13809. this.n4 = (this.getChild("n4"));
  13810. this.img1 = (this.getChild("img1"));
  13811. this.img2 = (this.getChild("img2"));
  13812. }
  13813. }
  13814. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13815. class ui_Component108 extends fgui.GComponent {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Component108"));
  13818. }
  13819. onConstruct() {
  13820. this.n19 = (this.getChild("n19"));
  13821. this.t0 = this.getTransition("t0");
  13822. }
  13823. }
  13824. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13825. class ui_Component63 extends fgui.GComponent {
  13826. static createInstance() {
  13827. return (fgui.UIPackage.createObject("game", "Component63"));
  13828. }
  13829. onConstruct() {
  13830. this.n66 = (this.getChild("n66"));
  13831. this.n56 = (this.getChild("n56"));
  13832. this.n63 = (this.getChild("n63"));
  13833. this.n65 = (this.getChild("n65"));
  13834. this.t0 = this.getTransition("t0");
  13835. }
  13836. }
  13837. ui_Component63.URL = "ui://isxx5ak7h657452";
  13838. class ui_topNode extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "topNode"));
  13841. }
  13842. onConstruct() {
  13843. this.selfProgress = (this.getChild("selfProgress"));
  13844. this.aiProgress = (this.getChild("aiProgress"));
  13845. this.selfKuang = (this.getChild("selfKuang"));
  13846. this.aiKuang = (this.getChild("aiKuang"));
  13847. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13848. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13849. this.n33 = (this.getChild("n33"));
  13850. this.n34 = (this.getChild("n34"));
  13851. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13852. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13853. this.selfBallList = (this.getChild("selfBallList"));
  13854. this.aiBallList = (this.getChild("aiBallList"));
  13855. this.middleNode = (this.getChild("middleNode"));
  13856. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13857. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13858. this.scoreNode = (this.getChild("scoreNode"));
  13859. this.selfTips = (this.getChild("selfTips"));
  13860. this.aiTips = (this.getChild("aiTips"));
  13861. }
  13862. }
  13863. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13864. class ui_selfProgress extends fgui.GProgressBar {
  13865. static createInstance() {
  13866. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13867. }
  13868. onConstruct() {
  13869. this.n3 = (this.getChild("n3"));
  13870. this.bar = (this.getChild("bar"));
  13871. }
  13872. }
  13873. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13874. class ui_aiProgress extends fgui.GProgressBar {
  13875. static createInstance() {
  13876. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13877. }
  13878. onConstruct() {
  13879. this.n3 = (this.getChild("n3"));
  13880. this.bar = (this.getChild("bar"));
  13881. }
  13882. }
  13883. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13884. class ui_ballDisplay extends fgui.GComponent {
  13885. static createInstance() {
  13886. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13887. }
  13888. onConstruct() {
  13889. this.myImg = (this.getChild("myImg"));
  13890. }
  13891. }
  13892. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13893. class ui_moveNode extends fgui.GComponent {
  13894. static createInstance() {
  13895. return (fgui.UIPackage.createObject("game", "moveNode"));
  13896. }
  13897. onConstruct() {
  13898. this.n8 = (this.getChild("n8"));
  13899. this.finger = (this.getChild("finger"));
  13900. }
  13901. }
  13902. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13903. class ui_cancelBtn extends fgui.GButton {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13906. }
  13907. onConstruct() {
  13908. this.c1 = this.getController("c1");
  13909. this.n0 = (this.getChild("n0"));
  13910. this.n1 = (this.getChild("n1"));
  13911. }
  13912. }
  13913. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13914. class ui_shareBtn extends fgui.GButton {
  13915. static createInstance() {
  13916. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13917. }
  13918. onConstruct() {
  13919. this.c1 = this.getController("c1");
  13920. this.n2 = (this.getChild("n2"));
  13921. this.n1 = (this.getChild("n1"));
  13922. this.n3 = (this.getChild("n3"));
  13923. this.n4 = (this.getChild("n4"));
  13924. this.n5 = (this.getChild("n5"));
  13925. this.n6 = (this.getChild("n6"));
  13926. }
  13927. }
  13928. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13929. class ui_share2Btn extends fgui.GButton {
  13930. static createInstance() {
  13931. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13932. }
  13933. onConstruct() {
  13934. this.n3 = (this.getChild("n3"));
  13935. }
  13936. }
  13937. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13938. class ui_rodMethodNode extends fgui.GComponent {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13941. }
  13942. onConstruct() {
  13943. this.bg = (this.getChild("bg"));
  13944. this.dot = (this.getChild("dot"));
  13945. }
  13946. }
  13947. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13948. class ui_sureBtn extends fgui.GButton {
  13949. static createInstance() {
  13950. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13951. }
  13952. onConstruct() {
  13953. this.n2 = (this.getChild("n2"));
  13954. this.n1 = (this.getChild("n1"));
  13955. }
  13956. }
  13957. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13958. class ui_Component18 extends fgui.GComponent {
  13959. static createInstance() {
  13960. return (fgui.UIPackage.createObject("game", "Component18"));
  13961. }
  13962. onConstruct() {
  13963. this.c1 = this.getController("c1");
  13964. this.nameTxt = (this.getChild("nameTxt"));
  13965. this.headImg = (this.getChild("headImg"));
  13966. this.n24 = (this.getChild("n24"));
  13967. this.skillImg = (this.getChild("skillImg"));
  13968. this.skillTxt = (this.getChild("skillTxt"));
  13969. }
  13970. }
  13971. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13972. class ui_Component45 extends fgui.GComponent {
  13973. static createInstance() {
  13974. return (fgui.UIPackage.createObject("game", "Component45"));
  13975. }
  13976. onConstruct() {
  13977. this.c1 = this.getController("c1");
  13978. this.n40 = (this.getChild("n40"));
  13979. this.n41 = (this.getChild("n41"));
  13980. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13981. this.n42 = (this.getChild("n42"));
  13982. this.awardTxt = (this.getChild("awardTxt"));
  13983. this.n44 = (this.getChild("n44"));
  13984. this.t0 = this.getTransition("t0");
  13985. }
  13986. }
  13987. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13988. class ui_emotionDisplay extends fgui.GButton {
  13989. static createInstance() {
  13990. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13991. }
  13992. onConstruct() {
  13993. this.myIcon = (this.getChild("myIcon"));
  13994. }
  13995. }
  13996. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13997. class ui_Component49 extends fgui.GButton {
  13998. static createInstance() {
  13999. return (fgui.UIPackage.createObject("game", "Component49"));
  14000. }
  14001. onConstruct() {
  14002. this.n69 = (this.getChild("n69"));
  14003. this.n56 = (this.getChild("n56"));
  14004. }
  14005. }
  14006. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14007. class ui_Component50 extends fgui.GButton {
  14008. static createInstance() {
  14009. return (fgui.UIPackage.createObject("game", "Component50"));
  14010. }
  14011. onConstruct() {
  14012. this.n54 = (this.getChild("n54"));
  14013. this.n65 = (this.getChild("n65"));
  14014. }
  14015. }
  14016. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14017. class ui_Component51 extends fgui.GButton {
  14018. static createInstance() {
  14019. return (fgui.UIPackage.createObject("game", "Component51"));
  14020. }
  14021. onConstruct() {
  14022. this.c1 = this.getController("c1");
  14023. this.n51 = (this.getChild("n51"));
  14024. this.n54 = (this.getChild("n54"));
  14025. }
  14026. }
  14027. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14028. class ui_Button5 extends fgui.GButton {
  14029. static createInstance() {
  14030. return (fgui.UIPackage.createObject("game", "Button5"));
  14031. }
  14032. onConstruct() {
  14033. this.c1 = this.getController("c1");
  14034. this.n0 = (this.getChild("n0"));
  14035. this.n2 = (this.getChild("n2"));
  14036. }
  14037. }
  14038. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14039. class ui_Component124 extends fgui.GComponent {
  14040. static createInstance() {
  14041. return (fgui.UIPackage.createObject("game", "Component124"));
  14042. }
  14043. onConstruct() {
  14044. this.n22 = (this.getChild("n22"));
  14045. this.shareNode = (this.getChild("shareNode"));
  14046. }
  14047. }
  14048. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14049. class ui_Component125 extends fgui.GComponent {
  14050. static createInstance() {
  14051. return (fgui.UIPackage.createObject("game", "Component125"));
  14052. }
  14053. onConstruct() {
  14054. this.n29 = (this.getChild("n29"));
  14055. this.coinTxt = (this.getChild("coinTxt"));
  14056. }
  14057. }
  14058. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14059. class ui_Component52 extends fgui.GButton {
  14060. static createInstance() {
  14061. return (fgui.UIPackage.createObject("game", "Component52"));
  14062. }
  14063. onConstruct() {
  14064. this.n35 = (this.getChild("n35"));
  14065. this.n36 = (this.getChild("n36"));
  14066. }
  14067. }
  14068. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14069. class ui_Component_fl_1 extends fgui.GComponent {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14072. }
  14073. onConstruct() {
  14074. this.n0 = (this.getChild("n0"));
  14075. this.n6 = (this.getChild("n6"));
  14076. this.n7 = (this.getChild("n7"));
  14077. this.n8 = (this.getChild("n8"));
  14078. this.n5 = (this.getChild("n5"));
  14079. this.n9 = (this.getChild("n9"));
  14080. this.n10 = (this.getChild("n10"));
  14081. this.txt_price = (this.getChild("txt_price"));
  14082. this.n_no = (this.getChild("n_no"));
  14083. this.n_buy = (this.getChild("n_buy"));
  14084. }
  14085. }
  14086. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14087. class ui_Component_fl_2 extends fgui.GComponent {
  14088. static createInstance() {
  14089. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14090. }
  14091. onConstruct() {
  14092. this.n0 = (this.getChild("n0"));
  14093. this.txt_price = (this.getChild("txt_price"));
  14094. this.n4 = (this.getChild("n4"));
  14095. this.n6 = (this.getChild("n6"));
  14096. this.n7 = (this.getChild("n7"));
  14097. this.n5 = (this.getChild("n5"));
  14098. this.n8 = (this.getChild("n8"));
  14099. this.n9 = (this.getChild("n9"));
  14100. this.n_no = (this.getChild("n_no"));
  14101. this.n_buy = (this.getChild("n_buy"));
  14102. }
  14103. }
  14104. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14105. class ui_drawBtn extends fgui.GButton {
  14106. static createInstance() {
  14107. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14108. }
  14109. onConstruct() {
  14110. this.c1 = this.getController("c1");
  14111. this.n2 = (this.getChild("n2"));
  14112. this.n1 = (this.getChild("n1"));
  14113. this.n5 = (this.getChild("n5"));
  14114. }
  14115. }
  14116. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14117. class ui_Component43 extends fgui.GButton {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "Component43"));
  14120. }
  14121. onConstruct() {
  14122. this.n49 = (this.getChild("n49"));
  14123. }
  14124. }
  14125. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14126. class ui_wordsDisplay extends fgui.GComponent {
  14127. static createInstance() {
  14128. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14129. }
  14130. onConstruct() {
  14131. this.txt = (this.getChild("txt"));
  14132. this.n63 = (this.getChild("n63"));
  14133. }
  14134. }
  14135. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14136. class ui_Component_phb extends fgui.GComponent {
  14137. static createInstance() {
  14138. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14139. }
  14140. onConstruct() {
  14141. this.n3 = (this.getChild("n3"));
  14142. this.n4 = (this.getChild("n4"));
  14143. }
  14144. }
  14145. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14146. class ui_Component3 extends fgui.GComponent {
  14147. static createInstance() {
  14148. return (fgui.UIPackage.createObject("game", "Component3"));
  14149. }
  14150. onConstruct() {
  14151. this.n26 = (this.getChild("n26"));
  14152. this.n24 = (this.getChild("n24"));
  14153. this.nameTxt = (this.getChild("nameTxt"));
  14154. this.headRoot = (this.getChild("headRoot"));
  14155. }
  14156. }
  14157. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14158. class ui_Component4 extends fgui.GComponent {
  14159. static createInstance() {
  14160. return (fgui.UIPackage.createObject("game", "Component4"));
  14161. }
  14162. onConstruct() {
  14163. this.headImg = (this.getChild("headImg"));
  14164. }
  14165. }
  14166. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14167. class ui_Component7 extends fgui.GButton {
  14168. static createInstance() {
  14169. return (fgui.UIPackage.createObject("game", "Component7"));
  14170. }
  14171. onConstruct() {
  14172. this.n17 = (this.getChild("n17"));
  14173. }
  14174. }
  14175. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14176. class ui_Component8 extends fgui.GButton {
  14177. static createInstance() {
  14178. return (fgui.UIPackage.createObject("game", "Component8"));
  14179. }
  14180. onConstruct() {
  14181. this.n19 = (this.getChild("n19"));
  14182. }
  14183. }
  14184. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14185. class ui_Component10 extends fgui.GButton {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "Component10"));
  14188. }
  14189. onConstruct() {
  14190. this.c1 = this.getController("c1");
  14191. this.n40 = (this.getChild("n40"));
  14192. }
  14193. }
  14194. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14195. class ui_Component11 extends fgui.GButton {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "Component11"));
  14198. }
  14199. onConstruct() {
  14200. this.n34 = (this.getChild("n34"));
  14201. }
  14202. }
  14203. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14204. class ui_Component12 extends fgui.GButton {
  14205. static createInstance() {
  14206. return (fgui.UIPackage.createObject("game", "Component12"));
  14207. }
  14208. onConstruct() {
  14209. this.n35 = (this.getChild("n35"));
  14210. }
  14211. }
  14212. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14213. class ui_Component13 extends fgui.GButton {
  14214. static createInstance() {
  14215. return (fgui.UIPackage.createObject("game", "Component13"));
  14216. }
  14217. onConstruct() {
  14218. this.n27 = (this.getChild("n27"));
  14219. this.n36 = (this.getChild("n36"));
  14220. }
  14221. }
  14222. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14223. class ui_dh_js_tuowei extends fgui.GComponent {
  14224. static createInstance() {
  14225. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14226. }
  14227. onConstruct() {
  14228. this.n19 = (this.getChild("n19"));
  14229. this.n18 = (this.getChild("n18"));
  14230. this.n0 = (this.getChild("n0"));
  14231. this.n3 = (this.getChild("n3"));
  14232. this.n4 = (this.getChild("n4"));
  14233. this.n5 = (this.getChild("n5"));
  14234. this.n6 = (this.getChild("n6"));
  14235. this.n8 = (this.getChild("n8"));
  14236. this.n9 = (this.getChild("n9"));
  14237. this.n10 = (this.getChild("n10"));
  14238. this.n11 = (this.getChild("n11"));
  14239. this.n12 = (this.getChild("n12"));
  14240. this.n13 = (this.getChild("n13"));
  14241. this.n14 = (this.getChild("n14"));
  14242. this.n15 = (this.getChild("n15"));
  14243. this.n20 = (this.getChild("n20"));
  14244. this.t0 = this.getTransition("t0");
  14245. this.t1 = this.getTransition("t1");
  14246. }
  14247. }
  14248. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14249. class ui_dh_js_tw_g extends fgui.GComponent {
  14250. static createInstance() {
  14251. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14252. }
  14253. onConstruct() {
  14254. this.n0 = (this.getChild("n0"));
  14255. this.n1 = (this.getChild("n1"));
  14256. this.t0 = this.getTransition("t0");
  14257. }
  14258. }
  14259. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14260. class ui_dh_js_xingxing extends fgui.GComponent {
  14261. static createInstance() {
  14262. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14263. }
  14264. onConstruct() {
  14265. this.n1 = (this.getChild("n1"));
  14266. this.n2 = (this.getChild("n2"));
  14267. this.n3 = (this.getChild("n3"));
  14268. this.n4 = (this.getChild("n4"));
  14269. this.n0 = (this.getChild("n0"));
  14270. this.t2 = this.getTransition("t2");
  14271. this.t1 = this.getTransition("t1");
  14272. }
  14273. }
  14274. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14275. class ui_dh_zy_jiazai extends fgui.GComponent {
  14276. static createInstance() {
  14277. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14278. }
  14279. onConstruct() {
  14280. this.c1 = this.getController("c1");
  14281. this.n0 = (this.getChild("n0"));
  14282. this.n1 = (this.getChild("n1"));
  14283. this.n2 = (this.getChild("n2"));
  14284. this.n4 = (this.getChild("n4"));
  14285. this.n5 = (this.getChild("n5"));
  14286. this.n6 = (this.getChild("n6"));
  14287. this.n8 = (this.getChild("n8"));
  14288. this.n7 = (this.getChild("n7"));
  14289. this.t0 = this.getTransition("t0");
  14290. }
  14291. }
  14292. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14293. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14296. }
  14297. onConstruct() {
  14298. this.c1 = this.getController("c1");
  14299. this.n3 = (this.getChild("n3"));
  14300. this.n5 = (this.getChild("n5"));
  14301. this.n4 = (this.getChild("n4"));
  14302. this.n0 = (this.getChild("n0"));
  14303. this.n1 = (this.getChild("n1"));
  14304. this.n2 = (this.getChild("n2"));
  14305. }
  14306. }
  14307. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14308. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14309. static createInstance() {
  14310. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14311. }
  14312. onConstruct() {
  14313. this.n19 = (this.getChild("n19"));
  14314. this.n21 = (this.getChild("n21"));
  14315. this.n0 = (this.getChild("n0"));
  14316. this.n3 = (this.getChild("n3"));
  14317. this.n4 = (this.getChild("n4"));
  14318. this.n5 = (this.getChild("n5"));
  14319. this.n6 = (this.getChild("n6"));
  14320. this.n8 = (this.getChild("n8"));
  14321. this.n9 = (this.getChild("n9"));
  14322. this.n10 = (this.getChild("n10"));
  14323. this.n11 = (this.getChild("n11"));
  14324. this.n12 = (this.getChild("n12"));
  14325. this.n13 = (this.getChild("n13"));
  14326. this.n14 = (this.getChild("n14"));
  14327. this.n15 = (this.getChild("n15"));
  14328. this.n23 = (this.getChild("n23"));
  14329. this.t0 = this.getTransition("t0");
  14330. this.t1 = this.getTransition("t1");
  14331. }
  14332. }
  14333. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14334. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14335. static createInstance() {
  14336. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14337. }
  14338. onConstruct() {
  14339. this.n1 = (this.getChild("n1"));
  14340. this.n2 = (this.getChild("n2"));
  14341. this.t0 = this.getTransition("t0");
  14342. }
  14343. }
  14344. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14345. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14348. }
  14349. onConstruct() {
  14350. this.n4 = (this.getChild("n4"));
  14351. this.n2 = (this.getChild("n2"));
  14352. this.n3 = (this.getChild("n3"));
  14353. this.idle = this.getTransition("idle");
  14354. this.attack = this.getTransition("attack");
  14355. }
  14356. }
  14357. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14358. class ui_special extends fgui.GComponent {
  14359. static createInstance() {
  14360. return (fgui.UIPackage.createObject("game", "special"));
  14361. }
  14362. onConstruct() {
  14363. this.n18 = (this.getChild("n18"));
  14364. this.n19 = (this.getChild("n19"));
  14365. this.n20 = (this.getChild("n20"));
  14366. this.n21 = (this.getChild("n21"));
  14367. this.n22 = (this.getChild("n22"));
  14368. this.levelTxt = (this.getChild("levelTxt"));
  14369. this.n24 = (this.getChild("n24"));
  14370. this.n25 = (this.getChild("n25"));
  14371. this.t0 = this.getTransition("t0");
  14372. }
  14373. }
  14374. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14375. class ui_Component145 extends fgui.GComponent {
  14376. static createInstance() {
  14377. return (fgui.UIPackage.createObject("game", "Component145"));
  14378. }
  14379. onConstruct() {
  14380. this.guanyuNode = (this.getChild("guanyuNode"));
  14381. }
  14382. }
  14383. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14384. class ui_longBtn extends fgui.GButton {
  14385. static createInstance() {
  14386. return (fgui.UIPackage.createObject("game", "longBtn"));
  14387. }
  14388. onConstruct() {
  14389. this.c1 = this.getController("c1");
  14390. this.n2 = (this.getChild("n2"));
  14391. this.n1 = (this.getChild("n1"));
  14392. this.n4 = (this.getChild("n4"));
  14393. }
  14394. }
  14395. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14396. class ui_Component146 extends fgui.GComponent {
  14397. static createInstance() {
  14398. return (fgui.UIPackage.createObject("game", "Component146"));
  14399. }
  14400. onConstruct() {
  14401. this.n89 = (this.getChild("n89"));
  14402. this.n90 = (this.getChild("n90"));
  14403. this.guideBtn = (this.getChild("guideBtn"));
  14404. }
  14405. }
  14406. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14407. class ui_Component146_11 extends fgui.GComponent {
  14408. static createInstance() {
  14409. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14410. }
  14411. onConstruct() {
  14412. this.n89 = (this.getChild("n89"));
  14413. this.n90 = (this.getChild("n90"));
  14414. this.guideBtn = (this.getChild("guideBtn"));
  14415. }
  14416. }
  14417. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14418. class ui_Component111_1 extends fgui.GComponent {
  14419. static createInstance() {
  14420. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14421. }
  14422. onConstruct() {
  14423. this.n68 = (this.getChild("n68"));
  14424. this.myMask = (this.getChild("myMask"));
  14425. }
  14426. }
  14427. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14428. class ui_Component64_1 extends fgui.GComponent {
  14429. static createInstance() {
  14430. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14431. }
  14432. onConstruct() {
  14433. this.n57 = (this.getChild("n57"));
  14434. this.n54 = (this.getChild("n54"));
  14435. this.n55 = (this.getChild("n55"));
  14436. this.n56 = (this.getChild("n56"));
  14437. this.t1 = this.getTransition("t1");
  14438. }
  14439. }
  14440. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14441. class ui_ModeSelection_com123 extends fgui.GComponent {
  14442. static createInstance() {
  14443. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14444. }
  14445. onConstruct() {
  14446. this.type1 = (this.getChild("type1"));
  14447. this.type2 = (this.getChild("type2"));
  14448. this.type3 = (this.getChild("type3"));
  14449. this.n38 = (this.getChild("n38"));
  14450. this.t0 = this.getTransition("t0");
  14451. }
  14452. }
  14453. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14454. class ui_Component132_2 extends fgui.GComponent {
  14455. static createInstance() {
  14456. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14457. }
  14458. onConstruct() {
  14459. this.n25 = (this.getChild("n25"));
  14460. this.n26 = (this.getChild("n26"));
  14461. this.n27 = (this.getChild("n27"));
  14462. this.t0 = this.getTransition("t0");
  14463. }
  14464. }
  14465. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14466. class ui_UIPower$1 extends fgui.GComponent {
  14467. static createInstance() {
  14468. return (fgui.UIPackage.createObject("game", "UIPower"));
  14469. }
  14470. onConstruct() {
  14471. this.n11 = (this.getChild("n11"));
  14472. this.myNode = (this.getChild("myNode"));
  14473. this.t0 = this.getTransition("t0");
  14474. }
  14475. }
  14476. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14477. class ui_Component133 extends fgui.GComponent {
  14478. static createInstance() {
  14479. return (fgui.UIPackage.createObject("game", "Component133"));
  14480. }
  14481. onConstruct() {
  14482. this.n29 = (this.getChild("n29"));
  14483. this.n30 = (this.getChild("n30"));
  14484. }
  14485. }
  14486. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14487. class ui_Component134 extends fgui.GComponent {
  14488. static createInstance() {
  14489. return (fgui.UIPackage.createObject("game", "Component134"));
  14490. }
  14491. onConstruct() {
  14492. this.n30 = (this.getChild("n30"));
  14493. this.n31 = (this.getChild("n31"));
  14494. this.t0 = this.getTransition("t0");
  14495. }
  14496. }
  14497. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14498. class ui_Component135 extends fgui.GComponent {
  14499. static createInstance() {
  14500. return (fgui.UIPackage.createObject("game", "Component135"));
  14501. }
  14502. onConstruct() {
  14503. this.n30 = (this.getChild("n30"));
  14504. this.t0 = this.getTransition("t0");
  14505. }
  14506. }
  14507. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14508. class ui_Component137 extends fgui.GComponent {
  14509. static createInstance() {
  14510. return (fgui.UIPackage.createObject("game", "Component137"));
  14511. }
  14512. onConstruct() {
  14513. this.n28 = (this.getChild("n28"));
  14514. this.n29 = (this.getChild("n29"));
  14515. this.n30 = (this.getChild("n30"));
  14516. this.n32 = (this.getChild("n32"));
  14517. }
  14518. }
  14519. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14520. class ui_dh_zuanshi extends fgui.GButton {
  14521. static createInstance() {
  14522. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14523. }
  14524. onConstruct() {
  14525. this.n1 = (this.getChild("n1"));
  14526. this.n2 = (this.getChild("n2"));
  14527. this.n0 = (this.getChild("n0"));
  14528. this.n3 = (this.getChild("n3"));
  14529. this.n4 = (this.getChild("n4"));
  14530. }
  14531. }
  14532. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14533. class ui_Component138 extends fgui.GComponent {
  14534. static createInstance() {
  14535. return (fgui.UIPackage.createObject("game", "Component138"));
  14536. }
  14537. onConstruct() {
  14538. this.n1 = (this.getChild("n1"));
  14539. this.n2 = (this.getChild("n2"));
  14540. this.t0 = this.getTransition("t0");
  14541. }
  14542. }
  14543. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14544. class ui_Component139 extends fgui.GComponent {
  14545. static createInstance() {
  14546. return (fgui.UIPackage.createObject("game", "Component139"));
  14547. }
  14548. onConstruct() {
  14549. this.n0 = (this.getChild("n0"));
  14550. this.t0 = this.getTransition("t0");
  14551. }
  14552. }
  14553. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14554. class ui_Component140 extends fgui.GComponent {
  14555. static createInstance() {
  14556. return (fgui.UIPackage.createObject("game", "Component140"));
  14557. }
  14558. onConstruct() {
  14559. this.n2 = (this.getChild("n2"));
  14560. this.n3 = (this.getChild("n3"));
  14561. this.t0 = this.getTransition("t0");
  14562. }
  14563. }
  14564. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14565. class ui_Component141 extends fgui.GComponent {
  14566. static createInstance() {
  14567. return (fgui.UIPackage.createObject("game", "Component141"));
  14568. }
  14569. onConstruct() {
  14570. this.n0 = (this.getChild("n0"));
  14571. this.t0 = this.getTransition("t0");
  14572. }
  14573. }
  14574. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14575. class ui_powerNode extends fgui.GProgressBar {
  14576. static createInstance() {
  14577. return (fgui.UIPackage.createObject("game", "powerNode"));
  14578. }
  14579. onConstruct() {
  14580. this.n2 = (this.getChild("n2"));
  14581. this.bar_v = (this.getChild("bar_v"));
  14582. this.showImg = (this.getChild("showImg"));
  14583. this.n12 = (this.getChild("n12"));
  14584. }
  14585. }
  14586. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14587. class ui_dh_jingbi1 extends fgui.GComponent {
  14588. static createInstance() {
  14589. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14590. }
  14591. onConstruct() {
  14592. this.n0 = (this.getChild("n0"));
  14593. this.n1 = (this.getChild("n1"));
  14594. this.n2 = (this.getChild("n2"));
  14595. this.n3 = (this.getChild("n3"));
  14596. this.n4 = (this.getChild("n4"));
  14597. this.n5 = (this.getChild("n5"));
  14598. this.n6 = (this.getChild("n6"));
  14599. this.n8 = (this.getChild("n8"));
  14600. this.t0 = this.getTransition("t0");
  14601. }
  14602. }
  14603. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14604. class ui_Component94 extends fgui.GButton {
  14605. static createInstance() {
  14606. return (fgui.UIPackage.createObject("game", "Component94"));
  14607. }
  14608. onConstruct() {
  14609. this.n77 = (this.getChild("n77"));
  14610. }
  14611. }
  14612. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14613. class ui_Component95 extends fgui.GButton {
  14614. static createInstance() {
  14615. return (fgui.UIPackage.createObject("game", "Component95"));
  14616. }
  14617. onConstruct() {
  14618. this.n77 = (this.getChild("n77"));
  14619. }
  14620. }
  14621. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14622. class ui_Component126 extends fgui.GComponent {
  14623. static createInstance() {
  14624. return (fgui.UIPackage.createObject("game", "Component126"));
  14625. }
  14626. onConstruct() {
  14627. this.c1 = this.getController("c1");
  14628. this.normalBtn = (this.getChild("normalBtn"));
  14629. this.tripleBtn = (this.getChild("tripleBtn"));
  14630. }
  14631. }
  14632. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14633. class ui_Component60 extends fgui.GComponent {
  14634. static createInstance() {
  14635. return (fgui.UIPackage.createObject("game", "Component60"));
  14636. }
  14637. onConstruct() {
  14638. this.c1 = this.getController("c1");
  14639. this.n48 = (this.getChild("n48"));
  14640. this.womanTxt = (this.getChild("womanTxt"));
  14641. this.t0 = this.getTransition("t0");
  14642. }
  14643. }
  14644. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14645. class ui_Component_fuli1 extends fgui.GComponent {
  14646. static createInstance() {
  14647. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14648. }
  14649. onConstruct() {
  14650. this.n0 = (this.getChild("n0"));
  14651. }
  14652. }
  14653. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14654. class ui_Button_h extends fgui.GButton {
  14655. static createInstance() {
  14656. return (fgui.UIPackage.createObject("game", "Button_h"));
  14657. }
  14658. onConstruct() {
  14659. this.button = this.getController("button");
  14660. this.n0 = (this.getChild("n0"));
  14661. this.n1 = (this.getChild("n1"));
  14662. }
  14663. }
  14664. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14665. class ui_Button_lv extends fgui.GButton {
  14666. static createInstance() {
  14667. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14668. }
  14669. onConstruct() {
  14670. this.button = this.getController("button");
  14671. this.n0 = (this.getChild("n0"));
  14672. this.n1 = (this.getChild("n1"));
  14673. }
  14674. }
  14675. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14676. class ui_Component98_3 extends fgui.GButton {
  14677. static createInstance() {
  14678. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14679. }
  14680. onConstruct() {
  14681. this.c1 = this.getController("c1");
  14682. this.n8 = (this.getChild("n8"));
  14683. this.n41 = (this.getChild("n41"));
  14684. this.n40 = (this.getChild("n40"));
  14685. }
  14686. }
  14687. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14688. class ui_ModeSelection_com1 extends fgui.GButton {
  14689. static createInstance() {
  14690. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14691. }
  14692. onConstruct() {
  14693. this.n34 = (this.getChild("n34"));
  14694. this.n36 = (this.getChild("n36"));
  14695. this.n22 = (this.getChild("n22"));
  14696. this.n20 = (this.getChild("n20"));
  14697. this.n23 = (this.getChild("n23"));
  14698. this.n24 = (this.getChild("n24"));
  14699. this.n26 = (this.getChild("n26"));
  14700. this.n33 = (this.getChild("n33"));
  14701. this.coinImg = (this.getChild("coinImg"));
  14702. this.need = (this.getChild("need"));
  14703. this.n35 = (this.getChild("n35"));
  14704. this.n29 = (this.getChild("n29"));
  14705. this.tipsTxt = (this.getChild("tipsTxt"));
  14706. this.n30 = (this.getChild("n30"));
  14707. this.peopleTxt = (this.getChild("peopleTxt"));
  14708. this.t0 = this.getTransition("t0");
  14709. }
  14710. }
  14711. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14712. class ui_ModeSelection_com2 extends fgui.GButton {
  14713. static createInstance() {
  14714. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14715. }
  14716. onConstruct() {
  14717. this.n36 = (this.getChild("n36"));
  14718. this.n34 = (this.getChild("n34"));
  14719. this.n22 = (this.getChild("n22"));
  14720. this.n20 = (this.getChild("n20"));
  14721. this.n23 = (this.getChild("n23"));
  14722. this.n24 = (this.getChild("n24"));
  14723. this.n26 = (this.getChild("n26"));
  14724. this.n33 = (this.getChild("n33"));
  14725. this.coinImg = (this.getChild("coinImg"));
  14726. this.need = (this.getChild("need"));
  14727. this.n35 = (this.getChild("n35"));
  14728. this.n29 = (this.getChild("n29"));
  14729. this.tipsTxt = (this.getChild("tipsTxt"));
  14730. this.n30 = (this.getChild("n30"));
  14731. this.peopleTxt = (this.getChild("peopleTxt"));
  14732. this.t0 = this.getTransition("t0");
  14733. }
  14734. }
  14735. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14736. class ui_ModeSelection_com3 extends fgui.GButton {
  14737. static createInstance() {
  14738. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14739. }
  14740. onConstruct() {
  14741. this.n34 = (this.getChild("n34"));
  14742. this.n36 = (this.getChild("n36"));
  14743. this.n22 = (this.getChild("n22"));
  14744. this.n20 = (this.getChild("n20"));
  14745. this.n23 = (this.getChild("n23"));
  14746. this.n24 = (this.getChild("n24"));
  14747. this.n26 = (this.getChild("n26"));
  14748. this.n33 = (this.getChild("n33"));
  14749. this.coinImg = (this.getChild("coinImg"));
  14750. this.need = (this.getChild("need"));
  14751. this.n35 = (this.getChild("n35"));
  14752. this.n29 = (this.getChild("n29"));
  14753. this.tipsTxt = (this.getChild("tipsTxt"));
  14754. this.n30 = (this.getChild("n30"));
  14755. this.peopleTxt = (this.getChild("peopleTxt"));
  14756. this.t0 = this.getTransition("t0");
  14757. }
  14758. }
  14759. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14760. class ui_Invitation_com1 extends fgui.GComponent {
  14761. static createInstance() {
  14762. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14763. }
  14764. onConstruct() {
  14765. this.n14 = (this.getChild("n14"));
  14766. this.n13 = (this.getChild("n13"));
  14767. this.n3 = (this.getChild("n3"));
  14768. this.n1 = (this.getChild("n1"));
  14769. this.n6 = (this.getChild("n6"));
  14770. this.n7 = (this.getChild("n7"));
  14771. this.enterBtn = (this.getChild("enterBtn"));
  14772. this.n11 = (this.getChild("n11"));
  14773. this.n12 = (this.getChild("n12"));
  14774. this.n15 = (this.getChild("n15"));
  14775. this.t0 = this.getTransition("t0");
  14776. this.t1 = this.getTransition("t1");
  14777. }
  14778. }
  14779. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14780. class ui_Component87_1 extends fgui.GComponent {
  14781. static createInstance() {
  14782. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14783. }
  14784. onConstruct() {
  14785. this.n74 = (this.getChild("n74"));
  14786. this.n73 = (this.getChild("n73"));
  14787. this.ballTxt = (this.getChild("ballTxt"));
  14788. this.n76 = (this.getChild("n76"));
  14789. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14790. this.levelTxt = (this.getChild("levelTxt"));
  14791. this.n87 = (this.getChild("n87"));
  14792. this.n84 = (this.getChild("n84"));
  14793. this.hpTxt = (this.getChild("hpTxt"));
  14794. this.n89 = (this.getChild("n89"));
  14795. this.tipsTxt = (this.getChild("tipsTxt"));
  14796. }
  14797. }
  14798. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14799. class ui_sqg1 extends fgui.GComponent {
  14800. static createInstance() {
  14801. return (fgui.UIPackage.createObject("game", "sqg1"));
  14802. }
  14803. onConstruct() {
  14804. this.n1 = (this.getChild("n1"));
  14805. this.n0 = (this.getChild("n0"));
  14806. }
  14807. }
  14808. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14809. class ui_sqg2 extends fgui.GComponent {
  14810. static createInstance() {
  14811. return (fgui.UIPackage.createObject("game", "sqg2"));
  14812. }
  14813. onConstruct() {
  14814. this.n1 = (this.getChild("n1"));
  14815. this.n0 = (this.getChild("n0"));
  14816. }
  14817. }
  14818. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14819. class ui_sqg3 extends fgui.GComponent {
  14820. static createInstance() {
  14821. return (fgui.UIPackage.createObject("game", "sqg3"));
  14822. }
  14823. onConstruct() {
  14824. this.n1 = (this.getChild("n1"));
  14825. this.n0 = (this.getChild("n0"));
  14826. }
  14827. }
  14828. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14829. class ui_sqg4 extends fgui.GComponent {
  14830. static createInstance() {
  14831. return (fgui.UIPackage.createObject("game", "sqg4"));
  14832. }
  14833. onConstruct() {
  14834. this.n1 = (this.getChild("n1"));
  14835. this.n0 = (this.getChild("n0"));
  14836. }
  14837. }
  14838. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14839. class ui_Component36 extends fgui.GButton {
  14840. static createInstance() {
  14841. return (fgui.UIPackage.createObject("game", "Component36"));
  14842. }
  14843. onConstruct() {
  14844. this.c1 = this.getController("c1");
  14845. this.n53 = (this.getChild("n53"));
  14846. this.n56 = (this.getChild("n56"));
  14847. }
  14848. }
  14849. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14850. class ui_Component37 extends fgui.GButton {
  14851. static createInstance() {
  14852. return (fgui.UIPackage.createObject("game", "Component37"));
  14853. }
  14854. onConstruct() {
  14855. this.c1 = this.getController("c1");
  14856. this.n52 = (this.getChild("n52"));
  14857. this.n54 = (this.getChild("n54"));
  14858. }
  14859. }
  14860. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14861. class ui_UISetting extends fgui.GComponent {
  14862. static createInstance() {
  14863. return (fgui.UIPackage.createObject("game", "UISetting"));
  14864. }
  14865. onConstruct() {
  14866. this.c1 = this.getController("c1");
  14867. this.n4 = (this.getChild("n4"));
  14868. this.soundBtn = (this.getChild("soundBtn"));
  14869. this.shakeBtn = (this.getChild("shakeBtn"));
  14870. this.clickNode = (this.getChild("clickNode"));
  14871. this.xyBtn = (this.getChild("xyBtn"));
  14872. }
  14873. }
  14874. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14875. class ui_Component39 extends fgui.GComponent {
  14876. static createInstance() {
  14877. return (fgui.UIPackage.createObject("game", "Component39"));
  14878. }
  14879. onConstruct() {
  14880. this.n5 = (this.getChild("n5"));
  14881. this.n6 = (this.getChild("n6"));
  14882. this.n7 = (this.getChild("n7"));
  14883. this.t0 = this.getTransition("t0");
  14884. }
  14885. }
  14886. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14887. class ui_Component40 extends fgui.GButton {
  14888. static createInstance() {
  14889. return (fgui.UIPackage.createObject("game", "Component40"));
  14890. }
  14891. onConstruct() {
  14892. this.n46 = (this.getChild("n46"));
  14893. this.n47 = (this.getChild("n47"));
  14894. }
  14895. }
  14896. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14897. class ui_Component41 extends fgui.GComponent {
  14898. static createInstance() {
  14899. return (fgui.UIPackage.createObject("game", "Component41"));
  14900. }
  14901. onConstruct() {
  14902. this.c1 = this.getController("c1");
  14903. this.n0 = (this.getChild("n0"));
  14904. this.titleTxt = (this.getChild("titleTxt"));
  14905. this.n2 = (this.getChild("n2"));
  14906. this.msgTips = (this.getChild("msgTips"));
  14907. this.numTxt = (this.getChild("numTxt"));
  14908. this.n18 = (this.getChild("n18"));
  14909. this.cancelBtn = (this.getChild("cancelBtn"));
  14910. this.videoBtn = (this.getChild("videoBtn"));
  14911. this.n10 = (this.getChild("n10"));
  14912. }
  14913. }
  14914. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14915. class ui_Component42 extends fgui.GComponent {
  14916. static createInstance() {
  14917. return (fgui.UIPackage.createObject("game", "Component42"));
  14918. }
  14919. onConstruct() {
  14920. this.c1 = this.getController("c1");
  14921. this.n1 = (this.getChild("n1"));
  14922. this.n2 = (this.getChild("n2"));
  14923. this.n3 = (this.getChild("n3"));
  14924. this.tipsTxt = (this.getChild("tipsTxt"));
  14925. this.cancelBtn = (this.getChild("cancelBtn"));
  14926. this.sureBtn = (this.getChild("sureBtn"));
  14927. this.n11 = (this.getChild("n11"));
  14928. this.n13 = (this.getChild("n13"));
  14929. this.n14 = (this.getChild("n14"));
  14930. this.womanTxt = (this.getChild("womanTxt"));
  14931. this.t0 = this.getTransition("t0");
  14932. }
  14933. }
  14934. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14935. class ui_dh_js_shengli extends fgui.GComponent {
  14936. static createInstance() {
  14937. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14938. }
  14939. onConstruct() {
  14940. this.n3 = (this.getChild("n3"));
  14941. this.n4 = (this.getChild("n4"));
  14942. this.n1 = (this.getChild("n1"));
  14943. this.n2 = (this.getChild("n2"));
  14944. this.n5 = (this.getChild("n5"));
  14945. this.n6 = (this.getChild("n6"));
  14946. this.n7 = (this.getChild("n7"));
  14947. this.n8 = (this.getChild("n8"));
  14948. this.attack = this.getTransition("attack");
  14949. this.idle = this.getTransition("idle");
  14950. }
  14951. }
  14952. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14953. class ui_dh_js_shengli_g extends fgui.GComponent {
  14954. static createInstance() {
  14955. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14956. }
  14957. onConstruct() {
  14958. this.n3 = (this.getChild("n3"));
  14959. this.n1 = (this.getChild("n1"));
  14960. this.t0 = this.getTransition("t0");
  14961. }
  14962. }
  14963. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14964. class ui_dh_js_shibai extends fgui.GComponent {
  14965. static createInstance() {
  14966. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14967. }
  14968. onConstruct() {
  14969. this.n0 = (this.getChild("n0"));
  14970. this.n1 = (this.getChild("n1"));
  14971. this.n2 = (this.getChild("n2"));
  14972. this.n3 = (this.getChild("n3"));
  14973. this.idle = this.getTransition("idle");
  14974. this.attack = this.getTransition("attack");
  14975. }
  14976. }
  14977. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14978. class ui_dh_zy_ganfa extends fgui.GButton {
  14979. static createInstance() {
  14980. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14981. }
  14982. onConstruct() {
  14983. this.n0 = (this.getChild("n0"));
  14984. }
  14985. }
  14986. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14987. class ui_dh_zy_sc_guang extends fgui.GButton {
  14988. static createInstance() {
  14989. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14990. }
  14991. onConstruct() {
  14992. this.n0 = (this.getChild("n0"));
  14993. this.n2 = (this.getChild("n2"));
  14994. }
  14995. }
  14996. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14997. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14998. static createInstance() {
  14999. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15000. }
  15001. onConstruct() {
  15002. this.n0 = (this.getChild("n0"));
  15003. this.n3 = (this.getChild("n3"));
  15004. this.t0 = this.getTransition("t0");
  15005. }
  15006. }
  15007. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15008. class ui_dh_zy_wanfa extends fgui.GButton {
  15009. static createInstance() {
  15010. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15011. }
  15012. onConstruct() {
  15013. this.n0 = (this.getChild("n0"));
  15014. }
  15015. }
  15016. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15017. class ui_Button_login extends fgui.GButton {
  15018. static createInstance() {
  15019. return (fgui.UIPackage.createObject("game", "Button_login"));
  15020. }
  15021. onConstruct() {
  15022. this.button = this.getController("button");
  15023. this.n5 = (this.getChild("n5"));
  15024. this.n3 = (this.getChild("n3"));
  15025. }
  15026. }
  15027. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15028. class ui_Component53_1 extends fgui.GComponent {
  15029. static createInstance() {
  15030. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15031. }
  15032. onConstruct() {
  15033. this.n0 = (this.getChild("n0"));
  15034. this.n1 = (this.getChild("n1"));
  15035. this.n2 = (this.getChild("n2"));
  15036. this.n3 = (this.getChild("n3"));
  15037. this.n4 = (this.getChild("n4"));
  15038. this.n5 = (this.getChild("n5"));
  15039. this.n6 = (this.getChild("n6"));
  15040. this.n7 = (this.getChild("n7"));
  15041. this.n8 = (this.getChild("n8"));
  15042. this.n9 = (this.getChild("n9"));
  15043. this.n10 = (this.getChild("n10"));
  15044. this.n11 = (this.getChild("n11"));
  15045. this.n12 = (this.getChild("n12"));
  15046. this.n13 = (this.getChild("n13"));
  15047. this.n14 = (this.getChild("n14"));
  15048. this.n15 = (this.getChild("n15"));
  15049. this.n16 = (this.getChild("n16"));
  15050. this.n19 = (this.getChild("n19"));
  15051. this.n20 = (this.getChild("n20"));
  15052. this.n21 = (this.getChild("n21"));
  15053. this.n22 = (this.getChild("n22"));
  15054. this.n23 = (this.getChild("n23"));
  15055. this.n24 = (this.getChild("n24"));
  15056. this.n25 = (this.getChild("n25"));
  15057. this.n26 = (this.getChild("n26"));
  15058. this.n27 = (this.getChild("n27"));
  15059. this.n28 = (this.getChild("n28"));
  15060. this.n29 = (this.getChild("n29"));
  15061. this.n30 = (this.getChild("n30"));
  15062. this.n31 = (this.getChild("n31"));
  15063. this.n32 = (this.getChild("n32"));
  15064. this.n33 = (this.getChild("n33"));
  15065. this.n34 = (this.getChild("n34"));
  15066. this.n35 = (this.getChild("n35"));
  15067. this.t0 = this.getTransition("t0");
  15068. }
  15069. }
  15070. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15071. class ui_Component30 extends fgui.GComponent {
  15072. static createInstance() {
  15073. return (fgui.UIPackage.createObject("game", "Component30"));
  15074. }
  15075. onConstruct() {
  15076. this.c1 = this.getController("c1");
  15077. this.n46 = (this.getChild("n46"));
  15078. this.n47 = (this.getChild("n47"));
  15079. this.numTxt = (this.getChild("numTxt"));
  15080. this.n50 = (this.getChild("n50"));
  15081. this.n53 = (this.getChild("n53"));
  15082. this.n54 = (this.getChild("n54"));
  15083. this.n55 = (this.getChild("n55"));
  15084. this.n56 = (this.getChild("n56"));
  15085. }
  15086. }
  15087. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15088. class ui_Component30_1 extends fgui.GComponent {
  15089. static createInstance() {
  15090. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15091. }
  15092. onConstruct() {
  15093. this.c1 = this.getController("c1");
  15094. this.n46 = (this.getChild("n46"));
  15095. this.n47 = (this.getChild("n47"));
  15096. this.numTxt = (this.getChild("numTxt"));
  15097. this.n50 = (this.getChild("n50"));
  15098. this.n51 = (this.getChild("n51"));
  15099. this.n52 = (this.getChild("n52"));
  15100. this.n53 = (this.getChild("n53"));
  15101. this.n54 = (this.getChild("n54"));
  15102. }
  15103. }
  15104. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15105. class ui_Component31 extends fgui.GComponent {
  15106. static createInstance() {
  15107. return (fgui.UIPackage.createObject("game", "Component31"));
  15108. }
  15109. onConstruct() {
  15110. this.n55 = (this.getChild("n55"));
  15111. this.n54 = (this.getChild("n54"));
  15112. this.conditionTxt = (this.getChild("conditionTxt"));
  15113. this.n57 = (this.getChild("n57"));
  15114. this.t0 = this.getTransition("t0");
  15115. }
  15116. }
  15117. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15118. class ui_Component32 extends fgui.GComponent {
  15119. static createInstance() {
  15120. return (fgui.UIPackage.createObject("game", "Component32"));
  15121. }
  15122. onConstruct() {
  15123. this.n5 = (this.getChild("n5"));
  15124. this.n6 = (this.getChild("n6"));
  15125. this.n7 = (this.getChild("n7"));
  15126. this.t0 = this.getTransition("t0");
  15127. }
  15128. }
  15129. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15130. class ui_AwardItem extends fgui.GComponent {
  15131. static createInstance() {
  15132. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15133. }
  15134. onConstruct() {
  15135. this.n9 = (this.getChild("n9"));
  15136. this.myIcon = (this.getChild("myIcon"));
  15137. this.numTxt = (this.getChild("numTxt"));
  15138. this.nameTxt = (this.getChild("nameTxt"));
  15139. this.n16 = (this.getChild("n16"));
  15140. this.n17 = (this.getChild("n17"));
  15141. }
  15142. }
  15143. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15144. class ui_ranking_com1 extends fgui.GButton {
  15145. static createInstance() {
  15146. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15147. }
  15148. onConstruct() {
  15149. this.c1 = this.getController("c1");
  15150. this.n49 = (this.getChild("n49"));
  15151. this.n18 = (this.getChild("n18"));
  15152. this.n46 = (this.getChild("n46"));
  15153. this.n48 = (this.getChild("n48"));
  15154. this.n50 = (this.getChild("n50"));
  15155. }
  15156. }
  15157. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15158. class ui_ranking_com2 extends fgui.GButton {
  15159. static createInstance() {
  15160. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15161. }
  15162. onConstruct() {
  15163. this.c1 = this.getController("c1");
  15164. this.n49 = (this.getChild("n49"));
  15165. this.n18 = (this.getChild("n18"));
  15166. this.n46 = (this.getChild("n46"));
  15167. this.n48 = (this.getChild("n48"));
  15168. this.n50 = (this.getChild("n50"));
  15169. }
  15170. }
  15171. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15172. class ui_ranking_com3 extends fgui.GComponent {
  15173. static createInstance() {
  15174. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15175. }
  15176. onConstruct() {
  15177. this.n17 = (this.getChild("n17"));
  15178. this.myIcon = (this.getChild("myIcon"));
  15179. }
  15180. }
  15181. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15182. class ui_ranking_com4 extends fgui.GComponent {
  15183. static createInstance() {
  15184. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15185. }
  15186. onConstruct() {
  15187. this.n16 = (this.getChild("n16"));
  15188. this.head = (this.getChild("head"));
  15189. }
  15190. }
  15191. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15192. class ui_ranking_com5 extends fgui.GComponent {
  15193. static createInstance() {
  15194. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15195. }
  15196. onConstruct() {
  15197. this.c1 = this.getController("c1");
  15198. this.c2 = this.getController("c2");
  15199. this.n2 = (this.getChild("n2"));
  15200. this.n3 = (this.getChild("n3"));
  15201. this.levelBtn = (this.getChild("levelBtn"));
  15202. this.starBtn = (this.getChild("starBtn"));
  15203. this.n23 = (this.getChild("n23"));
  15204. this.n24 = (this.getChild("n24"));
  15205. this.n25 = (this.getChild("n25"));
  15206. this.myList = (this.getChild("myList"));
  15207. this.selfNode = (this.getChild("selfNode"));
  15208. this.n9 = (this.getChild("n9"));
  15209. this.n12 = (this.getChild("n12"));
  15210. this.n13 = (this.getChild("n13"));
  15211. this.n14 = (this.getChild("n14"));
  15212. this.n39 = (this.getChild("n39"));
  15213. this.n41 = (this.getChild("n41"));
  15214. this.n42 = (this.getChild("n42"));
  15215. this.n45 = (this.getChild("n45"));
  15216. this.changeBtn = (this.getChild("changeBtn"));
  15217. this.closeBtn = (this.getChild("closeBtn"));
  15218. this.t0 = this.getTransition("t0");
  15219. }
  15220. }
  15221. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15222. class ui_RankItem extends fgui.GComponent {
  15223. static createInstance() {
  15224. return (fgui.UIPackage.createObject("game", "RankItem"));
  15225. }
  15226. onConstruct() {
  15227. this.n10 = (this.getChild("n10"));
  15228. this.n11 = (this.getChild("n11"));
  15229. this.rankTxt = (this.getChild("rankTxt"));
  15230. this.headNode = (this.getChild("headNode"));
  15231. this.nameTxt = (this.getChild("nameTxt"));
  15232. this.n19 = (this.getChild("n19"));
  15233. this.valueTxt = (this.getChild("valueTxt"));
  15234. this.img1 = (this.getChild("img1"));
  15235. this.img2 = (this.getChild("img2"));
  15236. this.img3 = (this.getChild("img3"));
  15237. }
  15238. }
  15239. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15240. class ui_ranking_com9 extends fgui.GComponent {
  15241. static createInstance() {
  15242. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15243. }
  15244. onConstruct() {
  15245. this.c1 = this.getController("c1");
  15246. this.n27 = (this.getChild("n27"));
  15247. this.n28 = (this.getChild("n28"));
  15248. this.headNode = (this.getChild("headNode"));
  15249. this.rankTxt = (this.getChild("rankTxt"));
  15250. this.nameTxt = (this.getChild("nameTxt"));
  15251. this.n34 = (this.getChild("n34"));
  15252. this.valueTxt = (this.getChild("valueTxt"));
  15253. this.n36 = (this.getChild("n36"));
  15254. this.n37 = (this.getChild("n37"));
  15255. this.n38 = (this.getChild("n38"));
  15256. this.n39 = (this.getChild("n39"));
  15257. this.n40 = (this.getChild("n40"));
  15258. }
  15259. }
  15260. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15261. class ui_ranking_com10 extends fgui.GComponent {
  15262. static createInstance() {
  15263. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15264. }
  15265. onConstruct() {
  15266. this.n23 = (this.getChild("n23"));
  15267. this.n24 = (this.getChild("n24"));
  15268. }
  15269. }
  15270. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15271. class ui_ranking_com11 extends fgui.GComponent {
  15272. static createInstance() {
  15273. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15274. }
  15275. onConstruct() {
  15276. this.n24 = (this.getChild("n24"));
  15277. this.n25 = (this.getChild("n25"));
  15278. this.t0 = this.getTransition("t0");
  15279. }
  15280. }
  15281. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15282. class ui_ranking_com13 extends fgui.GButton {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15285. }
  15286. onConstruct() {
  15287. this.c1 = this.getController("c1");
  15288. this.n44 = (this.getChild("n44"));
  15289. this.n45 = (this.getChild("n45"));
  15290. this.n46 = (this.getChild("n46"));
  15291. }
  15292. }
  15293. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15294. class ui_Component_dl_zc extends fgui.GButton {
  15295. static createInstance() {
  15296. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15297. }
  15298. onConstruct() {
  15299. this.c1 = this.getController("c1");
  15300. this.n0 = (this.getChild("n0"));
  15301. }
  15302. }
  15303. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15304. class ui_Component122 extends fgui.GComponent {
  15305. static createInstance() {
  15306. return (fgui.UIPackage.createObject("game", "Component122"));
  15307. }
  15308. onConstruct() {
  15309. this.gameNode3 = (this.getChild("gameNode3"));
  15310. }
  15311. }
  15312. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15313. class ui_skillItem extends fgui.GComponent {
  15314. static createInstance() {
  15315. return (fgui.UIPackage.createObject("game", "skillItem"));
  15316. }
  15317. onConstruct() {
  15318. this.c1 = this.getController("c1");
  15319. this.n31 = (this.getChild("n31"));
  15320. this.n6 = (this.getChild("n6"));
  15321. this.skillImg = (this.getChild("skillImg"));
  15322. this.nameTxt = (this.getChild("nameTxt"));
  15323. this.levelTxt = (this.getChild("levelTxt"));
  15324. this.n28 = (this.getChild("n28"));
  15325. this.describeTxt = (this.getChild("describeTxt"));
  15326. this.n32 = (this.getChild("n32"));
  15327. this.mutiBtn = (this.getChild("mutiBtn"));
  15328. this.tryNode = (this.getChild("tryNode"));
  15329. this.normalBtn = (this.getChild("normalBtn"));
  15330. this.startBtn = (this.getChild("startBtn"));
  15331. this.n42 = (this.getChild("n42"));
  15332. this.n43 = (this.getChild("n43"));
  15333. this.n44 = (this.getChild("n44"));
  15334. }
  15335. }
  15336. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15337. class ui_Component26 extends fgui.GButton {
  15338. static createInstance() {
  15339. return (fgui.UIPackage.createObject("game", "Component26"));
  15340. }
  15341. onConstruct() {
  15342. this.n11 = (this.getChild("n11"));
  15343. this.n30 = (this.getChild("n30"));
  15344. this.n34 = (this.getChild("n34"));
  15345. }
  15346. }
  15347. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15348. class ui_Component28 extends fgui.GButton {
  15349. static createInstance() {
  15350. return (fgui.UIPackage.createObject("game", "Component28"));
  15351. }
  15352. onConstruct() {
  15353. this.n12 = (this.getChild("n12"));
  15354. this.n31 = (this.getChild("n31"));
  15355. this.curTxt = (this.getChild("curTxt"));
  15356. this.n33 = (this.getChild("n33"));
  15357. }
  15358. }
  15359. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15360. class ui_Component1302 extends fgui.GComponent {
  15361. static createInstance() {
  15362. return (fgui.UIPackage.createObject("game", "Component1302"));
  15363. }
  15364. onConstruct() {
  15365. this.n2 = (this.getChild("n2"));
  15366. this.n3 = (this.getChild("n3"));
  15367. }
  15368. }
  15369. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15370. class ui_Component113 extends fgui.GComponent {
  15371. static createInstance() {
  15372. return (fgui.UIPackage.createObject("game", "Component113"));
  15373. }
  15374. onConstruct() {
  15375. this.n85 = (this.getChild("n85"));
  15376. this.n86 = (this.getChild("n86"));
  15377. this.n77 = (this.getChild("n77"));
  15378. this.n79 = (this.getChild("n79"));
  15379. this.n80 = (this.getChild("n80"));
  15380. this.n81 = (this.getChild("n81"));
  15381. this.n82 = (this.getChild("n82"));
  15382. this.n84 = (this.getChild("n84"));
  15383. this.n87 = (this.getChild("n87"));
  15384. this.t0 = this.getTransition("t0");
  15385. }
  15386. }
  15387. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15388. class ui_Component114 extends fgui.GComponent {
  15389. static createInstance() {
  15390. return (fgui.UIPackage.createObject("game", "Component114"));
  15391. }
  15392. onConstruct() {
  15393. this.n77 = (this.getChild("n77"));
  15394. this.t0 = this.getTransition("t0");
  15395. }
  15396. }
  15397. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15398. class ui_Component115 extends fgui.GComponent {
  15399. static createInstance() {
  15400. return (fgui.UIPackage.createObject("game", "Component115"));
  15401. }
  15402. onConstruct() {
  15403. this.n83 = (this.getChild("n83"));
  15404. this.fingerNode = (this.getChild("fingerNode"));
  15405. this.n84 = (this.getChild("n84"));
  15406. }
  15407. }
  15408. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15409. class ui_Component117 extends fgui.GComponent {
  15410. static createInstance() {
  15411. return (fgui.UIPackage.createObject("game", "Component117"));
  15412. }
  15413. onConstruct() {
  15414. this.n87 = (this.getChild("n87"));
  15415. this.n88 = (this.getChild("n88"));
  15416. this.n84 = (this.getChild("n84"));
  15417. this.n85 = (this.getChild("n85"));
  15418. this.n86 = (this.getChild("n86"));
  15419. this.t0 = this.getTransition("t0");
  15420. }
  15421. }
  15422. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15423. class ui_Component98_1 extends fgui.GButton {
  15424. static createInstance() {
  15425. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15426. }
  15427. onConstruct() {
  15428. this.c1 = this.getController("c1");
  15429. this.n8 = (this.getChild("n8"));
  15430. this.n41 = (this.getChild("n41"));
  15431. this.n40 = (this.getChild("n40"));
  15432. }
  15433. }
  15434. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15435. class ui_Component61 extends fgui.GComponent {
  15436. static createInstance() {
  15437. return (fgui.UIPackage.createObject("game", "Component61"));
  15438. }
  15439. onConstruct() {
  15440. this.n14 = (this.getChild("n14"));
  15441. this.n6 = (this.getChild("n6"));
  15442. this.t0 = this.getTransition("t0");
  15443. }
  15444. }
  15445. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15446. class ui_Component62 extends fgui.GComponent {
  15447. static createInstance() {
  15448. return (fgui.UIPackage.createObject("game", "Component62"));
  15449. }
  15450. onConstruct() {
  15451. this.n66 = (this.getChild("n66"));
  15452. this.n56 = (this.getChild("n56"));
  15453. this.n63 = (this.getChild("n63"));
  15454. this.n65 = (this.getChild("n65"));
  15455. this.t0 = this.getTransition("t0");
  15456. }
  15457. }
  15458. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15459. class ui_d3Root extends fgui.GComponent {
  15460. static createInstance() {
  15461. return (fgui.UIPackage.createObject("game", "d3Root"));
  15462. }
  15463. onConstruct() {
  15464. }
  15465. }
  15466. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15467. class ui_d2Root extends fgui.GComponent {
  15468. static createInstance() {
  15469. return (fgui.UIPackage.createObject("game", "d2Root"));
  15470. }
  15471. onConstruct() {
  15472. }
  15473. }
  15474. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15475. class ui_ballNode extends fgui.GComponent {
  15476. static createInstance() {
  15477. return (fgui.UIPackage.createObject("game", "ballNode"));
  15478. }
  15479. onConstruct() {
  15480. }
  15481. }
  15482. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15483. class ui_border extends fgui.GComponent {
  15484. static createInstance() {
  15485. return (fgui.UIPackage.createObject("game", "border"));
  15486. }
  15487. onConstruct() {
  15488. this.bar1 = (this.getChild("bar1"));
  15489. this.bar2 = (this.getChild("bar2"));
  15490. this.bar3 = (this.getChild("bar3"));
  15491. this.bar4 = (this.getChild("bar4"));
  15492. this.bar5 = (this.getChild("bar5"));
  15493. this.bar6 = (this.getChild("bar6"));
  15494. this.circle1 = (this.getChild("circle1"));
  15495. this.circle2 = (this.getChild("circle2"));
  15496. this.circle3 = (this.getChild("circle3"));
  15497. this.circle4 = (this.getChild("circle4"));
  15498. this.circle5 = (this.getChild("circle5"));
  15499. this.circle6 = (this.getChild("circle6"));
  15500. this.n28 = (this.getChild("n28"));
  15501. }
  15502. }
  15503. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15504. class ui_btn_buy extends fgui.GButton {
  15505. static createInstance() {
  15506. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15507. }
  15508. onConstruct() {
  15509. this.button = this.getController("button");
  15510. this.n0 = (this.getChild("n0"));
  15511. this.n1 = (this.getChild("n1"));
  15512. this.n2 = (this.getChild("n2"));
  15513. }
  15514. }
  15515. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15516. class ui_Component41_2 extends fgui.GComponent {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15519. }
  15520. onConstruct() {
  15521. this.c1 = this.getController("c1");
  15522. this.n0 = (this.getChild("n0"));
  15523. this.n2 = (this.getChild("n2"));
  15524. this.n19 = (this.getChild("n19"));
  15525. this.cancelBtn = (this.getChild("cancelBtn"));
  15526. this.videoBtn = (this.getChild("videoBtn"));
  15527. this.n9 = (this.getChild("n9"));
  15528. this.n22 = (this.getChild("n22"));
  15529. this.tipsTxt = (this.getChild("tipsTxt"));
  15530. this.n23 = (this.getChild("n23"));
  15531. this.n24 = (this.getChild("n24"));
  15532. this.n26 = (this.getChild("n26"));
  15533. this.n27 = (this.getChild("n27"));
  15534. this.titleTxt = (this.getChild("titleTxt"));
  15535. }
  15536. }
  15537. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15538. class ui_Component41_1 extends fgui.GComponent {
  15539. static createInstance() {
  15540. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15541. }
  15542. onConstruct() {
  15543. this.c1 = this.getController("c1");
  15544. this.n0 = (this.getChild("n0"));
  15545. this.n2 = (this.getChild("n2"));
  15546. this.cancelBtn = (this.getChild("cancelBtn"));
  15547. this.videoBtn = (this.getChild("videoBtn"));
  15548. this.n27 = (this.getChild("n27"));
  15549. this.n30 = (this.getChild("n30"));
  15550. this.n31 = (this.getChild("n31"));
  15551. this.n32 = (this.getChild("n32"));
  15552. this.n33 = (this.getChild("n33"));
  15553. this.n34 = (this.getChild("n34"));
  15554. this.n35 = (this.getChild("n35"));
  15555. this.n36 = (this.getChild("n36"));
  15556. this.n1 = (this.getChild("n1"));
  15557. this.n37 = (this.getChild("n37"));
  15558. this.t0 = this.getTransition("t0");
  15559. this.t1 = this.getTransition("t1");
  15560. this.t2 = this.getTransition("t2");
  15561. this.t3 = this.getTransition("t3");
  15562. }
  15563. }
  15564. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15565. class ui_againBtn extends fgui.GButton {
  15566. static createInstance() {
  15567. return (fgui.UIPackage.createObject("game", "againBtn"));
  15568. }
  15569. onConstruct() {
  15570. this.n2 = (this.getChild("n2"));
  15571. this.n1 = (this.getChild("n1"));
  15572. this.n5 = (this.getChild("n5"));
  15573. }
  15574. }
  15575. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15576. class ui_Component118 extends fgui.GButton {
  15577. static createInstance() {
  15578. return (fgui.UIPackage.createObject("game", "Component118"));
  15579. }
  15580. onConstruct() {
  15581. this.c1 = this.getController("c1");
  15582. this.n14 = (this.getChild("n14"));
  15583. this.n9 = (this.getChild("n9"));
  15584. this.n10 = (this.getChild("n10"));
  15585. this.diamondTxt = (this.getChild("diamondTxt"));
  15586. this.n13 = (this.getChild("n13"));
  15587. this.n15 = (this.getChild("n15"));
  15588. }
  15589. }
  15590. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15591. class ui_Component119 extends fgui.GComponent {
  15592. static createInstance() {
  15593. return (fgui.UIPackage.createObject("game", "Component119"));
  15594. }
  15595. onConstruct() {
  15596. this.n1 = (this.getChild("n1"));
  15597. this.n2 = (this.getChild("n2"));
  15598. this.n13 = (this.getChild("n13"));
  15599. this.n6 = (this.getChild("n6"));
  15600. this.screenNode = (this.getChild("screenNode"));
  15601. this.n15 = (this.getChild("n15"));
  15602. this.closeBtn = (this.getChild("closeBtn"));
  15603. this.share2Btn = (this.getChild("share2Btn"));
  15604. this.shareBtn = (this.getChild("shareBtn"));
  15605. this.tipsNode = (this.getChild("tipsNode"));
  15606. this.awardNode = (this.getChild("awardNode"));
  15607. }
  15608. }
  15609. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15610. class ui_daoJuDisplay extends fgui.GComponent {
  15611. static createInstance() {
  15612. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15613. }
  15614. onConstruct() {
  15615. this.n6 = (this.getChild("n6"));
  15616. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15617. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15618. this.btn_buy = (this.getChild("btn_buy"));
  15619. this.nameTxt = (this.getChild("nameTxt"));
  15620. this.zsImg = (this.getChild("zsImg"));
  15621. }
  15622. }
  15623. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15624. class ui_Component132_1 extends fgui.GComponent {
  15625. static createInstance() {
  15626. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15627. }
  15628. onConstruct() {
  15629. this.n25 = (this.getChild("n25"));
  15630. this.n26 = (this.getChild("n26"));
  15631. this.n27 = (this.getChild("n27"));
  15632. this.t0 = this.getTransition("t0");
  15633. }
  15634. }
  15635. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15636. class ui_SecretaryDisplay extends fgui.GComponent {
  15637. static createInstance() {
  15638. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15639. }
  15640. onConstruct() {
  15641. this.n2 = (this.getChild("n2"));
  15642. this.levelTxt = (this.getChild("levelTxt"));
  15643. this.n4 = (this.getChild("n4"));
  15644. this.secretary = (this.getChild("secretary"));
  15645. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15646. this.n16 = (this.getChild("n16"));
  15647. this.n37 = (this.getChild("n37"));
  15648. this.n41 = (this.getChild("n41"));
  15649. this.n14 = (this.getChild("n14"));
  15650. this.n17 = (this.getChild("n17"));
  15651. this.heightTxt = (this.getChild("heightTxt"));
  15652. this.n46 = (this.getChild("n46"));
  15653. this.n36 = (this.getChild("n36"));
  15654. this.n38 = (this.getChild("n38"));
  15655. this.foodTxt = (this.getChild("foodTxt"));
  15656. this.n47 = (this.getChild("n47"));
  15657. this.n40 = (this.getChild("n40"));
  15658. this.n42 = (this.getChild("n42"));
  15659. this.historyTxt = (this.getChild("historyTxt"));
  15660. this.n48 = (this.getChild("n48"));
  15661. this.nameImg = (this.getChild("nameImg"));
  15662. this.n12 = (this.getChild("n12"));
  15663. this.n49 = (this.getChild("n49"));
  15664. this.t0 = this.getTransition("t0");
  15665. }
  15666. }
  15667. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15668. class ui_BallRodDisplay extends fgui.GComponent {
  15669. static createInstance() {
  15670. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15671. }
  15672. onConstruct() {
  15673. this.c1 = this.getController("c1");
  15674. this.n31 = (this.getChild("n31"));
  15675. this.n6 = (this.getChild("n6"));
  15676. this.nameTxt = (this.getChild("nameTxt"));
  15677. this.rodImg = (this.getChild("rodImg"));
  15678. this.eftRod = (this.getChild("eftRod"));
  15679. this.levelNode = (this.getChild("levelNode"));
  15680. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15681. }
  15682. }
  15683. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15684. class ui_Component111_11 extends fgui.GComponent {
  15685. static createInstance() {
  15686. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15687. }
  15688. onConstruct() {
  15689. this.n68 = (this.getChild("n68"));
  15690. this.n69 = (this.getChild("n69"));
  15691. }
  15692. }
  15693. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15694. class ui_Component112 extends fgui.GComponent {
  15695. static createInstance() {
  15696. return (fgui.UIPackage.createObject("game", "Component112"));
  15697. }
  15698. onConstruct() {
  15699. this.n68 = (this.getChild("n68"));
  15700. this.n70 = (this.getChild("n70"));
  15701. this.myMask = (this.getChild("myMask"));
  15702. }
  15703. }
  15704. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15705. class ui_Component111 extends fgui.GComponent {
  15706. static createInstance() {
  15707. return (fgui.UIPackage.createObject("game", "Component111"));
  15708. }
  15709. onConstruct() {
  15710. this.n68 = (this.getChild("n68"));
  15711. this.myMask = (this.getChild("myMask"));
  15712. }
  15713. }
  15714. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15715. class ui_Component144 extends fgui.GButton {
  15716. static createInstance() {
  15717. return (fgui.UIPackage.createObject("game", "Component144"));
  15718. }
  15719. onConstruct() {
  15720. this.n8 = (this.getChild("n8"));
  15721. }
  15722. }
  15723. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15724. class ui_Sign_com2 extends fgui.GComponent {
  15725. static createInstance() {
  15726. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15727. }
  15728. onConstruct() {
  15729. this.n0 = (this.getChild("n0"));
  15730. this.n1 = (this.getChild("n1"));
  15731. this.t0 = this.getTransition("t0");
  15732. }
  15733. }
  15734. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15735. class ui_Sign_guang extends fgui.GComponent {
  15736. static createInstance() {
  15737. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15738. }
  15739. onConstruct() {
  15740. this.n1 = (this.getChild("n1"));
  15741. this.n2 = (this.getChild("n2"));
  15742. this.n3 = (this.getChild("n3"));
  15743. this.n4 = (this.getChild("n4"));
  15744. this.n5 = (this.getChild("n5"));
  15745. this.n6 = (this.getChild("n6"));
  15746. this.n8 = (this.getChild("n8"));
  15747. }
  15748. }
  15749. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15750. class ui_SignMax extends fgui.GComponent {
  15751. static createInstance() {
  15752. return (fgui.UIPackage.createObject("game", "SignMax"));
  15753. }
  15754. onConstruct() {
  15755. this.c1 = this.getController("c1");
  15756. this.n7 = (this.getChild("n7"));
  15757. this.n15 = (this.getChild("n15"));
  15758. this.n8 = (this.getChild("n8"));
  15759. this.titleTxt = (this.getChild("titleTxt"));
  15760. this.myIcon1 = (this.getChild("myIcon1"));
  15761. this.numTxt1 = (this.getChild("numTxt1"));
  15762. this.myIcon2 = (this.getChild("myIcon2"));
  15763. this.n20 = (this.getChild("n20"));
  15764. this.n17 = (this.getChild("n17"));
  15765. this.numTxt2 = (this.getChild("numTxt2"));
  15766. this.n12 = (this.getChild("n12"));
  15767. this.n13 = (this.getChild("n13"));
  15768. this.n21 = (this.getChild("n21"));
  15769. this.n14 = (this.getChild("n14"));
  15770. }
  15771. }
  15772. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15773. class ui_Sign_com2_1 extends fgui.GComponent {
  15774. static createInstance() {
  15775. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15776. }
  15777. onConstruct() {
  15778. this.n0 = (this.getChild("n0"));
  15779. this.n1 = (this.getChild("n1"));
  15780. this.t0 = this.getTransition("t0");
  15781. }
  15782. }
  15783. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15784. class ui_Sign_com5 extends fgui.GComponent {
  15785. static createInstance() {
  15786. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15787. }
  15788. onConstruct() {
  15789. this.n3 = (this.getChild("n3"));
  15790. this.n29 = (this.getChild("n29"));
  15791. this.n4 = (this.getChild("n4"));
  15792. this.day1 = (this.getChild("day1"));
  15793. this.day2 = (this.getChild("day2"));
  15794. this.day3 = (this.getChild("day3"));
  15795. this.day4 = (this.getChild("day4"));
  15796. this.day5 = (this.getChild("day5"));
  15797. this.day6 = (this.getChild("day6"));
  15798. this.day7 = (this.getChild("day7"));
  15799. this.t0 = this.getTransition("t0");
  15800. }
  15801. }
  15802. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15803. class ui_Sign_com8 extends fgui.GComponent {
  15804. static createInstance() {
  15805. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15806. }
  15807. onConstruct() {
  15808. this.n48 = (this.getChild("n48"));
  15809. this.womanTxt = (this.getChild("womanTxt"));
  15810. this.t0 = this.getTransition("t0");
  15811. }
  15812. }
  15813. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15814. class ui_Sign_com6 extends fgui.GComponent {
  15815. static createInstance() {
  15816. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15817. }
  15818. onConstruct() {
  15819. this.n2 = (this.getChild("n2"));
  15820. this.n3 = (this.getChild("n3"));
  15821. this.t0 = this.getTransition("t0");
  15822. }
  15823. }
  15824. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15825. class ui_Sign_com7 extends fgui.GComponent {
  15826. static createInstance() {
  15827. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15828. }
  15829. onConstruct() {
  15830. this.n29 = (this.getChild("n29"));
  15831. this.n2 = (this.getChild("n2"));
  15832. }
  15833. }
  15834. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15835. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15836. static createInstance() {
  15837. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15838. }
  15839. onConstruct() {
  15840. this.n5 = (this.getChild("n5"));
  15841. this.n4 = (this.getChild("n4"));
  15842. this.t0 = this.getTransition("t0");
  15843. }
  15844. }
  15845. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15846. class ui_UITurntable_com2 extends fgui.GComponent {
  15847. static createInstance() {
  15848. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15849. }
  15850. onConstruct() {
  15851. this.c1 = this.getController("c1");
  15852. this.n4 = (this.getChild("n4"));
  15853. this.n6 = (this.getChild("n6"));
  15854. this.n10 = (this.getChild("n10"));
  15855. this.n11 = (this.getChild("n11"));
  15856. this.n12 = (this.getChild("n12"));
  15857. this.n13 = (this.getChild("n13"));
  15858. this.n14 = (this.getChild("n14"));
  15859. this.n15 = (this.getChild("n15"));
  15860. this.n16 = (this.getChild("n16"));
  15861. this.n17 = (this.getChild("n17"));
  15862. this.n18 = (this.getChild("n18"));
  15863. this.n19 = (this.getChild("n19"));
  15864. this.n20 = (this.getChild("n20"));
  15865. this.n21 = (this.getChild("n21"));
  15866. this.n22 = (this.getChild("n22"));
  15867. this.n23 = (this.getChild("n23"));
  15868. this.n24 = (this.getChild("n24"));
  15869. this.n25 = (this.getChild("n25"));
  15870. this.n26 = (this.getChild("n26"));
  15871. this.n27 = (this.getChild("n27"));
  15872. this.n28 = (this.getChild("n28"));
  15873. this.n29 = (this.getChild("n29"));
  15874. this.n30 = (this.getChild("n30"));
  15875. this.n31 = (this.getChild("n31"));
  15876. this.n32 = (this.getChild("n32"));
  15877. this.n33 = (this.getChild("n33"));
  15878. }
  15879. }
  15880. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15881. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15882. static createInstance() {
  15883. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15884. }
  15885. onConstruct() {
  15886. this.n5 = (this.getChild("n5"));
  15887. this.n4 = (this.getChild("n4"));
  15888. this.t0 = this.getTransition("t0");
  15889. }
  15890. }
  15891. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15892. class ui_UITurntable_com5 extends fgui.GComponent {
  15893. static createInstance() {
  15894. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15895. }
  15896. onConstruct() {
  15897. this.flashNode = (this.getChild("flashNode"));
  15898. this.rotNode = (this.getChild("rotNode"));
  15899. this.n3 = (this.getChild("n3"));
  15900. this.n21 = (this.getChild("n21"));
  15901. this.t0 = this.getTransition("t0");
  15902. }
  15903. }
  15904. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15905. class ui_UITurntable_com7 extends fgui.GComponent {
  15906. static createInstance() {
  15907. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15908. }
  15909. onConstruct() {
  15910. this.n2 = (this.getChild("n2"));
  15911. this.n35 = (this.getChild("n35"));
  15912. this.img1 = (this.getChild("img1"));
  15913. this.img2 = (this.getChild("img2"));
  15914. this.img3 = (this.getChild("img3"));
  15915. this.img4 = (this.getChild("img4"));
  15916. this.img6 = (this.getChild("img6"));
  15917. this.img5 = (this.getChild("img5"));
  15918. this.txt1 = (this.getChild("txt1"));
  15919. this.txt2 = (this.getChild("txt2"));
  15920. this.txt3 = (this.getChild("txt3"));
  15921. this.txt4 = (this.getChild("txt4"));
  15922. this.txt5 = (this.getChild("txt5"));
  15923. this.txt6 = (this.getChild("txt6"));
  15924. }
  15925. }
  15926. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15927. class ui_UITurntable_com9 extends fgui.GComponent {
  15928. static createInstance() {
  15929. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15930. }
  15931. onConstruct() {
  15932. this.n38 = (this.getChild("n38"));
  15933. this.n39 = (this.getChild("n39"));
  15934. }
  15935. }
  15936. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15937. class ui_UITurntable_com10 extends fgui.GComponent {
  15938. static createInstance() {
  15939. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15940. }
  15941. onConstruct() {
  15942. this.n39 = (this.getChild("n39"));
  15943. this.n40 = (this.getChild("n40"));
  15944. this.t0 = this.getTransition("t0");
  15945. }
  15946. }
  15947. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15948. class ui_UITurntable_com11 extends fgui.GComponent {
  15949. static createInstance() {
  15950. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15951. }
  15952. onConstruct() {
  15953. this.n38 = (this.getChild("n38"));
  15954. this.n39 = (this.getChild("n39"));
  15955. this.n40 = (this.getChild("n40"));
  15956. this.t0 = this.getTransition("t0");
  15957. }
  15958. }
  15959. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15960. class ui_UITurntable_com12 extends fgui.GComponent {
  15961. static createInstance() {
  15962. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15963. }
  15964. onConstruct() {
  15965. this.n43 = (this.getChild("n43"));
  15966. this.barNode = (this.getChild("barNode"));
  15967. this.tipsTxt = (this.getChild("tipsTxt"));
  15968. this.n45 = (this.getChild("n45"));
  15969. this.boxBtn = (this.getChild("boxBtn"));
  15970. }
  15971. }
  15972. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15973. class ui_UITurntable_com1 extends fgui.GButton {
  15974. static createInstance() {
  15975. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15976. }
  15977. onConstruct() {
  15978. this.n41 = (this.getChild("n41"));
  15979. this.n42 = (this.getChild("n42"));
  15980. this.t0 = this.getTransition("t0");
  15981. }
  15982. }
  15983. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15984. class ui_UITurntable_com3 extends fgui.GComponent {
  15985. static createInstance() {
  15986. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15987. }
  15988. onConstruct() {
  15989. this.n48 = (this.getChild("n48"));
  15990. this.womanTxt = (this.getChild("womanTxt"));
  15991. this.t0 = this.getTransition("t0");
  15992. }
  15993. }
  15994. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15995. class ui_cancelBtn2 extends fgui.GButton {
  15996. static createInstance() {
  15997. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15998. }
  15999. onConstruct() {
  16000. this.c1 = this.getController("c1");
  16001. this.n0 = (this.getChild("n0"));
  16002. this.n1 = (this.getChild("n1"));
  16003. this.n2 = (this.getChild("n2"));
  16004. this.n3 = (this.getChild("n3"));
  16005. this.n4 = (this.getChild("n4"));
  16006. this.n5 = (this.getChild("n5"));
  16007. this.n6 = (this.getChild("n6"));
  16008. this.n7 = (this.getChild("n7"));
  16009. this.n8 = (this.getChild("n8"));
  16010. this.powerEft = (this.getChild("powerEft"));
  16011. }
  16012. }
  16013. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16014. class ui_shareBtn2 extends fgui.GButton {
  16015. static createInstance() {
  16016. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16017. }
  16018. onConstruct() {
  16019. this.c1 = this.getController("c1");
  16020. this.n2 = (this.getChild("n2"));
  16021. this.n24 = (this.getChild("n24"));
  16022. this.n1 = (this.getChild("n1"));
  16023. this.n3 = (this.getChild("n3"));
  16024. this.n23 = (this.getChild("n23"));
  16025. this.n4 = (this.getChild("n4"));
  16026. this.n5 = (this.getChild("n5"));
  16027. this.n6 = (this.getChild("n6"));
  16028. this.n20 = (this.getChild("n20"));
  16029. this.n21 = (this.getChild("n21"));
  16030. this.n22 = (this.getChild("n22"));
  16031. this.powerEft = (this.getChild("powerEft"));
  16032. }
  16033. }
  16034. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16035. class ui_UIMoney extends fgui.GComponent {
  16036. static createInstance() {
  16037. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16038. }
  16039. onConstruct() {
  16040. this.c1 = this.getController("c1");
  16041. this.n4 = (this.getChild("n4"));
  16042. this.coinImg = (this.getChild("coinImg"));
  16043. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16044. this.coinTxt = (this.getChild("coinTxt"));
  16045. this.n7 = (this.getChild("n7"));
  16046. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16047. this.diamondTxt = (this.getChild("diamondTxt"));
  16048. this.diamondImg = (this.getChild("diamondImg"));
  16049. this.n12 = (this.getChild("n12"));
  16050. this.powerImg = (this.getChild("powerImg"));
  16051. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16052. this.powerTxt = (this.getChild("powerTxt"));
  16053. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16054. }
  16055. }
  16056. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16057. class ui_backBtn extends fgui.GButton {
  16058. static createInstance() {
  16059. return (fgui.UIPackage.createObject("game", "backBtn"));
  16060. }
  16061. onConstruct() {
  16062. this.n0 = (this.getChild("n0"));
  16063. this.t0 = this.getTransition("t0");
  16064. this.t1 = this.getTransition("t1");
  16065. }
  16066. }
  16067. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16068. class ui_MoneyBtn extends fgui.GButton {
  16069. static createInstance() {
  16070. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16071. }
  16072. onConstruct() {
  16073. this.button = this.getController("button");
  16074. this.n0 = (this.getChild("n0"));
  16075. }
  16076. }
  16077. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16078. class ui_UIMoneyBtn extends fgui.GComponent {
  16079. static createInstance() {
  16080. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16081. }
  16082. onConstruct() {
  16083. this.n1 = (this.getChild("n1"));
  16084. this.closeBtn = (this.getChild("closeBtn"));
  16085. }
  16086. }
  16087. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16088. class ui_Component64 extends fgui.GComponent {
  16089. static createInstance() {
  16090. return (fgui.UIPackage.createObject("game", "Component64"));
  16091. }
  16092. onConstruct() {
  16093. this.n57 = (this.getChild("n57"));
  16094. this.n54 = (this.getChild("n54"));
  16095. this.n55 = (this.getChild("n55"));
  16096. this.n56 = (this.getChild("n56"));
  16097. this.t1 = this.getTransition("t1");
  16098. }
  16099. }
  16100. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16101. class ui_Component41_3 extends fgui.GComponent {
  16102. static createInstance() {
  16103. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16104. }
  16105. onConstruct() {
  16106. this.c1 = this.getController("c1");
  16107. this.n0 = (this.getChild("n0"));
  16108. this.n2 = (this.getChild("n2"));
  16109. this.cancelBtn = (this.getChild("cancelBtn"));
  16110. this.videoBtn = (this.getChild("videoBtn"));
  16111. this.n9 = (this.getChild("n9"));
  16112. this.n24 = (this.getChild("n24"));
  16113. this.n27 = (this.getChild("n27"));
  16114. this.titleTxt = (this.getChild("titleTxt"));
  16115. this.n28 = (this.getChild("n28"));
  16116. this.t0 = this.getTransition("t0");
  16117. }
  16118. }
  16119. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16120. class ui_dh_zs_4 extends fgui.GComponent {
  16121. static createInstance() {
  16122. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16123. }
  16124. onConstruct() {
  16125. this.n1 = (this.getChild("n1"));
  16126. this.n2 = (this.getChild("n2"));
  16127. this.n3 = (this.getChild("n3"));
  16128. this.n4 = (this.getChild("n4"));
  16129. this.n5 = (this.getChild("n5"));
  16130. this.n6 = (this.getChild("n6"));
  16131. this.n8 = (this.getChild("n8"));
  16132. this.t0 = this.getTransition("t0");
  16133. }
  16134. }
  16135. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16136. class ui_Component71_1 extends fgui.GButton {
  16137. static createInstance() {
  16138. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16139. }
  16140. onConstruct() {
  16141. this.n17 = (this.getChild("n17"));
  16142. this.t0 = this.getTransition("t0");
  16143. }
  16144. }
  16145. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16146. class ui_Component83 extends fgui.GComponent {
  16147. static createInstance() {
  16148. return (fgui.UIPackage.createObject("game", "Component83"));
  16149. }
  16150. onConstruct() {
  16151. this.c1 = this.getController("c1");
  16152. this.n17 = (this.getChild("n17"));
  16153. this.n19 = (this.getChild("n19"));
  16154. this.n20 = (this.getChild("n20"));
  16155. }
  16156. }
  16157. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16158. class ui_Component84 extends fgui.GComponent {
  16159. static createInstance() {
  16160. return (fgui.UIPackage.createObject("game", "Component84"));
  16161. }
  16162. onConstruct() {
  16163. this.c1 = this.getController("c1");
  16164. this.n4 = (this.getChild("n4"));
  16165. this.n22 = (this.getChild("n22"));
  16166. this.n23 = (this.getChild("n23"));
  16167. this.numTxt = (this.getChild("numTxt"));
  16168. this.n25 = (this.getChild("n25"));
  16169. this.n26 = (this.getChild("n26"));
  16170. }
  16171. }
  16172. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16173. class ui_Component84_1 extends fgui.GComponent {
  16174. static createInstance() {
  16175. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16176. }
  16177. onConstruct() {
  16178. this.c1 = this.getController("c1");
  16179. this.n4 = (this.getChild("n4"));
  16180. this.n22 = (this.getChild("n22"));
  16181. this.n23 = (this.getChild("n23"));
  16182. this.numTxt = (this.getChild("numTxt"));
  16183. this.n25 = (this.getChild("n25"));
  16184. this.n26 = (this.getChild("n26"));
  16185. }
  16186. }
  16187. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16188. class ui_Component85 extends fgui.GComponent {
  16189. static createInstance() {
  16190. return (fgui.UIPackage.createObject("game", "Component85"));
  16191. }
  16192. onConstruct() {
  16193. this.n1 = (this.getChild("n1"));
  16194. this.n6 = (this.getChild("n6"));
  16195. this.n2 = (this.getChild("n2"));
  16196. this.n3 = (this.getChild("n3"));
  16197. this.levelTxt = (this.getChild("levelTxt"));
  16198. this.n10 = (this.getChild("n10"));
  16199. this.n11 = (this.getChild("n11"));
  16200. this.n12 = (this.getChild("n12"));
  16201. this.n13 = (this.getChild("n13"));
  16202. this.n14 = (this.getChild("n14"));
  16203. this.modeNode = (this.getChild("modeNode"));
  16204. this.n18 = (this.getChild("n18"));
  16205. this.conditionTxt = (this.getChild("conditionTxt"));
  16206. this.diamondNode = (this.getChild("diamondNode"));
  16207. this.coinNode = (this.getChild("coinNode"));
  16208. this.startBtn = (this.getChild("startBtn"));
  16209. this.n28 = (this.getChild("n28"));
  16210. this.displayRoot = (this.getChild("displayRoot"));
  16211. this.t0 = this.getTransition("t0");
  16212. }
  16213. }
  16214. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16215. class ui_Component86 extends fgui.GButton {
  16216. static createInstance() {
  16217. return (fgui.UIPackage.createObject("game", "Component86"));
  16218. }
  16219. onConstruct() {
  16220. this.n15 = (this.getChild("n15"));
  16221. this.t0 = this.getTransition("t0");
  16222. }
  16223. }
  16224. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16225. class ui_Component87 extends fgui.GComponent {
  16226. static createInstance() {
  16227. return (fgui.UIPackage.createObject("game", "Component87"));
  16228. }
  16229. onConstruct() {
  16230. this.n66 = (this.getChild("n66"));
  16231. this.myProgress = (this.getChild("myProgress"));
  16232. this.starAni = (this.getChild("starAni"));
  16233. this.hpTxt = (this.getChild("hpTxt"));
  16234. this.n74 = (this.getChild("n74"));
  16235. this.n73 = (this.getChild("n73"));
  16236. this.ballTxt = (this.getChild("ballTxt"));
  16237. this.n76 = (this.getChild("n76"));
  16238. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16239. this.levelTxt = (this.getChild("levelTxt"));
  16240. this.star1 = (this.getChild("star1"));
  16241. this.star2 = (this.getChild("star2"));
  16242. this.star3 = (this.getChild("star3"));
  16243. }
  16244. }
  16245. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16246. class ui_Component88 extends fgui.GProgressBar {
  16247. static createInstance() {
  16248. return (fgui.UIPackage.createObject("game", "Component88"));
  16249. }
  16250. onConstruct() {
  16251. this.n68 = (this.getChild("n68"));
  16252. this.bar = (this.getChild("bar"));
  16253. }
  16254. }
  16255. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16256. class ui_Component89 extends fgui.GComponent {
  16257. static createInstance() {
  16258. return (fgui.UIPackage.createObject("game", "Component89"));
  16259. }
  16260. onConstruct() {
  16261. this.c1 = this.getController("c1");
  16262. this.n71 = (this.getChild("n71"));
  16263. this.n72 = (this.getChild("n72"));
  16264. }
  16265. }
  16266. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16267. class ui_Component90 extends fgui.GComponent {
  16268. static createInstance() {
  16269. return (fgui.UIPackage.createObject("game", "Component90"));
  16270. }
  16271. onConstruct() {
  16272. this.c1 = this.getController("c1");
  16273. this.n64 = (this.getChild("n64"));
  16274. this.n65 = (this.getChild("n65"));
  16275. this.n66 = (this.getChild("n66"));
  16276. this.t0 = this.getTransition("t0");
  16277. }
  16278. }
  16279. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16280. class ui_Component127 extends fgui.GButton {
  16281. static createInstance() {
  16282. return (fgui.UIPackage.createObject("game", "Component127"));
  16283. }
  16284. onConstruct() {
  16285. this.n5 = (this.getChild("n5"));
  16286. }
  16287. }
  16288. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16289. class gameBinder {
  16290. static bindAll() {
  16291. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16292. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16293. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16294. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16295. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16296. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16297. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16298. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16299. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16300. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16301. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16302. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16303. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16304. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16305. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16306. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16307. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16308. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16309. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16310. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16311. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16312. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16313. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16314. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16315. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16316. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16317. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16318. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16319. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16320. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16321. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16322. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16323. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16324. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16325. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16326. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16327. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16328. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16329. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16330. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16331. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16332. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16333. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16334. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16335. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16336. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16337. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16338. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16339. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16340. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16341. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16342. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16343. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16344. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16345. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16346. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16347. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16348. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16349. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16350. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16351. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16352. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16353. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16354. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16355. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16356. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16357. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16358. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16359. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16360. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16361. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16362. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16363. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16364. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16365. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16366. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16367. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16368. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16369. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16370. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16371. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16372. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16373. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16374. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16375. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16376. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16377. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16378. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16379. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16380. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16381. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16382. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16383. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16384. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16385. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16386. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16387. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16388. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16389. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16390. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16391. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16392. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16393. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16394. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16395. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16396. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16397. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16398. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16399. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16400. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16401. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16402. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16403. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16404. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16405. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16406. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16407. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16408. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16409. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16410. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16411. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16412. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16413. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16414. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16415. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16416. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16417. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16418. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16419. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16420. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16421. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16422. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16423. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16424. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16425. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16426. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16427. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16428. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16429. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16430. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16431. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16432. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16433. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16434. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16435. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16436. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16437. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16438. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16439. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16440. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16441. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16442. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16443. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16444. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16445. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16446. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16447. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16448. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16449. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16450. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16451. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16452. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16453. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16454. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16455. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16456. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16457. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16458. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16459. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16460. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16461. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16462. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16463. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16464. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16465. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16466. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16467. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16468. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16469. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16470. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16471. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16472. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16473. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16474. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16475. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16476. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16477. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16478. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16479. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16480. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16481. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16482. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16483. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16484. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16485. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16486. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16487. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16488. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16489. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16490. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16491. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16492. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16493. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16494. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16495. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16496. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16497. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16498. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16499. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16500. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16501. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16502. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16503. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16504. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16505. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16506. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16507. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16508. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16509. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16510. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16511. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16512. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16513. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16514. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16515. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16516. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16517. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16518. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16519. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16520. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16521. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16522. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16523. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16524. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16525. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16526. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16527. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16528. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16529. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16530. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16531. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16532. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16533. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16534. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16535. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16536. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16537. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16538. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16539. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16540. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16541. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16542. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16543. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16544. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16545. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16546. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16547. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16548. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16549. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16550. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16551. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16552. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16553. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16554. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16555. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16556. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16557. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16558. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16559. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16560. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16561. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16562. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16563. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16564. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16565. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16566. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16567. }
  16568. }
  16569. class ui_btn6 extends fgui.GButton {
  16570. static createInstance() {
  16571. return (fgui.UIPackage.createObject("loading", "btn6"));
  16572. }
  16573. onConstruct() {
  16574. this.n6 = (this.getChild("n6"));
  16575. this.n1 = (this.getChild("n1"));
  16576. }
  16577. }
  16578. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16579. class ui_xyItem extends fgui.GComponent {
  16580. static createInstance() {
  16581. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16582. }
  16583. onConstruct() {
  16584. this.xyItem = (this.getChild("xyItem"));
  16585. }
  16586. }
  16587. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16588. class ui_loadinfo extends fgui.GProgressBar {
  16589. static createInstance() {
  16590. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16591. }
  16592. onConstruct() {
  16593. this.bg = (this.getChild("bg"));
  16594. this.bar = (this.getChild("bar"));
  16595. this.title = (this.getChild("title"));
  16596. this.ani = (this.getChild("ani"));
  16597. }
  16598. }
  16599. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16600. class ui_xyNode extends fgui.GComponent {
  16601. static createInstance() {
  16602. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16603. }
  16604. onConstruct() {
  16605. this.n0 = (this.getChild("n0"));
  16606. this.btnYes = (this.getChild("btnYes"));
  16607. this.btnNo = (this.getChild("btnNo"));
  16608. this.btnKnown = (this.getChild("btnKnown"));
  16609. this.btnSure = (this.getChild("btnSure"));
  16610. this.txtWelcom = (this.getChild("txtWelcom"));
  16611. this.txtXy = (this.getChild("txtXy"));
  16612. this.n75 = (this.getChild("n75"));
  16613. this.btnXy1 = (this.getChild("btnXy1"));
  16614. this.btnXy3 = (this.getChild("btnXy3"));
  16615. this.btnXy2 = (this.getChild("btnXy2"));
  16616. this.n74 = (this.getChild("n74"));
  16617. this.xy1 = (this.getChild("xy1"));
  16618. this.txtTitle = (this.getChild("txtTitle"));
  16619. this.btnBack = (this.getChild("btnBack"));
  16620. this.xyList = (this.getChild("xyList"));
  16621. this.xy2 = (this.getChild("xy2"));
  16622. this.xyNode = (this.getChild("xyNode"));
  16623. }
  16624. }
  16625. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16626. class ui_ageNode extends fgui.GComponent {
  16627. static createInstance() {
  16628. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16629. }
  16630. onConstruct() {
  16631. this.n3 = (this.getChild("n3"));
  16632. this.n7 = (this.getChild("n7"));
  16633. this.n4 = (this.getChild("n4"));
  16634. this.btnAge = (this.getChild("btnAge"));
  16635. this.ageNode = (this.getChild("ageNode"));
  16636. }
  16637. }
  16638. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16639. class ui_rnNode extends fgui.GComponent {
  16640. static createInstance() {
  16641. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16642. }
  16643. onConstruct() {
  16644. this.n28 = (this.getChild("n28"));
  16645. this.n30 = (this.getChild("n30"));
  16646. this.n33 = (this.getChild("n33"));
  16647. this.rn1 = (this.getChild("rn1"));
  16648. this.n40 = (this.getChild("n40"));
  16649. this.n41 = (this.getChild("n41"));
  16650. this.rn3 = (this.getChild("rn3"));
  16651. this.n37 = (this.getChild("n37"));
  16652. this.n39 = (this.getChild("n39"));
  16653. this.rn2 = (this.getChild("rn2"));
  16654. this.n47 = (this.getChild("n47"));
  16655. this.n49 = (this.getChild("n49"));
  16656. this.n44 = (this.getChild("n44"));
  16657. this.inputCode = (this.getChild("inputCode"));
  16658. this.inputName = (this.getChild("inputName"));
  16659. this.n48 = (this.getChild("n48"));
  16660. this.n50 = (this.getChild("n50"));
  16661. this.rn4 = (this.getChild("rn4"));
  16662. this.btnCheck = (this.getChild("btnCheck"));
  16663. this.btnExit = (this.getChild("btnExit"));
  16664. this.btnDone = (this.getChild("btnDone"));
  16665. this.rnNode = (this.getChild("rnNode"));
  16666. }
  16667. }
  16668. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16669. class ui_tipNode extends fgui.GComponent {
  16670. static createInstance() {
  16671. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16672. }
  16673. onConstruct() {
  16674. this.bg = (this.getChild("bg"));
  16675. this.n55 = (this.getChild("n55"));
  16676. this.n56 = (this.getChild("n56"));
  16677. this.tipNode = (this.getChild("tipNode"));
  16678. }
  16679. }
  16680. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16681. class ui_fcmNode extends fgui.GComponent {
  16682. static createInstance() {
  16683. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16684. }
  16685. onConstruct() {
  16686. this.n63 = (this.getChild("n63"));
  16687. this.n62 = (this.getChild("n62"));
  16688. this.btnRn = (this.getChild("btnRn"));
  16689. this.n61 = (this.getChild("n61"));
  16690. this.n58 = (this.getChild("n58"));
  16691. this.fcmNode = (this.getChild("fcmNode"));
  16692. }
  16693. }
  16694. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16695. class ui_msgNode extends fgui.GComponent {
  16696. static createInstance() {
  16697. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16698. }
  16699. onConstruct() {
  16700. this.n69 = (this.getChild("n69"));
  16701. this.txtMsg = (this.getChild("txtMsg"));
  16702. this.msgNode = (this.getChild("msgNode"));
  16703. }
  16704. }
  16705. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16706. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16707. static createInstance() {
  16708. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16709. }
  16710. onConstruct() {
  16711. this.n1 = (this.getChild("n1"));
  16712. this.n13 = (this.getChild("n13"));
  16713. this.n14 = (this.getChild("n14"));
  16714. this.n15 = (this.getChild("n15"));
  16715. this.n3 = (this.getChild("n3"));
  16716. this.n4 = (this.getChild("n4"));
  16717. this.n5 = (this.getChild("n5"));
  16718. this.n6 = (this.getChild("n6"));
  16719. this.n7 = (this.getChild("n7"));
  16720. this.n8 = (this.getChild("n8"));
  16721. this.n9 = (this.getChild("n9"));
  16722. this.n10 = (this.getChild("n10"));
  16723. this.n12 = (this.getChild("n12"));
  16724. this.n11 = (this.getChild("n11"));
  16725. this.n16 = (this.getChild("n16"));
  16726. this.n17 = (this.getChild("n17"));
  16727. this.n18 = (this.getChild("n18"));
  16728. this.n20 = (this.getChild("n20"));
  16729. this.n21 = (this.getChild("n21"));
  16730. this.t0 = this.getTransition("t0");
  16731. }
  16732. }
  16733. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16734. class ui_btn5 extends fgui.GButton {
  16735. static createInstance() {
  16736. return (fgui.UIPackage.createObject("loading", "btn5"));
  16737. }
  16738. onConstruct() {
  16739. this.n9 = (this.getChild("n9"));
  16740. this.n1 = (this.getChild("n1"));
  16741. }
  16742. }
  16743. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16744. class ui_UILoading extends fgui.GComponent {
  16745. static createInstance() {
  16746. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16747. }
  16748. onConstruct() {
  16749. this.n12 = (this.getChild("n12"));
  16750. this.loadinfo = (this.getChild("loadinfo"));
  16751. this.n13 = (this.getChild("n13"));
  16752. this.txtLoad = (this.getChild("txtLoad"));
  16753. this.n18 = (this.getChild("n18"));
  16754. }
  16755. }
  16756. ui_UILoading.URL = "ui://37nctnhwphc33";
  16757. class ui_AgeItem extends fgui.GComponent {
  16758. static createInstance() {
  16759. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16760. }
  16761. onConstruct() {
  16762. this.txtAge = (this.getChild("txtAge"));
  16763. }
  16764. }
  16765. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16766. class ui_btn1 extends fgui.GButton {
  16767. static createInstance() {
  16768. return (fgui.UIPackage.createObject("loading", "btn1"));
  16769. }
  16770. onConstruct() {
  16771. this.n6 = (this.getChild("n6"));
  16772. this.n1 = (this.getChild("n1"));
  16773. }
  16774. }
  16775. ui_btn1.URL = "ui://37nctnhwxe622p";
  16776. class ui_btn3 extends fgui.GButton {
  16777. static createInstance() {
  16778. return (fgui.UIPackage.createObject("loading", "btn3"));
  16779. }
  16780. onConstruct() {
  16781. this.n9 = (this.getChild("n9"));
  16782. this.n1 = (this.getChild("n1"));
  16783. }
  16784. }
  16785. ui_btn3.URL = "ui://37nctnhwxe622s";
  16786. class ui_btn2 extends fgui.GButton {
  16787. static createInstance() {
  16788. return (fgui.UIPackage.createObject("loading", "btn2"));
  16789. }
  16790. onConstruct() {
  16791. this.n6 = (this.getChild("n6"));
  16792. this.n1 = (this.getChild("n1"));
  16793. }
  16794. }
  16795. ui_btn2.URL = "ui://37nctnhwxe622t";
  16796. class ui_btnBack extends fgui.GButton {
  16797. static createInstance() {
  16798. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16799. }
  16800. onConstruct() {
  16801. this.n6 = (this.getChild("n6"));
  16802. this.n7 = (this.getChild("n7"));
  16803. }
  16804. }
  16805. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16806. class ui_btnXy1 extends fgui.GButton {
  16807. static createInstance() {
  16808. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16809. }
  16810. onConstruct() {
  16811. this.n1 = (this.getChild("n1"));
  16812. }
  16813. }
  16814. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16815. class ui_btnXy2 extends fgui.GButton {
  16816. static createInstance() {
  16817. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16818. }
  16819. onConstruct() {
  16820. this.n1 = (this.getChild("n1"));
  16821. }
  16822. }
  16823. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16824. class ui_btnXy3 extends fgui.GButton {
  16825. static createInstance() {
  16826. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16827. }
  16828. onConstruct() {
  16829. this.n1 = (this.getChild("n1"));
  16830. }
  16831. }
  16832. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16833. class ui_btn4 extends fgui.GButton {
  16834. static createInstance() {
  16835. return (fgui.UIPackage.createObject("loading", "btn4"));
  16836. }
  16837. onConstruct() {
  16838. this.n9 = (this.getChild("n9"));
  16839. this.n1 = (this.getChild("n1"));
  16840. }
  16841. }
  16842. ui_btn4.URL = "ui://37nctnhwxe622z";
  16843. class loadingBinder {
  16844. static bindAll() {
  16845. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16846. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16847. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16848. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16849. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16850. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16851. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16852. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16853. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16854. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16855. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16856. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16857. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16858. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16859. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16860. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16861. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16862. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16863. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16864. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16865. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16866. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16867. }
  16868. }
  16869. class UIMgr {
  16870. constructor() {
  16871. this._stage = null;
  16872. this._uiList = [];
  16873. this._showList = [];
  16874. this._bindPkgList = [];
  16875. this.uiIndex = 0;
  16876. }
  16877. static get inst() {
  16878. if (UIMgr._inst == null) {
  16879. UIMgr._inst = new UIMgr();
  16880. }
  16881. return UIMgr._inst;
  16882. }
  16883. setStage(s) {
  16884. if (this._stage) {
  16885. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16886. return;
  16887. }
  16888. this._stage = s;
  16889. }
  16890. clearTempData() {
  16891. console.log('zh:clearTempData start');
  16892. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16893. console.log('zh:clearTempData end');
  16894. }
  16895. init() {
  16896. this.setStage(Laya.stage);
  16897. fairygui.UIConfig.defaultFont = "微软雅黑";
  16898. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16899. fairygui.UIConfig.packageFileExtension = "obj";
  16900. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16901. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16902. fairygui.GRoot.inst.width = Laya.stage.width;
  16903. fairygui.GRoot.inst.height = Laya.stage.height;
  16904. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16905. }
  16906. addAllUpdate() {
  16907. this.uiIndex = 0;
  16908. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16909. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16910. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16911. }
  16912. }
  16913. }
  16914. bindFUI(pkgname) {
  16915. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16916. return;
  16917. }
  16918. switch (pkgname) {
  16919. case fguiRes.loading:
  16920. fairygui.UIPackage.addPackage(pkgname);
  16921. loadingBinder.bindAll();
  16922. this._bindPkgList.push(pkgname);
  16923. break;
  16924. case fguiRes.game:
  16925. fairygui.UIPackage.addPackage(pkgname);
  16926. gameBinder.bindAll();
  16927. this._bindPkgList.push(pkgname);
  16928. break;
  16929. default:
  16930. break;
  16931. }
  16932. }
  16933. Show(cls, ...param) {
  16934. let nameStr = cls.uiName;
  16935. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16936. let temp = this._uiList[i];
  16937. let str = temp.className;
  16938. if (str == nameStr) {
  16939. if (temp.isMuti) {
  16940. if (temp.isHide) {
  16941. temp.show(...param);
  16942. this._uiList.splice(i, 1);
  16943. this._uiList.push(temp);
  16944. return temp;
  16945. }
  16946. }
  16947. else {
  16948. temp.show(...param);
  16949. this._uiList.splice(i, 1);
  16950. this._uiList.push(temp);
  16951. return temp;
  16952. }
  16953. }
  16954. }
  16955. let ui = new cls();
  16956. ui.className = nameStr;
  16957. this._showUI(ui, param);
  16958. return ui;
  16959. }
  16960. destroyUI(ui) {
  16961. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16962. let temp = this._uiList[i].className;
  16963. if (temp == ui.className) {
  16964. this._uiList.splice(i, 1);
  16965. break;
  16966. }
  16967. }
  16968. this.checkUIState();
  16969. }
  16970. _showUI(ui, param) {
  16971. this._uiList.push(ui);
  16972. ui.show(...param);
  16973. }
  16974. Hide(uiClass) {
  16975. let ui = this.getUI(uiClass);
  16976. if (ui && !ui.isHide) {
  16977. ui.hide();
  16978. }
  16979. }
  16980. getUI(ui) {
  16981. let nameStr = ui.uiName;
  16982. for (let index = 0; index < this._uiList.length; index++) {
  16983. let temp = this._uiList[index];
  16984. if (temp.className == nameStr) {
  16985. return temp;
  16986. }
  16987. }
  16988. return null;
  16989. }
  16990. isShow(cls) {
  16991. for (var i of this._uiList) {
  16992. if (i instanceof cls) {
  16993. return i.isShowing;
  16994. }
  16995. }
  16996. return false;
  16997. }
  16998. showUINum() {
  16999. let num = 0;
  17000. for (var i of this._uiList) {
  17001. if (i.isShowing) {
  17002. num++;
  17003. }
  17004. }
  17005. return num;
  17006. }
  17007. checkUIState() {
  17008. Laya.timer.clear(this, this._uiCheck);
  17009. Laya.timer.once(400, this, this._uiCheck);
  17010. }
  17011. _uiCheck() {
  17012. let showList = [];
  17013. for (var i of this._uiList) {
  17014. if (!i.isHide) {
  17015. showList.push(i);
  17016. }
  17017. }
  17018. for (let index = 0; index < showList.length; index++) {
  17019. if (index == showList.length - 1) {
  17020. showList[index].checkActive(true);
  17021. }
  17022. else {
  17023. showList[index].checkActive(false);
  17024. }
  17025. }
  17026. }
  17027. showTip(msg, time = 600, size = 30) {
  17028. }
  17029. }
  17030. class UIShowList {
  17031. }
  17032. class SoundMgr {
  17033. constructor() {
  17034. this.soundMax = 4;
  17035. this.isLoad = false;
  17036. this.soundMap = {};
  17037. this.isSound = true;
  17038. this.openShake = true;
  17039. SoundMgr._instance = this;
  17040. }
  17041. static getInstance() {
  17042. if (!this._instance) {
  17043. this._instance = new SoundMgr();
  17044. }
  17045. return this._instance;
  17046. }
  17047. init() {
  17048. console.log('zh:sm init 1');
  17049. Laya.SoundManager.autoReleaseSound = true;
  17050. Laya.SoundManager.autoStopMusic = true;
  17051. Laya.SoundManager.musicVolume = 0.3;
  17052. Laya.SoundManager.soundVolume = 0.5;
  17053. this.musicPlayed = false;
  17054. this.audioUrl = "asset/sound/ogg/";
  17055. console.log('zh:sm init 2');
  17056. console.log('zh:dev type ');
  17057. if (Laya.Browser.onAndroid) {
  17058. console.log('zh:dev type android');
  17059. this.audioUrl = "asset/sound/ogg/";
  17060. this.isLoad = true;
  17061. }
  17062. else {
  17063. console.log('zh:dev type not android');
  17064. this.audioUrl = "asset/sound/mp3/";
  17065. this.isLoad = true;
  17066. }
  17067. }
  17068. onSetting(isS) {
  17069. this.isSound = isS;
  17070. this.mute(!this.isSound);
  17071. }
  17072. clearCount() {
  17073. for (var key in this.soundMap) {
  17074. delete this.soundMap[key];
  17075. }
  17076. }
  17077. playMusic(path, loop = 0) {
  17078. console.log('zh:playMusic 1 PATH=' + path);
  17079. this.musicPath = path;
  17080. if (!this.isLoad) {
  17081. return;
  17082. }
  17083. if (!path || path == "") {
  17084. return;
  17085. }
  17086. if (!this.isSound) {
  17087. return;
  17088. }
  17089. this.musicPlayed = true;
  17090. let url = this.getUrl(path);
  17091. if (!Laya.Browser.onAndroid) {
  17092. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17093. this.play(url, loop);
  17094. }));
  17095. }
  17096. else {
  17097. this.play(url, loop);
  17098. }
  17099. }
  17100. play(url, loop) {
  17101. Laya.SoundManager.playMusic(url, loop);
  17102. }
  17103. getUrl(path) {
  17104. let url = this.audioUrl + path;
  17105. if (Laya.Browser.onAndroid) {
  17106. url += ".ogg";
  17107. }
  17108. else {
  17109. url += ".mp3";
  17110. }
  17111. return url;
  17112. }
  17113. pauseMusic(pause) {
  17114. if (pause) {
  17115. this.mute(true);
  17116. }
  17117. else if (this.isSound)
  17118. this.mute(false);
  17119. }
  17120. stopMusic() {
  17121. Laya.SoundManager.stopMusic();
  17122. if (Moyu.isNeedPlatAudio) {
  17123. Moyu.stopMusic();
  17124. }
  17125. }
  17126. mute(mute) {
  17127. if (Moyu.isNeedPlatAudio) {
  17128. Moyu.pauseMusic(mute);
  17129. }
  17130. else {
  17131. Laya.SoundManager.musicMuted = mute;
  17132. if (!mute && !this.musicPlayed && this.musicPath) {
  17133. this.playMusic(this.musicPath);
  17134. }
  17135. }
  17136. }
  17137. stopSound(path) {
  17138. let url = this.getUrl(path);
  17139. Laya.SoundManager.stopSound(url);
  17140. }
  17141. playSound(path, loop = 1, soundMax = this.soundMax) {
  17142. if (!this.isLoad)
  17143. return;
  17144. if (!this.isSound)
  17145. return;
  17146. if (!path || path == "")
  17147. return;
  17148. let url = this.getUrl(path);
  17149. if (Moyu.isNeedPlatAudio) {
  17150. Moyu.playSound(path, loop == 0);
  17151. }
  17152. else {
  17153. let count = 1;
  17154. if (this.soundMap[path])
  17155. count = this.soundMap[path] + 1;
  17156. if (count > soundMax)
  17157. return;
  17158. this.soundMap[path] = count;
  17159. Laya.SoundManager.playSound(url, loop);
  17160. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17161. }
  17162. }
  17163. removePath(path) {
  17164. if (this.soundMap[path]) {
  17165. let count = this.soundMap[path];
  17166. count--;
  17167. if (count < 1)
  17168. delete this.soundMap[path];
  17169. else
  17170. this.soundMap[path] = count;
  17171. }
  17172. }
  17173. playBtnSound() {
  17174. this.playSound("btn");
  17175. }
  17176. playGetSound() {
  17177. }
  17178. playCloseUISound() {
  17179. }
  17180. }
  17181. SoundMgr._instance = null;
  17182. var Handler$1 = Laya.Handler;
  17183. var EResType;
  17184. (function (EResType) {
  17185. EResType[EResType["none"] = 0] = "none";
  17186. EResType[EResType["nromal"] = 1] = "nromal";
  17187. EResType[EResType["td"] = 2] = "td";
  17188. EResType[EResType["sk"] = 3] = "sk";
  17189. })(EResType || (EResType = {}));
  17190. class CResLoader {
  17191. constructor(doneCall, proCall) {
  17192. this.completrCall = doneCall;
  17193. this.progressCall = proCall;
  17194. this.progressHander = new Handler$1(this, this.onProgress);
  17195. this.tdResMap = {};
  17196. }
  17197. load(resList) {
  17198. this.resCount = 0;
  17199. this.loadCount = 0;
  17200. for (let i = 0; i < resList.length; i++) {
  17201. let path = resList[i];
  17202. if (!path)
  17203. continue;
  17204. this.resCount++;
  17205. let type = this.getResType(path);
  17206. if (type == EResType.nromal)
  17207. this.loadNromal(path);
  17208. else if (type == EResType.td)
  17209. this.loadTd(path);
  17210. }
  17211. }
  17212. getRes(path) {
  17213. let type = this.getResType(path);
  17214. if (type == EResType.nromal)
  17215. return Laya.loader.getRes(path);
  17216. else if (type == EResType.td) {
  17217. let res = this.tdResMap[path];
  17218. if (res)
  17219. return res.clone();
  17220. return null;
  17221. }
  17222. }
  17223. destroy() {
  17224. this.progressHander.clear();
  17225. this.progressHander = null;
  17226. }
  17227. clearRes(path) {
  17228. let type = this.getResType(path);
  17229. if (type == EResType.nromal)
  17230. Laya.loader.clearRes(path);
  17231. else if (type == EResType.td) {
  17232. let obj = this.tdResMap[path];
  17233. if (obj)
  17234. obj.destroy();
  17235. delete this.tdResMap[path];
  17236. }
  17237. }
  17238. getResType(path) {
  17239. let exs = this.getExtension(path);
  17240. if (exs == "sk")
  17241. return EResType.sk;
  17242. if (exs == "ls" || exs == "lh" || exs == "lm")
  17243. return EResType.td;
  17244. else
  17245. return EResType.nromal;
  17246. }
  17247. getExtension(res) {
  17248. var index = res.lastIndexOf(".");
  17249. return res.substr(index + 1);
  17250. }
  17251. loadNromal(path) {
  17252. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17253. if (res) {
  17254. this.onLoad();
  17255. }
  17256. else
  17257. console.log("load res fail:" + path);
  17258. }), this.progressHander);
  17259. }
  17260. loadSk() {
  17261. }
  17262. loadTd(path) {
  17263. if (this.tdResMap[path]) {
  17264. this.onLoad();
  17265. return;
  17266. }
  17267. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17268. if (res) {
  17269. this.tdResMap[path] = res;
  17270. this.onLoad();
  17271. }
  17272. else
  17273. console.log("load res fail:" + path);
  17274. }));
  17275. }
  17276. onLoad() {
  17277. this.loadCount++;
  17278. this.onProgress(1);
  17279. if (this.loadCount >= this.resCount) {
  17280. this.completrCall.run();
  17281. }
  17282. }
  17283. onProgress(pro) {
  17284. let progress = (this.loadCount + pro) / this.resCount;
  17285. this.progressCall.runWith(progress);
  17286. }
  17287. }
  17288. var Handler$2 = Laya.Handler;
  17289. class ResInfo {
  17290. constructor() {
  17291. this.index = 0;
  17292. }
  17293. }
  17294. class ResMgr {
  17295. constructor() {
  17296. this.resList = [];
  17297. this.doneList = [];
  17298. this.resMap = {};
  17299. this.currentLoad = null;
  17300. this.completeHandler = new Handler$2(this, this.onComplete);
  17301. this.progressHandler = new Handler$2(this, this.onProgress);
  17302. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17303. }
  17304. static getInstance() {
  17305. if (ResMgr._instance == null) {
  17306. ResMgr._instance = new ResMgr();
  17307. }
  17308. return ResMgr._instance;
  17309. }
  17310. loadList(list, completeHandler, progressHandler) {
  17311. if (list.length < 1) {
  17312. completeHandler.run();
  17313. return;
  17314. }
  17315. let info = this.getResInfo();
  17316. info.resList = list;
  17317. info.completeHandler = completeHandler;
  17318. info.progressHandler = progressHandler;
  17319. this.resList.push(info);
  17320. this.startLoad();
  17321. }
  17322. loadFguiRes(list, completeHandler, progressHandler) {
  17323. Laya.loader.load(list, completeHandler, progressHandler);
  17324. }
  17325. loadAny(list, completeHandler, progressHandler) {
  17326. Laya.loader.load(list, completeHandler, progressHandler);
  17327. }
  17328. load(path, completeHandler, progressHandler) {
  17329. let count = this.resMap[path];
  17330. if (count && count > 0) {
  17331. if (completeHandler)
  17332. completeHandler.run();
  17333. }
  17334. else
  17335. this.loadList([path], completeHandler, progressHandler);
  17336. }
  17337. getRes(path) {
  17338. let res = this.resMap[path];
  17339. if (!res)
  17340. this.showLog("资源不存在:" + path);
  17341. else
  17342. return this.loader.getRes(path);
  17343. }
  17344. clearList(list, force = false) {
  17345. if (!list || list.length < 1)
  17346. return;
  17347. let cr = () => {
  17348. for (const k in list) {
  17349. let v = list[k];
  17350. if (!v)
  17351. continue;
  17352. if (force) {
  17353. this.loader.clearRes(v);
  17354. delete this.resMap[v];
  17355. }
  17356. else {
  17357. let count = this.resMap[v];
  17358. if (count && count > 1) {
  17359. count--;
  17360. this.resMap[v] = count;
  17361. }
  17362. else {
  17363. this.loader.clearRes(v);
  17364. delete this.resMap[v];
  17365. }
  17366. }
  17367. }
  17368. if (!window.hasOwnProperty("ks"))
  17369. Laya.Resource.destroyUnusedResources();
  17370. };
  17371. Laya.timer.clearAll(this);
  17372. Laya.timer.once(2000, this, cr);
  17373. }
  17374. clear3D() {
  17375. for (const k in this.loader.tdResMap) {
  17376. this.loader.clearRes(k);
  17377. if (this.resMap[k])
  17378. delete this.resMap[k];
  17379. }
  17380. if (!window.hasOwnProperty("ks"))
  17381. Laya.Resource.destroyUnusedResources();
  17382. }
  17383. clear(path, force = false) {
  17384. this.clearList([path], force);
  17385. }
  17386. getResInfo() {
  17387. if (this.doneList.length > 0)
  17388. return this.doneList.pop();
  17389. else
  17390. return new ResInfo();
  17391. }
  17392. startLoad() {
  17393. if (this.currentLoad)
  17394. return;
  17395. this.currentLoad = this.resList.pop();
  17396. if (this.currentLoad) {
  17397. this.loader.load(this.currentLoad.resList);
  17398. }
  17399. }
  17400. onComplete() {
  17401. if (!this.currentLoad)
  17402. return;
  17403. for (const k in this.currentLoad.resList) {
  17404. let v = this.currentLoad.resList[k];
  17405. let count = this.resMap[v];
  17406. if (count)
  17407. count++;
  17408. else
  17409. count = 1;
  17410. this.resMap[v] = count;
  17411. }
  17412. if (this.currentLoad.completeHandler)
  17413. this.currentLoad.completeHandler.run();
  17414. this.doneList.push(this.currentLoad);
  17415. this.currentLoad = null;
  17416. this.startLoad();
  17417. }
  17418. onProgress(pro) {
  17419. if (!this.currentLoad)
  17420. return;
  17421. if (this.currentLoad.progressHandler)
  17422. this.currentLoad.progressHandler.runWith(pro);
  17423. }
  17424. showLog(str, ...args) {
  17425. console.log("[ResLoader] " + str);
  17426. }
  17427. }
  17428. ResMgr._instance = null;
  17429. class EventMgr extends Laya.EventDispatcher {
  17430. }
  17431. let eventMgr = new EventMgr();
  17432. /*! *****************************************************************************
  17433. Copyright (c) Microsoft Corporation. All rights reserved.
  17434. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17435. this file except in compliance with the License. You may obtain a copy of the
  17436. License at http://www.apache.org/licenses/LICENSE-2.0
  17437. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17438. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17439. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17440. MERCHANTABLITY OR NON-INFRINGEMENT.
  17441. See the Apache Version 2.0 License for specific language governing permissions
  17442. and limitations under the License.
  17443. ***************************************************************************** */
  17444. /* global Reflect, Promise */
  17445. var extendStatics = function(d, b) {
  17446. extendStatics = Object.setPrototypeOf ||
  17447. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17448. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17449. return extendStatics(d, b);
  17450. };
  17451. function __extends(d, b) {
  17452. extendStatics(d, b);
  17453. function __() { this.constructor = d; }
  17454. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17455. }
  17456. var __assign = function() {
  17457. __assign = Object.assign || function __assign(t) {
  17458. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17459. s = arguments[i];
  17460. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17461. }
  17462. return t;
  17463. };
  17464. return __assign.apply(this, arguments);
  17465. };
  17466. function __rest(s, e) {
  17467. var t = {};
  17468. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17469. t[p] = s[p];
  17470. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17471. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17472. t[p[i]] = s[p[i]];
  17473. return t;
  17474. }
  17475. function __decorate(decorators, target, key, desc) {
  17476. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17477. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17478. 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;
  17479. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17480. }
  17481. function __param(paramIndex, decorator) {
  17482. return function (target, key) { decorator(target, key, paramIndex); }
  17483. }
  17484. function __metadata(metadataKey, metadataValue) {
  17485. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17486. }
  17487. function __awaiter(thisArg, _arguments, P, generator) {
  17488. return new (P || (P = Promise))(function (resolve, reject) {
  17489. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17490. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17491. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17492. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17493. });
  17494. }
  17495. function __generator(thisArg, body) {
  17496. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17497. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17498. function verb(n) { return function (v) { return step([n, v]); }; }
  17499. function step(op) {
  17500. if (f) throw new TypeError("Generator is already executing.");
  17501. while (_) try {
  17502. 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;
  17503. if (y = 0, t) op = [op[0] & 2, t.value];
  17504. switch (op[0]) {
  17505. case 0: case 1: t = op; break;
  17506. case 4: _.label++; return { value: op[1], done: false };
  17507. case 5: _.label++; y = op[1]; op = [0]; continue;
  17508. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17509. default:
  17510. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17511. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17512. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17513. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17514. if (t[2]) _.ops.pop();
  17515. _.trys.pop(); continue;
  17516. }
  17517. op = body.call(thisArg, _);
  17518. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17519. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17520. }
  17521. }
  17522. function __exportStar(m, exports) {
  17523. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17524. }
  17525. function __values(o) {
  17526. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17527. if (m) return m.call(o);
  17528. return {
  17529. next: function () {
  17530. if (o && i >= o.length) o = void 0;
  17531. return { value: o && o[i++], done: !o };
  17532. }
  17533. };
  17534. }
  17535. function __read(o, n) {
  17536. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17537. if (!m) return o;
  17538. var i = m.call(o), r, ar = [], e;
  17539. try {
  17540. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17541. }
  17542. catch (error) { e = { error: error }; }
  17543. finally {
  17544. try {
  17545. if (r && !r.done && (m = i["return"])) m.call(i);
  17546. }
  17547. finally { if (e) throw e.error; }
  17548. }
  17549. return ar;
  17550. }
  17551. function __spread() {
  17552. for (var ar = [], i = 0; i < arguments.length; i++)
  17553. ar = ar.concat(__read(arguments[i]));
  17554. return ar;
  17555. }
  17556. function __await(v) {
  17557. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17558. }
  17559. function __asyncGenerator(thisArg, _arguments, generator) {
  17560. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17561. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17562. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17563. 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); }); }; }
  17564. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17565. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17566. function fulfill(value) { resume("next", value); }
  17567. function reject(value) { resume("throw", value); }
  17568. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17569. }
  17570. function __asyncDelegator(o) {
  17571. var i, p;
  17572. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17573. 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; }
  17574. }
  17575. function __asyncValues(o) {
  17576. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17577. var m = o[Symbol.asyncIterator], i;
  17578. 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);
  17579. 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); }); }; }
  17580. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17581. }
  17582. function __makeTemplateObject(cooked, raw) {
  17583. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17584. return cooked;
  17585. };
  17586. function __importStar(mod) {
  17587. if (mod && mod.__esModule) return mod;
  17588. var result = {};
  17589. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17590. result.default = mod;
  17591. return result;
  17592. }
  17593. function __importDefault(mod) {
  17594. return (mod && mod.__esModule) ? mod : { default: mod };
  17595. }
  17596. class CustomAlert {
  17597. static show(title, content, buttons) {
  17598. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17599. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17600. return;
  17601. }
  17602. const bg = new Laya.Box();
  17603. bg.alpha = 0;
  17604. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17605. Laya.stage.addChild(bg);
  17606. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17607. const panel = new Laya.Box();
  17608. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17609. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17610. bg.addChild(panel);
  17611. const titleText = new Laya.Text();
  17612. titleText.text = title;
  17613. titleText.fontSize = 32;
  17614. titleText.color = "#333333";
  17615. titleText.bold = true;
  17616. titleText.pos(20, 20);
  17617. titleText.width = 360;
  17618. titleText.align = "center";
  17619. panel.addChild(titleText);
  17620. const contentText = new Laya.Text();
  17621. contentText.text = content;
  17622. contentText.fontSize = 21;
  17623. contentText.color = "#555555";
  17624. contentText.pos(20, 70);
  17625. contentText.width = 360;
  17626. contentText.wordWrap = true;
  17627. contentText.align = "center";
  17628. panel.addChild(contentText);
  17629. const buttonContainer = new Laya.Box();
  17630. buttonContainer.pos(20, 160);
  17631. panel.addChild(buttonContainer);
  17632. const btnWidth = 120;
  17633. const spacing = 30;
  17634. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17635. buttons.forEach((btn, index) => {
  17636. const button = new Laya.Button();
  17637. button.label = btn.label;
  17638. button.size(btnWidth, 40);
  17639. button.labelSize = 22;
  17640. button.pos(index * (btnWidth + spacing), 0);
  17641. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17642. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17643. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17644. button.alpha = 0.9;
  17645. });
  17646. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17647. button.alpha = 1;
  17648. });
  17649. button.on(Laya.Event.CLICK, this, () => {
  17650. btn.handler();
  17651. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17652. bg.removeSelf();
  17653. }));
  17654. });
  17655. buttonContainer.addChild(button);
  17656. });
  17657. buttonContainer.x = (panel.width - totalWidth) / 2;
  17658. }
  17659. }
  17660. class ConfigMgr {
  17661. constructor() {
  17662. this.httpReqCount = 4;
  17663. this.httpReqOkCount = 0;
  17664. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17665. try {
  17666. this.httpReqOkCount = 0;
  17667. let reqData = xGame.httpMgr.getReqData();
  17668. console.log('zh:第1个请求getClassicCfg');
  17669. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17670. this.classicCfg = classicCfg;
  17671. this.httpReqOkCount++;
  17672. console.log('zh:第2个请求getLevelCfg');
  17673. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17674. this.levelCfg = levelCfg;
  17675. this.httpReqOkCount++;
  17676. console.log('zh:第3个请求 getPlaceBallCfg');
  17677. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17678. this.placeBallCfg = placeBallCfg;
  17679. this.httpReqOkCount++;
  17680. console.log('zh:第4个请求 npc');
  17681. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17682. this.npcJson = npc.Data;
  17683. this.httpReqOkCount++;
  17684. console.log('zh:所有配置加载完成');
  17685. }
  17686. catch (error) {
  17687. console.error('❌请求失败:', error);
  17688. Laya.timer.once(5000, this, () => {
  17689. let retryCount = 0;
  17690. const maxRetries = 3;
  17691. const tryFetchConfig = () => {
  17692. try {
  17693. xGame.cfgMgr.getConfigFromServer();
  17694. }
  17695. catch (error) {
  17696. if (retryCount < maxRetries) {
  17697. retryCount++;
  17698. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17699. Laya.timer.once(5000, this, tryFetchConfig);
  17700. }
  17701. else {
  17702. console.error("❌ 达到最大重试次数,配置获取失败");
  17703. }
  17704. }
  17705. };
  17706. tryFetchConfig();
  17707. });
  17708. }
  17709. finally {
  17710. if (this.httpReqCount > this.httpReqOkCount) {
  17711. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17712. {
  17713. label: "Okay", handler: () => {
  17714. console.log("zh:好的知道了");
  17715. JSBridgeUtils.instance.exitAndCloseGame();
  17716. }
  17717. }
  17718. ]);
  17719. }
  17720. }
  17721. });
  17722. this.sendPostAsync = (action, reqData) => {
  17723. return new Promise((resolve, reject) => {
  17724. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17725. try {
  17726. let code = res.code;
  17727. if (code == 200) {
  17728. const parsedData = JSON.parse(res.msg);
  17729. resolve(parsedData);
  17730. }
  17731. else {
  17732. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17733. reject(new Error(`Request failed with code: ${code}`));
  17734. }
  17735. }
  17736. catch (error) {
  17737. console.error(`ERROR=${error}`);
  17738. alert("Please check your network connection.");
  17739. reject(error);
  17740. }
  17741. finally {
  17742. console.log(`zh:${action}的请求处理完毕`);
  17743. }
  17744. });
  17745. });
  17746. };
  17747. }
  17748. static getInstance() {
  17749. if (!this._instance) {
  17750. this._instance = new ConfigMgr();
  17751. }
  17752. return this._instance;
  17753. }
  17754. init() {
  17755. this.getConfigFromServer();
  17756. }
  17757. test() {
  17758. let reqData = xGame.httpMgr.getReqData();
  17759. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17760. console.log('zh:1s');
  17761. try {
  17762. let code = res.code;
  17763. let data = res.data;
  17764. if (code == 200) {
  17765. const parsedData = JSON.parse(data);
  17766. this.classicCfg = parsedData;
  17767. }
  17768. else {
  17769. console.log('zh:res = ' + JSON.stringify(res));
  17770. }
  17771. }
  17772. catch (error) {
  17773. console.log('error=' + error);
  17774. alert("Please check your network connection.");
  17775. }
  17776. finally {
  17777. console.log('zh:1');
  17778. }
  17779. });
  17780. }
  17781. getUserInfoByIndex(index) {
  17782. return this.npcJson[index];
  17783. }
  17784. getRandomUserInfo() {
  17785. let index = xGame.tools.random(0, this.npcJson.length);
  17786. let rs = this.npcJson[index];
  17787. return rs;
  17788. }
  17789. getMaxBigMoveLength() {
  17790. return Object.keys(this.levelCfg).length;
  17791. }
  17792. getBigMoveLevelByIndex(index) {
  17793. let cfg = this.levelCfg;
  17794. cfg = cfg[index];
  17795. return cfg;
  17796. }
  17797. getRandomClassicLevel() {
  17798. let cfg = this.classicCfg;
  17799. let num = Object.keys(cfg).length;
  17800. let rand = xGame.common.randomNum(1, num);
  17801. return cfg[rand];
  17802. }
  17803. getPlaceBallByLevel(level) {
  17804. return this.placeBallCfg[level];
  17805. }
  17806. getMaxPlaceBall() {
  17807. return Object.keys(this.placeBallCfg).length;
  17808. }
  17809. }
  17810. class PoolD3Mgr {
  17811. constructor() {
  17812. this.pool = {};
  17813. }
  17814. static get ins() {
  17815. return this._ins || (this._ins = new PoolD3Mgr);
  17816. }
  17817. createList(key, prefab, parent) {
  17818. if (!this.pool[key]) {
  17819. this.pool[key] = {};
  17820. this.pool[key].prefab = prefab;
  17821. this.pool[key].list = [];
  17822. this.pool[key].parent = parent;
  17823. }
  17824. }
  17825. getItem(key) {
  17826. if (!this.pool[key]) {
  17827. return;
  17828. }
  17829. let temp;
  17830. if (this.pool[key].list.length > 0) {
  17831. temp = this.pool[key].list.pop();
  17832. }
  17833. else {
  17834. temp = this.pool[key].prefab.clone();
  17835. if (this.pool[key].parent) {
  17836. this.pool[key].parent.addChild(temp);
  17837. }
  17838. }
  17839. temp.active = true;
  17840. return temp;
  17841. }
  17842. putItem(key, obj) {
  17843. if (!this.pool[key]) {
  17844. return;
  17845. }
  17846. obj.active = false;
  17847. this.pool[key].list.push(obj);
  17848. }
  17849. }
  17850. let context$1 = context;
  17851. let uiMgr = UIMgr.inst;
  17852. let soundMgr = SoundMgr.getInstance();
  17853. let resMgr = ResMgr.getInstance();
  17854. let httpMgr = HttpMgr.getInstance();
  17855. let common = Common.getInstance();
  17856. let cfgMgr = ConfigMgr.getInstance();
  17857. let poolD3Mgr = PoolD3Mgr.ins;
  17858. let d3TexUrl = "res/d3Res/";
  17859. let d3ModeUrl = "res/unityRes/";
  17860. function setStageSize(view) {
  17861. if (view.width) {
  17862. view.width = Laya.stage.width;
  17863. view.height = Laya.stage.height;
  17864. }
  17865. }
  17866. function filledBg(view) {
  17867. let wh = Laya.stage.height / Laya.stage.width;
  17868. if (wh > 16 / 9) {
  17869. view.height = Laya.stage.height;
  17870. view.width = Laya.stage.height / 1334 * 750;
  17871. }
  17872. else {
  17873. view.width = Laya.stage.width;
  17874. view.height = Laya.stage.width / 750 * 1334;
  17875. }
  17876. }
  17877. function setNotch(view) {
  17878. if (view.height) {
  17879. view.y += context$1.notchHeight;
  17880. }
  17881. }
  17882. function showTip(str) {
  17883. uiMgr.Show(UIMsg, str);
  17884. }
  17885. function log(...args) {
  17886. console.log(args);
  17887. }
  17888. let xGame = {
  17889. context: context$1,
  17890. eventMgr,
  17891. resMgr,
  17892. uiMgr,
  17893. soundMgr,
  17894. define,
  17895. tools,
  17896. httpMgr,
  17897. d3TexUrl,
  17898. d3ModeUrl,
  17899. common,
  17900. cfgMgr,
  17901. poolD3Mgr,
  17902. setStageSize,
  17903. filledBg,
  17904. setNotch,
  17905. showTip,
  17906. log,
  17907. };
  17908. window["xGame"] = xGame;
  17909. let dataName = 'tBall_';
  17910. class UserData {
  17911. constructor() {
  17912. this.userId = "";
  17913. this.isAgree = false;
  17914. this.coinNum = 0;
  17915. this.gemNum = 0;
  17916. this.sound = true;
  17917. this.vibration = true;
  17918. this.currentDate = 0;
  17919. this.createTime = 0;
  17920. this.awardTime = 0;
  17921. this.roleId = 1;
  17922. this.roleList = [];
  17923. this.roleAds = [];
  17924. this.dressId = 101;
  17925. this.itemId = 201;
  17926. this.bigSkills = [1, 1, 1, 1, 1];
  17927. this.coin = 4000;
  17928. this.diamond = 0;
  17929. this.skillSuccessTimes = 0;
  17930. this.skillGuide = 0;
  17931. this.skillAccTimes = 0;
  17932. this.placeBallData = [];
  17933. this.shareDiamondTimes = 0;
  17934. this.dailyVideoShareTimes = 0;
  17935. this.secretary = [1, 0];
  17936. this.curSecretary = 0;
  17937. this.ballRod = [1, 0, 0, 0, 0, 1];
  17938. this.curBallRod = 5;
  17939. this.signData = 0;
  17940. this.signTime = 0;
  17941. this.drawTimes = 0;
  17942. this.drawAwardTimes = 0;
  17943. this.dailyfreeDrawTimes = 1;
  17944. this.power = 5;
  17945. this.powerTime = 0;
  17946. this.challengeTimes = 0;
  17947. this.extraSign = 0;
  17948. this.classicTimes = 0;
  17949. this.guideHelpLine = 0;
  17950. this.newUser = true;
  17951. this.rootBallFoul = 0;
  17952. this.timeoutFoul = 0;
  17953. this.roleList = [1];
  17954. }
  17955. saveData() {
  17956. let data = {};
  17957. for (let k in this) {
  17958. data[k.toString()] = this[k];
  17959. }
  17960. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17961. }
  17962. getData() {
  17963. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17964. if (ld) {
  17965. let localData = JSON.parse(ld);
  17966. if (localData) {
  17967. for (let k in this) {
  17968. let key = k.toString();
  17969. let data = localData[key];
  17970. if (data != undefined) {
  17971. this[k] = data;
  17972. }
  17973. }
  17974. }
  17975. }
  17976. }
  17977. }
  17978. class ItemData {
  17979. constructor() {
  17980. this.itemList = {};
  17981. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17982. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17983. }
  17984. saveData() {
  17985. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17986. }
  17987. getData() {
  17988. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17989. if (ld) {
  17990. let localData = JSON.parse(ld);
  17991. if (localData) {
  17992. this.itemList = localData;
  17993. }
  17994. }
  17995. }
  17996. }
  17997. class GameData {
  17998. constructor() {
  17999. this.curLevel = 0;
  18000. this.gameType = 1;
  18001. this.signIdx = 0;
  18002. this.signMax = 0;
  18003. this.rotaryTime = 0;
  18004. this.rotaryCount = 0;
  18005. this.rotaryList = [];
  18006. this.diyCount = 3;
  18007. this.awardIdx = 0;
  18008. this.shareNum = 2;
  18009. this.rankWeek = 0;
  18010. this.rankScore = 0;
  18011. this.gameCount = 0;
  18012. this.trySkill = -1;
  18013. this.tryTime = 0;
  18014. }
  18015. saveData() {
  18016. let data = {};
  18017. for (let k in this) {
  18018. data[k.toString()] = this[k];
  18019. }
  18020. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18021. }
  18022. getData() {
  18023. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18024. if (ld) {
  18025. let localData = JSON.parse(ld);
  18026. if (localData) {
  18027. for (let k in this) {
  18028. let key = k.toString();
  18029. let data = localData[key];
  18030. if (data != undefined) {
  18031. this[k] = data;
  18032. }
  18033. }
  18034. }
  18035. }
  18036. }
  18037. }
  18038. class Diy2025GameData {
  18039. constructor() {
  18040. this.challengeMode_overLev = 0;
  18041. this.xszyForClassic = false;
  18042. this.xszyForChallenge = false;
  18043. }
  18044. saveData() {
  18045. let data = {};
  18046. for (let k in this) {
  18047. data[k.toString()] = this[k];
  18048. }
  18049. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18050. }
  18051. getData() {
  18052. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18053. if (ld) {
  18054. let localData = JSON.parse(ld);
  18055. if (localData) {
  18056. for (let k in this) {
  18057. let key = k.toString();
  18058. let data = localData[key];
  18059. if (data != undefined) {
  18060. this[k] = data;
  18061. }
  18062. }
  18063. }
  18064. }
  18065. }
  18066. }
  18067. class DataMgr {
  18068. static Init() {
  18069. this.userData = new UserData();
  18070. this.gameData = new GameData();
  18071. this.itemData = new ItemData();
  18072. this.diyGameData = new Diy2025GameData();
  18073. this.userData.getData();
  18074. this.gameData.getData();
  18075. this.itemData.getData();
  18076. this.diyGameData.getData();
  18077. this.roleId = this.userData.roleId;
  18078. this.resetUse();
  18079. }
  18080. static isNewDay() {
  18081. Moyu.isNewDay(this, (isnew) => {
  18082. xGame.common.isNewDay = isnew;
  18083. if (!isnew)
  18084. return;
  18085. DataMgr.setShareDiamondTimes(0, false);
  18086. DataMgr.setDailyVideoShareTimes(0, false);
  18087. DataMgr.setDailyfreeDrawTimes(1);
  18088. DataMgr.setExtraSign(0);
  18089. });
  18090. }
  18091. static deletData() {
  18092. Laya.LocalStorage.clear();
  18093. }
  18094. static upRankData() {
  18095. let num = xGame.common.getAllStarNum();
  18096. if (num > 0)
  18097. Moyu.upRankData(xGame.common.curRankID, num);
  18098. }
  18099. static addItem(id, count = 1) {
  18100. let v = this.itemData.itemList[id];
  18101. if (!v)
  18102. v = { id: id, count: count, adnum: 0, active: true };
  18103. else {
  18104. if (v.active) {
  18105. v.count += count;
  18106. }
  18107. else {
  18108. v.count = count;
  18109. v.active = true;
  18110. }
  18111. }
  18112. this.itemData.itemList[id] = v;
  18113. xGame.soundMgr.playGetSound();
  18114. this.saveItemData();
  18115. }
  18116. static hasItem(id) {
  18117. let v = this.itemData.itemList[id];
  18118. if (v && v.active)
  18119. return true;
  18120. return false;
  18121. }
  18122. static getItem(id) {
  18123. let v = this.itemData.itemList[id];
  18124. return v;
  18125. }
  18126. static getItemCount(id) {
  18127. let v = this.itemData.itemList[id];
  18128. if (v && v.active)
  18129. return v.count;
  18130. return 0;
  18131. }
  18132. static getItemAd(id) {
  18133. let v = this.itemData.itemList[id];
  18134. if (v) {
  18135. return v.adnum;
  18136. }
  18137. return 0;
  18138. }
  18139. static onItemAd(id, num = 1) {
  18140. let v = this.itemData.itemList[id];
  18141. if (!v)
  18142. v = { id: id, count: 1, adnum: num, active: false };
  18143. else
  18144. v.adnum += num;
  18145. this.itemData.itemList[id] = v;
  18146. this.saveItemData();
  18147. }
  18148. static costItem(id, count) {
  18149. let v = this.itemData.itemList[id];
  18150. if (v && v.active) {
  18151. if (v.count < count)
  18152. return false;
  18153. else {
  18154. v.count -= count;
  18155. this.itemData.itemList[id] = v;
  18156. return true;
  18157. }
  18158. }
  18159. return false;
  18160. }
  18161. static resetUse() {
  18162. this.dressId = this.userData.dressId;
  18163. this.itemId = this.userData.itemId;
  18164. }
  18165. static passLevel() {
  18166. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18167. this.gameData.curLevel++;
  18168. this.curLevel = this.gameData.curLevel;
  18169. this.saveGameData();
  18170. }
  18171. static useRole(id) {
  18172. this.roleId = id;
  18173. if (this.hasRole(id)) {
  18174. this.userData.roleId = id;
  18175. this.saveUserData();
  18176. }
  18177. }
  18178. static addRole(id) {
  18179. if (this.hasRole(id))
  18180. return;
  18181. this.userData.roleList.push(id);
  18182. this.saveUserData();
  18183. }
  18184. static hasRole(id) {
  18185. return this.userData.roleList.indexOf(id) >= 0;
  18186. }
  18187. static gemEnough(num) {
  18188. return this.userData.gemNum >= num;
  18189. }
  18190. static roleHasAd(id) {
  18191. let count = this.userData.roleAds[id];
  18192. if (count != undefined && count >= 0)
  18193. return true;
  18194. else
  18195. return false;
  18196. }
  18197. static saveUserData(time = 500, event, arg) {
  18198. if (this.userSaving)
  18199. return;
  18200. this.userSaving = true;
  18201. Laya.timer.once(time, this, () => {
  18202. this.userSaving = false;
  18203. this.userData.saveData();
  18204. if (event)
  18205. xGame.eventMgr.event(event, arg);
  18206. });
  18207. }
  18208. static saveGameData() {
  18209. if (this.gameSaving)
  18210. return;
  18211. this.gameSaving = true;
  18212. Laya.timer.once(1000, this, () => {
  18213. this.gameSaving = false;
  18214. this.gameData.saveData();
  18215. });
  18216. }
  18217. static saveItemData() {
  18218. let fun = () => {
  18219. this.itemData.saveData();
  18220. };
  18221. Laya.timer.clear(this, fun);
  18222. Laya.timer.once(500, this, fun);
  18223. }
  18224. static saveData() {
  18225. this.saveUserData();
  18226. this.saveGameData();
  18227. }
  18228. static getBigSkillList() {
  18229. return this.userData.bigSkills;
  18230. }
  18231. static getBigSkillByIndex(index) {
  18232. return this.userData.bigSkills[index];
  18233. }
  18234. static setBigSkill(index, val, addUp = true) {
  18235. if (addUp) {
  18236. this.userData.bigSkills[index] += val;
  18237. }
  18238. else {
  18239. this.userData.bigSkills[index] = val;
  18240. }
  18241. this.saveUserData();
  18242. }
  18243. static coinEnough(need) {
  18244. if (typeof need != "number") {
  18245. console.error("金币格式错误");
  18246. return;
  18247. }
  18248. return this.userData.coin >= need;
  18249. }
  18250. static setCoin(val) {
  18251. if (typeof val != "number") {
  18252. return;
  18253. }
  18254. this.userData.coin += val;
  18255. this.saveUserData();
  18256. xGame.eventMgr.event(COIN_CHANGE);
  18257. this.updateUserInfo2Server("jb");
  18258. }
  18259. static setCoinFormServer(val) {
  18260. if (typeof val != "number") {
  18261. return;
  18262. }
  18263. this.userData.coin = val;
  18264. this.saveUserData();
  18265. xGame.eventMgr.event(COIN_CHANGE);
  18266. }
  18267. static getCoin() {
  18268. return this.userData.coin;
  18269. }
  18270. static diamondEnough(need) {
  18271. if (typeof need != "number") {
  18272. console.error("金币格式错误");
  18273. return;
  18274. }
  18275. return this.userData.diamond >= need;
  18276. }
  18277. static setDiamond(val) {
  18278. if (typeof val != "number") {
  18279. return;
  18280. }
  18281. this.userData.diamond += val;
  18282. this.saveUserData();
  18283. xGame.eventMgr.event(DIAMOND_CHANGE);
  18284. this.updateUserInfo2Server("zs");
  18285. }
  18286. static setDiamondFormServer(val) {
  18287. if (typeof val != "number") {
  18288. return;
  18289. }
  18290. this.userData.diamond = val;
  18291. this.saveUserData();
  18292. xGame.eventMgr.event(DIAMOND_CHANGE);
  18293. }
  18294. static getDiamond() {
  18295. return this.userData.diamond;
  18296. }
  18297. static getSkillSuccessTimes() {
  18298. return this.userData.skillSuccessTimes;
  18299. }
  18300. static setSkillSuccessTimes(val, addUp = true) {
  18301. if (addUp)
  18302. this.userData.skillSuccessTimes += val;
  18303. else
  18304. this.userData.skillSuccessTimes = val;
  18305. this.saveUserData();
  18306. }
  18307. static getSkillAccTimes() {
  18308. return this.userData.skillAccTimes;
  18309. }
  18310. static setSkillAccTimes(val) {
  18311. this.userData.skillAccTimes += val;
  18312. this.saveUserData();
  18313. }
  18314. static getSkillGuide() {
  18315. if (!xGame.common.openGuide) {
  18316. return 1;
  18317. }
  18318. return this.userData.skillGuide;
  18319. }
  18320. static setSkillGuide(val) {
  18321. this.userData.skillGuide = val;
  18322. this.saveUserData();
  18323. }
  18324. static getPlaceBallLevelList() {
  18325. return this.userData.placeBallData;
  18326. }
  18327. static getPlaceBallLevel(level) {
  18328. let arr = this.userData.placeBallData;
  18329. let index = level - 1;
  18330. let out;
  18331. if (arr[index]) {
  18332. out = arr[index];
  18333. }
  18334. else {
  18335. let max = arr.length;
  18336. if (max == index) {
  18337. out = {
  18338. star: 0,
  18339. play: true,
  18340. isCur: true,
  18341. getAward: false
  18342. };
  18343. }
  18344. else {
  18345. out = {
  18346. star: 0,
  18347. play: false,
  18348. getAward: false
  18349. };
  18350. }
  18351. }
  18352. return out;
  18353. }
  18354. static setPlaceBallLevel(level, star) {
  18355. let arr = this.userData.placeBallData;
  18356. let index = level - 1;
  18357. if (arr[index]) {
  18358. arr[index].star = Math.max(arr[index].star, star);
  18359. }
  18360. else {
  18361. let max = arr.length;
  18362. if (max == index) {
  18363. arr.push({
  18364. star: star,
  18365. play: true,
  18366. getAward: false
  18367. });
  18368. }
  18369. else {
  18370. console.error("关卡存储出错");
  18371. }
  18372. }
  18373. this.saveUserData();
  18374. }
  18375. static setPlaceBallAward(level) {
  18376. let arr = this.userData.placeBallData;
  18377. let index = level - 1;
  18378. if (arr[index]) {
  18379. arr[index].getAward = true;
  18380. }
  18381. this.saveUserData();
  18382. }
  18383. static getShareDiamondTimes() {
  18384. return this.userData.shareDiamondTimes;
  18385. }
  18386. static setShareDiamondTimes(val, addUp = true) {
  18387. if (addUp) {
  18388. this.userData.shareDiamondTimes += val;
  18389. }
  18390. else {
  18391. this.userData.shareDiamondTimes = val;
  18392. }
  18393. this.saveUserData();
  18394. }
  18395. static getDailyVideoShareTimes() {
  18396. return this.userData.dailyVideoShareTimes;
  18397. }
  18398. static setDailyVideoShareTimes(val, addUp = true) {
  18399. if (addUp) {
  18400. this.userData.dailyVideoShareTimes += val;
  18401. }
  18402. else {
  18403. this.userData.dailyVideoShareTimes = val;
  18404. }
  18405. this.saveUserData();
  18406. }
  18407. static getSecretary(index) {
  18408. return this.userData.secretary[index];
  18409. }
  18410. static setSecretary(index, val) {
  18411. this.userData.secretary[index] = val;
  18412. this.saveUserData();
  18413. }
  18414. static getCurSecretary() {
  18415. return this.userData.curSecretary;
  18416. }
  18417. static setCurSecretary(index) {
  18418. this.userData.curSecretary = index;
  18419. this.saveUserData();
  18420. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18421. }
  18422. static getBallRod(index) {
  18423. return this.userData.ballRod[index];
  18424. }
  18425. static setBallRod(index, val) {
  18426. this.userData.ballRod[index] = val;
  18427. this.saveUserData();
  18428. }
  18429. static setBallRodFormServer(haveQiuGanJsonStr) {
  18430. if (!haveQiuGanJsonStr) {
  18431. console.log("setBallRodFormServer数据为空或未定义");
  18432. return;
  18433. }
  18434. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18435. const keys = Object.keys(haveQiuGanJsonObj);
  18436. keys.forEach(key => {
  18437. let v = haveQiuGanJsonObj[key];
  18438. let k = parseInt(key);
  18439. let idx = k - 1;
  18440. console.log('zh:更新IDX = ' + idx);
  18441. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18442. if (this.userData.ballRod[idx] === 0) {
  18443. console.log('zh: uuuuu ' + (k - 1));
  18444. this.userData.ballRod[k - 1] = 1;
  18445. this.saveUserData();
  18446. }
  18447. });
  18448. }
  18449. static getCurBallRod() {
  18450. return this.userData.curBallRod;
  18451. }
  18452. static setCurBallRod(index) {
  18453. this.userData.curBallRod = index;
  18454. this.saveUserData();
  18455. }
  18456. static setSignData(val) {
  18457. this.userData.signData = val;
  18458. this.saveUserData();
  18459. }
  18460. static getSignData() {
  18461. return this.userData.signData;
  18462. }
  18463. static setSignTime(val) {
  18464. this.userData.signTime = val;
  18465. this.saveUserData();
  18466. }
  18467. static getSignTime() {
  18468. return this.userData.signTime;
  18469. }
  18470. static getDrawTimes() {
  18471. return this.userData.drawTimes;
  18472. }
  18473. static setDrawTimes(val, addUp = true) {
  18474. if (addUp) {
  18475. this.userData.drawTimes += val;
  18476. }
  18477. else {
  18478. this.userData.drawTimes = val;
  18479. }
  18480. this.saveUserData();
  18481. }
  18482. static getDrawAwardTimes() {
  18483. return this.userData.drawAwardTimes;
  18484. }
  18485. static setDrawAwardTimes(val) {
  18486. this.userData.drawAwardTimes = val;
  18487. this.saveUserData();
  18488. }
  18489. static getDailyfreeDrawTimes() {
  18490. return this.userData.dailyfreeDrawTimes;
  18491. }
  18492. static setDailyfreeDrawTimes(val) {
  18493. this.userData.dailyfreeDrawTimes = val;
  18494. this.saveUserData();
  18495. }
  18496. static setPower(val, addUp = true) {
  18497. if (addUp)
  18498. this.userData.power += val;
  18499. else
  18500. this.userData.power = val;
  18501. if (this.userData.power >= xGame.common.maxPower) {
  18502. this.userData.power = xGame.common.maxPower;
  18503. }
  18504. xGame.eventMgr.event(POWER_CHANGE, val);
  18505. this.saveUserData();
  18506. }
  18507. static getPower() {
  18508. return this.userData.power;
  18509. }
  18510. static setPowerTime(val) {
  18511. this.userData.powerTime = val;
  18512. this.saveUserData();
  18513. }
  18514. static getPowerTime() {
  18515. return this.userData.powerTime;
  18516. }
  18517. static powerEnough() {
  18518. return this.getPower() > 0;
  18519. }
  18520. static getChallengeTimes() {
  18521. return this.userData.challengeTimes;
  18522. }
  18523. static setChallengeTimes(val) {
  18524. this.userData.challengeTimes += val;
  18525. this.saveUserData();
  18526. }
  18527. static getExtraSign() {
  18528. return this.userData.extraSign;
  18529. }
  18530. static setExtraSign(val) {
  18531. this.userData.extraSign = val;
  18532. this.saveUserData();
  18533. }
  18534. static getClassicTimes() {
  18535. return this.userData.classicTimes;
  18536. }
  18537. static setClassicTimes() {
  18538. this.userData.classicTimes += 1;
  18539. this.saveUserData();
  18540. }
  18541. static getGuideHelpLine() {
  18542. return this.userData.guideHelpLine;
  18543. }
  18544. static setGuideHelpLine() {
  18545. this.userData.guideHelpLine = 1;
  18546. this.saveUserData();
  18547. }
  18548. static getNewUser() {
  18549. return this.userData.newUser;
  18550. }
  18551. static setNewUser() {
  18552. this.userData.newUser = false;
  18553. this.saveUserData();
  18554. }
  18555. static getRootBallFoul() {
  18556. return this.userData.rootBallFoul;
  18557. }
  18558. static setRootBallFoul() {
  18559. this.userData.rootBallFoul = 1;
  18560. this.saveUserData();
  18561. }
  18562. static getTimeoutFoul() {
  18563. return this.userData.timeoutFoul;
  18564. }
  18565. static setTimeoutFoul() {
  18566. this.userData.timeoutFoul = 1;
  18567. this.saveUserData();
  18568. }
  18569. static saveDiyGameData() {
  18570. if (this.diyGameSaving)
  18571. return;
  18572. this.diyGameSaving = true;
  18573. Laya.timer.once(500, this, () => {
  18574. this.diyGameSaving = false;
  18575. this.diyGameData.saveData();
  18576. });
  18577. }
  18578. static getChallengeMode_overLev() {
  18579. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18580. return this.challengeMode_overLev;
  18581. }
  18582. static setChallengeMode_overLev(levNum) {
  18583. this.diyGameData.challengeMode_overLev = levNum;
  18584. this.saveDiyGameData();
  18585. }
  18586. static updateUserInfo2Server(type, count = 0) {
  18587. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18588. if (userInfoData == null) {
  18589. return;
  18590. }
  18591. let reqData = xGame.httpMgr.getReqData();
  18592. let rd = JSON.parse(reqData);
  18593. rd.dataType = type;
  18594. let dataValue = 0;
  18595. if (type == "zs") {
  18596. dataValue = this.getDiamond();
  18597. }
  18598. if (type == "jb") {
  18599. dataValue = this.getCoin();
  18600. }
  18601. rd.dataValue = dataValue;
  18602. reqData = JSON.stringify(rd);
  18603. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18604. try {
  18605. let code = res.code;
  18606. let data = res.data;
  18607. if (code == 401) {
  18608. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18609. console.log('zh:保存资产信息失败,请重新登录 ');
  18610. return;
  18611. }
  18612. if (code == 200) {
  18613. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18614. }
  18615. else {
  18616. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18617. }
  18618. }
  18619. catch (error) {
  18620. console.log('error=' + error);
  18621. alert("Please check your network connection.");
  18622. }
  18623. finally {
  18624. }
  18625. });
  18626. }
  18627. static getUserZiChanInfo() {
  18628. console.log('zh:开始获取用户资产信息');
  18629. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18630. if (userInfoData == null) {
  18631. return;
  18632. }
  18633. let reqData = xGame.httpMgr.getReqData();
  18634. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18635. try {
  18636. console.log('zh:buySp res = ' + JSON.stringify(res));
  18637. let code = res.code;
  18638. let msg = res.msg;
  18639. if (code == 401) {
  18640. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18641. alert(TIP_MSG_key.pleaseLoginIn);
  18642. return;
  18643. }
  18644. if (code == 200) {
  18645. let d = res.data;
  18646. let zuanShi = d.zuanShi;
  18647. let jinBi = d.jinBi;
  18648. let haveQiuGanJson = d.haveQiuGanJson;
  18649. DataMgr.setDiamondFormServer(zuanShi);
  18650. DataMgr.setCoinFormServer(jinBi);
  18651. console.log('zh:更新球杆信息');
  18652. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18653. }
  18654. else {
  18655. alert(msg);
  18656. }
  18657. }
  18658. catch (error) {
  18659. console.log('error=' + error);
  18660. alert(error);
  18661. }
  18662. finally {
  18663. }
  18664. });
  18665. }
  18666. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18667. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18668. console.log('zh:updateLocalUserData=' + userInfo);
  18669. if (userInfo != null) {
  18670. if (!userInfo.buySpids) {
  18671. userInfo.buySpids = { 1: false, 7: false };
  18672. }
  18673. else {
  18674. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18675. }
  18676. userInfo.buySpids[spid] = isBuyOk;
  18677. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18678. }
  18679. else {
  18680. }
  18681. }
  18682. }
  18683. DataMgr.isNewUser = false;
  18684. DataMgr.fristEnter = true;
  18685. DataMgr.levelType = 0;
  18686. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18687. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18688. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18689. DataMgr.challengeMode_overLev = 0;
  18690. DataMgr.xszyForClassic = false;
  18691. DataMgr.xszyForChallenge = false;
  18692. DataMgr.awardId = 0;
  18693. DataMgr.awardCoin = 0;
  18694. DataMgr.sceneId = -1;
  18695. DataMgr.tryId = 0;
  18696. DataMgr.curLevel = 1;
  18697. DataMgr.vipLevel = 0;
  18698. DataMgr.maxLevel = 0;
  18699. DataMgr.awardRatio = 1;
  18700. DataMgr.gameList = [];
  18701. DataMgr.rankList = [];
  18702. DataMgr.recoverTime = 480000;
  18703. DataMgr.minScore = 0;
  18704. DataMgr.rankDis = 0;
  18705. DataMgr.userSaving = false;
  18706. DataMgr.gameSaving = false;
  18707. DataMgr.diyGameSaving = false;
  18708. class D3Tween extends Laya.Script3D {
  18709. constructor() {
  18710. super();
  18711. this.isInited = false;
  18712. }
  18713. ;
  18714. init() {
  18715. if (this.isInited)
  18716. return;
  18717. this.isInited = true;
  18718. this.gameObj = this.owner;
  18719. this.transform = this.gameObj.transform;
  18720. }
  18721. get rotX() {
  18722. return this.transform.localRotationEulerX;
  18723. }
  18724. set rotX(v) {
  18725. this.transform.localRotationEulerX = v;
  18726. }
  18727. get rotY() {
  18728. return this.transform.localRotationEulerY;
  18729. }
  18730. set rotY(v) {
  18731. this.transform.localRotationEulerY = v;
  18732. }
  18733. get rotZ() {
  18734. return this.transform.localRotationEulerZ;
  18735. }
  18736. set rotZ(v) {
  18737. this.transform.localRotationEulerZ = v;
  18738. }
  18739. get posX() {
  18740. return this.transform.localPositionX;
  18741. }
  18742. set posX(v) {
  18743. this.transform.localPositionX = v;
  18744. }
  18745. get posY() {
  18746. return this.transform.localPositionY;
  18747. }
  18748. set posY(v) {
  18749. this.transform.localPositionY = v;
  18750. }
  18751. get posZ() {
  18752. return this.transform.localPositionZ;
  18753. }
  18754. set posZ(v) {
  18755. this.transform.localPositionZ = v;
  18756. }
  18757. get rotation() {
  18758. return this.transform.localRotation;
  18759. }
  18760. set rotation(v) {
  18761. this.transform.localRotation = v;
  18762. }
  18763. }
  18764. class D2Hole extends Laya.Script {
  18765. constructor() { super(); }
  18766. onTriggerEnter(collider) {
  18767. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18768. return;
  18769. }
  18770. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18771. if (collider.owner["mySrc"].isRunSkillAni) {
  18772. return;
  18773. }
  18774. if (collider.owner["mySrc"].number != 0) {
  18775. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18776. }
  18777. xGame.common.ballColliHole(collider);
  18778. xGame.common.recoverCameraView();
  18779. }
  18780. }
  18781. }
  18782. class Table extends Laya.Script3D {
  18783. constructor() {
  18784. super();
  18785. this.isSetBorder = false;
  18786. this.inited = false;
  18787. }
  18788. ;
  18789. onAwake() {
  18790. this.init();
  18791. }
  18792. init() {
  18793. if (this.inited)
  18794. return;
  18795. this.inited = true;
  18796. this.gameObj = this.owner;
  18797. this.border = this.gameObj.getChildByName("border");
  18798. }
  18799. setBorderPos() {
  18800. if (this.isSetBorder)
  18801. return;
  18802. this.isSetBorder = true;
  18803. let ui = xGame.common.gameUI.ui;
  18804. let bar1 = this.border.getChildByName("bar1");
  18805. let bar2 = this.border.getChildByName("bar2");
  18806. let bar3 = this.border.getChildByName("bar3");
  18807. let bar4 = this.border.getChildByName("bar4");
  18808. let bar5 = this.border.getChildByName("bar5");
  18809. let bar6 = this.border.getChildByName("bar6");
  18810. this.setInfo(bar1, ui.border.bar1, "box");
  18811. this.setInfo(bar2, ui.border.bar2, "box");
  18812. this.setInfo(bar3, ui.border.bar3, "box");
  18813. this.setInfo(bar4, ui.border.bar4, "box");
  18814. this.setInfo(bar5, ui.border.bar5, "box");
  18815. this.setInfo(bar6, ui.border.bar6, "box");
  18816. let circle1 = this.border.getChildByName("circle1");
  18817. let circle2 = this.border.getChildByName("circle2");
  18818. let circle3 = this.border.getChildByName("circle3");
  18819. let circle4 = this.border.getChildByName("circle4");
  18820. let circle5 = this.border.getChildByName("circle5");
  18821. let circle6 = this.border.getChildByName("circle6");
  18822. this.setInfo(circle1, ui.border.circle1, "circle");
  18823. this.setInfo(circle2, ui.border.circle2, "circle");
  18824. this.setInfo(circle3, ui.border.circle3, "circle");
  18825. this.setInfo(circle4, ui.border.circle4, "circle");
  18826. this.setInfo(circle5, ui.border.circle5, "circle");
  18827. this.setInfo(circle6, ui.border.circle6, "circle");
  18828. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18829. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18830. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18831. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18832. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18833. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18834. let arr = xGame.common.gameMgr.holePosList;
  18835. xGame.common.gameMgr.posObj = {
  18836. "1": arr[0],
  18837. "3": arr[2],
  18838. "4": arr[3],
  18839. "6": arr[5]
  18840. };
  18841. }
  18842. initHolePos(x, y) {
  18843. if (x < 300)
  18844. x += 25;
  18845. else if (x > 1000)
  18846. x -= 25;
  18847. else if (y > 200)
  18848. y -= 10;
  18849. else
  18850. y += 10;
  18851. if (y < 200)
  18852. y += 30;
  18853. else if (y > 500)
  18854. y -= 30;
  18855. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18856. }
  18857. setInfo(d3Obj, d2Obj, type) {
  18858. let ui = xGame.common.gameUI.ui;
  18859. let sprite = new Laya.Sprite();
  18860. ui.border.displayObject.addChild(sprite);
  18861. let colli = xGame.common.getCollider(type);
  18862. sprite.addComponentIntance(colli);
  18863. let rigy = xGame.common.getRigbody();
  18864. rigy.type = "static";
  18865. sprite.addComponentIntance(rigy);
  18866. let d3Pos = d3Obj.transform.position;
  18867. xGame.common.pos3to2Convert(d3Pos);
  18868. let scaleX = d3Obj.transform.localScaleX;
  18869. let scaleZ = d3Obj.transform.localScaleZ;
  18870. let width = xGame.common.scale3to2Convert(scaleZ);
  18871. let height = xGame.common.scale3to2Convert(scaleX);
  18872. sprite.pivotX = width / 2;
  18873. sprite.pivotY = height / 2;
  18874. sprite.x = d3Pos.x;
  18875. sprite.y = d3Pos.y;
  18876. sprite.width = width;
  18877. sprite.height = height;
  18878. d2Obj.x = d3Pos.x;
  18879. d2Obj.y = d3Pos.y;
  18880. d2Obj.width = width;
  18881. d2Obj.height = height;
  18882. if (type == "box") {
  18883. colli.width = width;
  18884. colli.height = height;
  18885. colli.isSensor = false;
  18886. colli.label = "border";
  18887. }
  18888. else {
  18889. colli.radius = width / 2;
  18890. colli.isSensor = true;
  18891. colli.label = "hole";
  18892. sprite.addComponent(D2Hole);
  18893. }
  18894. }
  18895. }
  18896. class D3World extends Laya.Script3D {
  18897. constructor() {
  18898. super();
  18899. this.loadNum = 0;
  18900. this.setLoadNum = 7;
  18901. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18902. }
  18903. onAwake() {
  18904. }
  18905. loadScene() {
  18906. this.scene = this.owner;
  18907. let url = `res/unityRes/root.lh`;
  18908. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18909. this.scene.addChild(prefab);
  18910. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18911. this.putCameraInfo();
  18912. this.camera.enableHDR = false;
  18913. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18914. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18915. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18916. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18917. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18918. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18919. this.knife.active = false;
  18920. this.loadD3Obj();
  18921. }));
  18922. }
  18923. putCameraInfo() {
  18924. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18925. this.cameraObj = new cameraType();
  18926. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18927. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18928. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18929. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18930. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18931. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18932. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18933. this.visitAngleChild.init();
  18934. this.visitRootObj.posX = this.visitAngleChild.posX;
  18935. this.visitRootObj.posY = this.visitAngleChild.posY;
  18936. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18937. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18938. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18939. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18940. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18941. xGame.common.showOneCamera("mainCamera");
  18942. }
  18943. loadD3Obj() {
  18944. this.loadTable();
  18945. this.loadRoom();
  18946. this.loadInHoleParticial();
  18947. this.loadIceParticial();
  18948. this.loadHitParticial();
  18949. this.loadFireworksParticial();
  18950. this.loadBall();
  18951. }
  18952. loadInHoleParticial() {
  18953. this.loadD3Res("inHoleEft", "", (prefab) => {
  18954. prefab.addComponent(Partical);
  18955. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18956. });
  18957. }
  18958. loadIceParticial() {
  18959. this.loadD3Res("iceEft", "", (prefab) => {
  18960. prefab.addComponent(Partical);
  18961. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18962. });
  18963. }
  18964. loadHitParticial() {
  18965. this.loadD3Res("hitEft", "", (prefab) => {
  18966. prefab.addComponent(Partical);
  18967. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18968. });
  18969. }
  18970. loadFireworksParticial() {
  18971. this.loadD3Res("fireworksEft", "", (prefab) => {
  18972. prefab.addComponent(Partical);
  18973. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18974. });
  18975. }
  18976. loadBall(index = 1) {
  18977. this.loadD3Res("ball", index, (prefab) => {
  18978. this.ballPrefab = prefab;
  18979. this.ballPrefab.addComponent(Ball);
  18980. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18981. });
  18982. }
  18983. loadTable(index = 1) {
  18984. this.loadD3Res("table", index, (prefab) => {
  18985. this.tableSrc = prefab.addComponent(Table);
  18986. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18987. this.d3Hand.init();
  18988. this.tableRoot.addChild(prefab);
  18989. });
  18990. }
  18991. loadRoom(index = 1) {
  18992. this.loadD3Res("room", index, (prefab) => {
  18993. this.roomRoot.addChild(prefab);
  18994. });
  18995. }
  18996. loadD3Res(type, index, callback) {
  18997. let url = `res/unityRes/${type}${index}.lh`;
  18998. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18999. callback && callback(prefab);
  19000. this.checkResLoad();
  19001. }));
  19002. }
  19003. checkResLoad() {
  19004. this.loadNum++;
  19005. if (this.loadNum >= this.setLoadNum) {
  19006. xGame.eventMgr.event(D3RES_LOADED);
  19007. }
  19008. }
  19009. prePlayEft() {
  19010. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19011. eft.transform.localPositionX = 0;
  19012. eft.transform.localPositionY = -5;
  19013. eft.transform.localPositionZ = 0;
  19014. eft.active = true;
  19015. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19016. ice.transform.localPositionX = 0;
  19017. ice.transform.localPositionY = -5;
  19018. ice.transform.localPositionZ = 0;
  19019. ice.active = true;
  19020. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19021. hit.transform.localPositionX = 0;
  19022. hit.transform.localPositionY = -5;
  19023. hit.transform.localPositionZ = 0;
  19024. hit.active = true;
  19025. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19026. fireworks.transform.localPositionX = 0;
  19027. fireworks.transform.localPositionY = -5;
  19028. fireworks.transform.localPositionZ = 0;
  19029. fireworks.active = true;
  19030. }
  19031. }
  19032. class cameraType {
  19033. }
  19034. class MoyuMgr$1 {
  19035. static initMoyu() {
  19036. this.moyuView = new MoyuView$1();
  19037. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19038. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19039. this.moyuView.ui.displayObject.zOrder = 1000;
  19040. this.moyuView.init();
  19041. this.moyuView.showTip(true);
  19042. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19043. window['XApk'] = this;
  19044. }
  19045. static showAge(show) {
  19046. if (this.moyuView)
  19047. this.moyuView.showAge(show);
  19048. }
  19049. static onPlatMsg(idx) {
  19050. if (!MoyuMgr$1.moyuView)
  19051. return;
  19052. if (idx == '0') {
  19053. MoyuMgr$1.moyuView.showTip(false);
  19054. }
  19055. }
  19056. static showAgree(call) {
  19057. if (this.moyuView)
  19058. this.moyuView.showAgree(call);
  19059. else
  19060. call && call();
  19061. }
  19062. static showXy(type = 1) {
  19063. if (this.moyuView)
  19064. this.moyuView.showXy(type);
  19065. }
  19066. }
  19067. MoyuMgr$1.isAdvise = false;
  19068. class MoyuView$1 {
  19069. constructor() {
  19070. this.ysxyNum = 1;
  19071. this.ysJson = null;
  19072. this.ui = ui_UIMoyu.createInstance();
  19073. }
  19074. init() {
  19075. this.ui.mainBg.visible = false;
  19076. this.ui.xyNode.visible = false;
  19077. this.ui.ageNode.visible = false;
  19078. this.ui.tipNode.visible = false;
  19079. this.ui.rnNode.visible = false;
  19080. this.ui.fcmNode.visible = false;
  19081. this.ui.ageTip.visible = false;
  19082. this.ui.msgNode.visible = false;
  19083. this.ui.visible = false;
  19084. this.ui.xyNode.xyList.setVirtual();
  19085. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19086. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19087. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19088. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19089. this.ui.xyNode.btnKnown.visible = false;
  19090. this.ui.xyNode.xy1.visible = false;
  19091. this.ui.xyNode.xy2.visible = false;
  19092. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19093. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19094. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19095. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19096. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19097. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19098. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19099. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19100. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19101. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19102. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19103. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19104. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19105. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19106. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19107. this.ysxyNum = 2;
  19108. }
  19109. }
  19110. onClick(obj) {
  19111. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19112. switch (obj) {
  19113. case this.ui.ageTip:
  19114. if (Moyu.isTTApk) {
  19115. this.ui.ageNode.visible = true;
  19116. this.ui.mainBg.visible = true;
  19117. }
  19118. break;
  19119. case this.ui.tipNode:
  19120. this.showTip(false);
  19121. break;
  19122. case this.ui.ageNode.btnAge:
  19123. this.ui.ageNode.visible = false;
  19124. this.ui.mainBg.visible = false;
  19125. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19126. this.ui.visible = false;
  19127. break;
  19128. case this.ui.xyNode.btnXy3:
  19129. case this.ui.xyNode.btnXy1:
  19130. this.loadXy(1);
  19131. break;
  19132. case this.ui.xyNode.btnXy2:
  19133. this.loadXy(2);
  19134. break;
  19135. case this.ui.xyNode.btnBack:
  19136. this.ui.xyNode.xy1.visible = true;
  19137. this.ui.xyNode.xy2.visible = false;
  19138. break;
  19139. case this.ui.xyNode.btnKnown:
  19140. this.ui.xyNode.visible = false;
  19141. this.ui.mainBg.visible = false;
  19142. this.ui.visible = false;
  19143. break;
  19144. case this.ui.rnNode.btnCheck:
  19145. this.check();
  19146. break;
  19147. case this.ui.rnNode.btnExit:
  19148. case this.ui.xyNode.btnNo:
  19149. this.ysxyNum--;
  19150. if (this.ysxyNum > 0)
  19151. this.showMsg("Refuse to quit the game once again");
  19152. else {
  19153. Moyu.userAgree(false);
  19154. Moyu.exit();
  19155. }
  19156. break;
  19157. case this.ui.xyNode.btnSure:
  19158. case this.ui.xyNode.btnYes:
  19159. DataMgr.userData.isAgree = true;
  19160. DataMgr.saveUserData();
  19161. this.onAgree();
  19162. break;
  19163. case this.ui.rnNode.btnDone:
  19164. this.ui.rnNode.visible = false;
  19165. this.ui.visible = false;
  19166. break;
  19167. case this.ui.fcmNode.btnRn:
  19168. this.showRn();
  19169. break;
  19170. }
  19171. }
  19172. showTip(show) {
  19173. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19174. return;
  19175. if (show) {
  19176. MoyuMgr$1.isAdvise = true;
  19177. this.ui.visible = true;
  19178. this.ui.tipNode.visible = true;
  19179. this.ui.tipNode.alpha = 1;
  19180. Laya.timer.once(1000, this, this.showTip, [false]);
  19181. }
  19182. else {
  19183. this.ui.tipNode.alpha = 1;
  19184. this.ui.tipNode.visible = true;
  19185. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19186. this.ui.tipNode.visible = false;
  19187. MoyuMgr$1.isAdvise = false;
  19188. }), 1000);
  19189. }
  19190. }
  19191. showAge(show, px = 0, py = 0) {
  19192. if (Moyu.platType > 10 && !Moyu.isIos) {
  19193. this.ui.ageTip.x = px;
  19194. this.ui.ageTip.y = py;
  19195. this.ui.ageTip.visible = show;
  19196. if (show)
  19197. this.ui.visible = true;
  19198. }
  19199. }
  19200. showAgree(call) {
  19201. this.agreeCall = call;
  19202. this.onAgree();
  19203. return;
  19204. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19205. this.showXy(0);
  19206. }
  19207. else
  19208. this.onAgree();
  19209. }
  19210. onAgree() {
  19211. if (!this.ui.ageNode.visible)
  19212. this.ui.visible = false;
  19213. this.ui.xyNode.visible = false;
  19214. Moyu.userAgree(true);
  19215. this.showAge(false);
  19216. this.agreeCall && this.agreeCall();
  19217. this.showRn();
  19218. }
  19219. showMsg(txt) {
  19220. this.ui.msgNode.txtMsg.text = txt;
  19221. this.ui.msgNode.visible = true;
  19222. this.ui.msgNode.alpha = 1;
  19223. this.ui.visible = true;
  19224. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19225. this.ui.msgNode.visible = false;
  19226. }), 2500, true);
  19227. }
  19228. showRn() {
  19229. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19230. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19231. this.ui.rnNode.rn1.visible = true;
  19232. this.ui.rnNode.rn2.visible = false;
  19233. this.ui.rnNode.rn3.visible = false;
  19234. this.ui.rnNode.rn4.visible = false;
  19235. this.ui.rnNode.visible = true;
  19236. this.ui.mainBg.visible = true;
  19237. this.ui.rnNode.btnDone.visible = false;
  19238. this.ui.rnNode.btnExit.visible = true;
  19239. this.ui.rnNode.btnCheck.visible = true;
  19240. this.ui.fcmNode.visible = false;
  19241. this.ui.visible = true;
  19242. return;
  19243. }
  19244. }
  19245. this.showFcm();
  19246. }
  19247. showFcm() {
  19248. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19249. Moyu.initFCM(true);
  19250. if (Moyu.gameTime < 1)
  19251. this.fcmLoop();
  19252. else if (Moyu.gameTime < 999)
  19253. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19254. }
  19255. }
  19256. fcmLoop() {
  19257. if (Moyu.gameTime < 1) {
  19258. this.ui.rnNode.visible = false;
  19259. this.ui.fcmNode.visible = true;
  19260. this.ui.mainBg.visible = true;
  19261. this.ui.visible = true;
  19262. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19263. Laya.timer.clear(this.ui, this.fcmLoop);
  19264. }
  19265. }
  19266. check() {
  19267. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19268. this.ui.rnNode.rn1.visible = false;
  19269. this.ui.rnNode.rn2.visible = false;
  19270. this.ui.rnNode.rn4.visible = true;
  19271. }
  19272. else if (this.ui.rnNode.rn4.visible) {
  19273. let name = this.ui.rnNode.inputName.text;
  19274. let code = this.ui.rnNode.inputCode.text;
  19275. if (code && code.length == 18) {
  19276. this.ui.rnNode.rn1.visible = false;
  19277. this.ui.rnNode.rn4.visible = false;
  19278. Moyu.authenticate(name, code, (res) => {
  19279. this.ui.rnNode.rn2.visible = !res;
  19280. this.ui.rnNode.rn3.visible = res;
  19281. this.ui.rnNode.btnDone.visible = res;
  19282. this.ui.rnNode.btnExit.visible = !res;
  19283. this.ui.rnNode.btnCheck.visible = !res;
  19284. if (res)
  19285. this.showFcm();
  19286. });
  19287. }
  19288. else
  19289. this.showMsg("信息填写不完整");
  19290. }
  19291. }
  19292. loadXy(type = 0) {
  19293. this.ui.xyNode.xy1.visible = false;
  19294. this.ui.xyNode.xy2.visible = true;
  19295. this.ui.xyNode.xyList.scrollToView(0);
  19296. if (type == 1) {
  19297. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19298. }
  19299. else if (type == 2) {
  19300. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19301. }
  19302. }
  19303. showXy(type = 0) {
  19304. this.xyBtn();
  19305. if (type == 0) {
  19306. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19307. this.ui.xyNode.btnSure.visible = true;
  19308. }
  19309. else {
  19310. this.ui.xyNode.btnYes.visible = true;
  19311. this.ui.xyNode.btnNo.visible = true;
  19312. }
  19313. }
  19314. else {
  19315. this.ui.xyNode.btnKnown.visible = true;
  19316. this.ui.mainBg.visible = true;
  19317. }
  19318. this.ui.xyNode.xy1.visible = true;
  19319. this.ui.xyNode.xy2.visible = false;
  19320. this.ui.xyNode.visible = true;
  19321. this.ui.visible = true;
  19322. }
  19323. xyBtn() {
  19324. this.ui.xyNode.btnSure.visible = false;
  19325. this.ui.xyNode.btnYes.visible = false;
  19326. this.ui.xyNode.btnNo.visible = false;
  19327. this.ui.xyNode.btnKnown.visible = false;
  19328. {
  19329. this.ui.xyNode.btnXy3.visible = false;
  19330. this.ui.xyNode.btnXy2.visible = true;
  19331. this.ui.xyNode.btnXy1.visible = true;
  19332. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19333. }
  19334. }
  19335. createXY(json) {
  19336. this.ysJson = json.content;
  19337. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19338. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19339. this.ui.xyNode.xy2.visible = true;
  19340. }
  19341. renderListItem(idx, cell) {
  19342. let xy = this.ysJson[idx];
  19343. cell.height = xy.line * 30;
  19344. cell.xyItem.text = xy.text;
  19345. }
  19346. onDestroy() {
  19347. this.agreeCall = null;
  19348. }
  19349. }
  19350. class UILoading extends UIBase {
  19351. constructor() {
  19352. super();
  19353. this.accTime = 0;
  19354. this.curNum = 0;
  19355. this.rate = 1;
  19356. this.loadSubOk = false;
  19357. this.loadResOK = false;
  19358. this.openLoading = true;
  19359. this.beginLoadRes = false;
  19360. this.finishD2 = false;
  19361. this.finishD3 = false;
  19362. }
  19363. onConstructor() {
  19364. this.ui = ui_UILoading.createInstance();
  19365. this.contentPane = this.ui;
  19366. this.isEject = false;
  19367. this._initUI();
  19368. this._addEvent();
  19369. }
  19370. _initUI() {
  19371. MoyuMgr$1.initMoyu();
  19372. }
  19373. _addEvent() {
  19374. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19375. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19376. }
  19377. show() {
  19378. super.show();
  19379. console.log('zh:加载分包资源');
  19380. loadSubRes(this.subResProgress.bind(this));
  19381. this.ui.txtLoad.text = "Loading...";
  19382. }
  19383. subResProgress(pro, finish) {
  19384. this.curNum = pro;
  19385. if (finish) {
  19386. this.curNum = 1;
  19387. this.loadSubOk = true;
  19388. }
  19389. }
  19390. laodD3Res() {
  19391. let scene3D = new Laya.Scene3D();
  19392. xGame.common.d3Scene = scene3D;
  19393. xGame.common.d3World = scene3D.addComponent(D3World);
  19394. xGame.common.d3World.loadScene();
  19395. }
  19396. loadD2Res() {
  19397. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19398. this.finishD2 = true;
  19399. this.checkLoadAll();
  19400. this.curNum = 1;
  19401. }), Laya.Handler.create(this, (pro) => {
  19402. this.curNum = pro;
  19403. }, null, false));
  19404. }
  19405. d3ResFinish() {
  19406. this.finishD3 = true;
  19407. this.checkLoadAll();
  19408. }
  19409. checkLoadAll() {
  19410. if (this.finishD2 && this.finishD3) {
  19411. this.loadResOK = true;
  19412. }
  19413. }
  19414. loadRes() {
  19415. this.laodD3Res();
  19416. this.loadD2Res();
  19417. }
  19418. myUpdate(dt) {
  19419. if (!this.openLoading)
  19420. return;
  19421. this.accTime += dt * this.rate;
  19422. if (this.accTime >= this.curNum)
  19423. this.accTime = this.curNum;
  19424. this.ui.loadinfo.value = this.accTime * 100;
  19425. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19426. if (!this.beginLoadRes) {
  19427. this.beginLoadRes = true;
  19428. this.ui.txtLoad.text = "Loading...";
  19429. this.curNum = 0;
  19430. this.accTime = 0;
  19431. this.loadRes();
  19432. }
  19433. if (this.loadResOK) {
  19434. this.openLoading = false;
  19435. Laya.timer.once(300, this, () => {
  19436. xGame.common.d3Scene.active = false;
  19437. MoyuMgr$1.showAgree(enterGame);
  19438. });
  19439. }
  19440. }
  19441. }
  19442. release() {
  19443. }
  19444. hide() {
  19445. super.hide();
  19446. this.release();
  19447. }
  19448. onClose() {
  19449. this.hide();
  19450. }
  19451. }
  19452. UILoading.uiName = "UILoading";
  19453. class UIRepentProp$1 extends UIBase {
  19454. constructor() {
  19455. super();
  19456. this.viewType = 0;
  19457. this.regretType = 0;
  19458. }
  19459. onConstructor() {
  19460. this.ui = ui_UIRepentProp.createInstance();
  19461. this.contentPane = this.ui;
  19462. this.isEject = false;
  19463. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19464. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19465. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19466. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19467. }
  19468. show(viewType, regretType, callback) {
  19469. PlatMgr.showInsert(true);
  19470. this.viewType = viewType;
  19471. this.regretType = regretType;
  19472. this.callback = callback;
  19473. super.show();
  19474. this.ui.t0.play();
  19475. this.ui.c1.selectedIndex = this.viewType;
  19476. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19477. if (this.viewType == 0) {
  19478. let guide = DataMgr.getGuideHelpLine();
  19479. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19480. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19481. }
  19482. xGame.common.gameMgr.gamePause = true;
  19483. }
  19484. hideSelf() {
  19485. xGame.common.gameMgr.gamePause = false;
  19486. this.callback && this.callback(false);
  19487. this.hide();
  19488. }
  19489. videoRegret() {
  19490. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19491. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19492. }
  19493. else {
  19494. console.log('zh:AD 失败,直接发放奖励');
  19495. this.qjff_AD_for_UIrepentProp_videoRegret();
  19496. }
  19497. }
  19498. qjff_AD_for_UIrepentProp_videoRegret() {
  19499. this.callback && this.callback(true);
  19500. this.hideSelf();
  19501. }
  19502. videoAddHelpLine() {
  19503. let guide = DataMgr.getGuideHelpLine();
  19504. if (guide == 0) {
  19505. this.callback && this.callback(true);
  19506. this.hideSelf();
  19507. DataMgr.setGuideHelpLine();
  19508. xGame.common.gameUI.ui.guideNode.visible = false;
  19509. }
  19510. else {
  19511. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19512. if (Laya.Browser.onAndroid) {
  19513. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19514. if (!boo) {
  19515. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19516. return;
  19517. }
  19518. }
  19519. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19520. }
  19521. else {
  19522. console.log('zh:AD 失败,直接发放奖励');
  19523. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19524. }
  19525. }
  19526. }
  19527. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19528. this.callback && this.callback(true);
  19529. this.hideSelf();
  19530. }
  19531. }
  19532. UIRepentProp$1.uiName = "UIRepentProp";
  19533. class UIRodMethod$1 extends UIBase {
  19534. constructor() {
  19535. super();
  19536. this.isPressd = false;
  19537. }
  19538. onConstructor() {
  19539. this.ui = ui_UIRodMethod.createInstance();
  19540. this.contentPane = this.ui;
  19541. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19542. this.moveDir = new Laya.Vector2();
  19543. this.moveDest = new Laya.Vector2();
  19544. this.centerPos = new Laya.Vector2();
  19545. xGame.common.uiRodMethod = this;
  19546. }
  19547. show() {
  19548. super.show();
  19549. xGame.common.gameMgr.gamePause = true;
  19550. this.openPressDotEvent();
  19551. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19552. this.centerPos.x = this.ui.white.x;
  19553. this.centerPos.y = this.ui.white.y;
  19554. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19555. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19556. this.setDot();
  19557. }
  19558. setDot() {
  19559. this.ui.dot.x = this.moveDest.x;
  19560. this.ui.dot.y = this.moveDest.y;
  19561. }
  19562. closeSelf() {
  19563. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19564. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19565. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19566. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19567. xGame.common.gameMgr.gamePause = false;
  19568. this.hide();
  19569. }
  19570. openPressDotEvent() {
  19571. this.closePressDotEvent();
  19572. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19573. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19574. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19575. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19576. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19577. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19578. }
  19579. closePressDotEvent() {
  19580. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19581. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19582. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19583. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19584. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19585. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19586. }
  19587. onDown(e) {
  19588. if (e.type == Laya.Event.MOUSE_DOWN)
  19589. this.isPressd = true;
  19590. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19591. this.isPressd = false;
  19592. if (!this.isPressd)
  19593. return;
  19594. this.moveDest.x = e.stageX;
  19595. this.moveDest.y = e.stageY;
  19596. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19597. if (dis > 6724) {
  19598. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19599. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19600. }
  19601. this.setDot();
  19602. }
  19603. resetRod() {
  19604. this.ui.dot.x = this.ui.white.x;
  19605. this.ui.dot.y = this.ui.white.y;
  19606. this.gameRod.dot.x = this.gameRod.bg.x;
  19607. this.gameRod.dot.y = this.gameRod.bg.y;
  19608. xGame.common.rodOffest.x = 0;
  19609. xGame.common.rodOffest.y = 0;
  19610. }
  19611. }
  19612. UIRodMethod$1.uiName = "UIRodMethod";
  19613. class UIMsg$1 extends UIBase {
  19614. constructor() {
  19615. super();
  19616. }
  19617. onConstructor() {
  19618. this.ui = ui_UIMsg.createInstance();
  19619. this.contentPane = this.ui;
  19620. this.isEject = false;
  19621. this.isMuti = true;
  19622. }
  19623. show(msg, callback) {
  19624. super.show();
  19625. this.ui.tipsNode.msgTxt.text = msg;
  19626. this.ui.alpha = 1;
  19627. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19628. this.hide();
  19629. callback && callback();
  19630. }), 1000);
  19631. }
  19632. }
  19633. UIMsg$1.uiName = "UIMsg";
  19634. class UITips$1 extends UIBase {
  19635. constructor() {
  19636. super();
  19637. this.type = 0;
  19638. }
  19639. onConstructor() {
  19640. this.ui = ui_UITips.createInstance();
  19641. this.contentPane = this.ui;
  19642. this.isEject = false;
  19643. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19644. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19645. }
  19646. show(tipsTxt, womanTxt, type) {
  19647. super.show();
  19648. this.ui.t0.play();
  19649. this.ui.myNode.tipsTxt.text = tipsTxt;
  19650. this.ui.myNode.womanTxt.text = womanTxt;
  19651. PlatMgr.showInsert(true);
  19652. this.ui.myNode.c1.selectedIndex = type;
  19653. this.type = type;
  19654. switch (this.type) {
  19655. case TipsType.exitGame:
  19656. xGame.common.gameMgr.gamePause = true;
  19657. break;
  19658. case TipsType.foul:
  19659. Laya.timer.once(200, this, () => {
  19660. xGame.common.gameMgr.gamePause = true;
  19661. });
  19662. break;
  19663. default:
  19664. break;
  19665. }
  19666. }
  19667. clickLeftBtn() {
  19668. this.hide();
  19669. xGame.common.gameMgr.gamePause = false;
  19670. switch (this.type) {
  19671. case TipsType.exitGame:
  19672. break;
  19673. case TipsType.foul:
  19674. break;
  19675. default:
  19676. break;
  19677. }
  19678. }
  19679. clickRightBtn() {
  19680. this.hide();
  19681. switch (this.type) {
  19682. case TipsType.exitGame:
  19683. xGame.eventMgr.event(RESET_GAME);
  19684. xGame.uiMgr.Show(UIMain$1);
  19685. Moyu.recordEnd(this, null);
  19686. xGame.common.longHelpLine = false;
  19687. break;
  19688. case TipsType.foul:
  19689. xGame.common.gameMgr.gamePause = false;
  19690. Laya.timer.clearAll(this);
  19691. break;
  19692. default:
  19693. break;
  19694. }
  19695. }
  19696. }
  19697. UITips$1.uiName = "UITips";
  19698. class UIGame$1 extends UIBase {
  19699. constructor() {
  19700. super();
  19701. this.powerNum = 0;
  19702. this.isD3Inited = false;
  19703. this.isPrePlay = false;
  19704. this.isMoveRod = false;
  19705. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19706. this.rulerDis = 20;
  19707. this.rulerOffset = 0;
  19708. }
  19709. onConstructor() {
  19710. this.ui = ui_UIGame.createInstance();
  19711. this.contentPane = this.ui;
  19712. this.ui.x += xGame.common.sysOffestNum;
  19713. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19714. this.isEject = false;
  19715. xGame.common.gameUI = this;
  19716. this.initSelf();
  19717. }
  19718. isTurnSelf() {
  19719. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19720. return true;
  19721. }
  19722. }
  19723. initSelf() {
  19724. let topUI = this.ui.topNode;
  19725. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19726. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19727. this.barInfo = {};
  19728. this.barInfo.curY = 0;
  19729. this.barInfo.height = this.ui.powerNode.height;
  19730. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19731. this.barInfo.powerStartY = this.ui.powerNode.y;
  19732. xGame.common.aiPlayer = new AIPlayer();
  19733. xGame.common.gameMgr = new GameMgr();
  19734. xGame.common.skillMgr = new SkillMgr();
  19735. xGame.common.wordsMgr = new WordsMgr();
  19736. xGame.common.talkMgr = new TalkMgr();
  19737. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19738. console.log("加载经典模式表情文件chenggon !");
  19739. });
  19740. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19741. console.log("挑战模式奖励模式spine加载成功!");
  19742. });
  19743. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19744. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19745. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19746. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19747. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19748. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19749. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19750. }
  19751. getGanZiImg() {
  19752. let index = DataMgr.getCurBallRod();
  19753. let data = cfgTable.ballrodData[index + 1];
  19754. let gan_url = xGame.common.getGameIconUrl(data.img);
  19755. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19756. this.ui.powerNode.showImg.url = gan_url;
  19757. console.log('zh:修改杆子图标O K');
  19758. }
  19759. returnHome() {
  19760. let tips = "Are you sure to exit the game?";
  19761. let woman = "Boss, why don't you play for a while longer?";
  19762. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19763. }
  19764. addRodMethodClick() {
  19765. if (this.isTurnSelf()) {
  19766. xGame.uiMgr.Show(UIRodMethod$1);
  19767. }
  19768. }
  19769. clickHelpLineBtn(force = false) {
  19770. if (!this.isTurnSelf())
  19771. return;
  19772. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19773. if (success) {
  19774. xGame.common.longHelpLine = true;
  19775. xGame.common.d2World.getHelpLine();
  19776. Moyu.sendDataEvent("guideNum");
  19777. }
  19778. else {
  19779. }
  19780. });
  19781. }
  19782. renderSelfDisplayBalls(index, target) {
  19783. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19784. target.myImg.url = xGame.common.getGameIconUrl(str);
  19785. }
  19786. renderAIDisplayBalls(index, target) {
  19787. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19788. target.myImg.url = xGame.common.getGameIconUrl(str);
  19789. ;
  19790. }
  19791. updateMode() {
  19792. if (xGame.common.gameMode == GameMode.classic) {
  19793. this.ui.topNode.scoreNode.visible = false;
  19794. }
  19795. else if (xGame.common.gameMode == GameMode.bigMove) {
  19796. this.ui.topNode.scoreNode.visible = true;
  19797. }
  19798. }
  19799. show() {
  19800. super.show();
  19801. console.log("zh:uigame show AADD");
  19802. this.ui.alpha = 0;
  19803. this.updateSelf();
  19804. xGame.common.gameMgr.gamePause = false;
  19805. xGame.common.gameUI.ui.blackAni.visible = false;
  19806. xGame.common.gameUI.ui.whiteAni.visible = false;
  19807. this.ui.powerEft.visible = false;
  19808. this.ui.colorNode.visible = false;
  19809. this.updateHead();
  19810. let curUse = DataMgr.getCurBallRod();
  19811. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19812. this.getGanZiImg();
  19813. }
  19814. updateSelf() {
  19815. if (xGame.common.gameMode == GameMode.classic) {
  19816. this.ui.c1.selectedIndex = 0;
  19817. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19818. this.ui.topNode.middleNode.visible = true;
  19819. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19820. }
  19821. else if (xGame.common.gameMode == GameMode.bigMove) {
  19822. this.ui.c1.selectedIndex = 0;
  19823. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19824. this.ui.topNode.middleNode.visible = false;
  19825. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19826. let rand = xGame.common.randomNum(1, max);
  19827. let guide = DataMgr.getSkillGuide();
  19828. if (guide == 0)
  19829. rand = 1;
  19830. xGame.common.bigMoveLevelIndex = rand;
  19831. }
  19832. else if (xGame.common.gameMode == GameMode.placeBall) {
  19833. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19834. this.ui.c1.selectedIndex = 1 + data.type;
  19835. this.ui.alpha = 1;
  19836. this.startGame();
  19837. }
  19838. this.updateMode();
  19839. this.initD3world();
  19840. this.initD2world();
  19841. }
  19842. startGame() {
  19843. this.ui.snowNode.visible = Math.random() <= 0.1;
  19844. this.ui.d2Node.visible = false;
  19845. xGame.common.d3World.d3Hand.gameObj.active = false;
  19846. xGame.common.d3World.tableSrc.init();
  19847. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19848. this.cameraViewChange(() => {
  19849. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19850. switch (xGame.common.gameMode) {
  19851. case GameMode.classic:
  19852. xGame.common.d3World.d3Hand.gameObj.active = true;
  19853. this.playPutBallD3Ani();
  19854. break;
  19855. case GameMode.bigMove:
  19856. this.enterGame();
  19857. Laya.timer.once(500, this, () => {
  19858. this.ui.topNode.middleNode.visible = true;
  19859. this.ui.topNode.middleNode.t0.play();
  19860. });
  19861. break;
  19862. case GameMode.placeBall:
  19863. this.enterGame();
  19864. break;
  19865. default:
  19866. break;
  19867. }
  19868. });
  19869. PlatMgr.showBanner(false);
  19870. }
  19871. enterGame() {
  19872. this.ui.d2Node.visible = true;
  19873. xGame.common.d3World.d3Hand.gameObj.active = false;
  19874. xGame.common.showOneCamera("mainCamera");
  19875. Moyu.recordGame(30, true);
  19876. if (!this.isPrePlay) {
  19877. this.isPrePlay = true;
  19878. xGame.common.d3World.prePlayEft();
  19879. }
  19880. xGame.common.gameMgr.gameReady();
  19881. this.openAllEvent();
  19882. this.ui.snowNode.visible = false;
  19883. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19884. this.ui.helpBtn.visible = condition;
  19885. }
  19886. showHelpLineGuide() {
  19887. let longGuide = DataMgr.getGuideHelpLine();
  19888. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19889. this.ui.helpBtn.visible = true;
  19890. this.ui.guideNode.visible = true;
  19891. }
  19892. }
  19893. setTurnAlpha(alpha) {
  19894. this.ui.keduNode.alpha = alpha;
  19895. this.ui.ganNode.alpha = alpha;
  19896. this.ui.rodMethodNode.alpha = alpha;
  19897. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19898. }
  19899. cameraViewChange(callback) {
  19900. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19901. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19902. xGame.common.showOneCamera("visitAngle");
  19903. cameraSrc.localRotationEulerY = 180;
  19904. cameraSrc.localRotationEulerZ = 0;
  19905. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19906. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19907. callback && callback();
  19908. }));
  19909. }));
  19910. }
  19911. playPutBallD3Ani() {
  19912. xGame.common.showOneCamera("mainCamera");
  19913. let handSrc = xGame.common.d3World.d3Hand;
  19914. handSrc.gameObj.active = true;
  19915. handSrc.transform.localPositionZ = 3;
  19916. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19917. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19918. handSrc.gameObj.active = false;
  19919. this.enterGame();
  19920. }), 400);
  19921. }));
  19922. }
  19923. updateHead() {
  19924. let user = Moyu.getUserInfo();
  19925. this.ui.topNode.selfNameTxt.text = user.nickName;
  19926. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19927. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19928. if (DataMgr.getSkillGuide() < 1) {
  19929. this.ui.topNode.aiNameTxt.text = 'billiards';
  19930. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19931. }
  19932. else {
  19933. this.ui.topNode.aiNameTxt.text = aiData.name;
  19934. let randNo = Math.floor(Math.random() * 10) + 1;
  19935. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19936. }
  19937. }
  19938. initD2world() {
  19939. let node = this.ui.d2Root.displayObject;
  19940. let src = node.getComponent(D2World);
  19941. if (!src) {
  19942. xGame.common.d2World = node.addComponent(D2World);
  19943. }
  19944. xGame.common.d2World.initSelf();
  19945. }
  19946. initD3world() {
  19947. if (this.isD3Inited)
  19948. return;
  19949. this.isD3Inited = true;
  19950. let scene3D = xGame.common.d3Scene;
  19951. this.ui.d3Root.displayObject.addChild(scene3D);
  19952. scene3D.active = true;
  19953. xGame.common.d3World.tableSrc.setBorderPos();
  19954. }
  19955. onRootMove(e) {
  19956. let rootBall = xGame.common.d2World.rootBall;
  19957. this.ui.moveNode.x = e.x;
  19958. this.ui.moveNode.y = e.y;
  19959. rootBall.gameObj.x = e.x;
  19960. rootBall.gameObj.y = e.y;
  19961. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19962. }
  19963. aiRootMove(move) {
  19964. if (move)
  19965. this.hideBallUI();
  19966. else {
  19967. this.showBallUI();
  19968. xGame.common.d2World.getHelpLine();
  19969. }
  19970. }
  19971. aiForce(type, force = 0) {
  19972. this.pressTarget = PressType.powerNode;
  19973. if (type == 1)
  19974. this.onEventUp({ force: true });
  19975. else if (type == 2)
  19976. this.onEventMove({ stageY: force, force: true });
  19977. }
  19978. onEventPress(e) {
  19979. if (e.stopPropagation)
  19980. e.stopPropagation();
  19981. if (!this.isTurnSelf())
  19982. return;
  19983. let target = e.target;
  19984. switch (target) {
  19985. case this.ui.myPowerNode.displayObject:
  19986. this.pressTarget = PressType.powerNode;
  19987. this.barInfo.curY = e.stageY;
  19988. this.updateBarInfo();
  19989. break;
  19990. case this.ui.moveNode.displayObject:
  19991. this.pressTarget = PressType.moveNode;
  19992. this.hideBallUI();
  19993. this.eventObj.curX = this.ui.moveNode.x;
  19994. this.eventObj.curY = this.ui.moveNode.y;
  19995. this.ui.moveNode.finger.visible = false;
  19996. this.eventObj.lastX = e.stageX;
  19997. this.eventObj.lastY = e.stageY;
  19998. break;
  19999. case this.ui.rulerClickNode.displayObject:
  20000. this.pressTarget = PressType.rulerNode;
  20001. this.eventObj.lastY = e.stageY;
  20002. break;
  20003. case this.ui.d2Root.displayObject:
  20004. this.pressTarget = PressType.d2Root;
  20005. this.eventObj.lastX = e.stageX;
  20006. this.eventObj.lastY = e.stageY;
  20007. this.eventObj.starX = e.stageX;
  20008. this.eventObj.starY = e.stageY;
  20009. this.eventObj.curX = 0;
  20010. this.eventObj.curY = 0;
  20011. xGame.common.d2World.d2Gan.setGanLastInfo();
  20012. this.rulerOffset = 0;
  20013. break;
  20014. default:
  20015. break;
  20016. }
  20017. }
  20018. onEventMove(e) {
  20019. if (e.stopPropagation)
  20020. e.stopPropagation();
  20021. if (e && e.force) {
  20022. }
  20023. else {
  20024. if (!this.isTurnSelf())
  20025. return;
  20026. }
  20027. switch (this.pressTarget) {
  20028. case PressType.powerNode:
  20029. this.barInfo.curY = e.stageY;
  20030. this.updateBarInfo();
  20031. this.isMoveRod = true;
  20032. break;
  20033. case PressType.moveNode:
  20034. let rootBall = xGame.common.d2World.rootBall;
  20035. let radius = rootBall.gameObj.width / 2;
  20036. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20037. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20038. let border = xGame.common.d2World.borderRect;
  20039. if (curX <= border.x + radius)
  20040. curX = border.x + radius;
  20041. else if (curX >= border.x + border.width - radius)
  20042. curX = border.x + border.width - radius;
  20043. if (curY <= border.y + radius)
  20044. curY = border.y + radius;
  20045. else if (curY >= border.y + border.height - radius)
  20046. curY = border.y + border.height - radius;
  20047. if (xGame.common.gameMgr.isOpenBall) {
  20048. if (curX >= border.x + border.openBallW - radius)
  20049. curX = border.x + border.openBallW - radius;
  20050. }
  20051. this.ui.moveNode.x = curX;
  20052. this.ui.moveNode.y = curY;
  20053. rootBall.gameObj.x = curX;
  20054. rootBall.gameObj.y = curY;
  20055. rootBall.d3BallSrc.setTransPos(curX, curY);
  20056. this.isMoveRod = true;
  20057. break;
  20058. case PressType.rulerNode:
  20059. let yy = e.stageY - this.eventObj.lastY;
  20060. this.eventObj.lastY = e.stageY;
  20061. let ruler1 = this.ui.rulerNode.img1;
  20062. let ruler2 = this.ui.rulerNode.img2;
  20063. ruler1.y += yy;
  20064. ruler2.y += yy;
  20065. this.rulerOffset += yy;
  20066. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20067. this.rulerOffset = 0;
  20068. xGame.soundMgr.playSound("inch", 1, 10);
  20069. }
  20070. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20071. let h = ruler1.height;
  20072. this.checkGuide();
  20073. this.isMoveRod = true;
  20074. if (ruler1.y >= h) {
  20075. ruler1.y = -h;
  20076. ruler2.y = 0;
  20077. return;
  20078. }
  20079. else if (ruler1.y <= -h) {
  20080. ruler1.y = h;
  20081. ruler2.y = 0;
  20082. return;
  20083. }
  20084. if (ruler2.y >= h) {
  20085. ruler2.y = -h;
  20086. ruler1.y = 0;
  20087. return;
  20088. }
  20089. else if (ruler2.y <= -h) {
  20090. ruler2.y = h;
  20091. ruler1.y = 0;
  20092. return;
  20093. }
  20094. break;
  20095. case PressType.d2Root:
  20096. this.eventObj.curX = e.stageX;
  20097. this.eventObj.curY = e.stageY;
  20098. let offset = this.checkRodMoveDir();
  20099. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20100. this.eventObj.lastX = e.stageX;
  20101. this.eventObj.lastY = e.stageY;
  20102. break;
  20103. default:
  20104. break;
  20105. }
  20106. }
  20107. onEventUp(e) {
  20108. if (e.stopPropagation)
  20109. e.stopPropagation();
  20110. if (e && e.force) {
  20111. }
  20112. else {
  20113. if (!this.isTurnSelf())
  20114. return;
  20115. }
  20116. switch (this.pressTarget) {
  20117. case PressType.powerNode:
  20118. this.ui.powerNode.value = 0;
  20119. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20120. this.ui.powerTxt.text = "";
  20121. if (this.powerNum > 0) {
  20122. xGame.eventMgr.event(BALL_SHOOT);
  20123. xGame.common.d2World.shoot(this.powerNum);
  20124. xGame.common.d2World.d2Gan.shoot();
  20125. xGame.common.d2World.d2HelpLine.shoot();
  20126. this.finishGuide();
  20127. this.ui.powerEft.visible = false;
  20128. this.ui.colorNode.visible = false;
  20129. let ganStr = "";
  20130. if (this.powerNum <= 30) {
  20131. ganStr = "gan_30";
  20132. }
  20133. else if (this.powerNum <= 60) {
  20134. ganStr = "gan_50";
  20135. }
  20136. else {
  20137. ganStr = "gan_80";
  20138. }
  20139. xGame.soundMgr.playSound(ganStr);
  20140. }
  20141. break;
  20142. case PressType.moveNode:
  20143. let rootBall = xGame.common.d2World.rootBall;
  20144. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20145. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20146. let isIntersect = this.judgeBallIntersect();
  20147. if (isIntersect) {
  20148. this.ui.moveNode.x = lastX;
  20149. this.ui.moveNode.y = lastY;
  20150. rootBall.gameObj.x = lastX;
  20151. rootBall.gameObj.y = lastY;
  20152. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20153. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20154. }
  20155. else {
  20156. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20157. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20158. }
  20159. this.showBallUI();
  20160. this.ui.moveNode.finger.visible = true;
  20161. xGame.common.d2World.getHelpLine();
  20162. break;
  20163. case PressType.rulerNode:
  20164. break;
  20165. case PressType.d2Root:
  20166. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20167. if (dis <= 25) {
  20168. this.moveToClickDot(e);
  20169. }
  20170. break;
  20171. default:
  20172. break;
  20173. }
  20174. this.pressTarget = -1;
  20175. }
  20176. checkGuide() {
  20177. let guide = DataMgr.getSkillGuide();
  20178. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20179. xGame.common.guideStep++;
  20180. xGame.common.gameUI.ui.guide2.visible = false;
  20181. xGame.common.gameUI.ui.guide3.visible = true;
  20182. }
  20183. }
  20184. finishGuide() {
  20185. let guide = DataMgr.getSkillGuide();
  20186. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20187. xGame.common.guideStep = 10;
  20188. this.closeAllGuide();
  20189. console.log('zh: 新手引导完毕');
  20190. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20191. }
  20192. }
  20193. closeAllGuide() {
  20194. xGame.common.gameUI.ui.guide1.visible = false;
  20195. xGame.common.gameUI.ui.guide2.visible = false;
  20196. xGame.common.gameUI.ui.guide3.visible = false;
  20197. }
  20198. updateBarInfo() {
  20199. let star = this.ui.powerNode.y;
  20200. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20201. if (rate >= 1)
  20202. rate = 1;
  20203. if (rate <= 0)
  20204. rate = 0;
  20205. this.powerNum = Math.ceil(rate * 100);
  20206. this.ui.powerNode.value = this.powerNum;
  20207. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20208. this.ui.colorNode.value = this.powerNum;
  20209. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20210. this.ui.powerEft.visible = this.powerNum != 0;
  20211. this.ui.colorNode.visible = this.powerNum != 0;
  20212. this.ui.powerTxt.text = this.powerNum + "";
  20213. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20214. }
  20215. forceCancel() {
  20216. this.ui.powerNode.value = 0;
  20217. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20218. this.ui.powerTxt.text = "";
  20219. }
  20220. checkRodMoveDir() {
  20221. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20222. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20223. if (tempX >= 0 && tempY <= 0) {
  20224. return this.checkDir();
  20225. }
  20226. else if (tempX < 0 && tempY < 0) {
  20227. return this.checkDir(1, -1);
  20228. }
  20229. else if (tempX < 0 && tempY > 0) {
  20230. return this.checkDir(-1, -1);
  20231. }
  20232. else {
  20233. return this.checkDir(-1, 1);
  20234. }
  20235. }
  20236. checkDir(flagX = 1, flagY = 1) {
  20237. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20238. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20239. if (offsetY == 0) {
  20240. return offsetX * flagX;
  20241. }
  20242. if (offsetX == 0) {
  20243. return offsetY * flagY;
  20244. }
  20245. let angle = offsetY / offsetX;
  20246. if (Math.abs(angle) >= 1) {
  20247. return offsetY * flagY;
  20248. }
  20249. else {
  20250. return offsetX * flagX;
  20251. }
  20252. }
  20253. judgeBallIntersect() {
  20254. let rootBall = xGame.common.d2World.rootBall;
  20255. let ballArr = xGame.common.d2World.ballArr;
  20256. let radius = rootBall.gameObj.width / 2;
  20257. let temp;
  20258. let isIntersect = false;
  20259. for (let index = 0; index < ballArr.length; index++) {
  20260. temp = ballArr[index];
  20261. if (temp.number == rootBall.number)
  20262. continue;
  20263. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20264. if (isIntersect) {
  20265. break;
  20266. }
  20267. }
  20268. return isIntersect;
  20269. }
  20270. hideBallUI() {
  20271. let d2Gan = xGame.common.d2World.d2Gan;
  20272. if (!d2Gan.ui.isDisposed)
  20273. d2Gan.ui.visible = false;
  20274. let d2Help = xGame.common.d2World.d2HelpLine;
  20275. if (!d2Help.ui.isDisposed)
  20276. d2Help.ui.visible = false;
  20277. let rootBall = xGame.common.d2World.rootBall;
  20278. if (!rootBall.destroyed) {
  20279. rootBall.gameObj.active = false;
  20280. }
  20281. }
  20282. showBallUI() {
  20283. let d2Gan = xGame.common.d2World.d2Gan;
  20284. if (!d2Gan.ui.isDisposed)
  20285. d2Gan.ui.visible = true;
  20286. let d2Help = xGame.common.d2World.d2HelpLine;
  20287. if (!d2Help.ui.isDisposed)
  20288. d2Help.ui.visible = true;
  20289. let rootBall = xGame.common.d2World.rootBall;
  20290. if (!rootBall.destroyed) {
  20291. rootBall.gameObj.active = true;
  20292. }
  20293. }
  20294. moveToClickDot(e) {
  20295. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20296. let root = xGame.common.d2World.rootBall.gameObj;
  20297. let xx = e.stageX - xGame.common.sysOffestNum;
  20298. let yy = e.stageY;
  20299. let x = xx - root.x;
  20300. let y = yy - root.y;
  20301. let angle = xGame.common.getfguiRotation(x, y);
  20302. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20303. xGame.common.d2World.getHelpLine();
  20304. }
  20305. this.isMoveRod = false;
  20306. xGame.common.clickedBall = false;
  20307. }
  20308. openAllEvent() {
  20309. this.closeAllEvent();
  20310. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20311. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20312. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20313. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20314. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20315. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20316. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20317. }
  20318. closeAllEvent() {
  20319. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20320. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20321. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20322. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20323. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20324. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20325. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20326. }
  20327. resetGame() {
  20328. this.closeAllEvent();
  20329. this.hideBallUI();
  20330. xGame.common.gameMgr.gamePause = true;
  20331. }
  20332. }
  20333. UIGame$1.uiName = "UIGame";
  20334. class UIAddCoin$1 extends UIBase {
  20335. constructor() {
  20336. super();
  20337. this.coinNum = 2000;
  20338. }
  20339. onConstructor() {
  20340. this.ui = ui_UIAddCoin.createInstance();
  20341. this.contentPane = this.ui;
  20342. this.isEject = false;
  20343. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20344. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20345. }
  20346. show() {
  20347. super.show();
  20348. this.ui.t0.play();
  20349. }
  20350. videoAddCoin() {
  20351. console.log('zh:qjff_AD_for_UIAddCoin');
  20352. if (Laya.Browser.onAndroid) {
  20353. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20354. if (!boo) {
  20355. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20356. return;
  20357. }
  20358. }
  20359. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20360. }
  20361. else {
  20362. console.log('zh:AD 失败,直接发放奖励');
  20363. this.qjff_AD_for_UIAddCoin();
  20364. }
  20365. }
  20366. qjff_AD_for_UIAddCoin() {
  20367. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20368. this.hide();
  20369. }
  20370. }
  20371. UIAddCoin$1.uiName = "UIAddCoin";
  20372. class UIInvitation$1 extends UIBase {
  20373. constructor() {
  20374. super();
  20375. }
  20376. onConstructor() {
  20377. this.ui = ui_UIInvitation.createInstance();
  20378. this.contentPane = this.ui;
  20379. this.isEject = false;
  20380. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20381. }
  20382. show() {
  20383. super.show();
  20384. }
  20385. enterGame() {
  20386. xGame.common.gameMode = GameMode.classic;
  20387. DataMgr.setChallengeTimes(1);
  20388. xGame.common.passAwardCoin = 2000;
  20389. let need = xGame.common.classicNiceNeddCoin;
  20390. if (DataMgr.coinEnough(need)) {
  20391. DataMgr.setCoin(-need);
  20392. xGame.eventMgr.event(RESTART_GAME, true);
  20393. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20394. }
  20395. else {
  20396. xGame.eventMgr.event(RESTART_GAME, true);
  20397. }
  20398. this.hide();
  20399. }
  20400. hide() {
  20401. super.hide();
  20402. }
  20403. }
  20404. UIInvitation$1.uiName = "UIInvitation";
  20405. class UIPower$1 extends UIBase {
  20406. constructor() {
  20407. super();
  20408. }
  20409. onConstructor() {
  20410. this.ui = ui_UIPower.createInstance();
  20411. this.contentPane = this.ui;
  20412. this.isEject = false;
  20413. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20414. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20415. }
  20416. show() {
  20417. super.show();
  20418. this.ui.t0.play();
  20419. }
  20420. videoGetPower() {
  20421. console.log('zh:qjff_AD_for_uipower');
  20422. if (Laya.Browser.onAndroid) {
  20423. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20424. if (!boo) {
  20425. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20426. return;
  20427. }
  20428. }
  20429. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20430. }
  20431. else {
  20432. console.log('zh:AD 失败,直接发放奖励');
  20433. this.qjff_AD_for_uipower();
  20434. }
  20435. }
  20436. qjff_AD_for_uipower() {
  20437. DataMgr.setPower(xGame.common.videoPower, true);
  20438. xGame.eventMgr.event(POWER_TIME);
  20439. this.hide();
  20440. }
  20441. }
  20442. UIPower$1.uiName = "UIPower";
  20443. class UIGameEnd$1 extends UIBase {
  20444. constructor() {
  20445. super();
  20446. this.success = false;
  20447. this.awardCoinNum = 1000;
  20448. this.awardDiamondNum = 10;
  20449. }
  20450. onConstructor() {
  20451. this.ui = ui_UIGameEnd.createInstance();
  20452. this.contentPane = this.ui;
  20453. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20454. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20455. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20456. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20457. this.ui.talkNode.visible = false;
  20458. if (Moyu.isKs)
  20459. this.ui.closeNode.closeBtn.x += 100;
  20460. }
  20461. updateType() {
  20462. switch (xGame.common.gameMode) {
  20463. case GameMode.classic:
  20464. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20465. this.ui.coinNode.visible = this.success;
  20466. if (!this.success) {
  20467. Laya.timer.once(500, this, () => {
  20468. xGame.uiMgr.Show(UIAddCoin$1);
  20469. });
  20470. }
  20471. else {
  20472. this.logEventForClassic_win();
  20473. }
  20474. this.logEventForClassic_complete();
  20475. this.ui.isGetAward.visible = false;
  20476. this.ui.leftBtn.c1.selectedIndex = 3;
  20477. this.ui.rightBtn.c1.selectedIndex = 0;
  20478. this.moneyNode.ui.c1.selectedIndex = 1;
  20479. break;
  20480. case GameMode.bigMove:
  20481. console.log('zh:招法模式 aaaaaa bigMove');
  20482. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20483. this.ui.coinNode.visible = this.success;
  20484. if (xGame.common.gameMode == GameMode.bigMove) {
  20485. if (this.success) {
  20486. DataMgr.setSkillSuccessTimes(1, true);
  20487. DataMgr.setSkillAccTimes(1);
  20488. }
  20489. else {
  20490. DataMgr.setSkillSuccessTimes(0, false);
  20491. }
  20492. }
  20493. this.logEventForRod_complete_N();
  20494. if (!this.success) {
  20495. Laya.timer.once(500, this, () => {
  20496. xGame.uiMgr.Show(UIAddCoin$1);
  20497. });
  20498. }
  20499. else {
  20500. this.logEventForRod_win();
  20501. }
  20502. this.ui.isGetAward.visible = false;
  20503. this.ui.leftBtn.c1.selectedIndex = 3;
  20504. this.ui.rightBtn.c1.selectedIndex = 0;
  20505. this.moneyNode.ui.c1.selectedIndex = 1;
  20506. break;
  20507. case GameMode.placeBall:
  20508. this.ui.coinNode.visible = false;
  20509. if (this.success) {
  20510. if (xGame.common.placeBallStarNum == 3) {
  20511. this.ui.c1.selectedIndex = 2;
  20512. }
  20513. else {
  20514. this.ui.c1.selectedIndex = 3;
  20515. }
  20516. let level = xGame.common.placeBallCurLevel;
  20517. if (level > 59) {
  20518. this.logEventForChallenge_level_complete(level);
  20519. }
  20520. else {
  20521. this.logEventForChallenge_level_N(level);
  20522. }
  20523. }
  20524. else {
  20525. this.ui.c1.selectedIndex = 4;
  20526. }
  20527. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20528. if (cfg.type == PlaceBallType.challenge) {
  20529. this.ui.c1.selectedIndex = 2;
  20530. }
  20531. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20532. this.updatePlaceBallBtn();
  20533. this.updatePlaceBallStarNum();
  20534. this.updatePlaceBallAwardState();
  20535. this.moneyNode.ui.c1.selectedIndex = 2;
  20536. this.moneyNode.checkPowerTime();
  20537. this.moneyNode.powerChange();
  20538. DataMgr.upRankData();
  20539. break;
  20540. default:
  20541. break;
  20542. }
  20543. }
  20544. logEventForRod_complete_N() {
  20545. let gfmsIdx = xGame.common.curPlayerSkillType;
  20546. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20547. let gfmc = 'Skyfall Shot';
  20548. if (gfmsIdx == 0) {
  20549. gfmc = 'Skyfall Shot';
  20550. }
  20551. if (gfmsIdx == 1) {
  20552. gfmc = 'Surging break';
  20553. }
  20554. if (gfmsIdx == 2) {
  20555. gfmc = 'Frost Lock';
  20556. }
  20557. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20558. console.log('zh:logEventForRod_complete_N level = ' + level);
  20559. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20560. let jsonStr = {
  20561. "count": 0,
  20562. "name": gfmc
  20563. };
  20564. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20565. const d = LocalStorageManager.getItem(keyStr);
  20566. jsonStr.count = d.count + 1;
  20567. LocalStorageManager.setItem(keyStr, jsonStr);
  20568. }
  20569. else {
  20570. LocalStorageManager.setItem(keyStr, jsonStr);
  20571. }
  20572. const d2 = LocalStorageManager.getItem(keyStr);
  20573. let count = d2.count;
  20574. console.log('zh:logEventForRod_complete_N count = ' + count);
  20575. if (count % 5 == 0) {
  20576. const reqStr = JSON.stringify(jsonStr);
  20577. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20578. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20579. }
  20580. }
  20581. logEventForRod_win() {
  20582. console.log('zh:logEventForRod_win,胜利');
  20583. let gfmsIdx = xGame.common.curPlayerSkillType;
  20584. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20585. let gfmc = 'Skyfall Shot';
  20586. if (gfmsIdx == 0) {
  20587. gfmc = 'Skyfall Shot';
  20588. }
  20589. if (gfmsIdx == 1) {
  20590. gfmc = 'Surging break';
  20591. }
  20592. if (gfmsIdx == 2) {
  20593. gfmc = 'Frost Lock';
  20594. }
  20595. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20596. console.log('zh:logEventForRod_win level = ' + level);
  20597. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20598. let jsonStr = {
  20599. "count": 1,
  20600. "name": gfmc + ' Lev' + level
  20601. };
  20602. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20603. const d = LocalStorageManager.getItem(keyStr);
  20604. jsonStr.count = d.count + 1;
  20605. LocalStorageManager.setItem(keyStr, jsonStr);
  20606. }
  20607. else {
  20608. LocalStorageManager.setItem(keyStr, jsonStr);
  20609. }
  20610. const reqStr = JSON.stringify(jsonStr);
  20611. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20612. }
  20613. logEventForClassic_win() {
  20614. console.log('zh:logEventForClassic_win,胜利');
  20615. let rtype = xGame.common.classicRoomType;
  20616. let msmc = '';
  20617. if (rtype == 1) {
  20618. msmc = 'beginner';
  20619. }
  20620. if (rtype == 2) {
  20621. msmc = 'expert';
  20622. }
  20623. if (rtype == 3) {
  20624. msmc = 'master';
  20625. }
  20626. let keyStr = 'sjmd_classic_win_' + rtype;
  20627. let jsonStr = {
  20628. "difficulty": msmc,
  20629. "classic_count": 1,
  20630. "difficulty_count": 1
  20631. };
  20632. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20633. const d = LocalStorageManager.getItem(keyStr);
  20634. jsonStr.classic_count = d.classic_count + 1;
  20635. jsonStr.difficulty_count = d.difficulty_count + 1;
  20636. LocalStorageManager.setItem(keyStr, jsonStr);
  20637. }
  20638. else {
  20639. LocalStorageManager.setItem(keyStr, jsonStr);
  20640. }
  20641. const reqStr = JSON.stringify(jsonStr);
  20642. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20643. }
  20644. logEventForClassic_complete() {
  20645. console.log('zh:logEventForClassic_complete,胜利');
  20646. let rtype = xGame.common.classicRoomType;
  20647. let msmc = '';
  20648. if (rtype == 1) {
  20649. msmc = 'beginner';
  20650. }
  20651. if (rtype == 2) {
  20652. msmc = 'expert';
  20653. }
  20654. if (rtype == 3) {
  20655. msmc = 'master';
  20656. }
  20657. let keyStr = 'sjmd_classic_complete_' + rtype;
  20658. let jsonStr = {
  20659. "msmc": msmc,
  20660. "count": 0
  20661. };
  20662. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20663. const d = LocalStorageManager.getItem(keyStr);
  20664. jsonStr.count = d.count + 1;
  20665. LocalStorageManager.setItem(keyStr, jsonStr);
  20666. }
  20667. else {
  20668. LocalStorageManager.setItem(keyStr, jsonStr);
  20669. }
  20670. if (jsonStr.count % 5 == 0) {
  20671. const reqStr = JSON.stringify(jsonStr);
  20672. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20673. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20674. }
  20675. }
  20676. updatePlaceBallBtn() {
  20677. this.ui.leftBtn.c1.selectedIndex = 5;
  20678. if (this.success) {
  20679. this.ui.rightBtn.c1.selectedIndex = 14;
  20680. }
  20681. else {
  20682. if (xGame.common.placeBallStarNum == 3) {
  20683. this.ui.rightBtn.c1.selectedIndex = 14;
  20684. }
  20685. else {
  20686. this.ui.rightBtn.c1.selectedIndex = 1;
  20687. }
  20688. }
  20689. }
  20690. updatePlaceBallStarNum() {
  20691. let starNum = xGame.common.placeBallStarNum;
  20692. if (starNum == 0)
  20693. this.ui.starNumNode.c1.selectedIndex = 3;
  20694. else {
  20695. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20696. }
  20697. }
  20698. updatePlaceBallAwardState() {
  20699. let level = xGame.common.placeBallCurLevel;
  20700. let starNum = xGame.common.placeBallStarNum;
  20701. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20702. let data = cfgTable.placeballData[level].award;
  20703. let cfg = cfgTable.placeballData[level];
  20704. this.awardDiamondNum = data[1];
  20705. this.awardCoinNum = data[0];
  20706. if (cfg.type == PlaceBallType.challenge) {
  20707. this.awardDiamondNum = 0;
  20708. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20709. }
  20710. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20711. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20712. if (cfg.type == PlaceBallType.challenge) {
  20713. this.ui.awardNode.coinNode.visible = true;
  20714. }
  20715. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20716. this.ui.awardNode.diamondNode.x = 265;
  20717. this.ui.awardNode.coinNode.x = 354;
  20718. }
  20719. else {
  20720. this.ui.awardNode.diamondNode.x = 291;
  20721. this.ui.awardNode.coinNode.x = 291;
  20722. }
  20723. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20724. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20725. if (this.awardCoinNum == 0) {
  20726. this.ui.awardNode.coinNode.numTxt.text = "";
  20727. }
  20728. if (getAward) {
  20729. this.ui.isGetAward.visible = true;
  20730. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20731. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20732. }
  20733. else {
  20734. this.ui.isGetAward.visible = false;
  20735. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20736. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20737. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20738. }
  20739. else {
  20740. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20741. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20742. }
  20743. }
  20744. }
  20745. show(success) {
  20746. super.show();
  20747. xGame.eventMgr.event(RESET_GAME);
  20748. this.success = success;
  20749. Laya.timer.clearAll(this);
  20750. this.playSecretaryAni();
  20751. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20752. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20753. offsetTime = Math.floor(offsetTime / 1000);
  20754. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20755. this.updateType();
  20756. Laya.timer.once(200, this, () => {
  20757. this.addAward(() => {
  20758. this.updateType();
  20759. Laya.timer.once(500, this, () => {
  20760. this.showChallengeLevel();
  20761. });
  20762. });
  20763. });
  20764. if (this.success) {
  20765. JSBridgeUtils.instance.showInternAd('gameend_success');
  20766. console.log('zh:game end 成功');
  20767. xGame.soundMgr.playSound('slots_roll01');
  20768. xGame.soundMgr.playSound("s_win");
  20769. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20770. this.diyGameDataUtilForGameWin();
  20771. }
  20772. else {
  20773. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20774. console.log('zh:game end失败');
  20775. xGame.soundMgr.playSound('matchwin01');
  20776. xGame.soundMgr.playSound("s_lose");
  20777. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20778. }
  20779. let challengeNum = DataMgr.getChallengeTimes();
  20780. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20781. DataMgr.setChallengeTimes(1);
  20782. }
  20783. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20784. DataMgr.setClassicTimes();
  20785. }
  20786. }
  20787. diyGameDataUtilForGameWin() {
  20788. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20789. switch (xGame.common.gameMode) {
  20790. case GameMode.classic:
  20791. console.log('zh:DiyGameDataUtilForGameWin 111');
  20792. case GameMode.bigMove:
  20793. console.log('zh:DiyGameDataUtilForGameWin 222');
  20794. this.restartGame();
  20795. break;
  20796. case GameMode.placeBall:
  20797. console.log('zh:DiyGameDataUtilForGameWin 333');
  20798. var level = xGame.common.placeBallCurLevel;
  20799. console.log('zh:练习模式 联系了多少LEV=' + level);
  20800. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20801. if (level > db_over_lev) {
  20802. DataMgr.setChallengeMode_overLev(level);
  20803. }
  20804. break;
  20805. default:
  20806. console.log('zh:DiyGameDataUtilForGameWin 444');
  20807. break;
  20808. }
  20809. }
  20810. showChallengeLevel() {
  20811. if (DataMgr.getChallengeTimes() != 0)
  20812. return;
  20813. let skill = DataMgr.getSkillAccTimes();
  20814. let put = DataMgr.getPlaceBallLevelList().length;
  20815. if (skill >= 3 || put >= 5) {
  20816. xGame.uiMgr.Show(UIInvitation$1);
  20817. this.hide();
  20818. }
  20819. }
  20820. addAward(callback) {
  20821. if (!this.success) {
  20822. callback && callback();
  20823. return;
  20824. }
  20825. switch (xGame.common.gameMode) {
  20826. case GameMode.classic:
  20827. this.awardCoinNum = xGame.common.passAwardCoin;
  20828. this.awardDiamondNum = 0;
  20829. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20830. break;
  20831. case GameMode.bigMove:
  20832. this.awardCoinNum = xGame.common.passAwardCoin;
  20833. this.awardDiamondNum = 0;
  20834. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20835. callback && callback();
  20836. break;
  20837. case GameMode.placeBall:
  20838. let level = xGame.common.placeBallCurLevel;
  20839. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20840. if (xGame.common.placeBallStarNum != 3) {
  20841. callback && callback();
  20842. return;
  20843. }
  20844. else {
  20845. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20846. if (getAward) {
  20847. callback && callback();
  20848. return;
  20849. }
  20850. }
  20851. let cfg = cfgTable.placeballData[level];
  20852. let data = cfgTable.placeballData[level].award;
  20853. this.awardCoinNum = data[0];
  20854. this.awardDiamondNum = data[1];
  20855. if (cfg.type == PlaceBallType.challenge) {
  20856. this.awardDiamondNum = 0;
  20857. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20858. }
  20859. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20860. let diamondAward;
  20861. if (this.awardDiamondNum > 0) {
  20862. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20863. xGame.common.getAward([diamondAward, coinAward], callback);
  20864. }
  20865. else {
  20866. xGame.common.getAward([coinAward], callback);
  20867. }
  20868. if (cfg.type == PlaceBallType.normal) {
  20869. DataMgr.setPlaceBallAward(level);
  20870. }
  20871. break;
  20872. default:
  20873. break;
  20874. }
  20875. }
  20876. playSecretaryAni_old() {
  20877. let parent = this.ui.secretary.displayObject;
  20878. parent.destroyChildren();
  20879. let xx = this.ui.secretary.width / 2;
  20880. let yy = this.ui.secretary.height;
  20881. let scale = xGame.common.getSecretaryScale();
  20882. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20883. if (this.success) {
  20884. let rand = Math.random() <= 0.5 ? 2 : 3;
  20885. xGame.common.secretary.play(data, rand, false, parent, () => {
  20886. xGame.common.secretary.play(data, 1, true, parent);
  20887. });
  20888. }
  20889. else {
  20890. xGame.common.secretary.play(data, 0, true, parent);
  20891. }
  20892. }
  20893. playSecretaryAni() {
  20894. let parent = this.ui.secretary.displayObject;
  20895. parent.destroyChildren();
  20896. let xx = this.ui.secretary.width / 2;
  20897. let yy = this.ui.secretary.height;
  20898. let scale = xGame.common.getSecretaryScale();
  20899. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20900. if (this.success) {
  20901. let rand = 0;
  20902. xGame.common.secretary.play(data, 0, true, parent);
  20903. }
  20904. else {
  20905. xGame.common.secretary.play(data, 0, true, parent);
  20906. }
  20907. }
  20908. restartGame() {
  20909. switch (xGame.common.gameMode) {
  20910. case GameMode.classic:
  20911. xGame.eventMgr.event(RESTART_GAME);
  20912. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20913. break;
  20914. case GameMode.bigMove:
  20915. this.hide();
  20916. xGame.eventMgr.event(RESTART_GAME);
  20917. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20918. break;
  20919. default:
  20920. break;
  20921. }
  20922. }
  20923. hide() {
  20924. super.hide();
  20925. xGame.common.stopGirlPop(this.ui.talkNode);
  20926. PlatMgr.showBanner(false);
  20927. }
  20928. returnHome() {
  20929. this.hide();
  20930. let showFailWords = !this.success;
  20931. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20932. }
  20933. clickLeftBtn() {
  20934. switch (xGame.common.gameMode) {
  20935. case GameMode.classic:
  20936. case GameMode.bigMove:
  20937. this.returnHome();
  20938. break;
  20939. case GameMode.placeBall:
  20940. let level = xGame.common.placeBallCurLevel;
  20941. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20942. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20943. break;
  20944. default:
  20945. break;
  20946. }
  20947. }
  20948. powerStartPlaceBallLevel(level, btn) {
  20949. if (DataMgr.powerEnough()) {
  20950. btn.touchable = false;
  20951. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20952. btn.touchable = true;
  20953. DataMgr.setPower(-1);
  20954. xGame.eventMgr.event(POWER_TIME);
  20955. this.startPlaceBallLevel(level);
  20956. this.logEventForChallenge_level_start(level);
  20957. }));
  20958. }
  20959. else {
  20960. xGame.uiMgr.Show(UIPower$1, 0);
  20961. }
  20962. }
  20963. clickRightBtn() {
  20964. switch (xGame.common.gameMode) {
  20965. case GameMode.classic:
  20966. console.log('zh:clickRightBtn 111');
  20967. case GameMode.bigMove:
  20968. console.log('zh:clickRightBtn 222');
  20969. this.restartGame();
  20970. break;
  20971. case GameMode.placeBall:
  20972. console.log('zh:clickRightBtn 333');
  20973. let level = xGame.common.placeBallCurLevel;
  20974. let data = DataMgr.getPlaceBallLevel(level);
  20975. let curPss = data.play && !data.isCur;
  20976. if (curPss) {
  20977. console.log('zh:clickRightBtn 333-111');
  20978. console.log('zh:当前LV=' + level);
  20979. if (level == 60) {
  20980. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20981. Laya.timer.once(3000, this, () => {
  20982. this.returnHome();
  20983. });
  20984. }
  20985. else {
  20986. let lev = level + 1;
  20987. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20988. }
  20989. }
  20990. else {
  20991. console.log('zh:clickRightBtn 333-000');
  20992. Moyu.sendDataEvent("placeBallNextLevel");
  20993. console.log('zh:qjff_AD_for_uiGameEnd');
  20994. if (Laya.Browser.onAndroid) {
  20995. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20996. if (!boo) {
  20997. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20998. return;
  20999. }
  21000. }
  21001. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21002. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21003. }
  21004. else {
  21005. console.log('zh:AD 失败,直接发放奖励');
  21006. this.qjff_AD_for_uiGameEnd(level);
  21007. }
  21008. }
  21009. break;
  21010. default:
  21011. console.log('zh:clickRightBtn 444');
  21012. break;
  21013. }
  21014. }
  21015. logEventForChallenge_level_start(level) {
  21016. let keyStr = 'sjmd_challenge_level_start';
  21017. let jsonStr = {
  21018. "count": 0,
  21019. "gold_balance ": DataMgr.getCoin(),
  21020. "level": level,
  21021. "diamond_balance ": DataMgr.getDiamond()
  21022. };
  21023. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21024. const d = LocalStorageManager.getItem(keyStr);
  21025. if (level > d.level) {
  21026. jsonStr.count = d.count + 1;
  21027. LocalStorageManager.setItem(keyStr, jsonStr);
  21028. }
  21029. else {
  21030. }
  21031. }
  21032. else {
  21033. LocalStorageManager.setItem(keyStr, jsonStr);
  21034. }
  21035. const reqStr = JSON.stringify(jsonStr);
  21036. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21037. }
  21038. qjff_AD_for_uiGameEnd(level) {
  21039. DataMgr.setPlaceBallLevel(level, 1);
  21040. this.startPlaceBallLevel(level + 1);
  21041. }
  21042. startPlaceBallLevel(level) {
  21043. xGame.common.gameMode = GameMode.placeBall;
  21044. xGame.common.placeBallCurLevel = level;
  21045. xGame.uiMgr.Show(UIGame$1);
  21046. this.hide();
  21047. }
  21048. logEventForChallenge_level_complete(level) {
  21049. let keyStr = 'sjmd_challenge_level_complete';
  21050. let jsonStr = {
  21051. "count": 1,
  21052. "gold_balance ": DataMgr.getCoin(),
  21053. "level": level,
  21054. "diamond_balance ": DataMgr.getDiamond()
  21055. };
  21056. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21057. const d = LocalStorageManager.getItem(keyStr);
  21058. jsonStr.count = d.count + 1;
  21059. LocalStorageManager.setItem(keyStr, jsonStr);
  21060. }
  21061. else {
  21062. LocalStorageManager.setItem(keyStr, jsonStr);
  21063. }
  21064. const reqStr = JSON.stringify(jsonStr);
  21065. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21066. }
  21067. logEventForChallenge_level_N(level) {
  21068. console.log('zh:logEventForChallenge_level_N ' + level);
  21069. let keyStr = 'sjmd_challenge_level_N';
  21070. if (LocalStorageManager.hasKey(keyStr)) {
  21071. let lev = LocalStorageManager.getItem(keyStr);
  21072. if (level > lev) {
  21073. LocalStorageManager.setItem(keyStr, level);
  21074. }
  21075. if ((level) % 5 == 0) {
  21076. console.log('zh:每5关上报1次');
  21077. let sjmc = 'challenge_level_' + level;
  21078. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21079. let sjmcForFirebase = 'challenge_level_' + level;
  21080. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21081. }
  21082. else {
  21083. console.log('zh:5 no 上报');
  21084. }
  21085. }
  21086. else {
  21087. LocalStorageManager.setItem(keyStr, level);
  21088. }
  21089. }
  21090. }
  21091. UIGameEnd$1.uiName = "UIGameEnd";
  21092. class ShowItem$1 {
  21093. constructor() {
  21094. this.ui = ui_ShowItem.createInstance();
  21095. }
  21096. destroySelf() {
  21097. if (!this.ui.isDisposed) {
  21098. this.ui.removeFromParent();
  21099. this.ui.dispose();
  21100. }
  21101. }
  21102. setParent(parent) {
  21103. parent.addChild(this.ui);
  21104. }
  21105. setPos(x, y) {
  21106. this.ui.x = x;
  21107. this.ui.y = y;
  21108. }
  21109. setUrl(index) {
  21110. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21111. }
  21112. }
  21113. class UILevelProp$1 extends UIBase {
  21114. constructor() {
  21115. super();
  21116. this.firstPos = 385;
  21117. this.secondPos = 467;
  21118. this.showItemArr = [];
  21119. }
  21120. onFontLoaded() {
  21121. try {
  21122. this.ui.myNode.conditionTxt.font = "arial";
  21123. console.log("zh: onFontLoaded 设置arial字体成功");
  21124. }
  21125. catch (error) {
  21126. console.log("zh: constructor onFontLoaded加载arial字体失败");
  21127. }
  21128. }
  21129. onConstructor() {
  21130. this.ui = ui_UILevelProp.createInstance();
  21131. this.contentPane = this.ui;
  21132. this.isEject = false;
  21133. this.addUIClick(this.ui.closeBtn, this.hide);
  21134. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21135. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21136. }
  21137. show(level) {
  21138. super.show();
  21139. this.ui.t1.play();
  21140. this.level = level;
  21141. this.data = cfgTable.placeballData[this.level];
  21142. this.updateSelf();
  21143. this.showPreView();
  21144. this.moneyNode.ui.c1.selectedIndex = 2;
  21145. this.moneyNode.checkPowerTime();
  21146. this.moneyNode.powerChange();
  21147. }
  21148. showPreView() {
  21149. let item;
  21150. let data;
  21151. for (let index = 0; index < this.showItemArr.length; index++) {
  21152. item = this.showItemArr[index];
  21153. item.destroySelf();
  21154. }
  21155. this.showItemArr = [];
  21156. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21157. for (const key in cfgData) {
  21158. data = cfgData[key];
  21159. item = new ShowItem$1();
  21160. item.setParent(this.ui.myNode.displayRoot);
  21161. item.setPos(data.x, data.y);
  21162. item.setUrl(data.value);
  21163. this.showItemArr.push(item);
  21164. }
  21165. }
  21166. updateSelf() {
  21167. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21168. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21169. if (this.data.ball == -1) {
  21170. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21171. }
  21172. else {
  21173. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21174. }
  21175. let localData = DataMgr.getPlaceBallLevel(this.level);
  21176. let getAward = localData.getAward;
  21177. let cfg = cfgTable.placeballData[this.level];
  21178. let coin = this.data.award[0];
  21179. let diamond = this.data.award[1];
  21180. if (cfg.type == PlaceBallType.challenge) {
  21181. diamond = 0;
  21182. coin = 100;
  21183. }
  21184. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21185. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21186. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21187. if (cfg.type == PlaceBallType.challenge) {
  21188. this.ui.myNode.coinNode.numTxt.text = "";
  21189. }
  21190. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21191. if (coin > 0 && diamond > 0) {
  21192. this.ui.myNode.diamondNode.x = 385;
  21193. this.ui.myNode.coinNode.x = 467;
  21194. }
  21195. else {
  21196. this.ui.myNode.diamondNode.x = 385;
  21197. this.ui.myNode.coinNode.x = 385;
  21198. }
  21199. if (!getAward) {
  21200. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21201. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21202. }
  21203. else {
  21204. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21205. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21206. }
  21207. }
  21208. startGame() {
  21209. if (DataMgr.powerEnough()) {
  21210. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21211. this.ui.myNode.startBtn.touchable = false;
  21212. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21213. console.log('zh:startGame ');
  21214. this.ui.myNode.startBtn.touchable = true;
  21215. DataMgr.setPower(-1);
  21216. xGame.eventMgr.event(POWER_TIME);
  21217. xGame.common.gameMode = GameMode.placeBall;
  21218. xGame.common.placeBallCurLevel = this.level;
  21219. xGame.uiMgr.Show(UIGame$1);
  21220. this.logEventForChallenge_level_start(this.level);
  21221. xGame.uiMgr.Hide(UILevelDisplay$1);
  21222. xGame.uiMgr.Hide(UIMain$1);
  21223. this.hide();
  21224. }));
  21225. }
  21226. else {
  21227. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21228. xGame.uiMgr.Show(UIPower$1);
  21229. }
  21230. }
  21231. logEventForChallenge_level_start(level) {
  21232. let keyStr = 'sjmd_challenge_level_start';
  21233. let jsonStr = {
  21234. "count": 1,
  21235. "gold_balance ": DataMgr.getCoin(),
  21236. "level": level,
  21237. "diamond_balance ": DataMgr.getDiamond()
  21238. };
  21239. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21240. const d = LocalStorageManager.getItem(keyStr);
  21241. if (level > d.level) {
  21242. jsonStr.count = d.count + 1;
  21243. LocalStorageManager.setItem(keyStr, jsonStr);
  21244. }
  21245. else {
  21246. }
  21247. }
  21248. else {
  21249. LocalStorageManager.setItem(keyStr, jsonStr);
  21250. }
  21251. const reqStr = JSON.stringify(jsonStr);
  21252. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21253. }
  21254. hide() {
  21255. super.hide();
  21256. }
  21257. }
  21258. UILevelProp$1.uiName = "UILevelProp";
  21259. class PutBallLevelDisplay$1 {
  21260. constructor(ui, index) {
  21261. this.index = 0;
  21262. this.ui = ui;
  21263. this.index = index;
  21264. this.ui.onClick(this, this.clickSelf);
  21265. this.updateSelf();
  21266. this.ui.levelTxt.text = (this.index + 1) + "";
  21267. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21268. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21269. }
  21270. updateSelf() {
  21271. let level = this.index + 1;
  21272. this.data = DataMgr.getPlaceBallLevel(level);
  21273. this.ui.starNode.c1.selectedIndex = this.data.star;
  21274. let isChallenge = cfgTable.placeballData[level].type;
  21275. if (this.data.isCur) {
  21276. if (isChallenge) {
  21277. this.ui.c1.selectedIndex = 5;
  21278. }
  21279. else {
  21280. this.ui.c1.selectedIndex = 2;
  21281. }
  21282. }
  21283. else {
  21284. if (this.data.play) {
  21285. if (this.data.star == 3) {
  21286. this.ui.c1.selectedIndex = 0;
  21287. }
  21288. else {
  21289. this.ui.c1.selectedIndex = 1;
  21290. }
  21291. }
  21292. else {
  21293. if (isChallenge) {
  21294. this.ui.c1.selectedIndex = 4;
  21295. }
  21296. else {
  21297. this.ui.c1.selectedIndex = 3;
  21298. }
  21299. }
  21300. }
  21301. }
  21302. clickSelf() {
  21303. if (!this.data.play)
  21304. return;
  21305. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21306. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21307. }
  21308. }
  21309. class UILevelDisplay$1 extends UIBase {
  21310. constructor() {
  21311. super();
  21312. }
  21313. onConstructor() {
  21314. this.ui = ui_UILevelDisplay.createInstance();
  21315. this.contentPane = this.ui;
  21316. this.isEject = false;
  21317. this.myList = this.ui.myNode.myList;
  21318. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21319. this.levelItemArr = [];
  21320. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21321. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21322. this.myList.numItems = levelNum;
  21323. if (Moyu.isKs)
  21324. this.ui.closeNode.closeBtn.x += 100;
  21325. }
  21326. levelItemRender(index, target) {
  21327. let item = new PutBallLevelDisplay$1(target, index);
  21328. this.levelItemArr.push(item);
  21329. }
  21330. show() {
  21331. super.show();
  21332. this.updateLevel();
  21333. this.scrollToPlace();
  21334. }
  21335. updateLevel() {
  21336. let temp;
  21337. for (let index = 0; index < this.levelItemArr.length; index++) {
  21338. temp = this.levelItemArr[index];
  21339. temp.updateSelf();
  21340. }
  21341. }
  21342. scrollToPlace() {
  21343. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21344. let passArr = DataMgr.getPlaceBallLevelList();
  21345. let offest = passArr.length;
  21346. if (offest >= maxNum - 1)
  21347. offest = maxNum - 1;
  21348. this.myList.scrollToView(offest, true, true);
  21349. }
  21350. hide() {
  21351. super.hide();
  21352. }
  21353. }
  21354. UILevelDisplay$1.uiName = "UILevelDisplay";
  21355. class UIMatching$1 extends UIBase {
  21356. constructor() {
  21357. super();
  21358. }
  21359. onConstructor() {
  21360. this.ui = ui_UIMatching.createInstance();
  21361. this.contentPane = this.ui;
  21362. this.isEject = false;
  21363. }
  21364. show(callback) {
  21365. super.show();
  21366. PlatMgr.showBanner(true);
  21367. this.callback = callback;
  21368. let user = Moyu.getUserInfo();
  21369. if (!this.selfPot) {
  21370. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21371. }
  21372. if (!this.aiPot) {
  21373. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21374. }
  21375. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21376. this.ui.selfHead.nameTxt.text = user.nickName;
  21377. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21378. this.ui.aiHead.nameTxt.text = "???";
  21379. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21380. this.ui.selfHead.c1.selectedIndex = 0;
  21381. this.ui.aiHead.c1.selectedIndex = 0;
  21382. this.ui.selfHead.x = this.selfPot.x;
  21383. this.ui.selfHead.y = this.selfPot.y;
  21384. this.ui.aiHead.x = this.aiPot.x;
  21385. this.ui.aiHead.y = this.aiPot.y;
  21386. switch (xGame.common.gameMode) {
  21387. case GameMode.classic:
  21388. break;
  21389. case GameMode.bigMove:
  21390. this.initSkillData();
  21391. break;
  21392. default:
  21393. break;
  21394. }
  21395. this.ui.t1.play(Laya.Handler.create(this, () => {
  21396. this.ui.t2.play(Laya.Handler.create(this, () => {
  21397. switch (xGame.common.gameMode) {
  21398. case GameMode.classic:
  21399. this.waitingPeople();
  21400. break;
  21401. case GameMode.bigMove:
  21402. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21403. break;
  21404. default:
  21405. break;
  21406. }
  21407. }));
  21408. }));
  21409. }
  21410. initSkillData() {
  21411. this.skillSelectData = [];
  21412. let skillUrl = xGame.common.skillIconList;
  21413. let skillName = xGame.common.skillNameList;
  21414. let skillLevel = DataMgr.getBigSkillList();
  21415. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21416. for (let index = 0; index < 5; index++) {
  21417. let obj = {};
  21418. obj.skillImg = skillUrl[index];
  21419. obj.skillName = skillName[index];
  21420. obj.skillType = skillType[index];
  21421. obj.skillLevel = skillLevel[index];
  21422. this.skillSelectData.push(obj);
  21423. }
  21424. }
  21425. getAISkillLevel(myLevel) {
  21426. let video = xGame.common.upSkillLevel;
  21427. let aiLevel;
  21428. let temp;
  21429. if (video) {
  21430. temp = xGame.common.randomNum(-2, -1);
  21431. }
  21432. else {
  21433. if (myLevel <= 5) {
  21434. temp = xGame.common.randomNum(1, 3);
  21435. }
  21436. else if (myLevel <= 9) {
  21437. temp = xGame.common.randomNum(-2, 1);
  21438. }
  21439. else {
  21440. temp = xGame.common.randomNum(-4, 0);
  21441. }
  21442. }
  21443. aiLevel = temp + myLevel;
  21444. if (aiLevel <= 1)
  21445. aiLevel = 1;
  21446. if (aiLevel >= 10)
  21447. aiLevel = 10;
  21448. return aiLevel;
  21449. }
  21450. getAISkillType() {
  21451. return xGame.common.randomNum(1, 4);
  21452. let successTimes = DataMgr.getSkillSuccessTimes();
  21453. let info = cfgTable.aiskillData[successTimes];
  21454. if (!info) {
  21455. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21456. info = cfgTable.aiskillData[max];
  21457. }
  21458. let dataArr = info.skillselect;
  21459. let myCfg = {};
  21460. for (let index = 0; index < dataArr.length; index++) {
  21461. let temp = dataArr[index].split('-');
  21462. myCfg[temp[0]] = {};
  21463. myCfg[temp[0]].id = parseInt(temp[0]);
  21464. myCfg[temp[0]].weight = parseInt(temp[1]);
  21465. }
  21466. let aiCfg = xGame.common.initWeight(myCfg);
  21467. let curData = xGame.common.getRandomWeightData(aiCfg);
  21468. return parseInt(curData.id);
  21469. }
  21470. getAISkillData(index) {
  21471. let myLevel = this.skillSelectData[index].skillLevel;
  21472. let aiLevel = this.getAISkillLevel(myLevel);
  21473. let aiType = this.getAISkillType() - 1;
  21474. return { aiLevel, aiType } = { aiLevel, aiType };
  21475. }
  21476. skillSelectFinish(index) {
  21477. let aiInfo = this.getAISkillData(index);
  21478. xGame.common.gameMgr.selfCurSkill = index;
  21479. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21480. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21481. this.ui.selfHead.c1.selectedIndex = 1;
  21482. this.ui.aiHead.c1.selectedIndex = 1;
  21483. let myData = this.skillSelectData[index];
  21484. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21485. let guide = DataMgr.getSkillGuide();
  21486. if (guide == 0) {
  21487. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21488. }
  21489. else {
  21490. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21491. }
  21492. let aiData = this.skillSelectData[aiInfo.aiType];
  21493. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21494. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21495. this.waitingPeople();
  21496. }
  21497. waitingPeople() {
  21498. let time = xGame.common.randomNum(1000, 3000);
  21499. time += 1000;
  21500. Laya.timer.once(time, this, () => {
  21501. this.matchingSuccess();
  21502. });
  21503. }
  21504. matchingSuccess() {
  21505. let gameUI = xGame.common.gameUI;
  21506. let name = gameUI.ui.topNode.aiNameTxt.text;
  21507. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21508. this.ui.aiHead.nameTxt.text = name;
  21509. this.ui.aiHead.headImg.url = url;
  21510. name = gameUI.ui.topNode.selfNameTxt.text;
  21511. url = gameUI.ui.topNode.selfHeadLoader.url;
  21512. this.ui.selfHead.nameTxt.text = name;
  21513. this.ui.selfHead.headImg.url = url;
  21514. this.ui.t3.play(Laya.Handler.create(this, () => {
  21515. this.callback && this.callback();
  21516. this.ui.t4.play(Laya.Handler.create(this, () => {
  21517. this.destroySelf();
  21518. }));
  21519. }));
  21520. }
  21521. destroySelf() {
  21522. this.callback = null;
  21523. this.skillSelectData = null;
  21524. this.selfPot = null;
  21525. this.aiPot = null;
  21526. if (!this.ui.isDisposed) {
  21527. this.ui.removeFromParent();
  21528. this.ui.dispose();
  21529. }
  21530. xGame.uiMgr.destroyUI(this);
  21531. }
  21532. }
  21533. UIMatching$1.uiName = "UIMatching";
  21534. class SkillDisplay$1 {
  21535. constructor(ui, data, uiIndex) {
  21536. this.starX = 0;
  21537. this.starY = 0;
  21538. this.index = 0;
  21539. this.ui = ui;
  21540. this.data = data;
  21541. this.index = uiIndex;
  21542. this.initSelf();
  21543. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21544. }
  21545. initSelf() {
  21546. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21547. this.ui.nameTxt.text = this.data.name;
  21548. this.ui.describeTxt.text = this.data.describe;
  21549. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21550. this.ui.startBtn.onClick(this, this.startGame);
  21551. this.updateSelf();
  21552. }
  21553. updateSelf() {
  21554. this.checkTry();
  21555. let level = DataMgr.getBigSkillByIndex(this.index);
  21556. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21557. }
  21558. checkTry() {
  21559. let index = this.index;
  21560. let level = DataMgr.getBigSkillByIndex(index);
  21561. if (level == null) {
  21562. DataMgr.setBigSkill(index, 1, false);
  21563. level = 1;
  21564. }
  21565. this.ui.levelTxt.text = "LV." + level;
  21566. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21567. this.ui.tryNode.visible = true;
  21568. else
  21569. this.ui.tryNode.visible = false;
  21570. }
  21571. clickAddLevel() {
  21572. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21573. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21574. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21575. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21576. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21577. }
  21578. else {
  21579. console.log('zh:AD 失败,直接发放奖励');
  21580. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21581. }
  21582. }
  21583. qjff_AD_for_skilldisplay_clickAddLevel() {
  21584. DataMgr.setBigSkill(this.data.index, 1);
  21585. this.updateSelf();
  21586. xGame.common.upSkillLevel = true;
  21587. }
  21588. startGame() {
  21589. console.log('zh:rod skill startgame');
  21590. if (this.data.index == 3) {
  21591. alert('Coming soon!');
  21592. return;
  21593. }
  21594. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21595. let needCoin = xGame.common.bigMoveNeedCoin;
  21596. xGame.common.passAwardCoin = 2000;
  21597. let guide = DataMgr.getSkillGuide();
  21598. console.log('zh:startGame guide=' + guide);
  21599. xGame.common.temSelfLevel = 0;
  21600. if (guide == 0) {
  21601. needCoin = 0;
  21602. xGame.common.temSelfLevel = 100;
  21603. }
  21604. if (DataMgr.coinEnough(needCoin)) {
  21605. DataMgr.setCoin(-needCoin);
  21606. xGame.common.curPlayerSkillType = this.index;
  21607. if (guide == 0)
  21608. xGame.common.curPlayerSkillType = 0;
  21609. console.log('zh: skilldisplay 1');
  21610. xGame.uiMgr.Show(UIGame$1);
  21611. xGame.uiMgr.Hide(UIMain$1);
  21612. xGame.uiMgr.Show(UIMatching$1, () => {
  21613. xGame.common.gameUI.ui.alpha = 1;
  21614. xGame.common.gameUI.startGame();
  21615. xGame.uiMgr.Hide(UISkill$1);
  21616. });
  21617. this.logEventForRod_start();
  21618. }
  21619. else {
  21620. console.log('zh: skilldisplay 2');
  21621. xGame.uiMgr.Show(UIAddProp$1, 0);
  21622. Moyu.sendDataEvent("AddCoinVideo");
  21623. }
  21624. }
  21625. logEventForRod_start() {
  21626. let gfmsIdx = xGame.common.curPlayerSkillType;
  21627. console.log('zh:选择的技能=' + gfmsIdx);
  21628. let gfmc = 'Skyfall Shot';
  21629. if (gfmsIdx == 0) {
  21630. gfmc = 'Skyfall Shot';
  21631. }
  21632. if (gfmsIdx == 1) {
  21633. gfmc = 'Surging break';
  21634. }
  21635. if (gfmsIdx == 2) {
  21636. gfmc = 'Frost Lock';
  21637. }
  21638. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21639. let jsonStr = {
  21640. "count": 0,
  21641. "name": gfmc
  21642. };
  21643. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21644. const d = LocalStorageManager.getItem(keyStr);
  21645. jsonStr.count = d.count + 1;
  21646. LocalStorageManager.setItem(keyStr, jsonStr);
  21647. }
  21648. else {
  21649. LocalStorageManager.setItem(keyStr, jsonStr);
  21650. }
  21651. const reqStr = JSON.stringify(jsonStr);
  21652. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21653. }
  21654. }
  21655. class UISkill$1 extends UIBase {
  21656. constructor() {
  21657. super();
  21658. this.skillData = [];
  21659. }
  21660. onConstructor() {
  21661. this.ui = ui_UISkill.createInstance();
  21662. this.contentPane = this.ui;
  21663. this.isEject = false;
  21664. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21665. this.initSkillData();
  21666. console.log('zh:aaaaaa1111111111');
  21667. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21668. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21669. console.log('zh:aaaaaa22222222');
  21670. this.displayList = [];
  21671. this.ui.skillNode.skillList.numItems = 3;
  21672. this.addUIClick(this.ui, this.interuptSecretary);
  21673. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21674. this.ui.talkNode.visible = false;
  21675. if (Moyu.isKs)
  21676. this.ui.closeNode.closeBtn.x += 100;
  21677. }
  21678. show() {
  21679. super.show();
  21680. this.playSecretaryIdle();
  21681. this.moneyNode.ui.c1.selectedIndex = 1;
  21682. Laya.timer.clearAll(this);
  21683. xGame.soundMgr.playSound("s_start");
  21684. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21685. let guide = DataMgr.getSkillGuide();
  21686. this.ui.guideNode.visible = guide == 0;
  21687. let item = this.getSkillItemByUIIndex(0);
  21688. if (guide == 0) {
  21689. item.ui.c1.selectedIndex = 1;
  21690. }
  21691. else {
  21692. item.ui.c1.selectedIndex = 0;
  21693. }
  21694. this.ui.guideNode.guideBtn.visible = guide == 0;
  21695. for (let index = 0; index < this.displayList.length; index++) {
  21696. this.displayList[index].checkTry();
  21697. }
  21698. }
  21699. getSkillItemByUIIndex(cur) {
  21700. for (let index = 0; index < this.displayList.length; index++) {
  21701. if (this.displayList[index].index == cur) {
  21702. return this.displayList[index];
  21703. }
  21704. }
  21705. }
  21706. enterGuideLevel() {
  21707. let item = this.getSkillItemByUIIndex(0);
  21708. item.startGame();
  21709. if (DataMgr.getNewUser())
  21710. Moyu.sendDataEvent("gameStart1");
  21711. }
  21712. initSkillData() {
  21713. this.skillData = [];
  21714. let nameList = xGame.common.skillNameList;
  21715. let iconList = xGame.common.skillIconList;
  21716. let describeList = [
  21717. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21718. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21719. "The power of frost descends—freezing the flow and taking full control of the game!"
  21720. ];
  21721. console.log('zh:initSkillData 111111111');
  21722. let data;
  21723. for (let index = 0; index < nameList.length; index++) {
  21724. data = {};
  21725. data.name = nameList[index];
  21726. data.icon = iconList[index];
  21727. data.describe = describeList[index];
  21728. data.index = index;
  21729. this.skillData.push(data);
  21730. }
  21731. }
  21732. updateSkillItem(index, target) {
  21733. if (this.displayList[index] == null) {
  21734. let uiIndex;
  21735. switch (index) {
  21736. case 0:
  21737. uiIndex = 1;
  21738. break;
  21739. case 1:
  21740. uiIndex = 0;
  21741. break;
  21742. case 2:
  21743. uiIndex = 2;
  21744. break;
  21745. case 3:
  21746. uiIndex = 3;
  21747. break;
  21748. default:
  21749. break;
  21750. }
  21751. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21752. this.displayList.push(temp);
  21753. }
  21754. }
  21755. playSecretaryIdle() {
  21756. let parent = this.ui.secretary.displayObject;
  21757. parent.destroyChildren();
  21758. let xx = this.ui.secretary.width / 2;
  21759. let yy = this.ui.secretary.height;
  21760. let scale = xGame.common.getSecretaryScale();
  21761. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21762. xGame.common.secretary.play(data, 0, true, parent);
  21763. }
  21764. returnUIMain() {
  21765. this.hide();
  21766. xGame.common.stopGirlPop(this.ui.talkNode);
  21767. xGame.uiMgr.Show(UIMain$1);
  21768. }
  21769. interuptSecretary() {
  21770. Laya.timer.clearAll(this);
  21771. this.playSecretaryRandomSound();
  21772. }
  21773. playSecretaryRandomSound() {
  21774. if (this.isHide)
  21775. return;
  21776. let time = xGame.common.randomNum(45000, 60000);
  21777. Laya.timer.once(time, this, () => {
  21778. if (this.isHide)
  21779. return;
  21780. let index = xGame.common.randomNum(4, 7);
  21781. xGame.soundMgr.playSound("s_main0" + index);
  21782. let words = 1;
  21783. switch (index) {
  21784. case 4:
  21785. words = 5;
  21786. break;
  21787. case 5:
  21788. words = 3;
  21789. break;
  21790. case 6:
  21791. words = 6;
  21792. break;
  21793. case 7:
  21794. words = 7;
  21795. break;
  21796. default:
  21797. break;
  21798. }
  21799. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21800. this.playSecretaryRandomSound();
  21801. });
  21802. }
  21803. }
  21804. UISkill$1.uiName = "UISkill";
  21805. class UIAddProp$1 extends UIBase {
  21806. constructor() {
  21807. super();
  21808. this.curType = "";
  21809. }
  21810. onConstructor() {
  21811. this.ui = ui_UIAddProp.createInstance();
  21812. this.contentPane = this.ui;
  21813. this.isEject = false;
  21814. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21815. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21816. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21817. this.updateUI();
  21818. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21819. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21820. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21821. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21822. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21823. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21824. }
  21825. show(type) {
  21826. super.show();
  21827. this.curType = type == 0 ? "coin" : "diamond";
  21828. this.switchBtn("");
  21829. this.ui.t0.play();
  21830. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21831. PlatMgr.showInsert(true);
  21832. }
  21833. closeSelf() {
  21834. this.hide();
  21835. }
  21836. updateUI() {
  21837. let data = cfgTable.moneyData;
  21838. let temp;
  21839. let obj;
  21840. for (const key in data) {
  21841. temp = data[key];
  21842. obj = this.ui.myNode["node" + key];
  21843. if (parseInt(key) <= 2) {
  21844. obj.diamondTxt.text = "+" + temp.num;
  21845. }
  21846. else {
  21847. obj.coinTxt.text = temp.num;
  21848. obj.diamondTxt.text = temp.get.split('_')[1];
  21849. }
  21850. }
  21851. this.updateDiamondShare();
  21852. }
  21853. updateDiamondShare() {
  21854. let data = DataMgr.getShareDiamondTimes();
  21855. if (data >= xGame.common.maxShareDiamondTimes) {
  21856. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21857. this.ui.myNode.node1.touchable = false;
  21858. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21859. }
  21860. else {
  21861. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21862. this.ui.myNode.node1.touchable = true;
  21863. }
  21864. }
  21865. switchBtn(type) {
  21866. if (type == "")
  21867. type = this.curType;
  21868. else {
  21869. if (this.curType == type) {
  21870. return;
  21871. }
  21872. else {
  21873. this.curType = type;
  21874. }
  21875. }
  21876. if (type == "coin") {
  21877. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21878. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21879. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21880. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21881. this.ui.myNode.c1.selectedIndex = 0;
  21882. }
  21883. else {
  21884. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21885. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21886. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21887. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21888. this.ui.myNode.c1.selectedIndex = 1;
  21889. }
  21890. }
  21891. convertCoin(index) {
  21892. let data = cfgTable.moneyData[index];
  21893. let coinNum = data.num;
  21894. let str = data.get.split('_')[1];
  21895. let needDiamond = parseInt(str);
  21896. if (DataMgr.diamondEnough(needDiamond)) {
  21897. DataMgr.setDiamond(-needDiamond);
  21898. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21899. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21900. }
  21901. else {
  21902. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21903. this.switchBtn("diamond");
  21904. }
  21905. }
  21906. videoGetDiamond() {
  21907. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21908. if (Laya.Browser.onAndroid) {
  21909. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21910. if (!boo) {
  21911. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21912. return;
  21913. }
  21914. }
  21915. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21916. }
  21917. else {
  21918. console.log('zh:AD 失败,直接发放奖励');
  21919. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21920. }
  21921. }
  21922. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21923. let num = cfgTable.moneyData[2].num;
  21924. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21925. this.closeSelf();
  21926. }
  21927. videoGetCoin() {
  21928. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21929. if (Laya.Browser.onAndroid) {
  21930. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21931. if (!boo) {
  21932. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21933. return;
  21934. }
  21935. }
  21936. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21937. }
  21938. else {
  21939. console.log('zh:AD 失败,直接发放奖励');
  21940. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21941. }
  21942. }
  21943. qjff_AD_for_uiAddProp_videoGetCoin() {
  21944. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21945. this.closeSelf();
  21946. }
  21947. shareGetDiamond() {
  21948. let times = DataMgr.getShareDiamondTimes();
  21949. if (times >= xGame.common.maxShareDiamondTimes) {
  21950. console.log('zh: 233333333333 maxShareDiamondTimes');
  21951. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21952. }
  21953. else {
  21954. console.log('zh:33333333333333ad');
  21955. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21956. if (Laya.Browser.onAndroid) {
  21957. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21958. if (!boo) {
  21959. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21960. return;
  21961. }
  21962. }
  21963. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21964. }
  21965. else {
  21966. console.log('zh:AD 失败,直接发放奖励');
  21967. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21968. }
  21969. }
  21970. }
  21971. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21972. let diamond = xGame.common.randomNum(50, 100);
  21973. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21974. DataMgr.setShareDiamondTimes(1);
  21975. this.updateDiamondShare();
  21976. }
  21977. openPutBallView() {
  21978. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21979. let skill = xGame.uiMgr.getUI(UISkill$1);
  21980. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21981. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21982. if (end && !end.isHide) {
  21983. xGame.uiMgr.Hide(UIGameEnd$1);
  21984. xGame.uiMgr.Show(UIMain$1);
  21985. }
  21986. if (skill && !skill.isHide)
  21987. xGame.uiMgr.Hide(UISkill$1);
  21988. if (uigame && !uigame.isHide)
  21989. xGame.uiMgr.Hide(UIGame$1);
  21990. if (level && !level.isHide) {
  21991. }
  21992. else {
  21993. xGame.uiMgr.Show(UILevelDisplay$1);
  21994. }
  21995. this.closeSelf();
  21996. }
  21997. }
  21998. UIAddProp$1.uiName = "UIAddProp";
  21999. class MoneyNode$1 {
  22000. constructor(ui) {
  22001. this.leftTime = 0;
  22002. this.ui = ui;
  22003. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22004. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22005. this.ui.addPowerBtn.onClick(this, this.addPower);
  22006. this.ui.c1.selectedIndex = 1;
  22007. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22008. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22009. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22010. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22011. this.coinChange();
  22012. this.diamondChange();
  22013. this.powerChange();
  22014. }
  22015. addPower() {
  22016. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22017. xGame.uiMgr.Show(UIPower$1);
  22018. }
  22019. powerChange() {
  22020. let powerNum = DataMgr.getPower();
  22021. this.ui.powerTxt.text = powerNum + "";
  22022. }
  22023. checkPowerTime() {
  22024. let cur = new Date().getTime();
  22025. let last = DataMgr.getPowerTime();
  22026. if (last == 0) {
  22027. last = cur;
  22028. DataMgr.setPowerTime(cur);
  22029. }
  22030. let power = DataMgr.getPower();
  22031. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22032. Laya.timer.clearAll(this);
  22033. if (power >= xGame.common.natureMaxPower) {
  22034. this.ui.powerTimeTxt.text = "";
  22035. DataMgr.setPowerTime(cur);
  22036. return;
  22037. }
  22038. if (power + offset >= xGame.common.natureMaxPower) {
  22039. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22040. this.ui.powerTimeTxt.text = "";
  22041. DataMgr.setPowerTime(cur);
  22042. }
  22043. else {
  22044. if (offset > 0) {
  22045. DataMgr.setPower(offset);
  22046. DataMgr.setPowerTime(cur);
  22047. }
  22048. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22049. this.leftTime = xGame.common.powerRecoverNum - time;
  22050. if (this.leftTime <= 0)
  22051. this.leftTime = 0;
  22052. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22053. Laya.timer.loop(1000, this, this.updatePowerTime);
  22054. }
  22055. }
  22056. updatePowerTime() {
  22057. this.leftTime -= 1;
  22058. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22059. if (this.leftTime <= 0) {
  22060. this.checkPowerTime();
  22061. }
  22062. }
  22063. coinChange() {
  22064. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22065. }
  22066. diamondChange() {
  22067. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22068. }
  22069. addCoin() {
  22070. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22071. Moyu.sendDataEvent("AddCoinBtn");
  22072. xGame.uiMgr.Show(UIAddProp$1, 0);
  22073. }
  22074. addDiamond() {
  22075. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22076. Moyu.sendDataEvent("AddDiamondBtn");
  22077. xGame.uiMgr.Show(UIAddProp$1, 1);
  22078. }
  22079. }
  22080. class SettingNode$1 {
  22081. constructor(ui) {
  22082. this.showSetting = false;
  22083. this.openSound = true;
  22084. this.openShake = true;
  22085. this.ui = ui;
  22086. this.ui.soundBtn.onClick(this, this.switchSound);
  22087. this.ui.shakeBtn.onClick(this, this.switchShake);
  22088. this.ui.xyBtn.onClick(this, this.onXy);
  22089. this.ui.clickNode.onClick(this, this.changeSetting);
  22090. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22091. this.ui.xyBtn.visible = false;
  22092. this.ui.shakeBtn.visible = false;
  22093. }
  22094. changeSetting() {
  22095. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22096. this.showSetting = !this.showSetting;
  22097. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22098. }
  22099. switchSound() {
  22100. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22101. this.openSound = !this.openSound;
  22102. Moyu.onSetting(this.openSound, this.openShake);
  22103. xGame.soundMgr.onSetting(this.openSound);
  22104. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22105. }
  22106. switchShake() {
  22107. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22108. this.openShake = !this.openShake;
  22109. Moyu.onSetting(this.openSound, this.openShake);
  22110. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22111. }
  22112. onXy() {
  22113. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22114. MoyuMgr$1.showXy(1);
  22115. }
  22116. }
  22117. class UIDraw$1 extends UIBase {
  22118. constructor() {
  22119. super();
  22120. this.curKey = 0;
  22121. }
  22122. onConstructor() {
  22123. this.ui = ui_UIDraw.createInstance();
  22124. this.contentPane = this.ui;
  22125. this.isEject = false;
  22126. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22127. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22128. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22129. this.initDraw();
  22130. this.initUI();
  22131. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22132. if (Moyu.isKs)
  22133. this.ui.closeNode.closeBtn.x += 100;
  22134. }
  22135. show() {
  22136. super.show();
  22137. this.ui.t0.play();
  22138. this.playSecretaryIdle();
  22139. this.updateDraw();
  22140. this.checkFree();
  22141. if (PlatMgr.bannerDelay > 0) {
  22142. this.ui.closeNode.closeBtn.visible = false;
  22143. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22144. this.ui.closeNode.closeBtn.visible = true;
  22145. });
  22146. }
  22147. PlatMgr.showRateBanner();
  22148. }
  22149. hide() {
  22150. Laya.timer.clearAll(this);
  22151. super.hide();
  22152. }
  22153. checkFree() {
  22154. let isFree = DataMgr.getDailyfreeDrawTimes();
  22155. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22156. }
  22157. initDraw() {
  22158. this.drawObj = [];
  22159. let data = cfgTable.drawData;
  22160. let temp;
  22161. let weight = 0;
  22162. for (const key in data) {
  22163. temp = data[key];
  22164. weight += temp.weight;
  22165. this.drawObj.push(weight);
  22166. }
  22167. this.allWeight = weight;
  22168. }
  22169. initUI() {
  22170. let data = cfgTable.drawData;
  22171. let temp;
  22172. let img;
  22173. let txt;
  22174. for (const key in data) {
  22175. temp = data[key];
  22176. img = this.ui.myNode.rotNode["img" + key];
  22177. txt = this.ui.myNode.rotNode["txt" + key];
  22178. img.url = xGame.common.getGameIconUrl(temp.icon);
  22179. txt.visible = true;
  22180. if (temp.award > 2) {
  22181. img.rotation = 0;
  22182. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22183. }
  22184. else {
  22185. img.rotation = temp.rotation;
  22186. txt.text = temp.num;
  22187. }
  22188. }
  22189. }
  22190. getCurkey() {
  22191. let rand = Math.random() * this.allWeight;
  22192. let temp;
  22193. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22194. temp = this.drawObj[index];
  22195. if (index == 0) {
  22196. if (rand < temp) {
  22197. return index + 1;
  22198. }
  22199. }
  22200. else {
  22201. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22202. return index + 1;
  22203. }
  22204. }
  22205. }
  22206. return 2;
  22207. }
  22208. startDraw() {
  22209. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22210. if (freeTimes > 0) {
  22211. this.beginDraw();
  22212. DataMgr.setDailyfreeDrawTimes(0);
  22213. this.checkFree();
  22214. }
  22215. else {
  22216. if (Laya.Browser.onAndroid) {
  22217. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22218. if (!boo) {
  22219. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22220. return;
  22221. }
  22222. }
  22223. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22224. }
  22225. else {
  22226. console.log('zh:AD 失败,直接发放奖励');
  22227. this.qjff_chouJiang();
  22228. }
  22229. }
  22230. }
  22231. qjff_chouJiang() {
  22232. this.beginDraw();
  22233. }
  22234. beginDraw() {
  22235. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22236. this.ui.drawBtn.touchable = false;
  22237. this.curKey = this.getCurkey();
  22238. console.log("当前key", this.curKey);
  22239. let cell = 60;
  22240. let lap = 3;
  22241. let angle = cell * (this.curKey - 1) + lap * 360;
  22242. let target = this.ui.myNode.rotNode;
  22243. target.rotation = 0;
  22244. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22245. console.log("旋转完成");
  22246. this.ui.drawBtn.touchable = true;
  22247. this.getAward();
  22248. }));
  22249. }
  22250. getAward() {
  22251. let data = cfgTable.drawData[this.curKey];
  22252. let temp = new AwardType();
  22253. temp.type = data.award;
  22254. temp.num = data.num;
  22255. xGame.common.getAward([temp], () => {
  22256. DataMgr.setDrawTimes(1);
  22257. this.updateDraw();
  22258. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22259. });
  22260. }
  22261. updateDraw() {
  22262. let drawTimes = DataMgr.getDrawTimes();
  22263. let awardTimes = DataMgr.getDrawAwardTimes();
  22264. if (Math.floor(drawTimes / 3) > awardTimes) {
  22265. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22266. this.ui.extraNode.boxBtn.touchable = true;
  22267. this.ui.extraNode.tipsTxt.text = "3/3";
  22268. this.ui.extraNode.barNode.width = 265;
  22269. this.getExtraAward();
  22270. }
  22271. else {
  22272. this.ui.extraNode.boxBtn.t0.stop();
  22273. this.ui.extraNode.boxBtn.touchable = false;
  22274. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22275. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22276. }
  22277. let data = cfgTable.drawData[1];
  22278. if (awardTimes == 0) {
  22279. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22280. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22281. this.ui.myNode.rotNode.img1.rotation = 0;
  22282. }
  22283. else {
  22284. let award = data.nextid;
  22285. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22286. this.ui.myNode.rotNode.txt1.text = award[1];
  22287. this.ui.myNode.rotNode.img1.rotation = 0;
  22288. }
  22289. }
  22290. getExtraAward() {
  22291. let drawTimes = DataMgr.getDrawTimes();
  22292. let awardTimes = DataMgr.getDrawAwardTimes();
  22293. let data = cfgTable.drawData[1];
  22294. let award = new AwardType();
  22295. if (awardTimes == 0) {
  22296. award.num = data.num;
  22297. award.type = data.award;
  22298. xGame.common.getAward([award], () => {
  22299. let all = Math.floor(drawTimes / 3);
  22300. DataMgr.setDrawAwardTimes(all);
  22301. this.updateDraw();
  22302. });
  22303. }
  22304. else {
  22305. award.num = parseInt(data.nextid[1]);
  22306. award.type = parseInt(data.nextid[0]);
  22307. xGame.common.getAward([award], () => {
  22308. let all = Math.floor(drawTimes / 3);
  22309. DataMgr.setDrawAwardTimes(all);
  22310. this.updateDraw();
  22311. });
  22312. }
  22313. }
  22314. closeSelf() {
  22315. this.hide();
  22316. }
  22317. playSecretaryIdle() {
  22318. let parent = this.ui.secretary.displayObject;
  22319. parent.destroyChildren();
  22320. let xx = this.ui.secretary.width / 2;
  22321. let yy = this.ui.secretary.height;
  22322. let scale = xGame.common.getSecretaryScale();
  22323. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22324. xGame.common.secretary.play(data, 0, true, parent);
  22325. }
  22326. }
  22327. UIDraw$1.uiName = "UIDraw";
  22328. class UIRanking$1 extends UIBase {
  22329. constructor() {
  22330. super();
  22331. this.showSelf = true;
  22332. this.rankType = 1;
  22333. this.rankList = [];
  22334. this.topX = 10;
  22335. this.myIndex = this.topX + 1;
  22336. this.myStar = 0;
  22337. }
  22338. onConstructor() {
  22339. this.ui = ui_UIRanking.createInstance();
  22340. this.contentPane = this.ui;
  22341. this.isEject = false;
  22342. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22343. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22344. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22345. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22346. this.ui.myNode.myList.setVirtual();
  22347. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22348. }
  22349. show() {
  22350. super.show();
  22351. this.getPaiHangBangDataFormJosnFile();
  22352. this.updateSelf();
  22353. let self = Moyu.getUserInfo();
  22354. if (!self.isAuth) {
  22355. Moyu.initUser(this, () => {
  22356. DataMgr.upRankData();
  22357. });
  22358. }
  22359. }
  22360. getPaiHangBangDataFormJosnFile() {
  22361. const rankingList = cfgTable.paiHangBangData.list;
  22362. this.updateItemData(rankingList);
  22363. }
  22364. updateSelfItem() {
  22365. console.log('zh:Moyu.platType =' + Moyu.platType);
  22366. let self = Moyu.getUserInfo();
  22367. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22368. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22369. if (this.myIndex > this.topX) {
  22370. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22371. }
  22372. else {
  22373. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22374. }
  22375. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22376. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22377. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22378. }
  22379. updateItemData(data) {
  22380. this.myStar = xGame.common.getAllStarNum();
  22381. if (this.rankList.length < 2) {
  22382. this.rankList = data;
  22383. let self = Moyu.getUserInfo();
  22384. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22385. self.headIcon = self.headIcon;
  22386. for (let i = 0; i < data.length; i++) {
  22387. let data = this.rankList[i];
  22388. if (data.userId == self.userId) {
  22389. this.rankList.splice(i, 1);
  22390. break;
  22391. }
  22392. }
  22393. for (let i = 0; i < data.length; i++) {
  22394. let data = this.rankList[i];
  22395. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22396. this.myIndex = i + 1;
  22397. let user = { headIcon: self.headIcon, nickName: "myself" };
  22398. let ud = { user: user, data: {} };
  22399. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22400. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22401. if (Moyu.platType < 11) {
  22402. user.headIcon = self.headIcon;
  22403. user.nickName = self.nickName;
  22404. }
  22405. this.rankList.splice(i, 0, md);
  22406. break;
  22407. }
  22408. }
  22409. }
  22410. this.updateSelfItem();
  22411. this.ui.myNode.myList.numItems = this.rankList.length;
  22412. }
  22413. updateItemUI(index, obj) {
  22414. let data = this.rankList[index];
  22415. let userData = JSON.parse(data.userData).user;
  22416. obj.nameTxt.text = userData.nickName.toString();
  22417. obj.valueTxt.text = data.rankScore;
  22418. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22419. obj.rankTxt.text = index + 1;
  22420. switch (index) {
  22421. case 0:
  22422. this.setImg(obj, 1, 0, 0);
  22423. obj.rankTxt.color = "#FFC047";
  22424. break;
  22425. case 1:
  22426. this.setImg(obj, 0, 1, 0);
  22427. obj.rankTxt.color = "#ACACAC";
  22428. break;
  22429. case 2:
  22430. this.setImg(obj, 0, 0, 1);
  22431. obj.rankTxt.color = "#D09672";
  22432. break;
  22433. default:
  22434. this.setImg(obj, 0, 0, 0);
  22435. obj.rankTxt.color = "#496FAB";
  22436. break;
  22437. }
  22438. }
  22439. setImg(obj, a, b, c) {
  22440. obj.img1.visible = a ? true : false;
  22441. obj.img2.visible = b ? true : false;
  22442. obj.img3.visible = c ? true : false;
  22443. }
  22444. changeList(type) {
  22445. this.rankType = type;
  22446. this.updateSelf();
  22447. }
  22448. changeSelfNode() {
  22449. this.showSelf = !this.showSelf;
  22450. this.updateSelf();
  22451. }
  22452. updateSelf() {
  22453. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22454. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22455. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22456. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22457. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22458. }
  22459. }
  22460. UIRanking$1.uiName = "UIRanking";
  22461. class UISecretary$1 extends UIBase {
  22462. constructor() {
  22463. super();
  22464. this.curIndex = 1;
  22465. }
  22466. onConstructor() {
  22467. this.ui = ui_UISecretary.createInstance();
  22468. this.contentPane = this.ui;
  22469. this.isEject = false;
  22470. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22471. this.nodeObj = { left: null, right: null, cur: null };
  22472. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22473. }
  22474. show() {
  22475. super.show();
  22476. this.ui.t0.play();
  22477. this.updateData();
  22478. }
  22479. addSecretarySpine(node, spineName) {
  22480. if (spineName == "mishu") {
  22481. if (this.secretarySpine1) {
  22482. node.displayObject.destroyChildren();
  22483. this.playWoman(this.secretarySpine1, node.displayObject);
  22484. }
  22485. else {
  22486. let spine1 = new SpineMgr("mishu", () => {
  22487. this.secretarySpine1 = spine1;
  22488. this.playWoman(this.secretarySpine1, node.displayObject);
  22489. });
  22490. }
  22491. }
  22492. else {
  22493. if (this.secretarySpine2) {
  22494. node.displayObject.destroyChildren();
  22495. this.playWoman(this.secretarySpine2, node.displayObject);
  22496. }
  22497. else {
  22498. let spine2 = new SpineMgr("xiaomishu2", () => {
  22499. this.secretarySpine2 = spine2;
  22500. this.playWoman(this.secretarySpine2, node.displayObject);
  22501. });
  22502. }
  22503. }
  22504. }
  22505. playWoman(node, parent) {
  22506. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22507. let yy = this.ui.myNode.gameNode3.secretary.height;
  22508. let scale = 1.5;
  22509. if (node == this.secretarySpine2) {
  22510. scale = 1.2;
  22511. }
  22512. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22513. node.play(data, 0, true, parent);
  22514. }
  22515. turnLeft() {
  22516. this.curIndex--;
  22517. if (this.curIndex < 1) {
  22518. this.curIndex = 2;
  22519. }
  22520. let left = this.nodeObj.left;
  22521. let right = this.nodeObj.right;
  22522. let cur = this.nodeObj.cur;
  22523. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22524. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22525. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22526. this.updateData();
  22527. }));
  22528. this.ui.myNode.setChildIndex(right, 2);
  22529. this.nodeObj.left = cur;
  22530. this.nodeObj.right = left;
  22531. this.nodeObj.cur = right;
  22532. }
  22533. turnRight() {
  22534. this.curIndex++;
  22535. if (this.curIndex > 2) {
  22536. this.curIndex = 1;
  22537. }
  22538. let left = this.nodeObj.left;
  22539. let right = this.nodeObj.right;
  22540. let cur = this.nodeObj.cur;
  22541. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22542. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22543. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22544. this.updateData();
  22545. }));
  22546. this.ui.myNode.setChildIndex(left, 2);
  22547. this.nodeObj.left = right;
  22548. this.nodeObj.right = cur;
  22549. this.nodeObj.cur = left;
  22550. }
  22551. updateData() {
  22552. console.log('zh: updateData FFFFFFFFFF');
  22553. let data = cfgTable.secretaryshopData;
  22554. let children = this.ui.myNode._children;
  22555. let temp;
  22556. let curData;
  22557. for (let index = 0; index < children.length; index++) {
  22558. temp = children[index];
  22559. curData = data[1];
  22560. temp.heightTxt.text = curData.height;
  22561. temp.foodTxt.text = curData.food;
  22562. temp.historyTxt.text = curData.history;
  22563. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22564. this.addSecretarySpine(temp.secretary, curData.spine);
  22565. let womanIndex = curData.id - 1;
  22566. let getWoman = DataMgr.getSecretary(womanIndex);
  22567. let curUse = DataMgr.getCurSecretary();
  22568. if (getWoman) {
  22569. if (curUse == womanIndex) {
  22570. temp.purchaseBtn.c1.selectedIndex = 1;
  22571. }
  22572. else {
  22573. temp.purchaseBtn.c1.selectedIndex = 2;
  22574. }
  22575. }
  22576. else {
  22577. temp.purchaseBtn.c1.selectedIndex = 0;
  22578. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22579. }
  22580. temp.purchaseBtn.visible = false;
  22581. }
  22582. }
  22583. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22584. console.log('zh: 点击了clickSecretary ');
  22585. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22586. if (getWoman) {
  22587. if (curUse != womanIndex) {
  22588. console.log();
  22589. DataMgr.setCurSecretary(womanIndex);
  22590. this.updateData();
  22591. }
  22592. }
  22593. else {
  22594. console.log('zh:点击购买了');
  22595. let need = needDiamond;
  22596. if (DataMgr.diamondEnough(need)) {
  22597. DataMgr.setDiamond(-need);
  22598. DataMgr.setSecretary(womanIndex, 1);
  22599. DataMgr.setCurSecretary(womanIndex);
  22600. this.updateData();
  22601. }
  22602. else {
  22603. xGame.uiMgr.Show(UIAddProp$1, 1);
  22604. }
  22605. }
  22606. }
  22607. closeSelf() {
  22608. this.hide();
  22609. }
  22610. }
  22611. UISecretary$1.uiName = "UISecretary";
  22612. class BallRodDisplay$1 {
  22613. constructor(ui, index) {
  22614. this.index = 0;
  22615. this.uiIndex = 0;
  22616. this.ui = ui;
  22617. this.index = index;
  22618. this.initData();
  22619. }
  22620. initData() {
  22621. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22622. let data = cfgTable.ballrodData[this.index + 1];
  22623. this.ui.nameTxt.text = data.name;
  22624. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22625. this.ui.levelNode.c1.selectedIndex = data.quality;
  22626. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22627. if (data.spine) {
  22628. this.mySpine = new SpineMgr(data.spine, () => {
  22629. let xx = 150;
  22630. let yy = 70;
  22631. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22632. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22633. });
  22634. }
  22635. }
  22636. updateSelf() {
  22637. console.log('zh:updateSelf -------------- ');
  22638. let get = DataMgr.getBallRod(this.index);
  22639. if (get == null)
  22640. get = 1;
  22641. let curUse = DataMgr.getCurBallRod();
  22642. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22643. if (get) {
  22644. if (curUse == this.index) {
  22645. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22646. }
  22647. else {
  22648. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22649. }
  22650. }
  22651. else {
  22652. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22653. }
  22654. }
  22655. buyBallRod() {
  22656. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22657. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22658. switch (selectedIndex) {
  22659. case 0:
  22660. break;
  22661. case 1:
  22662. console.log('zh:点击了 USE THIS');
  22663. DataMgr.setCurBallRod(this.index);
  22664. let curUse = DataMgr.getCurBallRod();
  22665. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22666. let ui = xGame.uiMgr.getUI(UIShop$1);
  22667. ui.updateBallRod();
  22668. break;
  22669. case 2:
  22670. let data = cfgTable.ballrodData[this.index + 1];
  22671. let need = data.price;
  22672. if (DataMgr.diamondEnough(need)) {
  22673. this.buyQiuGan(data);
  22674. DataMgr.setDiamond(-need);
  22675. DataMgr.setBallRod(this.index, 1);
  22676. DataMgr.setCurBallRod(this.index);
  22677. let ui = xGame.uiMgr.getUI(UIShop$1);
  22678. ui.updateBallRod();
  22679. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22680. }
  22681. else {
  22682. xGame.uiMgr.Show(UIAddProp$1, 1);
  22683. }
  22684. break;
  22685. default:
  22686. break;
  22687. }
  22688. }
  22689. buyQiuGan(qgItem) {
  22690. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22691. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22692. if (userInfo == null) {
  22693. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22694. return;
  22695. }
  22696. let reqData = xGame.httpMgr.getReqData();
  22697. let pd = JSON.parse(reqData);
  22698. pd.qiuGanData = qgItem;
  22699. reqData = JSON.stringify(pd);
  22700. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22701. try {
  22702. console.log('zh:buySp res = ' + JSON.stringify(res));
  22703. let code = res.code;
  22704. let msg = res.msg;
  22705. if (code == 401) {
  22706. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22707. alert(TIP_MSG_key.loginTimeOut);
  22708. xGame.uiMgr.Show(UIMsg$1, msg);
  22709. return;
  22710. }
  22711. if (code == 200) {
  22712. xGame.uiMgr.Show(UIMsg$1, msg);
  22713. DataMgr.getUserZiChanInfo();
  22714. }
  22715. else {
  22716. xGame.uiMgr.Show(UIMsg$1, msg);
  22717. }
  22718. }
  22719. catch (error) {
  22720. console.log('error=' + error);
  22721. alert(error);
  22722. }
  22723. finally {
  22724. }
  22725. });
  22726. }
  22727. logEventForGouMaiGan(qiuGanName) {
  22728. const ev = {
  22729. value: qiuGanName
  22730. };
  22731. const jsonStr = JSON.stringify(ev);
  22732. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22733. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22734. }
  22735. }
  22736. class DaoJuDisplay$1 {
  22737. constructor(ui, index) {
  22738. this.index = 0;
  22739. this.uiIndex = 0;
  22740. this.ggSpid = "";
  22741. this.spid = 0;
  22742. this.ui = ui;
  22743. this.index = index;
  22744. this.initData();
  22745. }
  22746. initData() {
  22747. this.ui.btn_buy.onClick(this, this.gotoBuy);
  22748. let data = cfgTable.daoJuData[this.index + 1];
  22749. console.log('zh:' + JSON.stringify(data));
  22750. this.ui.nameTxt.text = data.spbt;
  22751. this.ui.n_jiaGe.text = data.spjg + "";
  22752. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22753. this.ggSpid = data.ggSpid;
  22754. this.spid = data.spid;
  22755. let baseUrl = "asset/sound/ogg/";
  22756. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22757. }
  22758. gotoBuy() {
  22759. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22760. if (userInfo != null) {
  22761. let token = userInfo.token;
  22762. let ggSpid = this.ggSpid;
  22763. let spid = this.spid;
  22764. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  22765. console.log('zh:gotoBuy1 spid =' + spid);
  22766. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  22767. return;
  22768. }
  22769. else {
  22770. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22771. }
  22772. }
  22773. gotoBuy1() {
  22774. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22775. let djItem = cfgTable.daoJuData[this.index + 1];
  22776. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22777. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22778. if (userInfo == null) {
  22779. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22780. return;
  22781. }
  22782. let reqData = xGame.httpMgr.getReqData();
  22783. let pd = JSON.parse(reqData);
  22784. pd.spItem = djItem;
  22785. reqData = JSON.stringify(pd);
  22786. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22787. try {
  22788. console.log('zh:buySp res = ' + JSON.stringify(res));
  22789. let code = res.code;
  22790. let msg = res.msg;
  22791. if (code == 401) {
  22792. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22793. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22794. return;
  22795. }
  22796. if (code == 200) {
  22797. xGame.uiMgr.Show(UIMsg$1, msg);
  22798. DataMgr.getUserZiChanInfo();
  22799. }
  22800. else {
  22801. xGame.uiMgr.Show(UIMsg$1, msg);
  22802. }
  22803. }
  22804. catch (error) {
  22805. console.log('error=' + error);
  22806. alert(error);
  22807. }
  22808. finally {
  22809. }
  22810. });
  22811. }
  22812. }
  22813. class UIShop$1 extends UIBase {
  22814. constructor() {
  22815. super();
  22816. this.itemNums = 0;
  22817. this.itemNumsForDj = 0;
  22818. this.curType = "";
  22819. }
  22820. onConstructor() {
  22821. this.ui = ui_UIShop.createInstance();
  22822. this.contentPane = this.ui;
  22823. this.isEject = false;
  22824. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22825. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22826. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22827. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22828. this.addUIClick(this.ui, this.interuptSecretary);
  22829. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22830. this.ballRodArr = [];
  22831. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22832. this.ui.myNode.myList.numItems = this.itemNums;
  22833. this.loadDjdata_old();
  22834. }
  22835. loadDjdata_old() {
  22836. let fff = cfgTable.daoJuData;
  22837. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22838. this.daoJuArr = [];
  22839. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22840. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22841. }
  22842. getProductList() {
  22843. let reqData = xGame.httpMgr.getReqData();
  22844. let pd = JSON.parse(reqData);
  22845. pd.splx = "Consumable";
  22846. reqData = JSON.stringify(pd);
  22847. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22848. try {
  22849. let code = res.code;
  22850. let msg = res.msg;
  22851. if (code == 401) {
  22852. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22853. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  22854. return;
  22855. }
  22856. if (code == 200) {
  22857. let data = res.data;
  22858. for (let index = 0; index < data.length; index++) {
  22859. let element = data[index];
  22860. cfgTable.daoJuData[element.spid] = element;
  22861. }
  22862. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22863. }
  22864. else {
  22865. xGame.uiMgr.Show(UIMsg, msg);
  22866. }
  22867. }
  22868. catch (error) {
  22869. console.log('error=' + error);
  22870. alert(error);
  22871. }
  22872. finally {
  22873. }
  22874. });
  22875. }
  22876. show(type) {
  22877. super.show();
  22878. this.curType = type == 0 ? "qiugan" : "daoju";
  22879. this.switchBtn("qiugan");
  22880. this.playSecretaryIdle();
  22881. this.updateBallRod();
  22882. }
  22883. test123() {
  22884. console.log('zh:test123 ');
  22885. }
  22886. switchBtn(type) {
  22887. console.log('zh:1111切換 sel type=' + type);
  22888. if (type == "") {
  22889. type = this.curType;
  22890. }
  22891. else {
  22892. if (this.curType == type) {
  22893. return;
  22894. }
  22895. else {
  22896. this.curType = type;
  22897. }
  22898. }
  22899. if (type == "qiugan") {
  22900. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22901. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22902. this.ui.myNode.c1.selectedIndex = 0;
  22903. this.ui.myNode.myList.visible = true;
  22904. this.ui.myNode.djList.visible = false;
  22905. }
  22906. else {
  22907. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22908. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22909. this.ui.myNode.c1.selectedIndex = 1;
  22910. this.ui.myNode.myList.visible = false;
  22911. this.ui.myNode.djList.visible = true;
  22912. }
  22913. }
  22914. updateBallRod() {
  22915. for (let index = 0; index < this.ballRodArr.length; index++) {
  22916. this.ballRodArr[index].updateSelf();
  22917. }
  22918. }
  22919. renderBallRod(sort, obj) {
  22920. let index = this.getIndexBySort(sort + 1) - 1;
  22921. let ballRod = new BallRodDisplay$1(obj, index);
  22922. this.ballRodArr.push(ballRod);
  22923. }
  22924. renderDaoJu(idx, obj) {
  22925. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22926. let b = new DaoJuDisplay$1(obj, index);
  22927. this.daoJuArr.push(b);
  22928. }
  22929. getIndexBySort(sort) {
  22930. let object = cfgTable.ballrodData;
  22931. for (const key in object) {
  22932. if (object[key].sort == sort) {
  22933. return parseInt(key);
  22934. }
  22935. }
  22936. }
  22937. getIndexBySortForDj(idx) {
  22938. let object = cfgTable.daoJuData;
  22939. for (const key in object) {
  22940. if (object[key].idx == idx) {
  22941. return parseInt(key);
  22942. }
  22943. }
  22944. }
  22945. playSecretaryIdle() {
  22946. let parent = this.ui.secretary.displayObject;
  22947. parent.destroyChildren();
  22948. let xx = this.ui.secretary.width / 2;
  22949. let yy = this.ui.secretary.height;
  22950. let scale = xGame.common.getSecretaryScale();
  22951. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22952. xGame.common.secretary.play(data, 0, true, parent);
  22953. }
  22954. interuptSecretary() {
  22955. Laya.timer.clearAll(this);
  22956. this.playSecretaryRandomSound();
  22957. }
  22958. playSecretaryRandomSound() {
  22959. if (this.isHide)
  22960. return;
  22961. let time = xGame.common.randomNum(45000, 60000);
  22962. Laya.timer.once(time, this, () => {
  22963. if (this.isHide)
  22964. return;
  22965. let index = xGame.common.randomNum(4, 7);
  22966. xGame.soundMgr.playSound("s_main0" + index);
  22967. let words = 1;
  22968. switch (index) {
  22969. case 4:
  22970. words = 5;
  22971. break;
  22972. case 5:
  22973. words = 3;
  22974. break;
  22975. case 6:
  22976. words = 6;
  22977. break;
  22978. case 7:
  22979. words = 7;
  22980. break;
  22981. default:
  22982. break;
  22983. }
  22984. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22985. this.playSecretaryRandomSound();
  22986. });
  22987. }
  22988. closeSelf() {
  22989. this.hide();
  22990. }
  22991. }
  22992. UIShop$1.uiName = "UIShop";
  22993. class SignMax$1 {
  22994. constructor(ui) {
  22995. this.ui = ui;
  22996. }
  22997. updateSelf(index, sameDay, curDayIndex) {
  22998. let data = cfgTable.signData[index + 1];
  22999. this.ui.titleTxt.text = data.title;
  23000. let arr1 = data.award[0].split('-');
  23001. let arr2 = data.award[1].split('-');
  23002. let num1 = parseInt(arr1[1]);
  23003. let num2 = parseInt(arr2[1]);
  23004. this.ui.numTxt1.text = num1 + "";
  23005. this.ui.numTxt2.text = num2 + "";
  23006. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23007. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23008. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23009. this.ui.numTxt1.visible = false;
  23010. }
  23011. else {
  23012. this.ui.numTxt1.visible = true;
  23013. }
  23014. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23015. this.ui.numTxt2.visible = false;
  23016. }
  23017. else {
  23018. this.ui.numTxt2.visible = true;
  23019. }
  23020. if (index < curDayIndex) {
  23021. this.ui.c1.selectedIndex = 1;
  23022. }
  23023. else if (index == curDayIndex) {
  23024. if (sameDay) {
  23025. this.ui.c1.selectedIndex = 2;
  23026. }
  23027. else {
  23028. this.ui.c1.selectedIndex = 2;
  23029. }
  23030. }
  23031. else {
  23032. this.ui.c1.selectedIndex = 0;
  23033. }
  23034. }
  23035. }
  23036. class SignNormal$1 {
  23037. constructor(ui) {
  23038. this.ui = ui;
  23039. }
  23040. updateSelf(index, sameDay, curDayIndex) {
  23041. let data = cfgTable.signData[index + 1];
  23042. this.ui.titleTxt.text = data.title;
  23043. let arr = data.award[0].split('-');
  23044. let type = parseInt(arr[0]);
  23045. let num = parseInt(arr[1]);
  23046. this.ui.numTxt.text = num + "";
  23047. if (type > 2) {
  23048. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23049. this.ui.myIcon.rotation = 0;
  23050. }
  23051. else {
  23052. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23053. this.ui.myIcon.rotation = 0;
  23054. }
  23055. if (xGame.common.signAwardContainsRod(data.award)) {
  23056. this.ui.numTxt.visible = false;
  23057. }
  23058. else {
  23059. this.ui.numTxt.visible = true;
  23060. }
  23061. if (index < curDayIndex) {
  23062. this.ui.c1.selectedIndex = 1;
  23063. }
  23064. else if (index == curDayIndex) {
  23065. if (sameDay) {
  23066. this.ui.c1.selectedIndex = 2;
  23067. }
  23068. else {
  23069. this.ui.c1.selectedIndex = 2;
  23070. }
  23071. }
  23072. else {
  23073. this.ui.c1.selectedIndex = 0;
  23074. }
  23075. }
  23076. }
  23077. class UISign$1 extends UIBase {
  23078. constructor() {
  23079. super();
  23080. this.curDayIndex = 0;
  23081. this.starX = 0;
  23082. }
  23083. onConstructor() {
  23084. this.ui = ui_UISign.createInstance();
  23085. this.contentPane = this.ui;
  23086. this.isEject = false;
  23087. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23088. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23089. this.initSignItem();
  23090. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23091. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23092. }
  23093. show() {
  23094. super.show();
  23095. this.ui.t0.play();
  23096. this.playSecretaryIdle();
  23097. this.updateSign();
  23098. }
  23099. initSignItem() {
  23100. this.signArr = [];
  23101. for (let index = 0; index < 6; index++) {
  23102. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23103. this.signArr.push(temp);
  23104. }
  23105. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23106. if (Moyu.isKs)
  23107. this.ui.closeNode.closeBtn.x += 100;
  23108. }
  23109. updateSign() {
  23110. let sameDay = xGame.common.judgeSameDay();
  23111. let max = 7;
  23112. this.curDayIndex = DataMgr.getSignData();
  23113. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23114. this.curDayIndex = 0;
  23115. if (!sameDay) {
  23116. this.ui.normalBtn.visible = true;
  23117. this.ui.tipsNode.visible = false;
  23118. this.ui.againBtn.visible = false;
  23119. }
  23120. else {
  23121. this.ui.normalBtn.visible = false;
  23122. let again = DataMgr.getExtraSign();
  23123. let isCurrency = false;
  23124. let index = this.curDayIndex;
  23125. if (index == 0)
  23126. index = 7;
  23127. let award = cfgTable.signData[index].award;
  23128. let num = award[0].split("-")[0];
  23129. if (num == "1" || num == "2")
  23130. isCurrency = true;
  23131. let showAgain = again == 0 && isCurrency;
  23132. this.ui.againBtn.visible = showAgain;
  23133. this.ui.tipsNode.visible = !showAgain;
  23134. }
  23135. for (let index = 0; index < this.signArr.length; index++) {
  23136. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23137. }
  23138. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23139. }
  23140. playSecretaryIdle() {
  23141. let parent = this.ui.secretary.displayObject;
  23142. parent.destroyChildren();
  23143. let xx = this.ui.secretary.width / 2;
  23144. let yy = this.ui.secretary.height;
  23145. let scale = xGame.common.getSecretaryScale();
  23146. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23147. xGame.common.secretary.play(data, 0, true, parent);
  23148. }
  23149. closeSelf() {
  23150. this.hide();
  23151. }
  23152. normalGetAward() {
  23153. let sameDay = xGame.common.judgeSameDay();
  23154. if (!sameDay) {
  23155. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23156. let temp;
  23157. let type;
  23158. let num;
  23159. let arr = [];
  23160. for (let index = 0; index < award.length; index++) {
  23161. temp = award[index].split("-");
  23162. type = parseInt(temp[0]);
  23163. num = parseInt(temp[1]);
  23164. let awardType = new AwardType();
  23165. awardType.num = num;
  23166. awardType.type = type;
  23167. arr.push(awardType);
  23168. }
  23169. xGame.common.getAward(arr, (watchVideo) => {
  23170. this.curDayIndex++;
  23171. if (this.curDayIndex > 7)
  23172. this.curDayIndex = 0;
  23173. DataMgr.setSignData(this.curDayIndex);
  23174. DataMgr.setSignTime(new Date().getTime());
  23175. if (watchVideo) {
  23176. DataMgr.setExtraSign(1);
  23177. Moyu.sendDataEvent("signIn1");
  23178. }
  23179. this.updateSign();
  23180. });
  23181. }
  23182. }
  23183. againGetAward() {
  23184. Moyu.sendDataEvent("signIn2");
  23185. console.log('zh:qjff_AD_for_uisign');
  23186. if (Laya.Browser.onAndroid) {
  23187. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23188. if (!boo) {
  23189. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23190. return;
  23191. }
  23192. }
  23193. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23194. }
  23195. else {
  23196. console.log('zh:AD 失败,直接发放奖励');
  23197. this.qjff_AD_for_uisign();
  23198. }
  23199. }
  23200. qjff_AD_for_uisign() {
  23201. let index = this.curDayIndex;
  23202. if (index == 0)
  23203. index = 7;
  23204. let award = cfgTable.signData[index].award;
  23205. let temp;
  23206. let type;
  23207. let num;
  23208. for (let index = 0; index < award.length; index++) {
  23209. temp = award[index].split("-");
  23210. type = parseInt(temp[0]);
  23211. num = parseInt(temp[1]) * 3;
  23212. xGame.common.playObjFlyAnim(num, type);
  23213. }
  23214. DataMgr.setExtraSign(1);
  23215. this.updateSign();
  23216. }
  23217. }
  23218. UISign$1.uiName = "UISign";
  23219. class UIModeSelection$1 extends UIBase {
  23220. constructor() {
  23221. super();
  23222. }
  23223. onConstructor() {
  23224. this.ui = ui_UIModeSelection.createInstance();
  23225. this.contentPane = this.ui;
  23226. this.isEject = false;
  23227. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23228. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23229. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23230. this.addUIClick(this.ui.closeBtn, this.hide);
  23231. this.peopleArr = [65, 990, 580];
  23232. this.peopleOffest = [5, 10, 10];
  23233. }
  23234. show(callback) {
  23235. this.updateSelf();
  23236. super.show();
  23237. this.ui.t0.play();
  23238. this.callback = callback;
  23239. }
  23240. updateSelf() {
  23241. let cfg = cfgTable.modeselectData;
  23242. for (let index = 1; index <= 3; index++) {
  23243. let node = this.ui.myNode["type" + index];
  23244. node.need.text = cfg[index].need;
  23245. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23246. node.peopleTxt.text = this.getRandPeople(index - 1);
  23247. }
  23248. }
  23249. enterGame(type) {
  23250. console.log('zh: 进入经典模式 type: ' + type);
  23251. xGame.common.classicRoomType = type;
  23252. let cfg = cfgTable.modeselectData[type];
  23253. let need = cfg.need;
  23254. xGame.common.passAwardCoin = cfg.award;
  23255. if (DataMgr.coinEnough(need)) {
  23256. DataMgr.setCoin(-need);
  23257. this.ui.myNode["type" + type].t0.play();
  23258. Laya.timer.once(200, this, () => {
  23259. this.callback && this.callback();
  23260. });
  23261. this.logEventForClassic_start();
  23262. }
  23263. else {
  23264. Moyu.sendDataEvent("AddCoinVideo");
  23265. xGame.uiMgr.Show(UIAddProp$1, 0);
  23266. }
  23267. }
  23268. getRandPeople(index) {
  23269. let rand = this.peopleOffest[index];
  23270. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23271. }
  23272. logEventForClassic_start() {
  23273. let rtype = xGame.common.classicRoomType;
  23274. let msmc = '';
  23275. if (rtype == 1) {
  23276. msmc = 'beginner';
  23277. }
  23278. if (rtype == 2) {
  23279. msmc = 'expert';
  23280. }
  23281. if (rtype == 3) {
  23282. msmc = 'master';
  23283. }
  23284. let keyStr = 'sjmd_classic_start_' + rtype;
  23285. let jsonStr = {
  23286. "difficulty": msmc,
  23287. "classic_count": 1,
  23288. "difficulty_count": 1
  23289. };
  23290. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23291. const d = LocalStorageManager.getItem(keyStr);
  23292. jsonStr.classic_count = d.classic_count + 1;
  23293. jsonStr.difficulty_count = d.difficulty_count + 1;
  23294. LocalStorageManager.setItem(keyStr, jsonStr);
  23295. }
  23296. else {
  23297. LocalStorageManager.setItem(keyStr, jsonStr);
  23298. }
  23299. const reqStr = JSON.stringify(jsonStr);
  23300. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23301. }
  23302. }
  23303. UIModeSelection$1.uiName = "UIModeSelection";
  23304. class UILogin$1 extends UIBase {
  23305. constructor() {
  23306. super();
  23307. }
  23308. onConstructor() {
  23309. this.ui = ui_UILogin.createInstance();
  23310. this.contentPane = this.ui;
  23311. this.isEject = false;
  23312. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23313. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23314. this.addUIClick(this.ui.btn_login, this.userLogin);
  23315. }
  23316. show() {
  23317. super.show();
  23318. this.x = (Laya.stage.width - this.width) / 2;
  23319. this.y = (Laya.stage.height - this.height) / 2;
  23320. }
  23321. closeSelf() {
  23322. this.hide();
  23323. }
  23324. userLogin() {
  23325. let ua = this.ui.txt_ua.text;
  23326. let up = this.ui.txt_up.text;
  23327. if (ua && up) {
  23328. let reqData = JSON.stringify({
  23329. username: ua.trim(),
  23330. password: up.trim(),
  23331. fromMark: 'app_game'
  23332. });
  23333. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23334. try {
  23335. console.log('zh:res = ' + JSON.stringify(res));
  23336. let code = res.code;
  23337. let msg = res.msg;
  23338. if (code == 200) {
  23339. let keyStr = keyForLoginInfo;
  23340. let jsonStr = {
  23341. "username": res.username,
  23342. "token": res.token,
  23343. "buySpids": { 1: false, 7: false }
  23344. };
  23345. LocalStorageManager.setItem(keyStr, jsonStr);
  23346. xGame.uiMgr.Show(UIMsg$1, msg);
  23347. DataMgr.getUserZiChanInfo();
  23348. this.closeSelf();
  23349. }
  23350. else {
  23351. xGame.uiMgr.Show(UIMsg$1, msg);
  23352. }
  23353. }
  23354. catch (error) {
  23355. console.log('error=' + error);
  23356. alert(error);
  23357. }
  23358. finally {
  23359. }
  23360. });
  23361. }
  23362. else {
  23363. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23364. }
  23365. }
  23366. gotoRegPage() {
  23367. this.closeSelf();
  23368. xGame.uiMgr.Show(UIReg$1);
  23369. }
  23370. }
  23371. UILogin$1.uiName = "UILogin";
  23372. class UIReg$1 extends UIBase {
  23373. constructor() {
  23374. super();
  23375. }
  23376. onConstructor() {
  23377. this.ui = ui_UIReg.createInstance();
  23378. this.contentPane = this.ui;
  23379. this.isEject = false;
  23380. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23381. this.addUIClick(this.ui.btn_reg, this.regUser);
  23382. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23383. }
  23384. show() {
  23385. super.show();
  23386. this.x = (Laya.stage.width - this.width) / 2;
  23387. this.y = (Laya.stage.height - this.height) / 2;
  23388. }
  23389. closeSelf() {
  23390. this.hide();
  23391. }
  23392. regUser() {
  23393. this.ui.lab_tip.visible = false;
  23394. let ua = this.ui.txt_ua.text;
  23395. let up1 = this.ui.txt_up1.text;
  23396. let up2 = this.ui.txt_up2.text;
  23397. if (ua && up1 && up2 && up1 == up2) {
  23398. let reqData = JSON.stringify({
  23399. username: ua.trim(),
  23400. password: up1.trim(),
  23401. fromMark: 'app_game'
  23402. });
  23403. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23404. try {
  23405. console.log('zh:res = ' + JSON.stringify(res));
  23406. let code = res.code;
  23407. let msg = res.msg;
  23408. xGame.uiMgr.Show(UIMsg$1, msg);
  23409. if (code == 200) {
  23410. this.ui.lab_tip.color = "#FFFFFF";
  23411. xGame.uiMgr.Show(UIMsg$1, msg);
  23412. this.closeSelf();
  23413. }
  23414. else {
  23415. this.ui.lab_tip.color = "#FF0000";
  23416. xGame.uiMgr.Show(UIMsg$1, msg);
  23417. }
  23418. }
  23419. catch (error) {
  23420. console.log('error=' + error);
  23421. alert(error);
  23422. }
  23423. finally {
  23424. }
  23425. });
  23426. }
  23427. else {
  23428. if (up1 != up2) {
  23429. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23430. }
  23431. else {
  23432. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23433. }
  23434. }
  23435. }
  23436. gotoLogin() {
  23437. this.closeSelf();
  23438. xGame.uiMgr.Show(UILogin$1);
  23439. }
  23440. }
  23441. UIReg$1.uiName = "UIReg";
  23442. class UIFuli1$1 extends UIBase {
  23443. constructor() {
  23444. super();
  23445. }
  23446. onConstructor() {
  23447. this.ui = ui_UIFuli1.createInstance();
  23448. this.contentPane = this.ui;
  23449. this.isEject = false;
  23450. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23451. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23452. }
  23453. show() {
  23454. super.show();
  23455. this.x = (Laya.stage.width - this.width) / 2;
  23456. this.y = (Laya.stage.height - this.height) / 2;
  23457. }
  23458. closeSelf() {
  23459. this.hide();
  23460. }
  23461. gotoBuy() {
  23462. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23463. if (userInfo != null) {
  23464. let token = userInfo.token;
  23465. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23466. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23467. return;
  23468. }
  23469. else {
  23470. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23471. }
  23472. }
  23473. gotoBuy2() {
  23474. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23475. if (userInfo == null) {
  23476. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23477. return;
  23478. }
  23479. let reqData = xGame.httpMgr.getReqData();
  23480. let pd = JSON.parse(reqData);
  23481. pd.productId = 1;
  23482. reqData = JSON.stringify(pd);
  23483. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23484. try {
  23485. console.log('zh:buySp res = ' + JSON.stringify(res));
  23486. let code = res.code;
  23487. let msg = res.msg;
  23488. if (code == 401) {
  23489. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23490. alert(TIP_MSG_key.loginTimeOut);
  23491. xGame.uiMgr.Show(UIMsg$1, msg);
  23492. return;
  23493. }
  23494. if (code == 200) {
  23495. xGame.uiMgr.Show(UIMsg$1, msg);
  23496. DataMgr.getUserZiChanInfo();
  23497. this.closeSelf();
  23498. }
  23499. else {
  23500. xGame.uiMgr.Show(UIMsg$1, msg);
  23501. }
  23502. }
  23503. catch (error) {
  23504. console.log('error=' + error);
  23505. alert(error);
  23506. }
  23507. finally {
  23508. }
  23509. });
  23510. }
  23511. }
  23512. UIFuli1$1.uiName = "UIFuli1";
  23513. class UIFuli2$1 extends UIBase {
  23514. constructor() {
  23515. super();
  23516. }
  23517. onConstructor() {
  23518. this.ui = ui_UIFuli2.createInstance();
  23519. this.contentPane = this.ui;
  23520. this.isEject = false;
  23521. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23522. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23523. }
  23524. show() {
  23525. super.show();
  23526. this.x = (Laya.stage.width - this.width) / 2;
  23527. this.y = (Laya.stage.height - this.height) / 2;
  23528. }
  23529. closeSelf() {
  23530. this.hide();
  23531. }
  23532. gotoBuy() {
  23533. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23534. if (userInfo != null) {
  23535. let token = userInfo.token;
  23536. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23537. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23538. return;
  23539. }
  23540. else {
  23541. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23542. }
  23543. }
  23544. gotoBuy1() {
  23545. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23546. if (userInfo == null) {
  23547. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23548. return;
  23549. }
  23550. let reqData = xGame.httpMgr.getReqData();
  23551. let pd = JSON.parse(reqData);
  23552. pd.productId = 2;
  23553. reqData = JSON.stringify(pd);
  23554. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23555. try {
  23556. console.log('zh:buySp res = ' + JSON.stringify(res));
  23557. let code = res.code;
  23558. let msg = res.msg;
  23559. if (code == 401) {
  23560. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23561. alert(TIP_MSG_key.loginTimeOut);
  23562. xGame.uiMgr.Show(UIMsg$1, msg);
  23563. return;
  23564. }
  23565. if (code == 200) {
  23566. xGame.uiMgr.Show(UIMsg$1, msg);
  23567. DataMgr.getUserZiChanInfo();
  23568. this.closeSelf();
  23569. }
  23570. else {
  23571. xGame.uiMgr.Show(UIMsg$1, msg);
  23572. }
  23573. }
  23574. catch (error) {
  23575. console.log('error=' + error);
  23576. alert(error);
  23577. }
  23578. finally {
  23579. }
  23580. });
  23581. }
  23582. }
  23583. UIFuli2$1.uiName = "UIFuli2";
  23584. class UITry$1 extends UIBase {
  23585. constructor() {
  23586. super();
  23587. this.closeTime = 0;
  23588. this.closeNum = 0;
  23589. this.skillUrl = xGame.common.skillIconList;
  23590. }
  23591. onConstructor() {
  23592. this.ui = ui_UITry.createInstance();
  23593. this.contentPane = this.ui;
  23594. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23595. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23596. }
  23597. show() {
  23598. super.show();
  23599. this.closeNum = 0;
  23600. this.closeTime = 15;
  23601. this.ui.t0.play();
  23602. PlatMgr.showRateBanner();
  23603. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23604. Laya.timer.loop(1000, this, this.updateTime);
  23605. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23606. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23607. xGame.common.gameMgr.gamePause = true;
  23608. }
  23609. updateTime() {
  23610. if (this.closeTime > 1) {
  23611. this.closeTime--;
  23612. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23613. }
  23614. else
  23615. this.hide();
  23616. }
  23617. hide() {
  23618. Laya.timer.clearAll(this);
  23619. Moyu.showBannerAd(false);
  23620. super.hide();
  23621. xGame.common.gameMgr.gamePause = false;
  23622. }
  23623. onTry() {
  23624. console.log('zh:qjff_AD_for_uitry');
  23625. if (Laya.Browser.onAndroid) {
  23626. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23627. if (!boo) {
  23628. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23629. return;
  23630. }
  23631. }
  23632. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23633. }
  23634. else {
  23635. console.log('zh:AD 失败,直接发放奖励');
  23636. this.qjff_AD_for_uitry();
  23637. }
  23638. }
  23639. qjff_AD_for_uitry() {
  23640. let select = xGame.common.curPlayerSkillType;
  23641. DataMgr.gameData.trySkill = select;
  23642. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23643. DataMgr.saveGameData();
  23644. DataMgr.setBigSkill(select, 1);
  23645. xGame.showTip("Trial Successful");
  23646. this.hide();
  23647. }
  23648. onCancel() {
  23649. if (this.closeNum > 0) {
  23650. this.closeNum--;
  23651. if (this.closeNum < 2)
  23652. this.hide();
  23653. return;
  23654. }
  23655. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23656. this.onTry();
  23657. }
  23658. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23659. this.closeNum = 3;
  23660. }
  23661. else
  23662. this.hide();
  23663. }
  23664. }
  23665. UITry$1.uiName = "UITry";
  23666. class UIGetAward$1 extends UIBase {
  23667. constructor() {
  23668. super();
  23669. this.showTriple = true;
  23670. }
  23671. onConstructor() {
  23672. this.ui = ui_UIGetAward.createInstance();
  23673. this.contentPane = this.ui;
  23674. this.isEject = false;
  23675. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23676. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23677. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23678. }
  23679. show(arr, showTriple, callback) {
  23680. super.show();
  23681. this.ui.t0.play();
  23682. this.ui.eftNode.visible = true;
  23683. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23684. this.ui.eftNode.visible = false;
  23685. }), 1, 0, 0, 0.9);
  23686. this.awardArr = arr;
  23687. this.showTriple = showTriple;
  23688. this.callback = callback;
  23689. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23690. this.ui.myList.numItems = arr.length;
  23691. xGame.soundMgr.playSound("getaward");
  23692. }
  23693. updateSelf(index, obj) {
  23694. let temp = this.awardArr[index];
  23695. let icon = this.getIcon(temp.type);
  23696. let str = icon;
  23697. if (temp.type > 2) {
  23698. str = "s" + icon;
  23699. }
  23700. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23701. obj.myIcon.rotation = 0;
  23702. obj.numTxt.text = temp.num + "";
  23703. obj.numTxt.visible = temp.type > 2 ? false : true;
  23704. obj.nameTxt.text = this.getNameStr(temp.type);
  23705. }
  23706. renderItem(index, obj) {
  23707. this.updateSelf(index, obj);
  23708. }
  23709. tripleGetAward() {
  23710. console.log('zh:qjff_AD_for_uigetAward');
  23711. if (Laya.Browser.onAndroid) {
  23712. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23713. if (!boo) {
  23714. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23715. return;
  23716. }
  23717. }
  23718. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23719. }
  23720. else {
  23721. console.log('zh:AD 失败,直接发放奖励');
  23722. this.qjff_AD_for_uigetAward();
  23723. }
  23724. }
  23725. qjff_AD_for_uigetAward() {
  23726. this.getAward(3);
  23727. }
  23728. normalGetAward() {
  23729. if (PlatMgr.isMisVideo())
  23730. this.tripleGetAward();
  23731. else
  23732. this.getAward();
  23733. }
  23734. getAward(times = 1) {
  23735. this.hide();
  23736. for (let index = 0; index < this.awardArr.length; index++) {
  23737. this.awardArr[index].num *= times;
  23738. }
  23739. this.callback && this.callback(times != 1);
  23740. }
  23741. getIcon(type) {
  23742. switch (type) {
  23743. case Prop.diamond:
  23744. return "ty_zs";
  23745. case Prop.coin:
  23746. return "ty_jb";
  23747. case Prop.gan1:
  23748. return "qg1";
  23749. case Prop.gan2:
  23750. return "qg2";
  23751. case Prop.gan3:
  23752. return "qg3";
  23753. case Prop.gan4:
  23754. return "qg4";
  23755. default:
  23756. break;
  23757. }
  23758. }
  23759. getNameStr(type) {
  23760. switch (type) {
  23761. case Prop.diamond:
  23762. return "Diamond";
  23763. case Prop.coin:
  23764. return "Coins";
  23765. case Prop.gan1:
  23766. case Prop.gan2:
  23767. case Prop.gan3:
  23768. case Prop.gan4:
  23769. return cfgTable.ballrodData[type - 1].name;
  23770. default:
  23771. break;
  23772. }
  23773. }
  23774. }
  23775. UIGetAward$1.uiName = "UIGetAward";
  23776. class UIBox$1 extends UIBase {
  23777. constructor() {
  23778. super();
  23779. this.boxNum = 0;
  23780. this.boxMax = 10;
  23781. this.inAd = false;
  23782. this.isClose = false;
  23783. }
  23784. onConstructor() {
  23785. this.ui = ui_UIBox.createInstance();
  23786. this.contentPane = this.ui;
  23787. this.isEject = false;
  23788. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23789. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23790. Laya.timer.loop(1000, this, this.update);
  23791. }
  23792. update() {
  23793. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23794. this.boxNum -= 1;
  23795. this.upBar();
  23796. }
  23797. }
  23798. upBar() {
  23799. if (this.boxNum > this.boxMax)
  23800. this.boxNum = this.boxMax;
  23801. this.ui.bar.value = this.boxNum * 10;
  23802. }
  23803. show() {
  23804. super.show();
  23805. this.isClose = false;
  23806. this.boxNum = 0;
  23807. this.inAd = false;
  23808. this.upBar();
  23809. this.ui.t0.play();
  23810. this.ui.closeBtn.visible = false;
  23811. Laya.timer.once(3000, this, () => {
  23812. this.ui.closeBtn.visible = true;
  23813. this.ui.bar.alpha = 1;
  23814. });
  23815. Laya.timer.once(500, this, () => {
  23816. this.ui.t1.play();
  23817. });
  23818. }
  23819. hide() {
  23820. Laya.timer.clearAll(this);
  23821. Moyu.showBannerAd(false);
  23822. super.hide();
  23823. }
  23824. onOpenBox() {
  23825. this.boxNum++;
  23826. if (this.boxNum < this.boxMax) {
  23827. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23828. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23829. }
  23830. }
  23831. else if (this.boxNum == this.boxMax) {
  23832. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23833. this.ui.openBtn.c1.selectedIndex = 13;
  23834. this.inAd = true;
  23835. }
  23836. else
  23837. this.getAward();
  23838. }
  23839. else if (this.inAd) {
  23840. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23841. if (Laya.Browser.onAndroid) {
  23842. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23843. if (!boo) {
  23844. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23845. return;
  23846. }
  23847. }
  23848. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23849. }
  23850. else {
  23851. console.log('zh:AD 失败,直接发放奖励');
  23852. this.qjff_AD_for_UIBOX_onOpenBox();
  23853. }
  23854. }
  23855. this.upBar();
  23856. }
  23857. qjff_AD_for_UIBOX_onOpenBox() {
  23858. this.getAward();
  23859. }
  23860. onCloseBox() {
  23861. if (this.isClose)
  23862. this.hide();
  23863. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23864. this.isClose = true;
  23865. PlatMgr.showBanner(true, 0, 3000);
  23866. }
  23867. else
  23868. this.hide();
  23869. }
  23870. getAward() {
  23871. let str = "";
  23872. if (Math.random() < 0.5) {
  23873. let max = Moyu.isLegal ? 500 : 2500;
  23874. let num = xGame.tools.random(max, 500 + max);
  23875. DataMgr.setCoin(num);
  23876. str = "金币x" + num;
  23877. }
  23878. else {
  23879. let max = Moyu.isLegal ? 10 : 30;
  23880. let num = xGame.tools.random(max, 30 + max);
  23881. DataMgr.setDiamond(num);
  23882. str = "钻石x" + num;
  23883. }
  23884. xGame.showTip("恭喜获得-" + str);
  23885. this.hide();
  23886. }
  23887. }
  23888. UIBox$1.uiName = "UIBox";
  23889. class UIMain$1 extends UIBase {
  23890. constructor() {
  23891. super();
  23892. this.firstEnter = true;
  23893. }
  23894. nativeCallJs(msg) {
  23895. let t = msg;
  23896. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23897. switch (t) {
  23898. case 'qjff_chouJiang':
  23899. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23900. dui.qjff_chouJiang();
  23901. break;
  23902. case 'qjff_AD_for_uisign':
  23903. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23904. dui2.qjff_AD_for_uisign();
  23905. break;
  23906. case 'qjff_AD_for_uitry':
  23907. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23908. dui3.qjff_AD_for_uitry();
  23909. break;
  23910. case 'qjff_AD_for_uipower':
  23911. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23912. dui4.qjff_AD_for_uipower();
  23913. break;
  23914. case 'qjff_AD_for_uigetAward':
  23915. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23916. dui5.qjff_AD_for_uigetAward();
  23917. break;
  23918. case 'qjff_AD_for_uiGameEnd':
  23919. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23920. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23921. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23922. break;
  23923. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23924. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23925. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23926. break;
  23927. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23928. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23929. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23930. break;
  23931. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23932. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23933. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23934. break;
  23935. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23936. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23937. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23938. break;
  23939. case 'qjff_AD_for_UIBOX_onOpenBox':
  23940. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23941. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23942. break;
  23943. case 'qjff_AD_for_UIAddCoin':
  23944. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23945. dui12.qjff_AD_for_UIAddCoin();
  23946. break;
  23947. case '111a':
  23948. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23949. dui14.qjff_AD_for_uisign();
  23950. break;
  23951. case '222a':
  23952. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23953. dui15.qjff_AD_for_uisign();
  23954. break;
  23955. case '333a':
  23956. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23957. dui16.qjff_AD_for_uisign();
  23958. break;
  23959. default:
  23960. console.log('zh:未知的方法名字' + t);
  23961. break;
  23962. }
  23963. }
  23964. onConstructor() {
  23965. console.log('zh: UIMain onConstructor');
  23966. this.ui = ui_UIMain.createInstance();
  23967. this.contentPane = this.ui;
  23968. this.isEject = false;
  23969. this.addEvent();
  23970. this.addClickSpine();
  23971. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23972. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23973. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23974. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23975. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23976. let curUse = DataMgr.getCurSecretary();
  23977. this.changeSecretary(curUse);
  23978. this.ui.talkNode.visible = false;
  23979. let guide = DataMgr.getSkillGuide();
  23980. if (xGame.common.isNewDay && guide == 1) {
  23981. xGame.common.isNewDay = false;
  23982. xGame.soundMgr.playSound("s_main01");
  23983. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23984. console.log("zh:播放小秘书每天语音");
  23985. }
  23986. this.onGetUserInfo();
  23987. DataMgr.getUserZiChanInfo();
  23988. this.ui.n83.visible = false;
  23989. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23990. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23991. let ua = d.username;
  23992. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23993. }
  23994. this.c_btn_for_user();
  23995. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23996. this.loadUserSpOrderForAd();
  23997. }
  23998. Logout() {
  23999. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24000. LocalStorageManager.removeItem(keyForLoginInfo);
  24001. this.freshUser();
  24002. }
  24003. JSBridgeUtils.instance.loginOutForApp();
  24004. }
  24005. gotoLogin() {
  24006. xGame.uiMgr.Show(UILogin$1);
  24007. }
  24008. gotoRegUser() {
  24009. xGame.uiMgr.Show(UIReg$1);
  24010. }
  24011. showFuLiSp1() {
  24012. console.log('zh:福利1');
  24013. this.checkForShowFuLi17(1);
  24014. }
  24015. showFuLiSp7() {
  24016. console.log('zh:福利7');
  24017. this.checkForShowFuLi17(7);
  24018. }
  24019. loadUserSpOrderForAd() {
  24020. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24021. if (userInfo == null) {
  24022. return;
  24023. }
  24024. let reqData = xGame.httpMgr.getReqData();
  24025. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  24026. try {
  24027. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  24028. let code = res.code;
  24029. let msg = res.msg;
  24030. if (code == 401) {
  24031. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24032. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24033. return;
  24034. }
  24035. if (code == 200) {
  24036. let data = res.data;
  24037. let buy_spid1 = false;
  24038. let buy_spid7 = false;
  24039. for (let index = 0; index < data.length; index++) {
  24040. let element = data[index];
  24041. console.log('zh:list element.spid = ' + element.spid);
  24042. if (element.spid == 1) {
  24043. buy_spid1 = true;
  24044. }
  24045. if (element.spid == 7) {
  24046. buy_spid7 = true;
  24047. }
  24048. }
  24049. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  24050. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  24051. }
  24052. else {
  24053. xGame.uiMgr.Show(UIMsg$1, msg);
  24054. }
  24055. }
  24056. catch (error) {
  24057. console.log('error=' + error);
  24058. alert(error);
  24059. }
  24060. finally {
  24061. }
  24062. });
  24063. }
  24064. checkForShowFuLi17(spid) {
  24065. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24066. if (userInfo == null) {
  24067. console.log('zh:没有登录就不显示福利弹框了');
  24068. return;
  24069. }
  24070. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24071. let reqData = xGame.httpMgr.getReqData();
  24072. let pd = JSON.parse(reqData);
  24073. pd.productId = spid;
  24074. reqData = JSON.stringify(pd);
  24075. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24076. try {
  24077. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24078. let code = res.code;
  24079. let msg = res.msg;
  24080. if (code == 401) {
  24081. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24082. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24083. return;
  24084. }
  24085. if (code == 200) {
  24086. let isBuyOk = res.data;
  24087. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24088. if (isBuyOk === false) {
  24089. if (spid === 1) {
  24090. xGame.uiMgr.Show(UIFuli1$1);
  24091. }
  24092. if (spid === 7) {
  24093. xGame.uiMgr.Show(UIFuli2$1);
  24094. }
  24095. }
  24096. else {
  24097. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24098. }
  24099. }
  24100. else {
  24101. xGame.uiMgr.Show(UIMsg$1, msg);
  24102. }
  24103. }
  24104. catch (error) {
  24105. console.log('error=' + error);
  24106. alert(error);
  24107. }
  24108. finally {
  24109. }
  24110. });
  24111. }
  24112. c_btn_for_user() {
  24113. this.ui.n_Logout.visible = false;
  24114. this.ui.n_dengLu.visible = false;
  24115. this.ui.n_zhuCe.visible = false;
  24116. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24117. this.ui.n_Logout.visible = true;
  24118. }
  24119. else {
  24120. this.ui.n_dengLu.visible = true;
  24121. }
  24122. }
  24123. changeSecretary(curUse) {
  24124. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24125. xGame.common.secretary && xGame.common.secretary.dispose();
  24126. this.addSecretarySpine(name);
  24127. }
  24128. addSecretarySpine(name) {
  24129. let spine = new SpineMgr(name, () => {
  24130. this.playSecretaryIdle();
  24131. });
  24132. xGame.common.secretary = spine;
  24133. }
  24134. addClickSpine() {
  24135. let clickSpine = new SpineMgr("dianji", () => {
  24136. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24137. let parent = Laya.stage;
  24138. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24139. clickSpine.play(data, 0, false, parent, (spine) => {
  24140. spine.destroy(true);
  24141. });
  24142. });
  24143. });
  24144. }
  24145. addEvent() {
  24146. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24147. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24148. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  24149. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24150. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24151. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24152. this.addUIClick(this.ui, this.interuptSecretary);
  24153. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24154. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24155. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24156. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24157. this.addUIClick(this.ui.signBtn, this.openSignView);
  24158. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24159. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24160. this.addUIClick(this.ui.n_Logout, this.Logout);
  24161. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24162. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  24163. this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
  24164. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24165. }
  24166. show(showFailWords) {
  24167. super.show();
  24168. this.loadUserSpOrderForAd();
  24169. this.moneyNode.ui.c1.selectedIndex = 1;
  24170. this.playSecretaryIdle();
  24171. xGame.soundMgr.playMusic("caromhall01", 0);
  24172. Laya.timer.clearAll(this);
  24173. this.playSecretaryRandomSound();
  24174. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24175. if (showFailWords) {
  24176. console.log('zh:uimain.ts ');
  24177. setTimeout(() => {
  24178. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24179. let words = -1;
  24180. if (str == "s_main02") {
  24181. words = 2;
  24182. }
  24183. else {
  24184. words = 3;
  24185. }
  24186. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24187. xGame.soundMgr.playSound(str);
  24188. }, 300);
  24189. }
  24190. this.showGuide();
  24191. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24192. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24193. let guide = DataMgr.getSkillGuide();
  24194. if (guide == 1) {
  24195. let randTime = xGame.common.randomNum(300, 800);
  24196. if (this.firstEnter) {
  24197. console.log("zh: firstEnter");
  24198. this.firstEnter = false;
  24199. randTime += 900;
  24200. }
  24201. else {
  24202. console.log("zh: no firstEnter");
  24203. }
  24204. Laya.timer.once(randTime, this, () => {
  24205. });
  24206. }
  24207. }
  24208. checkActive(show) {
  24209. }
  24210. showGuide() {
  24211. let guide = DataMgr.getSkillGuide();
  24212. this.ui.guideBtn.visible = guide == 0;
  24213. this.ui.enterGuide.visible = false;
  24214. this.ui.secretaryGuide.visible = guide == 0;
  24215. if (guide == 0) {
  24216. console.log("zh:显示引导");
  24217. xGame.soundMgr.playSound("s_guide");
  24218. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24219. }
  24220. else {
  24221. console.log("zh:不需要显示引导");
  24222. }
  24223. }
  24224. ensureSecretary() {
  24225. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  24226. this.ui.secretaryGuide.visible = false;
  24227. this.ui.enterGuide.visible = true;
  24228. this.ui.wordsNode.t0.play();
  24229. if (DataMgr.getNewUser())
  24230. Moyu.sendDataEvent("gameReady");
  24231. }
  24232. playSecretaryIdle() {
  24233. let parent = this.ui.secretary.displayObject;
  24234. parent.destroyChildren();
  24235. let xx = this.ui.secretary.width / 2;
  24236. let yy = this.ui.secretary.height;
  24237. let scale = xGame.common.getSecretaryScale();
  24238. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24239. xGame.common.secretary.play(data, 0, true, parent);
  24240. }
  24241. startGame(type) {
  24242. if (!this.isReadyForLoadNetSource()) {
  24243. return;
  24244. }
  24245. xGame.common.gameMode = type;
  24246. Moyu.sendDataEvent("PlayGame", { type: type });
  24247. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  24248. switch (xGame.common.gameMode) {
  24249. case GameMode.classic:
  24250. console.log('zh:进入经典模式111111111');
  24251. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24252. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24253. console.log('zh:classic db_over_lev=', db_over_lev);
  24254. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24255. console.log('zh:判断是否可以玩该模式classic =NO');
  24256. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24257. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24258. return;
  24259. }
  24260. else {
  24261. console.log('zh:可以玩该模式classic 66666666666666');
  24262. this.beginGame();
  24263. }
  24264. }
  24265. else {
  24266. console.log('zh:不需要判断是否可以玩该classic');
  24267. let challengeTimes = DataMgr.getChallengeTimes();
  24268. if (challengeTimes == 0) {
  24269. xGame.uiMgr.Show(UIInvitation$1);
  24270. }
  24271. else {
  24272. this.beginGame();
  24273. }
  24274. break;
  24275. }
  24276. case GameMode.bigMove:
  24277. console.error('zh:bigMove check');
  24278. let guide = DataMgr.getSkillGuide();
  24279. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24280. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24281. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24282. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24283. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24284. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24285. return;
  24286. }
  24287. else {
  24288. console.log('zh:可以玩该模式 bigMove');
  24289. this.beginGame();
  24290. if (DataMgr.getNewUser())
  24291. Moyu.sendDataEvent("gameStart0");
  24292. }
  24293. }
  24294. else {
  24295. this.beginGame();
  24296. if (DataMgr.getNewUser())
  24297. Moyu.sendDataEvent("gameStart0");
  24298. }
  24299. break;
  24300. default:
  24301. console.error('zh:未知错误!!!!');
  24302. break;
  24303. }
  24304. }
  24305. beginGame(isNice = false) {
  24306. console.log('zh:beginGame ');
  24307. let guide = DataMgr.getSkillGuide();
  24308. if (guide == 1) {
  24309. console.log('zh:非新手引导,showInternAd ');
  24310. JSBridgeUtils.instance.showInternAd('beginGame');
  24311. }
  24312. else {
  24313. console.log('zh:新手引导,不显示AD ');
  24314. }
  24315. console.log('zh:beginGame 2 go');
  24316. if (xGame.common.gameMode == GameMode.classic) {
  24317. if (isNice) {
  24318. this.enterClassic();
  24319. }
  24320. else {
  24321. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24322. console.log('zh:BBBBBBBBBBBBBBB');
  24323. this.enterClassic();
  24324. });
  24325. }
  24326. }
  24327. else if (xGame.common.gameMode == GameMode.bigMove) {
  24328. this.ui.enterGuide.visible = false;
  24329. xGame.uiMgr.Show(UISkill$1);
  24330. }
  24331. }
  24332. enterClassic() {
  24333. xGame.uiMgr.Show(UIGame$1);
  24334. xGame.uiMgr.Show(UIMatching$1, () => {
  24335. if (!this.isHide)
  24336. this.hide();
  24337. xGame.common.gameUI.ui.alpha = 1;
  24338. xGame.common.gameUI.startGame();
  24339. xGame.uiMgr.Hide(UIGameEnd$1);
  24340. });
  24341. }
  24342. start_debug_for_moni_payOk() {
  24343. console.log('zh:start_debug_for_moni_payOk');
  24344. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24345. if (userInfo != null) {
  24346. let token = userInfo.token;
  24347. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24348. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24349. alert('模拟支付OK');
  24350. return;
  24351. }
  24352. else {
  24353. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24354. }
  24355. }
  24356. startGlobal() {
  24357. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24358. }
  24359. startWeekly() {
  24360. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24361. }
  24362. zhouSaiMonth() {
  24363. console.log('zh: zhouSaiMonth 被调用');
  24364. }
  24365. isReadyForLoadNetSource() {
  24366. let reqCount = xGame.cfgMgr.httpReqCount;
  24367. let ok = xGame.cfgMgr.httpReqOkCount;
  24368. if (reqCount > ok) {
  24369. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24370. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24371. Laya.timer.once(5000, this, () => {
  24372. let retryCount = 0;
  24373. const maxRetries = 3;
  24374. const tryFetchConfig = () => {
  24375. try {
  24376. xGame.cfgMgr.getConfigFromServer();
  24377. }
  24378. catch (error) {
  24379. if (retryCount < maxRetries) {
  24380. retryCount++;
  24381. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24382. Laya.timer.once(5000, this, tryFetchConfig);
  24383. }
  24384. else {
  24385. console.error("❌ 达到最大重试次数,配置获取失败");
  24386. }
  24387. }
  24388. };
  24389. tryFetchConfig();
  24390. });
  24391. return false;
  24392. }
  24393. return true;
  24394. }
  24395. startPlaceBall() {
  24396. if (!this.isReadyForLoadNetSource()) {
  24397. return;
  24398. }
  24399. xGame.uiMgr.Show(UILevelDisplay$1);
  24400. }
  24401. hide() {
  24402. console.log('zh:uimain hide ...');
  24403. super.hide();
  24404. xGame.common.stopGirlPop(this.ui.talkNode);
  24405. }
  24406. onGetUserInfo(force = false) {
  24407. if (Moyu.isWx) {
  24408. let info = Moyu.getSystemInfo();
  24409. if (info)
  24410. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24411. }
  24412. else {
  24413. Moyu.initUser(this, this.freshUser, force);
  24414. }
  24415. this.freshUser();
  24416. }
  24417. freshUser() {
  24418. let user = Moyu.getUserInfo();
  24419. if (!user.isAuth) {
  24420. user.headIcon = 'res/ty_touxiang.png';
  24421. }
  24422. else {
  24423. DataMgr.upRankData();
  24424. }
  24425. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24426. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24427. let keyStr = keyForLoginInfo;
  24428. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24429. const d = LocalStorageManager.getItem(keyStr);
  24430. let ua = d.username;
  24431. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24432. }
  24433. else {
  24434. }
  24435. this.c_btn_for_user();
  24436. }
  24437. interuptSecretary() {
  24438. Laya.timer.clearAll(this);
  24439. this.playSecretaryRandomSound();
  24440. }
  24441. playSecretaryRandomSound() {
  24442. if (this.isHide)
  24443. return;
  24444. let time = xGame.common.randomNum(45000, 60000);
  24445. Laya.timer.once(time, this, () => {
  24446. if (this.isHide)
  24447. return;
  24448. let index = xGame.common.randomNum(4, 7);
  24449. xGame.soundMgr.playSound("s_main0" + index);
  24450. let words = 1;
  24451. switch (index) {
  24452. case 4:
  24453. words = 5;
  24454. break;
  24455. case 5:
  24456. words = 3;
  24457. break;
  24458. case 6:
  24459. words = 6;
  24460. break;
  24461. case 7:
  24462. words = 7;
  24463. break;
  24464. default:
  24465. break;
  24466. }
  24467. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24468. this.playSecretaryRandomSound();
  24469. });
  24470. }
  24471. openSecretaryView() {
  24472. xGame.uiMgr.Show(UISecretary$1);
  24473. Moyu.sendDataEvent("secretary");
  24474. }
  24475. openShopView() {
  24476. xGame.uiMgr.Show(UIShop$1, 0);
  24477. }
  24478. openSignView() {
  24479. xGame.uiMgr.Show(UISign$1);
  24480. }
  24481. openDrawView() {
  24482. xGame.uiMgr.Show(UIDraw$1);
  24483. }
  24484. openRanking() {
  24485. console.log('zh:phb openRanking');
  24486. xGame.uiMgr.Show(UIRanking$1);
  24487. Moyu.sendDataEvent("rankingList");
  24488. }
  24489. }
  24490. UIMain$1.uiName = "UIMain";
  24491. function InitShader() {
  24492. }
  24493. function appInit() {
  24494. xGame.context.init(getLoadingResList(), initCallback);
  24495. }
  24496. function getLoadingResList() {
  24497. return [
  24498. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24499. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24500. ];
  24501. }
  24502. function getGameResList() {
  24503. return [
  24504. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24505. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24506. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24507. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24508. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24509. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24510. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24511. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24512. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24513. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24514. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24515. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24516. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24517. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24518. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24519. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24520. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24521. ];
  24522. }
  24523. function initCallback() {
  24524. window["DataMgr"] = DataMgr;
  24525. DataMgr.Init();
  24526. Moyu.init(getPlat(), this, () => {
  24527. DataMgr.isNewDay();
  24528. PlatMgr.initConfig();
  24529. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24530. }, true);
  24531. console.log('zh:开始sm init1 start');
  24532. xGame.soundMgr.init();
  24533. console.log('zh:开始sm init1 end');
  24534. xGame.uiMgr.init();
  24535. xGame.uiMgr.clearTempData();
  24536. xGame.uiMgr.bindFUI(fguiRes.loading);
  24537. xGame.uiMgr.Show(UILoading);
  24538. }
  24539. function loadSubRes(callback) {
  24540. var tab = ["asset", "res", "spine"];
  24541. let subDone = 0;
  24542. for (var i = 0; i < tab.length; i++) {
  24543. let sub = tab[i];
  24544. Moyu.loadSubRes(sub, (pro) => {
  24545. callback && callback(pro, false);
  24546. }).then(() => {
  24547. subDone++;
  24548. if (subDone >= tab.length)
  24549. callback && callback(1, true);
  24550. });
  24551. }
  24552. }
  24553. function enterGame() {
  24554. xGame.cfgMgr.init();
  24555. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24556. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24557. xGame.uiMgr.Hide(UILoading);
  24558. fgui.UIPackage.removePackage(fguiRes.loading);
  24559. xGame.uiMgr.bindFUI(fguiRes.game);
  24560. xGame.uiMgr.Show(UIMain$1);
  24561. if (DataMgr.getNewUser())
  24562. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24563. }
  24564. function getPlat() {
  24565. let cfg = new MoyuCfg();
  24566. cfg.plat = MoyuPlat.web;
  24567. cfg.myId = 180;
  24568. cfg.myKey = '8848a885774230a4';
  24569. cfg.version = 0;
  24570. if (window.hasOwnProperty("gamebox")) {
  24571. cfg.plat = MoyuPlat.f399;
  24572. cfg.version = 0;
  24573. }
  24574. else if (window.hasOwnProperty("ks")) {
  24575. cfg.plat = MoyuPlat.ks;
  24576. cfg.version = 0;
  24577. cfg.ads.ksVideoId = '2300002254_01';
  24578. cfg.ads.ksInsertId = '2300002254_02';
  24579. }
  24580. else if (Laya.Browser.onTTMiniGame) {
  24581. cfg.plat = MoyuPlat.tt;
  24582. cfg.version = 0;
  24583. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24584. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24585. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24586. }
  24587. else if (Laya.Browser.onMiniGame) {
  24588. cfg.plat = MoyuPlat.wx;
  24589. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24590. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24591. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24592. }
  24593. else if (Laya.Browser.onQQMiniGame) {
  24594. cfg.plat = MoyuPlat.qq;
  24595. }
  24596. else if (Laya.Browser.onQGMiniGame) {
  24597. cfg.plat = MoyuPlat.op;
  24598. cfg.ads.opVideoId = '455502';
  24599. cfg.ads.opBannerId = '455507';
  24600. }
  24601. else if (Laya.Browser.onVVMiniGame) {
  24602. cfg.plat = MoyuPlat.vv;
  24603. cfg.version = 0;
  24604. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24605. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24606. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24607. }
  24608. else if (Laya.Browser.onHWMiniGame) {
  24609. cfg.plat = MoyuPlat.hw;
  24610. }
  24611. else if (window["mz"]) {
  24612. cfg.plat = MoyuPlat.mz;
  24613. }
  24614. else {
  24615. let cfg = window['conchConfig'];
  24616. if (cfg) {
  24617. var os = cfg.getOS();
  24618. if (os == "Conch-ios") {
  24619. cfg.plat = MoyuPlat.ios;
  24620. }
  24621. else if (os == "Conch-android") {
  24622. }
  24623. }
  24624. }
  24625. return cfg;
  24626. }
  24627. class Main {
  24628. constructor() {
  24629. if (window["Laya3D"])
  24630. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24631. else {
  24632. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24633. this.initMain();
  24634. }
  24635. }
  24636. initMain() {
  24637. Laya["Physics"] && Laya["Physics"].enable();
  24638. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24639. Laya.stage.scaleMode = GameConfig.scaleMode;
  24640. Laya.stage.screenMode = GameConfig.screenMode;
  24641. Laya.stage.alignV = GameConfig.alignV;
  24642. Laya.stage.alignH = GameConfig.alignH;
  24643. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24644. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24645. Laya.enableDebugPanel();
  24646. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24647. Laya["PhysicsDebugDraw"].enable();
  24648. if (GameConfig.stat)
  24649. Laya.Stat.show();
  24650. Laya.alertGlobalError(true);
  24651. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24652. }
  24653. onVersionLoaded() {
  24654. appInit();
  24655. }
  24656. }
  24657. new Main();
  24658. }());
  24659. //# sourceMappingURL=bundle.js.map