bundle.js 982 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. console.log('zh:TEST环境');
  893. }
  894. else {
  895. console.log('zh:SC环境');
  896. }
  897. let url = urlMid + reqUrl;
  898. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  899. if (isDev) {
  900. url = urlTop + reqUrl;
  901. }
  902. else {
  903. url = urlTop + "prod-api/" + reqUrl;
  904. }
  905. }
  906. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  907. if (reqUrl.indexOf("/api/game/") >= 0) {
  908. }
  909. const keyForLoginInfo = "userInfo";
  910. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  911. if (userInfoData != null) {
  912. try {
  913. let bb = JSON.parse(userInfoData);
  914. if (bb) {
  915. let token = bb.token;
  916. headers.push("Authorization");
  917. headers.push(`Bearer ${token}`);
  918. }
  919. }
  920. catch (e) {
  921. }
  922. }
  923. let httpObj = new Laya.HttpRequest();
  924. httpObj.http.timeout = 5000;
  925. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  926. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  927. httpObj.send(url, data, 'post', 'text', headers);
  928. function errorHandler(error) {
  929. if (call) {
  930. call("{'msg':'Network exception','code':500}");
  931. }
  932. else {
  933. alert("Tip:Please check your network connection.");
  934. }
  935. }
  936. function completeHandler(data) {
  937. if (data && data.length > 0) {
  938. let jsonData = JSON.parse(data);
  939. if (call)
  940. call(jsonData);
  941. }
  942. }
  943. }
  944. sendGet(url, call) {
  945. let httpObj = new Laya.HttpRequest();
  946. httpObj.http.timeout = 5000;
  947. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  948. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  949. httpObj.send(url, '', 'get');
  950. function errorHandler(error) {
  951. console.log("errorHandler:" + error);
  952. }
  953. function completeHandler(data) {
  954. if (data && data.length > 0) {
  955. if (call)
  956. call(data);
  957. }
  958. }
  959. }
  960. }
  961. HttpMgr._instance = null;
  962. class LightShader extends Laya.Sprite {
  963. constructor() {
  964. super();
  965. this._time = 0;
  966. this._sin = 0;
  967. this.initShader();
  968. }
  969. initShader() {
  970. var vs = `
  971. #define FSHIGHPRECISION
  972. attribute vec4 posuv;
  973. uniform vec2 size;
  974. varying vec4 v_texcoord;
  975. void main() {
  976. vec4 pos = vec4(posuv.xy,0.,1.);
  977. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  978. gl_Position=pos1;
  979. v_texcoord.xy = posuv.xy;
  980. }
  981. `;
  982. var ps = `
  983. #define FSHIGHPRECISION
  984. precision highp float;
  985. varying vec4 v_texcoord;
  986. uniform vec2 size;
  987. uniform sampler2D texture;
  988. uniform float u_Time;
  989. void main() {
  990. vec4 color= texture2D(texture, v_texcoord.xy);
  991. float width = 0.2;
  992. float start = u_Time;
  993. float offset = 1.0;
  994. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  995. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  996. {
  997. color.r=1.1;
  998. color.g=1.1;
  999. color.b=1.1;
  1000. gl_FragColor = color;
  1001. } else {
  1002. gl_FragColor = color;
  1003. }
  1004. }
  1005. `;
  1006. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1007. this.customRenderEnable = true;
  1008. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1009. }
  1010. customRender(context, x, y) {
  1011. this.onUpdate();
  1012. if (!this.texture)
  1013. return;
  1014. let xx = x - this.pivotX;
  1015. let yy = y - this.pivotY;
  1016. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1017. }
  1018. onUpdate() {
  1019. this._time += 2 * Laya.timer.delta * 0.001;
  1020. this._sin = Math.sin(this._time);
  1021. if (this._sin > 0.99) {
  1022. this._sin = 0;
  1023. this._time = 0;
  1024. }
  1025. this.shaderValue['u_Time'] = this._sin;
  1026. }
  1027. }
  1028. LightShader.DissolveSurfaceSaveName = 9997;
  1029. class UIBase extends fairygui.Window {
  1030. constructor() {
  1031. super();
  1032. this.isEject = true;
  1033. this.isHide = true;
  1034. this.showbanner = true;
  1035. this.className = "";
  1036. this.isMuti = false;
  1037. this.showbanner = false;
  1038. this.onConstructor();
  1039. }
  1040. checkActive(show) {
  1041. }
  1042. getUIName() {
  1043. return UIBase.uiName;
  1044. }
  1045. onConstructor() {
  1046. try {
  1047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoadedForBase));
  1048. console.log("zh: base加载arial字体成功");
  1049. }
  1050. catch (error) {
  1051. console.log("zh: base加载arial字体失败");
  1052. }
  1053. }
  1054. onFontLoadedForBase() {
  1055. try {
  1056. Laya.Text.defaultFont = "arial";
  1057. console.log("zh: base 设置arial字体成功");
  1058. }
  1059. catch (error) {
  1060. console.log("zh: base 设置arial字体失败");
  1061. }
  1062. }
  1063. onInit() {
  1064. if (!!this.contentPane) {
  1065. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1066. }
  1067. this.setPivot(0.5, 0.5, false);
  1068. }
  1069. doShowAnimation() {
  1070. if (!this.isEject)
  1071. return;
  1072. super.doShowAnimation();
  1073. Laya.Tween.clearTween(this);
  1074. this.scaleX = this.scaleY = 0.8;
  1075. let tweenFunc1 = (func) => {
  1076. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1077. };
  1078. let tweenFunc2 = (func) => {
  1079. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1080. };
  1081. tweenFunc1(tweenFunc2);
  1082. }
  1083. show(...args) {
  1084. super.show();
  1085. this._openParam = args;
  1086. this.isHide = false;
  1087. xGame.uiMgr.checkUIState();
  1088. }
  1089. moveBannerButton() {
  1090. }
  1091. showBannerButton() {
  1092. this.bannerButton.visible = true;
  1093. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1094. this.bannerButton.touchable = true;
  1095. }));
  1096. }
  1097. hide() {
  1098. super.hide();
  1099. this.isHide = true;
  1100. xGame.uiMgr.checkUIState();
  1101. }
  1102. Dispose() {
  1103. super.dispose();
  1104. }
  1105. myUpdate(delay) {
  1106. }
  1107. refresh() { }
  1108. setGlobalFont(root) {
  1109. try {
  1110. console.log('zh: setGlobalFont start');
  1111. let fontName = "arial";
  1112. const setFont = (obj) => {
  1113. if (obj instanceof fairygui.GTextField) {
  1114. obj.font = fontName;
  1115. }
  1116. if (obj instanceof fairygui.GComponent) {
  1117. for (let i = 0; i < obj.numChildren; i++) {
  1118. setFont(obj.getChildAt(i));
  1119. }
  1120. }
  1121. };
  1122. const rootNode = root || this.contentPane;
  1123. if (rootNode) {
  1124. setFont(rootNode);
  1125. }
  1126. }
  1127. catch (error) {
  1128. console.log('zh: setGlobalFont error=' + error);
  1129. }
  1130. finally {
  1131. console.log('zh: setGlobalFont end');
  1132. }
  1133. }
  1134. addUIClick(obj, func, arr = null) {
  1135. obj.onClick(this, func, arr);
  1136. obj.onClick(this, this.playBtnSound);
  1137. }
  1138. offUIClick(obj, func) {
  1139. obj.offClick(this, func);
  1140. }
  1141. playBtnSound() {
  1142. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1143. }
  1144. }
  1145. UIBase.lastShowBanner = 0;
  1146. UIBase.showBannerNum = 0;
  1147. UIBase.uiName = "";
  1148. class ui_UIDraw extends fgui.GComponent {
  1149. static createInstance() {
  1150. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1151. }
  1152. onConstruct() {
  1153. this.n_bj = (this.getChild("n_bj"));
  1154. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1155. this.myNode = (this.getChild("myNode"));
  1156. this.extraNode = (this.getChild("extraNode"));
  1157. this.closeNode = (this.getChild("closeNode"));
  1158. this.moneyNode = (this.getChild("moneyNode"));
  1159. this.n38 = (this.getChild("n38"));
  1160. this.talkNode = (this.getChild("talkNode"));
  1161. this.secretary = (this.getChild("secretary"));
  1162. this.drawBtn = (this.getChild("drawBtn"));
  1163. this.t0 = this.getTransition("t0");
  1164. }
  1165. }
  1166. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1167. class ui_UIBox extends fgui.GComponent {
  1168. static createInstance() {
  1169. return (fgui.UIPackage.createObject("game", "UIBox"));
  1170. }
  1171. onConstruct() {
  1172. this.n0 = (this.getChild("n0"));
  1173. this.n12 = (this.getChild("n12"));
  1174. this.n1 = (this.getChild("n1"));
  1175. this.n2 = (this.getChild("n2"));
  1176. this.bar = (this.getChild("bar"));
  1177. this.closeBtn = (this.getChild("closeBtn"));
  1178. this.openBtn = (this.getChild("openBtn"));
  1179. this.t0 = this.getTransition("t0");
  1180. this.t1 = this.getTransition("t1");
  1181. }
  1182. }
  1183. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1184. class LocalStorageManager {
  1185. test1() {
  1186. LocalStorageManager.setItem("playerName", "Tom");
  1187. LocalStorageManager.setItem("playerLevel", 5);
  1188. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1189. const name = LocalStorageManager.getItem("playerName");
  1190. const level = LocalStorageManager.getItem("playerLevel");
  1191. const data = LocalStorageManager.getItem("playerData");
  1192. console.log(name);
  1193. console.log(level);
  1194. console.log(data);
  1195. LocalStorageManager.removeItem("playerLevel");
  1196. }
  1197. static setItem(key, value) {
  1198. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1199. }
  1200. static getItem(key) {
  1201. const data = Laya.LocalStorage.getItem(key);
  1202. if (data === null)
  1203. return null;
  1204. try {
  1205. return JSON.parse(data);
  1206. }
  1207. catch (e) {
  1208. return data;
  1209. }
  1210. }
  1211. static removeItem(key) {
  1212. Laya.LocalStorage.removeItem(key);
  1213. }
  1214. static clear() {
  1215. Laya.LocalStorage.clear();
  1216. }
  1217. static hasJosnKey(key) {
  1218. var value = Laya.LocalStorage.getJSON(key);
  1219. if (value != null) {
  1220. return true;
  1221. }
  1222. else {
  1223. return false;
  1224. }
  1225. }
  1226. static hasKey(key) {
  1227. return Laya.LocalStorage.getItem(key) !== null;
  1228. }
  1229. }
  1230. class GlobalManager {
  1231. constructor() {
  1232. }
  1233. registerMethod(name, method) {
  1234. console.log('zh: 注册全局方法', name);
  1235. this[name] = method;
  1236. }
  1237. callMethod(name, ...args) {
  1238. console.log('zh: 调用全局方法', name);
  1239. if (this[name]) {
  1240. return this[name](...args);
  1241. }
  1242. else {
  1243. console.error(`zh: 全局方法 Method ${name} not found`);
  1244. }
  1245. }
  1246. }
  1247. GlobalManager.instance = new GlobalManager();
  1248. class JSBridgeUtils {
  1249. constructor() { }
  1250. static get instance() {
  1251. if (!this._instance) {
  1252. this._instance = new JSBridgeUtils();
  1253. }
  1254. return this._instance;
  1255. }
  1256. initBridge() {
  1257. if (!Laya.Browser.onAndroid) {
  1258. console.log('zh:非android dev');
  1259. return;
  1260. }
  1261. let cfg = window['conchConfig'];
  1262. if (cfg) {
  1263. var os = cfg.getOS();
  1264. if (os == "Conch-android") {
  1265. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1266. if (this.bridge) {
  1267. return true;
  1268. }
  1269. else {
  1270. return false;
  1271. }
  1272. }
  1273. else {
  1274. return false;
  1275. }
  1276. }
  1277. else {
  1278. return false;
  1279. }
  1280. }
  1281. testAd1() {
  1282. if (!Laya.Browser.onAndroid) {
  1283. console.log('zh:非android dev');
  1284. return;
  1285. }
  1286. if (!this.initBridge()) {
  1287. return;
  1288. }
  1289. let rs = this.bridge.call("testString", "hello");
  1290. console.log('zh:testString rs=' + rs);
  1291. }
  1292. testAdCallBack() {
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log("zh:testAdCallBack start");
  1297. const defaultObj = { code: 200, msg: "req update Ui" };
  1298. const reqObj = { code: 300, msg: "hello java ui" };
  1299. this.bridge.callWithBack((rsStr) => {
  1300. const rsObj = JSON.parse(rsStr);
  1301. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1302. }, "testAsyncCallback", JSON.stringify(reqObj));
  1303. }
  1304. showInternAd(mark) {
  1305. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1306. if (boo1) {
  1307. console.log('zh: VIP SPID = 1,免除插页AD');
  1308. return false;
  1309. }
  1310. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1311. if (boo7) {
  1312. console.log('zh: VIP SPID = 7,免除任何AD');
  1313. return false;
  1314. }
  1315. console.log('zh:showInternAd start');
  1316. if (!Laya.Browser.onAndroid) {
  1317. console.log('zh:showInternAd 非android dev');
  1318. return false;
  1319. }
  1320. if (!this.initBridge()) {
  1321. return false;
  1322. }
  1323. let rs = this.bridge.call("showInternAd", mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:showInternAd OK");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:showInternAd FAILL:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. exitAndCloseGame() {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. console.log('zh:开始关闭游戏-');
  1348. this.bridge.call("exitAndCloseGame");
  1349. }
  1350. checkAdForUserOrderForSpid17(spid) {
  1351. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1352. if (userInfo != null) {
  1353. if (!userInfo.buySpids) {
  1354. userInfo.buySpids = { 1: false, 7: false };
  1355. }
  1356. else {
  1357. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1358. }
  1359. let boo = userInfo.buySpids[spid];
  1360. if (!boo) {
  1361. console.log('zh:刷新一下用户的AD权利');
  1362. DataMgr.loadUserSpOrderForAd();
  1363. }
  1364. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1365. return boo;
  1366. }
  1367. return false;
  1368. }
  1369. showRewardAd(mark) {
  1370. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1371. if (boo7) {
  1372. console.log('zh: VIP SPID = 7,免除任何AD');
  1373. return false;
  1374. }
  1375. if (!Laya.Browser.onAndroid) {
  1376. return false;
  1377. }
  1378. if (!this.initBridge()) {
  1379. return false;
  1380. }
  1381. let rs = this.bridge.call("showRewardAd", mark);
  1382. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1383. try {
  1384. const result = JSON.parse(rs);
  1385. if (result.code === 200) {
  1386. console.log("zh:广告显示成功");
  1387. return true;
  1388. }
  1389. else {
  1390. console.warn("zh:广告显示失败:", result.msg);
  1391. return false;
  1392. }
  1393. }
  1394. catch (e) {
  1395. console.error("zh:解析桥接返回值失败:", e);
  1396. return false;
  1397. }
  1398. }
  1399. logEventForAdNoParams(eventName) {
  1400. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1401. if (!Laya.Browser.onAndroid) {
  1402. return;
  1403. }
  1404. if (!this.initBridge()) {
  1405. return;
  1406. }
  1407. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1408. this.bridge.call("logEventForAdNoParams", eventName);
  1409. }
  1410. logEventForAdHaveParams(eventName, jsonStr) {
  1411. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1419. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1420. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1421. }
  1422. logEventForFirebase(eventName, jsonStr) {
  1423. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1424. if (!Laya.Browser.onAndroid) {
  1425. return;
  1426. }
  1427. if (!this.initBridge()) {
  1428. return;
  1429. }
  1430. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1431. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1432. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1433. }
  1434. testNetTip() {
  1435. if (Laya.Browser.onAndroid) {
  1436. let boo = this.getNetworkAvailable();
  1437. this.showToast2("Network error, reward unavailable");
  1438. return;
  1439. }
  1440. }
  1441. getNetworkAvailable() {
  1442. if (!Laya.Browser.onAndroid) {
  1443. return;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. console.log("zh:getNetworkAvailable boo=" + boo);
  1450. return boo;
  1451. }
  1452. showToast2(msg) {
  1453. if (!Laya.Browser.onAndroid) {
  1454. return;
  1455. }
  1456. if (!this.initBridge()) {
  1457. return;
  1458. }
  1459. this.bridge.call("showToast2", msg);
  1460. }
  1461. showConfirmationDialogForExit(title, msg) {
  1462. if (!Laya.Browser.onAndroid) {
  1463. return;
  1464. }
  1465. if (!this.initBridge()) {
  1466. return;
  1467. }
  1468. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1469. }
  1470. loginOutForApp() {
  1471. if (!Laya.Browser.onAndroid) {
  1472. return;
  1473. }
  1474. if (!this.initBridge()) {
  1475. return;
  1476. }
  1477. this.bridge.call("loginOutForApp");
  1478. }
  1479. startGgPay(token, ggSpid, spid) {
  1480. if (!Laya.Browser.onAndroid) {
  1481. return;
  1482. }
  1483. if (!this.initBridge()) {
  1484. return;
  1485. }
  1486. let jsonObj = {
  1487. token: token,
  1488. ggSpid: ggSpid,
  1489. spid: spid,
  1490. spsl: 1
  1491. };
  1492. let reqData = JSON.stringify(jsonObj);
  1493. console.log("zh:startGgPay ts reqData=" + reqData);
  1494. this.bridge.call("startGgPay", reqData);
  1495. }
  1496. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1497. if (!Laya.Browser.onAndroid) {
  1498. return;
  1499. }
  1500. if (!this.initBridge()) {
  1501. return;
  1502. }
  1503. let jsonObj = {
  1504. token: token,
  1505. ggSpid: ggSpid,
  1506. spid: spid,
  1507. spsl: 1
  1508. };
  1509. let reqData = JSON.stringify(jsonObj);
  1510. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1511. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1512. }
  1513. nativeCallJs(msg) {
  1514. console.log("zh:nativeCallJs received data: 1111", msg);
  1515. if (msg === 'Ad1') {
  1516. GlobalManager.instance.callMethod('Ad1');
  1517. console.log("zh: Ad1 奖励发送成功");
  1518. }
  1519. else if (msg === 'Ad2') {
  1520. GlobalManager.instance.callMethod('Ad2');
  1521. console.log("zh: Ad2 奖励发送成功");
  1522. }
  1523. else if (msg === 'Ad3') {
  1524. GlobalManager.instance.callMethod('Ad3');
  1525. console.log("zh: Ad3 奖励发送成功");
  1526. }
  1527. else if (msg === 'Ad4') {
  1528. GlobalManager.instance.callMethod('Ad4');
  1529. console.log("zh: Ad4 奖励发送成功");
  1530. }
  1531. else if (msg === 'Ad5') {
  1532. console.log("zh: Ad5 奖励发送成功");
  1533. GlobalManager.instance.callMethod('Ad5');
  1534. }
  1535. }
  1536. }
  1537. class UIBox extends UIBase {
  1538. constructor() {
  1539. super();
  1540. this.boxNum = 0;
  1541. this.boxMax = 10;
  1542. this.inAd = false;
  1543. this.isClose = false;
  1544. }
  1545. onConstructor() {
  1546. this.ui = ui_UIBox.createInstance();
  1547. this.contentPane = this.ui;
  1548. this.isEject = false;
  1549. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1550. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1551. Laya.timer.loop(1000, this, this.update);
  1552. }
  1553. update() {
  1554. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1555. this.boxNum -= 1;
  1556. this.upBar();
  1557. }
  1558. }
  1559. upBar() {
  1560. if (this.boxNum > this.boxMax)
  1561. this.boxNum = this.boxMax;
  1562. this.ui.bar.value = this.boxNum * 10;
  1563. }
  1564. show() {
  1565. super.show();
  1566. this.isClose = false;
  1567. this.boxNum = 0;
  1568. this.inAd = false;
  1569. this.upBar();
  1570. this.ui.t0.play();
  1571. this.ui.closeBtn.visible = false;
  1572. Laya.timer.once(3000, this, () => {
  1573. this.ui.closeBtn.visible = true;
  1574. this.ui.bar.alpha = 1;
  1575. });
  1576. Laya.timer.once(500, this, () => {
  1577. this.ui.t1.play();
  1578. });
  1579. this.setGlobalFont(this.ui);
  1580. }
  1581. hide() {
  1582. Laya.timer.clearAll(this);
  1583. Moyu.showBannerAd(false);
  1584. super.hide();
  1585. }
  1586. onOpenBox() {
  1587. this.boxNum++;
  1588. if (this.boxNum < this.boxMax) {
  1589. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1590. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1591. }
  1592. }
  1593. else if (this.boxNum == this.boxMax) {
  1594. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1595. this.ui.openBtn.c1.selectedIndex = 13;
  1596. this.inAd = true;
  1597. }
  1598. else
  1599. this.getAward();
  1600. }
  1601. else if (this.inAd) {
  1602. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1603. if (Laya.Browser.onAndroid) {
  1604. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1605. if (!boo) {
  1606. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1607. return;
  1608. }
  1609. }
  1610. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1611. }
  1612. else {
  1613. console.log('zh:AD 失败,直接发放奖励');
  1614. this.qjff_AD_for_UIBOX_onOpenBox();
  1615. }
  1616. }
  1617. this.upBar();
  1618. }
  1619. qjff_AD_for_UIBOX_onOpenBox() {
  1620. this.getAward();
  1621. }
  1622. onCloseBox() {
  1623. if (this.isClose)
  1624. this.hide();
  1625. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1626. this.isClose = true;
  1627. PlatMgr.showBanner(true, 0, 3000);
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. getAward() {
  1633. let str = "";
  1634. if (Math.random() < 0.5) {
  1635. let max = Moyu.isLegal ? 500 : 2500;
  1636. let num = xGame.tools.random(max, 500 + max);
  1637. DataMgr.setCoin(num);
  1638. str = "金币x" + num;
  1639. }
  1640. else {
  1641. let max = Moyu.isLegal ? 10 : 30;
  1642. let num = xGame.tools.random(max, 30 + max);
  1643. DataMgr.setDiamond(num);
  1644. str = "钻石x" + num;
  1645. }
  1646. xGame.showTip("恭喜获得-" + str);
  1647. this.hide();
  1648. }
  1649. }
  1650. UIBox.uiName = "UIBox";
  1651. class ui_UITry extends fgui.GComponent {
  1652. static createInstance() {
  1653. return (fgui.UIPackage.createObject("game", "UITry"));
  1654. }
  1655. onConstruct() {
  1656. this.n11 = (this.getChild("n11"));
  1657. this.myNode = (this.getChild("myNode"));
  1658. this.t0 = this.getTransition("t0");
  1659. }
  1660. }
  1661. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1662. class UITry extends UIBase {
  1663. constructor() {
  1664. super();
  1665. this.closeTime = 0;
  1666. this.closeNum = 0;
  1667. this.skillUrl = xGame.common.skillIconList;
  1668. }
  1669. onConstructor() {
  1670. this.ui = ui_UITry.createInstance();
  1671. this.contentPane = this.ui;
  1672. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1673. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1674. }
  1675. show() {
  1676. super.show();
  1677. this.closeNum = 0;
  1678. this.closeTime = 15;
  1679. this.ui.t0.play();
  1680. PlatMgr.showRateBanner();
  1681. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1682. Laya.timer.loop(1000, this, this.updateTime);
  1683. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1684. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1685. xGame.common.gameMgr.gamePause = true;
  1686. this.setGlobalFont(this.ui);
  1687. }
  1688. updateTime() {
  1689. if (this.closeTime > 1) {
  1690. this.closeTime--;
  1691. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1692. }
  1693. else
  1694. this.hide();
  1695. }
  1696. hide() {
  1697. Laya.timer.clearAll(this);
  1698. Moyu.showBannerAd(false);
  1699. super.hide();
  1700. xGame.common.gameMgr.gamePause = false;
  1701. }
  1702. onTry() {
  1703. console.log('zh:qjff_AD_for_uitry');
  1704. if (Laya.Browser.onAndroid) {
  1705. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1706. if (!boo) {
  1707. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1708. return;
  1709. }
  1710. }
  1711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1712. }
  1713. else {
  1714. console.log('zh:AD 失败,直接发放奖励');
  1715. this.qjff_AD_for_uitry();
  1716. }
  1717. }
  1718. qjff_AD_for_uitry() {
  1719. let select = xGame.common.curPlayerSkillType;
  1720. DataMgr.gameData.trySkill = select;
  1721. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1722. DataMgr.saveGameData();
  1723. DataMgr.setBigSkill(select, 1);
  1724. xGame.showTip("Trial Successful");
  1725. this.hide();
  1726. }
  1727. onCancel() {
  1728. if (this.closeNum > 0) {
  1729. this.closeNum--;
  1730. if (this.closeNum < 2)
  1731. this.hide();
  1732. return;
  1733. }
  1734. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1735. this.onTry();
  1736. }
  1737. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1738. this.closeNum = 3;
  1739. }
  1740. else
  1741. this.hide();
  1742. }
  1743. }
  1744. UITry.uiName = "UITry";
  1745. class PlatMgr {
  1746. static initConfig() {
  1747. this.lastVt = 0;
  1748. if (!Moyu.platConfig)
  1749. return;
  1750. for (let k in Moyu.platConfig) {
  1751. let pd = this[k];
  1752. let pc = Moyu.platConfig[k];
  1753. if (pd != undefined && pc != undefined)
  1754. this[k] = pc;
  1755. }
  1756. Moyu.setBannerPos(0.5, 1);
  1757. }
  1758. static rand100(num) {
  1759. return xGame.tools.random(0, 100) < num;
  1760. }
  1761. static isMisVideo() {
  1762. let dt = Laya.timer.currTimer - this.lastVt;
  1763. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1764. this.lastVt = Laya.timer.currTimer;
  1765. return true;
  1766. }
  1767. else {
  1768. if (this.rand100(this.fullVideoRate)) {
  1769. console.log('zh:插屏 ad start');
  1770. JSBridgeUtils.instance.showInternAd('platMgr');
  1771. }
  1772. return false;
  1773. }
  1774. }
  1775. static showVideo(call, type) {
  1776. Moyu.showVideoAd(() => {
  1777. this.lastVt = Laya.timer.currTimer;
  1778. call && call();
  1779. }, type);
  1780. }
  1781. static showInsert(delay = false) {
  1782. if (this.getRand() < this.insertRate) {
  1783. let dt = delay ? this.insertDelay : 0;
  1784. console.log('zh:插屏 ad start');
  1785. JSBridgeUtils.instance.showInternAd('gameInsert');
  1786. }
  1787. }
  1788. static gameInsert() {
  1789. let t = this.getRand();
  1790. let r = this.gameInsertRate;
  1791. if (t < r) {
  1792. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1793. }
  1794. }
  1795. static showRateBanner() {
  1796. if (this.getRand() < this.bannerRate)
  1797. this.showBanner(true, this.bannerDelay, 3000);
  1798. }
  1799. static showBanner(show, delay = 0, hide = 0) {
  1800. if (2 > 1) {
  1801. console.log('zh:显示showBanner广告 直接返回');
  1802. return;
  1803. }
  1804. if (!show)
  1805. Moyu.showBannerAd(false);
  1806. else {
  1807. Laya.timer.clear(this, this.bannerShow);
  1808. if (delay > 0)
  1809. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1810. else
  1811. this.bannerShow(true);
  1812. if (hide > 0)
  1813. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1814. }
  1815. }
  1816. static bannerShow(show) {
  1817. if (2 > 1) {
  1818. console.log('zh:显示showBanner广告 直接返回');
  1819. return;
  1820. }
  1821. Moyu.showBannerAd(show);
  1822. console.log("showBanner" + show);
  1823. }
  1824. static getRand() {
  1825. return xGame.tools.random(0, 100);
  1826. }
  1827. static openBox() {
  1828. if (this.getRand() < this.boxRate)
  1829. xGame.uiMgr.Show(UIBox);
  1830. }
  1831. static openTry() {
  1832. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1833. return;
  1834. if (this.getRand() < this.tryRate)
  1835. xGame.uiMgr.Show(UITry);
  1836. else if (DataMgr.gameData.gameCount == 1)
  1837. xGame.uiMgr.Show(UITry);
  1838. }
  1839. }
  1840. PlatMgr.forceShare = 0;
  1841. PlatMgr.signAdRate = 0;
  1842. PlatMgr.forceVideoRate = 0;
  1843. PlatMgr.forceVideoGap = 0;
  1844. PlatMgr.fullVideoRate = 0;
  1845. PlatMgr.gameInsertRate = 0;
  1846. PlatMgr.insertGap = 0;
  1847. PlatMgr.insertDelay = 0;
  1848. PlatMgr.insertRate = 0;
  1849. PlatMgr.boxRate = 0;
  1850. PlatMgr.boxVideoRate = 0;
  1851. PlatMgr.boxInsertRate = 0;
  1852. PlatMgr.boxBannerRate = 0;
  1853. PlatMgr.tryRate = 0;
  1854. PlatMgr.tryClose3Rate = 0;
  1855. PlatMgr.tryVideoRate = 0;
  1856. PlatMgr.bannerRate = 0;
  1857. PlatMgr.lastVt = 0;
  1858. class ui_UIAddProp extends fgui.GComponent {
  1859. static createInstance() {
  1860. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1861. }
  1862. onConstruct() {
  1863. this.n11 = (this.getChild("n11"));
  1864. this.myNode = (this.getChild("myNode"));
  1865. this.closeBtn = (this.getChild("closeBtn"));
  1866. this.t0 = this.getTransition("t0");
  1867. }
  1868. }
  1869. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1870. class SpineMgr {
  1871. constructor(name, loadCb = null) {
  1872. this.loaded = false;
  1873. this.spineName = '';
  1874. this.loadedCallback = loadCb;
  1875. this.templet = new Laya.Templet();
  1876. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1877. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1878. if (name === 'mishu') {
  1879. this.templet.loadAni('spine/nvmishu.sk');
  1880. }
  1881. else {
  1882. this.templet.loadAni(`spine/${name}.sk`);
  1883. }
  1884. this.templet.lock = true;
  1885. this.spineName = name;
  1886. }
  1887. onError() {
  1888. console.log("zh:spine加载出错");
  1889. }
  1890. parseComplete() {
  1891. this.loaded = true;
  1892. this.loadedCallback && this.loadedCallback();
  1893. }
  1894. dispose() {
  1895. if (this.templet && !this.templet.destroyed) {
  1896. this.templet.destroy();
  1897. }
  1898. this.templet = null;
  1899. }
  1900. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1901. if (!this.loaded) {
  1902. return;
  1903. }
  1904. let spine;
  1905. if (mySpine) {
  1906. spine = mySpine;
  1907. }
  1908. else {
  1909. spine = this.createSpine(data, parent);
  1910. }
  1911. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1912. if (!isLoop) {
  1913. spine.on(Laya.Event.STOPPED, this, () => {
  1914. spine.offAll(Laya.Event.STOPPED);
  1915. callback && callback(spine);
  1916. });
  1917. }
  1918. return spine;
  1919. }
  1920. createSpine(data, parent, type = 1) {
  1921. let spine;
  1922. spine = this.templet.buildArmature(type);
  1923. spine.showSkinByIndex(0);
  1924. parent.addChild(spine);
  1925. spine.pos(data.x, data.y);
  1926. spine.scale(data.scaleX, data.scaleY, true);
  1927. return spine;
  1928. }
  1929. }
  1930. var AIState;
  1931. (function (AIState) {
  1932. AIState[AIState["none"] = 0] = "none";
  1933. AIState[AIState["idle"] = 1] = "idle";
  1934. AIState[AIState["reset"] = 2] = "reset";
  1935. AIState[AIState["move"] = 3] = "move";
  1936. AIState[AIState["wait"] = 4] = "wait";
  1937. AIState[AIState["select"] = 5] = "select";
  1938. AIState[AIState["turn"] = 6] = "turn";
  1939. AIState[AIState["shoot"] = 7] = "shoot";
  1940. AIState[AIState["leave"] = 8] = "leave";
  1941. })(AIState || (AIState = {}));
  1942. class AIPlayer {
  1943. constructor() {
  1944. this.dtime = 30;
  1945. this.awayTime = 0;
  1946. this.awayNum = 0;
  1947. this.hideTime = 0;
  1948. this.rootMoveTime = 0;
  1949. this.isGuide = false;
  1950. this.state = AIState.none;
  1951. this.waitTime = 0;
  1952. this.forceNum = 0;
  1953. this.forceMax = 0;
  1954. this.ballSize = 33;
  1955. this.selectNum = 0;
  1956. this.destRot = 0;
  1957. this.aiLv = 10;
  1958. this.kickBall = [];
  1959. this.lineBall = [];
  1960. this.scoreBall = [];
  1961. this.holeBall = [];
  1962. this.turnNum = 0;
  1963. this.setNum = 0;
  1964. this.setMax = 0;
  1965. this.setRate = 0;
  1966. this.rectL = 0;
  1967. this.rectR = 0;
  1968. this.rectT = 0;
  1969. this.rectB = 0;
  1970. this.rootPos = { x: 0, y: 0 };
  1971. this.bestForce = 0;
  1972. this.bestAngle = 180;
  1973. this.bestPos = { x: 0, y: 0 };
  1974. this.bestKick = { x: 0, y: 0 };
  1975. this.posList = [];
  1976. this.posIdx = 0;
  1977. this.chatTime = 3000;
  1978. this.tempDir1 = new Laya.Vector2();
  1979. this.tempDir2 = new Laya.Vector2();
  1980. this.tempDir3 = new Laya.Vector2();
  1981. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1982. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1983. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1984. this.gameSrc = xGame.common.gameUI;
  1985. this.hideTime = Laya.timer.currTimer;
  1986. Moyu.setOnTipCall((id) => {
  1987. if (id == 20012)
  1988. this.hideTime = Laya.timer.currTimer;
  1989. else
  1990. (id == 20011);
  1991. {
  1992. let dt = Laya.timer.currTimer - this.hideTime;
  1993. console.log("onshow" + dt);
  1994. if (dt > 30000 && this.state > AIState.none)
  1995. xGame.common.gameMgr.aiGameEnd(false);
  1996. }
  1997. }, this);
  1998. }
  1999. init() {
  2000. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2001. this.awayTime = xGame.tools.random(5000, 10000);
  2002. this.awayNum = 0;
  2003. this.hideTime = Laya.timer.currTimer;
  2004. let rect = xGame.common.d2World.borderRect;
  2005. this.rectL = Math.ceil(rect.x) + 17;
  2006. this.rectT = Math.ceil(rect.y) + 17;
  2007. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2008. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2009. this.wBall = xGame.common.d2World.rootBall;
  2010. this.ballSize = this.wBall.gameObj.width - 1;
  2011. if (this.posList.length < 1) {
  2012. let dp = 40;
  2013. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2014. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2015. let dx = i < this.rectR ? i : this.rectR;
  2016. let dy = j < this.rectB ? j : this.rectB;
  2017. let order = xGame.tools.random(0, 1000);
  2018. this.posList.push({ x: dx, y: dy, order: order });
  2019. }
  2020. }
  2021. this.posList.sort(function (a, b) {
  2022. return a.order - b.order;
  2023. });
  2024. this.setMax = this.posList.length;
  2025. }
  2026. this.state = AIState.idle;
  2027. }
  2028. setAiLevel(num) {
  2029. this.aiLv = num;
  2030. }
  2031. initBall() {
  2032. this.rootPos.x = this.wBall.gameObj.x;
  2033. this.rootPos.y = this.wBall.gameObj.y;
  2034. this.initHoleBall();
  2035. }
  2036. initHoleBall() {
  2037. this.kickBall = [];
  2038. this.lineBall = [];
  2039. this.scoreBall = [];
  2040. this.holeBall = [];
  2041. this.selectNum = 0;
  2042. this.forceNum = 0;
  2043. this.forceMax = 0;
  2044. this.turnNum = 0;
  2045. let list = xGame.common.d2World.ballArr;
  2046. if (list.length < 20 && !this.isGuide) {
  2047. let holes = xGame.common.gameMgr.holePosList;
  2048. for (let i = 0; i < list.length; i++) {
  2049. let obj = list[i];
  2050. if (!obj)
  2051. continue;
  2052. obj.kickPos.x = 0;
  2053. obj.kickPos.y = 0;
  2054. obj.poleAngle = 0;
  2055. obj.hard = 0;
  2056. obj.borderDis = 0;
  2057. obj.kickAngle = 180;
  2058. if (obj.number == 0)
  2059. continue;
  2060. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2061. continue;
  2062. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2063. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2064. continue;
  2065. }
  2066. let b = obj.gameObj;
  2067. let wbp = this.rootPos;
  2068. let bx = wbp.x - b.x;
  2069. let by = wbp.y - b.y;
  2070. obj.borderDis = xGame.tools.random(0, 100);
  2071. this.kickBall.push(obj);
  2072. if (!this.isLine(wbp, obj))
  2073. continue;
  2074. obj.kickAngle = xGame.tools.random(90, 180);
  2075. obj.kickPos.x = b.x;
  2076. obj.kickPos.y = b.y;
  2077. this.lineBall.push(obj);
  2078. let minDis = 999999;
  2079. let hole = false;
  2080. for (let j = 0; j < holes.length; j++) {
  2081. let hp = holes[j];
  2082. if (bx >= 0 && hp.x > b.x + 100)
  2083. continue;
  2084. if (bx <= 0 && hp.x < b.x - 100)
  2085. continue;
  2086. if (by < -10 && hp.y < wbp.y)
  2087. continue;
  2088. if (by > 10 && hp.y > wbp.y)
  2089. continue;
  2090. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2091. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2092. if (dis < minDis) {
  2093. let dx = b.x - this.tempDir1.x * this.ballSize;
  2094. let dy = b.y - this.tempDir1.y * this.ballSize;
  2095. this.tempDir3.x = this.tempDir1.x;
  2096. this.tempDir3.y = this.tempDir1.y;
  2097. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2098. obj.kickPos.x = dx;
  2099. obj.kickPos.y = dy;
  2100. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2101. if (num > 1)
  2102. num = 1;
  2103. obj.kickAngle = Math.acos(num) * 57.3;
  2104. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2105. dis = dis * 2;
  2106. if (Math.abs(hp.x - 600) < 100)
  2107. dis += 50;
  2108. obj.hard = dis + obj.kickAngle * 3;
  2109. hole = true;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. if (hole) {
  2115. this.scoreBall.push(obj);
  2116. this.holeBall.push(obj);
  2117. }
  2118. }
  2119. this.scoreBall.sort(function (a, b) {
  2120. return a.hard - b.hard;
  2121. });
  2122. this.holeBall.sort(function (a, b) {
  2123. return a.kickAngle - b.kickAngle;
  2124. });
  2125. this.kickBall.sort(function (a, b) {
  2126. return a.borderDis - b.borderDis;
  2127. });
  2128. }
  2129. else {
  2130. let max = list.length - 1;
  2131. let i = xGame.tools.random(0, max);
  2132. for (i; i <= max; i++) {
  2133. let idx = i >= max ? i -= max : i;
  2134. let obj = list[idx];
  2135. if (obj && obj.number != 0) {
  2136. obj.kickAngle = xGame.tools.random(90, 180);
  2137. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2138. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2139. this.lineBall.push(obj);
  2140. break;
  2141. }
  2142. }
  2143. }
  2144. }
  2145. selectBall() {
  2146. let ball = null;
  2147. this.destRot = 0;
  2148. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2149. let ai = 110 - this.aiLv * 10;
  2150. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2151. let score = false;
  2152. if (this.scoreBall.length < 1) {
  2153. if (this.lineBall.length < 1) {
  2154. for (let i = 0; i < this.kickBall.length; i++) {
  2155. let list = [];
  2156. let bo = this.kickBall[i];
  2157. let bobj = bo.gameObj;
  2158. let rect = xGame.common.d2World.borderRect;
  2159. let mobj = this.wBall.gameObj;
  2160. let minb = bobj.y - rect.y - 20;
  2161. let minw = mobj.y - rect.y - 50;
  2162. if (minb > 0 && minw > 0) {
  2163. let dlenx = 0;
  2164. let dleny = mobj.y - rect.y;
  2165. let spx = mobj.x;
  2166. let spy = rect.y - dleny;
  2167. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2168. }
  2169. minb = rect.y + rect.height - bobj.y - 20;
  2170. minw = rect.y + rect.height - mobj.y - 50;
  2171. if (minb > 0 && minw > 0) {
  2172. let dlenx = 0;
  2173. let dleny = rect.y + rect.height - mobj.y;
  2174. let spx = mobj.x;
  2175. let spy = rect.y + rect.height + dleny;
  2176. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2177. }
  2178. minb = bobj.x - rect.x - 20;
  2179. minw = mobj.x - rect.x - 50;
  2180. if (minb > 0 && minw > 0) {
  2181. let dlenx = mobj.x - rect.x;
  2182. let dleny = 0;
  2183. let spx = rect.x - dlenx;
  2184. let spy = mobj.y;
  2185. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2186. }
  2187. minb = rect.x + rect.width - bobj.x - 20;
  2188. minw = rect.x + rect.width - mobj.x - 50;
  2189. if (minb > 0 && minw > 0) {
  2190. let dlenx = rect.x + rect.width - mobj.x;
  2191. let dleny = 0;
  2192. let spx = rect.x + rect.width + dlenx;
  2193. let spy = mobj.y;
  2194. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2195. }
  2196. list.sort(function (a, b) {
  2197. return a.order - b.order;
  2198. });
  2199. for (let i = 0; i < list.length; i++) {
  2200. let data = list[i];
  2201. let mx = mobj.x - bobj.x;
  2202. let my = mobj.y - bobj.y;
  2203. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2204. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2205. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2206. if (num > 1)
  2207. num = 1;
  2208. let cos = Math.acos(num);
  2209. if (cos > 1.57)
  2210. cos = 1.57;
  2211. else if (cos < 0.01)
  2212. cos = 0.01;
  2213. let tan = Math.tan(cos);
  2214. let dx = tan * data.dleny;
  2215. let dy = tan * data.dlenx;
  2216. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2217. if (Math.abs(bx - 667) < 40)
  2218. continue;
  2219. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2220. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2221. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2222. this.forceMax = dis * 0.08;
  2223. this.destRot += mis * 0.1;
  2224. this.setKick(bx, by);
  2225. return true;
  2226. }
  2227. }
  2228. }
  2229. }
  2230. else {
  2231. ball = xGame.common.getRandArrEle(this.lineBall);
  2232. }
  2233. }
  2234. else {
  2235. for (let i = 0; i < this.scoreBall.length; i++) {
  2236. if (i < this.scoreBall.length - 1) {
  2237. let rand = 70 + this.aiLv * 10 + i * 10;
  2238. if (xGame.tools.random(0, 100) < rand) {
  2239. ball = this.scoreBall[i];
  2240. break;
  2241. }
  2242. }
  2243. else {
  2244. ball = this.scoreBall[i];
  2245. break;
  2246. }
  2247. }
  2248. score = true;
  2249. this.selectNum++;
  2250. }
  2251. if (!ball)
  2252. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2253. if (this.selectNum >= max) {
  2254. console.log('zh:jian kong bug1');
  2255. if (ball && ball.gameObj) {
  2256. }
  2257. else {
  2258. console.log('zh:jian kong bug2 如果到这里应该能看到一个alert弹框报错');
  2259. }
  2260. let dx = ball.gameObj.x;
  2261. let dy = ball.gameObj.y;
  2262. let kickAngle = 0;
  2263. if (score) {
  2264. dx = ball.kickPos.x;
  2265. dy = ball.kickPos.y;
  2266. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2267. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2268. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2269. if (adot > 1)
  2270. adot = 1;
  2271. kickAngle = Math.acos(adot) * 57.3;
  2272. if (kickAngle > 45) {
  2273. let kdx = ball.kickPos.x - ball.gameObj.x;
  2274. let kdy = ball.kickPos.y - ball.gameObj.y;
  2275. dx = ball.kickPos.x - kdx * mis * 0.3;
  2276. dy = ball.kickPos.y - kdy * mis * 0.3;
  2277. }
  2278. else
  2279. this.destRot += mis;
  2280. }
  2281. else if (ball.poleAngle != 0) {
  2282. this.destRot += ball.poleAngle;
  2283. }
  2284. if (xGame.common.gameMode == 0) {
  2285. let af = kickAngle * 0.08;
  2286. this.forceMax = ball.hard * 0.1 + af * af;
  2287. }
  2288. this.setKick(dx, dy);
  2289. }
  2290. else {
  2291. let rand = this.aiLv * 5 + 40;
  2292. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2293. ball = xGame.common.getRandArrEle(this.scoreBall);
  2294. else
  2295. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2296. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2297. if (xGame.tools.random(0, 100) > rand) {
  2298. this.selectNum = max;
  2299. }
  2300. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2301. this.selectNum++;
  2302. }
  2303. ball.onClick(0, true);
  2304. }
  2305. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2306. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2307. let balls = xGame.common.d2World.ballArr;
  2308. let max = xGame.tools.getDis(hx, hy, bx, by);
  2309. for (let index = 0; index < balls.length; index++) {
  2310. let obj = balls[index];
  2311. if (obj.number == 0)
  2312. continue;
  2313. if (obj.number == bn || obj.number == dn)
  2314. continue;
  2315. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2316. if (dis * dis > max)
  2317. continue;
  2318. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2319. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2320. if (num > 1)
  2321. num = 1;
  2322. if (num < 0)
  2323. continue;
  2324. let gap = Math.sin(Math.acos(num)) * dis;
  2325. if (gap < this.ballSize)
  2326. return true;
  2327. }
  2328. return false;
  2329. }
  2330. isLine(xy, ball) {
  2331. let bx = xy.x;
  2332. let by = xy.y;
  2333. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2334. let dis = ball.getDestDis(xy);
  2335. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2336. let sin = Math.sin(angle);
  2337. let cos = Math.cos(angle);
  2338. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2339. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2340. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2341. let dx = bx + this.tempDir2.x * dis;
  2342. let dy = by + this.tempDir2.y * dis;
  2343. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2344. sin = Math.sin(-angle);
  2345. cos = Math.cos(-angle);
  2346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2348. dx = bx + this.tempDir2.x * dis;
  2349. dy = by + this.tempDir2.y * dis;
  2350. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2351. if (isr && isl)
  2352. return false;
  2353. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2354. }
  2355. return true;
  2356. }
  2357. turnPole() {
  2358. this.turnNum++;
  2359. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2360. let dr = rot - this.destRot;
  2361. let abs = Math.abs(dr) % 360;
  2362. if (abs > 180) {
  2363. if (rot > 180)
  2364. rot -= 360;
  2365. if (this.destRot > 180)
  2366. this.destRot -= 360;
  2367. }
  2368. let max = this.turnNum * 5 + this.aiLv * 5;
  2369. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2370. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2371. let at = xGame.tools.random(1000, 2000);
  2372. if (!this.onAway(3))
  2373. at += xGame.tools.random(10000, 15000);
  2374. this.setState(AIState.shoot, at);
  2375. }
  2376. else {
  2377. let mr = 0;
  2378. if (abs > 3)
  2379. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2380. else if (Math.random() > 0.6)
  2381. mr = xGame.tools.random(1, 10) * 0.1;
  2382. mr = dr > 0 ? -mr : mr;
  2383. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2384. }
  2385. }
  2386. setKick(dx, dy) {
  2387. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2388. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2389. this.tempDir1.x = 0;
  2390. this.tempDir1.y = 1;
  2391. this.tempDir2.y = -this.tempDir2.y;
  2392. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2393. if (num > 1)
  2394. num = 1;
  2395. let rot = Math.acos(num) * 57.3;
  2396. if (this.tempDir2.x < 0)
  2397. rot = 360 - rot;
  2398. this.destRot += rot;
  2399. if (!xGame.common.gameMgr.finishOneShoot) {
  2400. this.forceMax += xGame.tools.random(10, 50);
  2401. this.forceMax -= this.aiLv * 2;
  2402. if (this.forceMax < 20)
  2403. this.forceMax = 20;
  2404. }
  2405. if (this.forceMax > 100)
  2406. this.forceMax = 101;
  2407. else if (this.forceMax < 10)
  2408. this.forceMax += xGame.tools.random(0, 10);
  2409. if (xGame.common.gameMode == 1)
  2410. this.forceMax = xGame.tools.random(80, 100);
  2411. else
  2412. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2413. let max = 2000 - this.aiLv * 100;
  2414. if (Math.random() > 0.8)
  2415. max += xGame.tools.random(100, 2000);
  2416. this.setState(AIState.turn, xGame.tools.random(500, max));
  2417. }
  2418. shoot() {
  2419. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2420. if (Math.random() > 0.8) {
  2421. this.gameSrc.aiForce(1);
  2422. this.setState(AIState.wait);
  2423. }
  2424. }
  2425. else {
  2426. let df = xGame.tools.random(3, 8);
  2427. if (this.forceNum < this.forceMax)
  2428. this.forceNum += df;
  2429. else
  2430. this.forceNum -= df;
  2431. let startY = this.gameSrc.ui.powerNode.y;
  2432. let height = this.gameSrc.ui.powerNode.height;
  2433. let force = startY + height * this.forceNum * 0.01;
  2434. this.gameSrc.aiForce(2, force);
  2435. }
  2436. }
  2437. reset() {
  2438. for (let i = 0; i < 4; i++) {
  2439. this.setRate--;
  2440. this.setNum++;
  2441. let pos = this.posList[this.posIdx];
  2442. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2443. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2444. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2445. this.rootPos.x = 387;
  2446. if (this.rootPos.x < this.rectL)
  2447. this.rootPos.x = this.rectL;
  2448. else if (this.rootPos.x > this.rectR)
  2449. this.rootPos.x = this.rectR;
  2450. if (this.rootPos.y < this.rectT)
  2451. this.rootPos.y = this.rectT;
  2452. else if (this.rootPos.y > this.rectB)
  2453. this.rootPos.y = this.rectB;
  2454. this.posIdx++;
  2455. let max = this.posList.length;
  2456. if (this.posIdx >= max)
  2457. this.posIdx -= max;
  2458. this.initHoleBall();
  2459. let ball = null;
  2460. if (this.scoreBall.length > 0)
  2461. ball = this.scoreBall[0];
  2462. else if (this.lineBall.length > 0)
  2463. ball = xGame.common.getRandArrEle(this.lineBall);
  2464. if (ball && ball.kickAngle < this.bestAngle) {
  2465. this.bestAngle = ball.kickAngle;
  2466. this.bestKick.x = ball.kickPos.x;
  2467. this.bestKick.y = ball.kickPos.y;
  2468. this.bestPos.x = this.rootPos.x;
  2469. this.bestPos.y = this.rootPos.y;
  2470. this.bestForce = ball.hard * 0.08;
  2471. }
  2472. }
  2473. if (this.setNum >= this.setMax)
  2474. this.setMax = 0;
  2475. if (this.setRate < 1) {
  2476. this.setState(AIState.move, 0);
  2477. this.rootMoveTime = Laya.timer.currTimer;
  2478. this.gameSrc.aiRootMove(true);
  2479. }
  2480. }
  2481. delayLine() {
  2482. this.gameSrc.aiRootMove(false);
  2483. }
  2484. move() {
  2485. if (this.bestPos.x < 1)
  2486. this.bestPos = this.rootPos;
  2487. let wObj = this.wBall.gameObj;
  2488. let destx = wObj.x;
  2489. let desty = wObj.y;
  2490. let dx = Math.abs(destx - this.bestPos.x);
  2491. let dy = Math.abs(desty - this.bestPos.y);
  2492. let mx = 3 + dx * 0.03;
  2493. let my = 3 + dy * 0.03;
  2494. if (dx < 4 && dy < 4) {
  2495. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2496. dt = dt < 1000 ? 1000 - dt : 0;
  2497. if (this.setMax > 0) {
  2498. let min = this.setMax * 0.3 + this.aiLv * 5;
  2499. this.setRate = xGame.tools.random(min, this.setMax);
  2500. this.setState(AIState.reset, 0);
  2501. }
  2502. else {
  2503. this.destRot = 0;
  2504. this.forceMax = this.bestForce;
  2505. this.setKick(this.bestKick.x, this.bestKick.y);
  2506. }
  2507. if (dt > 100) {
  2508. Laya.timer.clear(this, this.delayLine);
  2509. Laya.timer.once(dt, this, this.delayLine);
  2510. }
  2511. else
  2512. this.gameSrc.aiRootMove(false);
  2513. }
  2514. else {
  2515. if (dx > 4)
  2516. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2517. if (dy > 4)
  2518. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2519. this.gameSrc.onRootMove({ x: destx, y: desty });
  2520. }
  2521. }
  2522. resetRoot() {
  2523. this.bestAngle = 180;
  2524. this.bestForce = 0;
  2525. this.setMax = this.posList.length;
  2526. this.posIdx = xGame.tools.random(0, this.setMax);
  2527. let min = this.setMax * 0.3 + this.aiLv * 5;
  2528. this.setRate = xGame.tools.random(min, this.setMax);
  2529. let max = 2000 - this.aiLv * 100;
  2530. if (Math.random() > 0.8)
  2531. max += xGame.tools.random(100, 1000);
  2532. if (this.isGuide)
  2533. this.setState(AIState.select, 500);
  2534. else if (this.onAway(2))
  2535. this.setState(AIState.reset, xGame.tools.random(400, max));
  2536. else
  2537. this.setState(AIState.none);
  2538. if (xGame.common.gameMgr.finishOneShoot)
  2539. this.chat();
  2540. }
  2541. runAI() {
  2542. if (this.state > AIState.idle)
  2543. return;
  2544. this.initBall();
  2545. this.onGame(2500);
  2546. if (Math.random() > 0.6)
  2547. this.chat();
  2548. }
  2549. stopRun() {
  2550. this.setState(AIState.idle);
  2551. }
  2552. onGame(base) {
  2553. let max = base - this.aiLv * 100;
  2554. if (Math.random() > 0.8)
  2555. max += xGame.tools.random(100, 1000);
  2556. if (this.onAway(2))
  2557. this.setState(AIState.select, xGame.tools.random(500, max));
  2558. else
  2559. this.setState(AIState.none);
  2560. }
  2561. setState(sta, wt = 0) {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.state = sta;
  2565. this.waitTime = wt;
  2566. }
  2567. onUpdate() {
  2568. if (this.state == AIState.none)
  2569. return;
  2570. this.awayTime -= this.dtime;
  2571. if (this.awayTime < 1) {
  2572. this.awayTime = xGame.tools.random(6000, 10000);
  2573. this.awayNum += (11 - this.aiLv);
  2574. this.onAway(1);
  2575. }
  2576. if (this.waitTime >= 0) {
  2577. this.waitTime -= this.dtime;
  2578. return;
  2579. }
  2580. switch (this.state) {
  2581. case AIState.idle:
  2582. this.chat();
  2583. break;
  2584. case AIState.reset:
  2585. this.reset();
  2586. break;
  2587. case AIState.move:
  2588. this.move();
  2589. break;
  2590. case AIState.leave:
  2591. this.state = AIState.none;
  2592. xGame.common.gameMgr.aiGameEnd(true);
  2593. break;
  2594. case AIState.select:
  2595. this.selectBall();
  2596. break;
  2597. case AIState.turn:
  2598. this.turnPole();
  2599. break;
  2600. case AIState.shoot:
  2601. this.shoot();
  2602. break;
  2603. }
  2604. }
  2605. onAway(type) {
  2606. if (type == 1) {
  2607. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2608. let num = this.awayNum + db * 20;
  2609. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2610. xGame.common.gameMgr.aiLeave();
  2611. this.setState(AIState.leave, 6666);
  2612. }
  2613. }
  2614. else if (type == 2) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 30;
  2617. if (xGame.tools.random(0, 10000) < num)
  2618. return false;
  2619. }
  2620. else if (type == 3) {
  2621. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2622. let num = this.awayNum + db * 10;
  2623. if (xGame.tools.random(0, 4000) < num)
  2624. return false;
  2625. }
  2626. return true;
  2627. }
  2628. chat() {
  2629. if (this.chatTime > 0) {
  2630. this.chatTime -= this.dtime;
  2631. return;
  2632. }
  2633. this.chatTime = xGame.tools.random(2000, 10000);
  2634. let rand = xGame.tools.random(0, 100);
  2635. if (rand < 15)
  2636. this.talk();
  2637. else if (rand < 35)
  2638. this.emotion();
  2639. }
  2640. talk() {
  2641. xGame.common.talkMgr.showAITalk(0);
  2642. }
  2643. emotion() {
  2644. xGame.common.talkMgr.showAIEmotion(0);
  2645. }
  2646. resetAI() {
  2647. this.stopRun();
  2648. this.state = AIState.none;
  2649. }
  2650. }
  2651. class Partical extends Laya.Script3D {
  2652. constructor() {
  2653. super();
  2654. this.duration = 2000;
  2655. }
  2656. ;
  2657. onAwake() {
  2658. this.gameObj = this.owner;
  2659. }
  2660. onEnable() {
  2661. this.openTimer();
  2662. }
  2663. openTimer() {
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. setCallback(obj, callback) {
  2667. this.obj = obj;
  2668. this.callback = callback;
  2669. Laya.timer.clearAll(this);
  2670. Laya.timer.once(this.duration, this, this.disappear);
  2671. }
  2672. disappear() {
  2673. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2674. this.callback && this.callback(this.obj);
  2675. }
  2676. }
  2677. class Ball extends Laya.Script3D {
  2678. constructor() {
  2679. super();
  2680. this.posV3 = new Laya.Vector3();
  2681. this.rotRate = 2.1;
  2682. this.rotSpeed = new Laya.Vector3();
  2683. this.myIndex = 0;
  2684. }
  2685. onAwake() {
  2686. this.gameObj = this.owner;
  2687. this.transform = this.gameObj.transform;
  2688. this.ballNode = this.gameObj.getChildByName("Ball");
  2689. this.shadowNode = this.gameObj.getChildByName("shadow");
  2690. }
  2691. initSelf(index, x, y, owner) {
  2692. this.d2BallSrc = owner;
  2693. this.myIndex = index;
  2694. this.setAlbedoTexture();
  2695. this.setTransPos(x, y);
  2696. this.setScale();
  2697. this.ballNode.transform.localRotationEulerX = 90;
  2698. if (index == 0) {
  2699. }
  2700. }
  2701. setAlbedoTexture(isIce = false) {
  2702. let url;
  2703. if (isIce) {
  2704. url = `res/d3Res/ballTexture/ice.jpg`;
  2705. }
  2706. else {
  2707. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2708. }
  2709. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2710. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2711. }));
  2712. }
  2713. runFireworks(obj, delay, callback) {
  2714. Laya.timer.clearAll(this);
  2715. Laya.timer.once(delay + 1, this, () => {
  2716. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2717. fire.transform.localPositionX = this.transform.localPositionX;
  2718. fire.transform.localPositionY = this.transform.localPositionY;
  2719. fire.transform.localPositionZ = this.transform.localPositionZ;
  2720. let src = fire.getComponent(Partical);
  2721. src.duration = 1000;
  2722. src.setCallback(obj, callback);
  2723. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2724. eft.transform.localPositionX = this.transform.localPositionX;
  2725. eft.transform.localPositionY = this.transform.localPositionY;
  2726. eft.transform.localPositionZ = this.transform.localPositionZ;
  2727. });
  2728. }
  2729. setTransPos(x, y) {
  2730. this.setRotation();
  2731. xGame.common.pos2to3Convert(x, y, this.posV3);
  2732. this.transform.localPositionX = this.posV3.x;
  2733. this.transform.localPositionY = 0;
  2734. this.transform.localPositionZ = this.posV3.z;
  2735. this.transform.localRotationEulerX = 0;
  2736. this.transform.localRotationEulerY = 0;
  2737. this.transform.localRotationEulerZ = 0;
  2738. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2739. this.shadowNode.transform.localPositionY = 0.1;
  2740. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2741. }
  2742. setRotation() {
  2743. if (this.d2BallSrc.canRot) {
  2744. let speed = this.d2BallSrc.rigy.linearVelocity;
  2745. this.rotSpeed.x = speed.x * this.rotRate;
  2746. this.rotSpeed.z = speed.y * this.rotRate;
  2747. this.rotSpeed.y = this.d2BallSrc.rotY;
  2748. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2749. }
  2750. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2751. this.rotSpeed.x = this.rotSpeed.y = 0;
  2752. this.rotSpeed.y = this.d2BallSrc.rotY;
  2753. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2754. }
  2755. }
  2756. setScale() {
  2757. let radius = xGame.common.d2World.rootBall.ui.width;
  2758. let scale = xGame.common.scale2to3Convert(radius);
  2759. this.transform.localScaleX = scale;
  2760. this.transform.localScaleY = scale;
  2761. this.transform.localScaleZ = scale;
  2762. }
  2763. playInHoleEft() {
  2764. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2765. eft.transform.position = this.transform.position;
  2766. }
  2767. playIceEft() {
  2768. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2769. eft.transform.position = this.transform.position;
  2770. }
  2771. get scaleXYZ() {
  2772. return this.transform.localScaleX;
  2773. }
  2774. set scaleXYZ(val) {
  2775. this.transform.localScaleX = val;
  2776. this.transform.localScaleY = val;
  2777. this.transform.localScaleZ = val;
  2778. }
  2779. get posX() {
  2780. return this.transform.localPositionX;
  2781. }
  2782. set posX(val) {
  2783. this.transform.localPositionX = val;
  2784. }
  2785. get posY() {
  2786. return this.transform.localPositionY;
  2787. }
  2788. set posY(val) {
  2789. this.transform.localPositionY = val;
  2790. }
  2791. get posZ() {
  2792. return this.transform.localPositionZ;
  2793. }
  2794. set posZ(val) {
  2795. this.transform.localPositionZ = val;
  2796. }
  2797. destroySelf() {
  2798. this.posV3 = null;
  2799. this.rotSpeed = null;
  2800. this.d2BallSrc = null;
  2801. this.ballNode = null;
  2802. this.gameObj.destroy(true);
  2803. this.transform = null;
  2804. this.destroy();
  2805. }
  2806. }
  2807. class ui_D2Ball extends fgui.GComponent {
  2808. static createInstance() {
  2809. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2810. }
  2811. onConstruct() {
  2812. this.myIcon = (this.getChild("myIcon"));
  2813. this.inner = (this.getChild("inner"));
  2814. this.n8 = (this.getChild("n8"));
  2815. this.n4 = (this.getChild("n4"));
  2816. this.wrongTips = (this.getChild("wrongTips"));
  2817. this.rightTips = (this.getChild("rightTips"));
  2818. this.breathAni = this.getTransition("breathAni");
  2819. }
  2820. }
  2821. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2822. class D2BallSrc extends Laya.Script {
  2823. constructor() {
  2824. super();
  2825. this.number = 0;
  2826. this.startX = 0;
  2827. this.startY = 0;
  2828. this.angleV2 = new Laya.Vector2();
  2829. this.isRootBall = false;
  2830. this.isBlackBall = false;
  2831. this.ballType = "";
  2832. this.canRot = true;
  2833. this.rotY = 0;
  2834. this.poleAngle = 0;
  2835. this.kickPos = { x: 0, y: 0 };
  2836. this.hard = 0;
  2837. this.kickAngle = 0;
  2838. this.borderDis = 0;
  2839. this.speedP10 = 5.6;
  2840. this.lastSpeed = { x: 0, y: 0 };
  2841. this.stillSpeed = 0.12;
  2842. this.ballFunc = "normal";
  2843. this.isRunSkillAni = false;
  2844. this.isInHole = false;
  2845. this.iceOwner = "";
  2846. this.forceRun = false;
  2847. this.myUNID = "";
  2848. this.rectL = 0;
  2849. this.rectR = 0;
  2850. this.rectT = 0;
  2851. this.rectB = 0;
  2852. this.forceVec = new Laya.Vector2();
  2853. this.lastDis = 0;
  2854. this.helpOut = { type: "", x: 0, y: 0 };
  2855. }
  2856. initSelf(number, x, y, d3Ball) {
  2857. if (!this.gameObj)
  2858. this.gameObj = this.owner;
  2859. this.number = number;
  2860. this.startX = x;
  2861. this.startY = y;
  2862. this.d3Ball = d3Ball;
  2863. this.isRootBall = false;
  2864. this.isBlackBall = false;
  2865. this.ballType = "";
  2866. if (number == 0) {
  2867. this.isRootBall = true;
  2868. }
  2869. else if (number == 8) {
  2870. this.isBlackBall = true;
  2871. }
  2872. else {
  2873. if (number <= 7) {
  2874. this.ballType = ballCamp.full;
  2875. }
  2876. else {
  2877. this.ballType = ballCamp.flower;
  2878. }
  2879. }
  2880. this.setInfo();
  2881. this.setD3Ball();
  2882. this.owner["mySrc"] = this;
  2883. this.rigy.linearDamping = 1;
  2884. D2BallSrc._unid++;
  2885. this.myUNID = "d2ball" + D2BallSrc._unid;
  2886. let rect = xGame.common.d2World.borderRect;
  2887. this.rectL = Math.ceil(rect.x) + 20;
  2888. this.rectT = Math.ceil(rect.y) + 20;
  2889. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2890. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2891. }
  2892. setInfo() {
  2893. this.gameObj.x = this.startX;
  2894. this.gameObj.y = this.startY;
  2895. let radius = this.ui.width / 2;
  2896. this.gameObj.width = radius * 2;
  2897. this.gameObj.height = radius * 2;
  2898. if (xGame.common.showDebug) {
  2899. this.ui.myIcon.alpha = 1;
  2900. this.ui.inner.alpha = 1;
  2901. }
  2902. else {
  2903. this.ui.myIcon.alpha = 0;
  2904. this.ui.inner.alpha = 0;
  2905. }
  2906. }
  2907. setD3Ball() {
  2908. this.d3Ball = this.d3Ball;
  2909. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2910. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2911. }
  2912. onUpdate() {
  2913. if (xGame.common.gameMgr.gamePause)
  2914. return;
  2915. if (this.isInHole)
  2916. return;
  2917. if (!xGame.common.d2World.openCheckStill)
  2918. return;
  2919. this.runBall();
  2920. }
  2921. runBall() {
  2922. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2923. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2924. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2925. this.judgeBorder();
  2926. }
  2927. getDestDis(dest) {
  2928. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2929. }
  2930. setmyXY(x, y) {
  2931. this.d3BallSrc.setTransPos(x, y);
  2932. }
  2933. getSpeed() {
  2934. let speed = this.rigy.linearVelocity;
  2935. return speed.x * speed.x + speed.y * speed.y;
  2936. }
  2937. onTriggerEnter(collider) {
  2938. if (!collider || !collider.owner)
  2939. return;
  2940. let coll = "collide";
  2941. let speed = this.getSpeed();
  2942. let sv2 = this.speedP10 * this.speedP10;
  2943. if (collider.label == "ball") {
  2944. if (speed < 9 && this.number != 0)
  2945. coll = "";
  2946. else if (speed < sv2)
  2947. coll = "collide_4";
  2948. else if (speed < sv2 * 6.2)
  2949. coll = "collide_3";
  2950. else if (speed < sv2 * 25)
  2951. coll = "collide_2";
  2952. else if (speed < sv2 * 56)
  2953. coll = "collide_1";
  2954. xGame.soundMgr.playSound(coll);
  2955. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2956. if (collider.owner) {
  2957. let rig = collider.owner.getComponent(D2BallSrc);
  2958. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2959. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2960. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2961. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2962. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2963. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2964. let rx = 0;
  2965. let ry = 0;
  2966. if (this.gameObj.x < this.rectL)
  2967. rx = vx;
  2968. else if (this.gameObj.x > this.rectR)
  2969. rx = -vx;
  2970. else if (this.gameObj.y < this.rectT)
  2971. ry = vy;
  2972. else if (this.gameObj.y > this.rectB)
  2973. ry = -vy;
  2974. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2975. }
  2976. }
  2977. if (this.number != 0) {
  2978. return;
  2979. }
  2980. else {
  2981. if (this.forceRun) {
  2982. console.log("randon force");
  2983. this.applyForce(collider);
  2984. }
  2985. }
  2986. if (xGame.common.d2World.isOnSameLine) {
  2987. xGame.common.d2World.isOnSameLine = false;
  2988. this.rigy.linearVelocity = { x: 0, y: 0 };
  2989. }
  2990. if (xGame.common.gameMgr.firstColliObj == null) {
  2991. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2992. xGame.common.gameMgr.isTouchedBall = true;
  2993. }
  2994. }
  2995. else {
  2996. xGame.common.recoverCameraView();
  2997. let wallStr = "";
  2998. if (speed < 9) { }
  2999. else if (speed < sv2) { }
  3000. else if (speed < sv2 * 6.2)
  3001. wallStr = "wall_30";
  3002. else if (speed < sv2 * 25)
  3003. wallStr = "wall_50";
  3004. else if (speed < sv2 * 56)
  3005. wallStr = "wall_80";
  3006. xGame.soundMgr.playSound(wallStr);
  3007. }
  3008. }
  3009. applyForce(collider) {
  3010. let src = collider.owner.mySrc;
  3011. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3012. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3013. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3014. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3015. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3016. }
  3017. checkWrongBall(playEft = true) {
  3018. if (this.isInHole)
  3019. return;
  3020. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3021. if (this.number != 0 && playEft)
  3022. this.d3BallSrc.playInHoleEft();
  3023. let coll = "inpocket_1";
  3024. let speed = this.getSpeed();
  3025. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3026. if (speed < 9 && this.number != 0)
  3027. coll = "";
  3028. else if (speed < sv2 * 6.2)
  3029. coll = "inpocket_4";
  3030. else if (speed < sv2 * 25)
  3031. coll = "collide_3";
  3032. else if (speed < sv2 * 56)
  3033. coll = "collide_2";
  3034. xGame.soundMgr.playSound(coll);
  3035. this.isInHole = true;
  3036. if (this.number == 0) {
  3037. console.log("白球进了。。");
  3038. this.reset();
  3039. this.rigy.linearVelocity = { x: 0, y: 0 };
  3040. this.hideSelf();
  3041. xGame.common.gameUI.ui.whiteAni.visible = true;
  3042. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3043. xGame.common.gameUI.ui.whiteAni.visible = false;
  3044. }));
  3045. }
  3046. else {
  3047. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3048. xGame.common.d2World.removeOneBall(this);
  3049. this.destroySelf();
  3050. xGame.common.playHappySound(this.number);
  3051. this.runFlyEft();
  3052. }
  3053. }
  3054. runFlyEft() {
  3055. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3056. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3057. }
  3058. }
  3059. hideSelf() {
  3060. if (this.d3Ball)
  3061. this.d3Ball.active = false;
  3062. }
  3063. showSelf() {
  3064. this.isInHole = false;
  3065. if (this.d3Ball && !this.d3Ball.active)
  3066. this.d3Ball.active = true;
  3067. }
  3068. isStill() {
  3069. let speed = this.rigy.linearVelocity;
  3070. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3071. this.rigy.linearVelocity = { x: 0, y: 0 };
  3072. return true;
  3073. }
  3074. return false;
  3075. }
  3076. reset() {
  3077. }
  3078. destroySelf() {
  3079. this.d3BallSrc.destroySelf();
  3080. if (!this.ui.isDisposed) {
  3081. this.ui.removeFromParent();
  3082. this.ui.dispose();
  3083. this.ui = null;
  3084. }
  3085. this.outColli = null;
  3086. this.innerColli = null;
  3087. this.rigy = null;
  3088. this.d3Ball = null;
  3089. this.d3BallSrc = null;
  3090. this.angleV2 = null;
  3091. this.gameObj.destroy(true);
  3092. this.destroy();
  3093. }
  3094. judgeBorder() {
  3095. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3096. return;
  3097. }
  3098. if (this.destroyed)
  3099. return;
  3100. if (xGame.common.gameMode == GameMode.classic)
  3101. return;
  3102. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3103. if (isOver) {
  3104. this.checkWrongBall();
  3105. }
  3106. }
  3107. onClick(e, force = false) {
  3108. if (this.number == 0)
  3109. return;
  3110. if (force) {
  3111. }
  3112. else {
  3113. if (xGame.common.d2World.openCheckStill)
  3114. return;
  3115. if (!xGame.common.gameMgr.selfTurn) {
  3116. return;
  3117. }
  3118. }
  3119. if (!xGame.common.gameMgr.finishOneShoot)
  3120. return;
  3121. let root = xGame.common.d2World.rootBall.gameObj;
  3122. let x = this.gameObj.x - root.x;
  3123. let y = this.gameObj.y - root.y;
  3124. let angle = xGame.common.getfguiRotation(x, y);
  3125. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3126. xGame.common.d2World.getHelpLine();
  3127. xGame.common.clickedBall = true;
  3128. this.checkGuide();
  3129. }
  3130. checkGuide() {
  3131. let guide = DataMgr.getSkillGuide();
  3132. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3133. xGame.common.guideStep++;
  3134. xGame.common.gameUI.ui.guide1.visible = false;
  3135. xGame.common.gameUI.ui.guide2.visible = true;
  3136. }
  3137. }
  3138. checkDistance(disX, disY, angle) {
  3139. let diameter = this.gameObj.width - 1;
  3140. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3141. if (!this.lastDis)
  3142. this.lastDis = dis;
  3143. else {
  3144. if (dis > this.lastDis) {
  3145. this.helpOut.type = "remove";
  3146. return this.helpOut;
  3147. }
  3148. }
  3149. if (dis <= Math.pow(diameter, 2)) {
  3150. let del = 0.01;
  3151. let offest = 0;
  3152. let realX = disX - this.gameObj.x;
  3153. let realY = disY - this.gameObj.y;
  3154. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3155. offest += del;
  3156. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3157. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3158. }
  3159. this.helpOut.type = "ok";
  3160. this.helpOut.x = realX + this.gameObj.x;
  3161. this.helpOut.y = realY + this.gameObj.y;
  3162. return this.helpOut;
  3163. }
  3164. else {
  3165. this.helpOut.type = "no";
  3166. return this.helpOut;
  3167. }
  3168. }
  3169. clearBallEft() {
  3170. this.clearBallRightEft();
  3171. this.clearBallWrongEft();
  3172. }
  3173. clearBallRightEft() {
  3174. this.ui.breathAni.stop();
  3175. this.ui.rightTips.visible = false;
  3176. }
  3177. clearBallWrongEft() {
  3178. this.ui.wrongTips.visible = false;
  3179. }
  3180. showWrongEft() {
  3181. if (!xGame.common.gameMgr.selfTurn)
  3182. return;
  3183. this.ui.wrongTips.visible = true;
  3184. }
  3185. showRightEft() {
  3186. if (!xGame.common.gameMgr.selfTurn)
  3187. return;
  3188. this.ui.rightTips.visible = true;
  3189. this.ui.rightTips.scaleX = 1;
  3190. this.ui.rightTips.scaleY = 1;
  3191. this.ui.breathAni.play();
  3192. }
  3193. setBallFunc(type, owner) {
  3194. if (type == "ice") {
  3195. this.ballFunc = type;
  3196. this.d3BallSrc.setAlbedoTexture(true);
  3197. this.rigy.type = "static";
  3198. this.iceOwner = owner;
  3199. }
  3200. else {
  3201. if (owner == this.iceOwner) {
  3202. this.ballFunc = type;
  3203. this.d3BallSrc.setAlbedoTexture(false);
  3204. this.rigy.type = "dynamic";
  3205. }
  3206. }
  3207. }
  3208. }
  3209. D2BallSrc._unid = 0;
  3210. class D2RootBallSrc extends D2BallSrc {
  3211. constructor() {
  3212. super();
  3213. this.maxSpeed = 0;
  3214. this.classicMaxSpeed = 2.2;
  3215. this.bigSkillMaxSpeed = 4;
  3216. this.angle = 0;
  3217. this.allPercent = 0;
  3218. this.linearPercent = 0;
  3219. this.anglePercent = 0;
  3220. this.maxAngleRate = 0.6;
  3221. this.baseRot = 7;
  3222. this.angleMax = 0;
  3223. this.speed = new Laya.Vector2();
  3224. this.rotSpeed = new Laya.Vector2();
  3225. }
  3226. isStill() {
  3227. let speed = this.rigy.linearVelocity;
  3228. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3229. if (this.anglePercent <= 0.1) {
  3230. this.rigy.linearVelocity = { x: 0, y: 0 };
  3231. return true;
  3232. }
  3233. }
  3234. return false;
  3235. }
  3236. reset() {
  3237. this.linearPercent = 0;
  3238. this.anglePercent = 0;
  3239. }
  3240. setSpeed(percent, angle) {
  3241. this.allPercent = percent;
  3242. this.angle = angle;
  3243. this.setAngleSpeed();
  3244. this.setLinearSpeed();
  3245. let hit = "hit";
  3246. if (percent < 25)
  3247. hit = "hit03";
  3248. else if (percent < 50)
  3249. hit = "hit02";
  3250. else if (percent < 75)
  3251. hit = "hit01";
  3252. xGame.soundMgr.playSound(hit);
  3253. }
  3254. setAngleSpeed() {
  3255. let offest = xGame.common.rodOffest;
  3256. let radius = 82;
  3257. let rate = Math.abs(offest.y / radius) * 0.5;
  3258. if (offest.y > 0)
  3259. this.angleMax = -this.baseRot * 2;
  3260. else
  3261. this.angleMax = this.baseRot;
  3262. this.rotY = -offest.x / radius * 100;
  3263. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3264. this.linearPercent = this.allPercent - this.anglePercent;
  3265. }
  3266. setLinearSpeed() {
  3267. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3268. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3269. if (!xGame.common.longHelpLine) {
  3270. let offset = -150 + xGame.common.randomNum(0, 300);
  3271. offset /= 100;
  3272. this.angle += offset;
  3273. }
  3274. }
  3275. }
  3276. let sin = Math.sin(this.angle * Math.PI / 180);
  3277. let cos = Math.cos(this.angle * Math.PI / 180);
  3278. switch (xGame.common.gameMode) {
  3279. case GameMode.classic:
  3280. this.maxSpeed = this.classicMaxSpeed;
  3281. break;
  3282. case GameMode.bigMove:
  3283. this.maxSpeed = this.bigSkillMaxSpeed;
  3284. break;
  3285. case GameMode.placeBall:
  3286. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3287. if (data.type == 1) {
  3288. this.maxSpeed = this.bigSkillMaxSpeed;
  3289. }
  3290. else {
  3291. this.maxSpeed = this.classicMaxSpeed;
  3292. }
  3293. break;
  3294. default:
  3295. break;
  3296. }
  3297. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3298. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3299. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3300. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3301. this.rigy.applyLinearImpulseToCenter(this.speed);
  3302. }
  3303. onUpdate() {
  3304. if (this.anglePercent > 0.1) {
  3305. this.anglePercent *= 0.97;
  3306. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3307. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3308. this.rigy.applyForceToCenter(this.rotSpeed);
  3309. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3310. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3311. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3312. if (num > 0.9)
  3313. this.canRot = true;
  3314. }
  3315. else
  3316. this.canRot = true;
  3317. if (Math.abs(this.rotY) > 0.1)
  3318. this.rotY *= 0.98;
  3319. super.onUpdate();
  3320. }
  3321. destroySelf() {
  3322. super.destroySelf();
  3323. this.speed = null;
  3324. }
  3325. }
  3326. class D2Ball extends Laya.Sprite {
  3327. constructor(isRootBall = false) {
  3328. super();
  3329. this.ui = ui_D2Ball.createInstance();
  3330. this.pivotX = this.ui.width / 2;
  3331. this.pivotY = this.ui.width / 2;
  3332. this.x = 0;
  3333. this.y = 0;
  3334. this.addChild(this.ui.displayObject);
  3335. this.ui.displayObject.x += this.ui.width / 2;
  3336. this.ui.displayObject.y += this.ui.width / 2;
  3337. if (isRootBall) {
  3338. this.d2Src = this.addComponent(D2RootBallSrc);
  3339. }
  3340. else {
  3341. this.d2Src = this.addComponent(D2BallSrc);
  3342. }
  3343. this.d2Src.ui = this.ui;
  3344. this.addCircleCollider();
  3345. this.addInnerCircleCollider();
  3346. this.addRigyBody();
  3347. }
  3348. addCircleCollider() {
  3349. let colli = xGame.common.getCollider("circle");
  3350. colli.radius = this.ui.width / 2;
  3351. this.addComponentIntance(colli);
  3352. this.d2Src.outColli = colli;
  3353. colli.label = "ball";
  3354. }
  3355. addInnerCircleCollider() {
  3356. let colli = xGame.common.getCollider("circle");
  3357. colli.radius = this.ui.inner.width / 2;
  3358. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3359. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3360. this.addComponentIntance(colli);
  3361. this.d2Src.innerColli = colli;
  3362. colli.label = "inner";
  3363. }
  3364. addRigyBody() {
  3365. let rigy = xGame.common.getRigbody();
  3366. rigy.type = "dynamic";
  3367. this.addComponentIntance(rigy);
  3368. this.d2Src.rigy = rigy;
  3369. }
  3370. disposeSelf() {
  3371. if (!this.ui.isDisposed) {
  3372. this.ui.dispose();
  3373. this.ui.removeFromParent();
  3374. this.ui = null;
  3375. }
  3376. }
  3377. }
  3378. class ui_D2Gan extends fgui.GComponent {
  3379. static createInstance() {
  3380. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3381. }
  3382. onConstruct() {
  3383. this.myIcon = (this.getChild("myIcon"));
  3384. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3385. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3386. this.self = (this.getChild("self"));
  3387. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3388. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3389. this.ai = (this.getChild("ai"));
  3390. }
  3391. }
  3392. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3393. class D2Gan {
  3394. constructor() {
  3395. this.offset = 0.15;
  3396. this.cell = 1.5;
  3397. this.onBallCell = 0.4;
  3398. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3399. this.moveNum = 70;
  3400. this.rulerRate = 0.1;
  3401. this.ui = ui_D2Gan.createInstance();
  3402. this.changeSelfRod();
  3403. this.changeAIRod();
  3404. }
  3405. changeSelfRod() {
  3406. let index = DataMgr.getCurBallRod();
  3407. let data = cfgTable.ballrodData[index + 1];
  3408. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3409. this.selfMySpine && this.selfMySpine.dispose();
  3410. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3411. if (data.spine) {
  3412. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3413. this.selfMySpine = new SpineMgr(data.spine, () => {
  3414. let xx = this.ui.selfEftRoot.width / 2;
  3415. let yy = this.ui.selfEftRoot.height / 2;
  3416. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3417. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3418. outSpine.rotation = -90;
  3419. });
  3420. }
  3421. }
  3422. changeAIRod() {
  3423. let length = Object.keys(cfgTable.ballrodData).length;
  3424. let rand = Math.floor(length * Math.random()) + 1;
  3425. let data = cfgTable.ballrodData[rand];
  3426. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3427. this.aiMySpine && this.aiMySpine.dispose();
  3428. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3429. if (data.spine) {
  3430. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3431. this.aiMySpine = new SpineMgr(data.spine, () => {
  3432. let xx = this.ui.aiEftRoot.width / 2;
  3433. let yy = this.ui.aiEftRoot.height / 2;
  3434. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3435. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3436. outSpine.rotation = -90;
  3437. });
  3438. }
  3439. }
  3440. setGanLastInfo() {
  3441. this.lastInfo.rotation = this.ui.rotation;
  3442. this.lastInfo.x = this.ui.x;
  3443. this.lastInfo.y = this.ui.y;
  3444. }
  3445. rotateSelf(flag, isRuler = false) {
  3446. let angle;
  3447. flag = flag * this.offset;
  3448. if (xGame.common.d2World.isHelpLineOnBall) {
  3449. angle = flag * this.onBallCell;
  3450. }
  3451. else {
  3452. angle = flag * this.cell;
  3453. }
  3454. if (isRuler) {
  3455. angle *= this.rulerRate;
  3456. }
  3457. this.ui.rotation += angle;
  3458. xGame.common.d2World.getHelpLine();
  3459. }
  3460. checkDistance() {
  3461. let target = xGame.common.d2World.targetBall;
  3462. let root = xGame.common.d2World.rootBall;
  3463. if (target == null) {
  3464. return 1;
  3465. }
  3466. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3467. if (dis <= 2500) {
  3468. return 5;
  3469. }
  3470. return 1;
  3471. }
  3472. rotDest(rot) {
  3473. this.ui.rotation = rot;
  3474. xGame.common.d2World.getHelpLine();
  3475. }
  3476. storagePower(powerNum) {
  3477. let pos = (powerNum / 100) * this.moveNum;
  3478. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3479. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3480. this.ui.x = this.lastInfo.x + xx;
  3481. this.ui.y = this.lastInfo.y + yy;
  3482. }
  3483. shoot() {
  3484. this.storagePower(0);
  3485. this.ui.visible = false;
  3486. }
  3487. destroySelf() {
  3488. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3489. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3490. this.selfMySpine && this.selfMySpine.dispose();
  3491. this.aiMySpine && this.aiMySpine.dispose();
  3492. this.lastInfo = null;
  3493. if (!this.ui.isDisposed) {
  3494. this.ui.removeFromParent();
  3495. this.ui.dispose();
  3496. }
  3497. }
  3498. }
  3499. class ui_HelpLine extends fgui.GComponent {
  3500. static createInstance() {
  3501. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3502. }
  3503. onConstruct() {
  3504. this.n10 = (this.getChild("n10"));
  3505. this.rect = (this.getChild("rect"));
  3506. this.dir11 = (this.getChild("dir11"));
  3507. this.dir = (this.getChild("dir"));
  3508. this.rootDir = (this.getChild("rootDir"));
  3509. this.dirDot = (this.getChild("dirDot"));
  3510. }
  3511. }
  3512. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3513. class D2HelpLine {
  3514. constructor() {
  3515. this.starX = 0;
  3516. this.starY = 0;
  3517. this.ui = ui_HelpLine.createInstance();
  3518. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3519. this.starX = this.ui.rect.x;
  3520. this.starY = this.ui.rect.y;
  3521. }
  3522. shoot() {
  3523. this.ui.visible = false;
  3524. }
  3525. destroySelf() {
  3526. if (this.ui.isDisposed) {
  3527. this.ui.removeFromParent();
  3528. this.ui.dispose();
  3529. }
  3530. }
  3531. }
  3532. class D2World extends Laya.Script {
  3533. constructor() {
  3534. super();
  3535. this.ballArr = [];
  3536. this.openCheckStill = false;
  3537. this.checkArr = [];
  3538. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3539. this.isHelpLineOnBall = false;
  3540. this.isOnSameLine = false;
  3541. this.reflectAngle = 0;
  3542. this.powerPercent = 0;
  3543. this.inHolesSpeed = [];
  3544. this.outDir = new Laya.Vector2();
  3545. this.rootDir = new Laya.Vector2();
  3546. this.aiLv = 0;
  3547. this.rootPos = new Laya.Vector2();
  3548. this.tempDir1 = new Laya.Vector2();
  3549. this.tempDir2 = new Laya.Vector2();
  3550. this.tempDir3 = new Laya.Vector2();
  3551. this.ballSize = 33;
  3552. this.destRot = 0;
  3553. }
  3554. initSelf() {
  3555. this.createBalls();
  3556. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3557. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3558. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3559. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3560. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3561. }
  3562. setBorderRect() {
  3563. let ui = xGame.common.gameUI.ui;
  3564. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3565. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3566. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3567. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3568. this.borderRect.x = starX;
  3569. this.borderRect.y = starY;
  3570. this.borderRect.width = width;
  3571. this.borderRect.height = height;
  3572. }
  3573. resetGame() {
  3574. this.openCheckStill = false;
  3575. let temp;
  3576. for (let index = 0; index < this.ballArr.length; index++) {
  3577. temp = this.ballArr[index];
  3578. temp.destroySelf();
  3579. }
  3580. xGame.common.d3World.ballRoot.destroyChildren();
  3581. xGame.common.gameUI.ui.ballNode.removeChildren();
  3582. console.log("进入摧毁逻辑");
  3583. this.d2Gan.destroySelf();
  3584. this.d2HelpLine.destroySelf();
  3585. this.ballArr = [];
  3586. }
  3587. setD2Gan() {
  3588. let ballNode = this.rootBall.ui;
  3589. let d2Gan = new D2Gan();
  3590. this.d2Gan = d2Gan;
  3591. let ganNode = d2Gan.ui;
  3592. ballNode.addChild(ganNode);
  3593. ganNode.pivotX = ganNode.pivotX;
  3594. ganNode.pivotY = ganNode.pivotY;
  3595. ganNode.x = ganNode.myIcon.width / 2;
  3596. ganNode.y = this.rootBall.gameObj.width;
  3597. d2Gan.setGanLastInfo();
  3598. }
  3599. setHelpLine() {
  3600. let d2Help = new D2HelpLine();
  3601. this.d2HelpLine = d2Help;
  3602. }
  3603. createBalls() {
  3604. let cfg;
  3605. switch (xGame.common.gameMode) {
  3606. case GameMode.classic:
  3607. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3608. break;
  3609. case GameMode.bigMove:
  3610. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3611. break;
  3612. case GameMode.placeBall:
  3613. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3614. break;
  3615. default:
  3616. break;
  3617. }
  3618. cfg = JSON.parse(JSON.stringify(cfg));
  3619. for (const key in cfg) {
  3620. if (cfg[key].value == 0) {
  3621. this.createRootBall(cfg[key]);
  3622. delete cfg[key];
  3623. break;
  3624. }
  3625. }
  3626. this.createOtherBalls(cfg);
  3627. }
  3628. createRootBall(data) {
  3629. let root = new D2Ball(true);
  3630. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3631. this.rootBall = root.d2Src;
  3632. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3633. let d3BallSrc = d3Ball.getComponent(Ball);
  3634. xGame.common.d3World.rootBall = d3Ball;
  3635. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3636. let xx = data.x;
  3637. let yy = data.y;
  3638. let numer = data.value;
  3639. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3640. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3641. this.ballArr.push(this.rootBall);
  3642. this.setD2Gan();
  3643. this.setHelpLine();
  3644. }
  3645. createOtherBalls(cfg) {
  3646. let temp;
  3647. let src;
  3648. let data;
  3649. for (const key in cfg) {
  3650. data = cfg[key];
  3651. temp = new D2Ball();
  3652. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3653. src = temp.d2Src;
  3654. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3655. src.initSelf(data.value, data.x, data.y, d3Ball);
  3656. this.ballArr.push(src);
  3657. }
  3658. }
  3659. shoot(percent) {
  3660. this.powerPercent = percent;
  3661. this.openCheckStill = true;
  3662. let d2Angle = this.d2Gan.ui.rotation;
  3663. this.rootBall.setSpeed(percent, d2Angle);
  3664. this.clearBallAllEft();
  3665. this.changePlayerView();
  3666. }
  3667. onUpdate() {
  3668. if (!this.openCheckStill)
  3669. return;
  3670. this.checkStill();
  3671. }
  3672. checkStill() {
  3673. for (let index = 0; index < this.ballArr.length; index++) {
  3674. if (!this.ballArr[index].isStill()) {
  3675. return;
  3676. }
  3677. }
  3678. xGame.eventMgr.event(ALL_BALL_STOP);
  3679. }
  3680. allBallStop() {
  3681. this.openCheckStill = false;
  3682. xGame.common.recoverCameraView();
  3683. }
  3684. waitShoot() {
  3685. if (!this.d2Gan.ui.isDisposed) {
  3686. this.d2Gan.ui.visible = true;
  3687. }
  3688. if (!this.d2HelpLine.ui.isDisposed) {
  3689. this.d2HelpLine.ui.visible = true;
  3690. }
  3691. this.clearBallAllEft();
  3692. this.showBallRightEft();
  3693. this.getHelpLine();
  3694. this.inHolesSpeed = [];
  3695. this.selectOneBall();
  3696. }
  3697. _getAllBallArr() {
  3698. let arr = this.ballArr;
  3699. let outArr = [];
  3700. for (let index = 0; index < arr.length; index++) {
  3701. if (arr[index] instanceof D2RootBallSrc)
  3702. continue;
  3703. if (arr[index].ballFunc == "ice")
  3704. continue;
  3705. if (arr[index].destroyed)
  3706. continue;
  3707. outArr.push(arr[index]);
  3708. }
  3709. return outArr;
  3710. }
  3711. _getBlackObj() {
  3712. let arr = this.ballArr;
  3713. for (let index = 0; index < arr.length; index++) {
  3714. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3715. return arr[index];
  3716. }
  3717. }
  3718. }
  3719. selectOneBall() {
  3720. let all = this._getAllBallArr();
  3721. let target;
  3722. switch (xGame.common.gameMode) {
  3723. case GameMode.classic:
  3724. if (xGame.common.gameMgr.selfTurn) {
  3725. let self = xGame.common.gameMgr.selfBallArr;
  3726. let black = this._getBlackObj();
  3727. if (xGame.common.gameMgr.ensureBallType) {
  3728. if (self.length > 0) {
  3729. let out = [];
  3730. for (let j = 0; j < all.length; j++) {
  3731. if (self.indexOf(all[j].number) > -1) {
  3732. out.push(all[j]);
  3733. }
  3734. }
  3735. target = this.selectBestEnterOne(out);
  3736. }
  3737. else {
  3738. target = this.selectBestEnterOne([black]);
  3739. }
  3740. }
  3741. else {
  3742. target = this.selectBestEnterOne(all);
  3743. }
  3744. }
  3745. else {
  3746. target = this.selectBestEnterOne(all);
  3747. }
  3748. break;
  3749. case GameMode.bigMove:
  3750. target = this.selectBestEnterOne(all);
  3751. break;
  3752. case GameMode.placeBall:
  3753. if (all.length > 0) {
  3754. target = this.selectBestEnterOne(all);
  3755. }
  3756. break;
  3757. default:
  3758. break;
  3759. }
  3760. if (target && !target.destroyed && target.onClick) {
  3761. target.onClick(0, true);
  3762. let num = -200 + xGame.common.randomNum(0, 400);
  3763. num /= 150;
  3764. if (xGame.common.longHelpLine) {
  3765. num = 0;
  3766. }
  3767. this.destRot += num;
  3768. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3769. }
  3770. }
  3771. removeOneBall(ball) {
  3772. for (let index = 0; index < this.ballArr.length; index++) {
  3773. if (this.ballArr[index].id == ball.id) {
  3774. this.ballArr.splice(index, 1);
  3775. break;
  3776. }
  3777. }
  3778. }
  3779. getHelpLine() {
  3780. this.d2HelpLine.ui.dirDot.visible = false;
  3781. this.isOnSameLine = false;
  3782. let startX = this.rootBall.gameObj.x;
  3783. let startY = this.rootBall.gameObj.y;
  3784. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3785. if (dis == null) {
  3786. this.d2HelpLine.ui.visible = false;
  3787. console.error("辅助线异常");
  3788. return;
  3789. }
  3790. this.d2HelpLine.ui.visible = true;
  3791. let angle = this.d2Gan.ui.rotation;
  3792. let radius = 16.5;
  3793. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3794. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3795. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3796. if (colliObj == null) {
  3797. this.getColliPos(disX, disY, radius, angle);
  3798. xGame.common.d2World.isHelpLineOnBall = false;
  3799. this.targetBall = null;
  3800. this.reflectAngle = 0;
  3801. this.showBallWrongEft();
  3802. }
  3803. else {
  3804. let target = colliObj.src;
  3805. let radius = 16.5;
  3806. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3807. dis1 = Math.sqrt(dis1);
  3808. let realDis = colliObj.disHon - dis1;
  3809. let dir = colliObj.dir;
  3810. let xx = startX + dir.x * realDis;
  3811. let yy = startY + dir.y * realDis;
  3812. this.getColliPos(xx, yy, radius, angle);
  3813. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3814. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3815. let offset = xGame.common.rodOffest;
  3816. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3817. this.isOnSameLine = true;
  3818. }
  3819. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3820. xGame.common.d2World.isHelpLineOnBall = true;
  3821. this.targetBall = target;
  3822. this.reflectAngle = reflectAngle;
  3823. this.showBallWrongEft();
  3824. if (xGame.common.longHelpLine) {
  3825. this.delayReflectLine(target, reflectAngle);
  3826. }
  3827. }
  3828. }
  3829. getBorderDot(startX, startY, angle) {
  3830. let radius = 17;
  3831. let distance;
  3832. let isDone;
  3833. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3834. isDone = this.judgeUpDown(distance, angle, startX);
  3835. if (isDone != null) {
  3836. return isDone;
  3837. }
  3838. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3839. isDone = this.judgeUpDown(distance, angle, startX);
  3840. if (isDone != null) {
  3841. return isDone;
  3842. }
  3843. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3844. isDone = this.judgeLeftRight(distance, angle, startY);
  3845. if (isDone != null) {
  3846. return isDone;
  3847. }
  3848. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3849. isDone = this.judgeLeftRight(distance, angle, startY);
  3850. if (isDone != null) {
  3851. return isDone;
  3852. }
  3853. }
  3854. judgeUpDown(distance, angle, startX) {
  3855. let flag = Math.sin(angle * Math.PI / 180);
  3856. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3857. if (distance >= 0) {
  3858. if (flag > 0) {
  3859. if (temp < this.borderRect.x + this.borderRect.width) {
  3860. return distance;
  3861. }
  3862. }
  3863. else {
  3864. if (temp > this.borderRect.x) {
  3865. return distance;
  3866. }
  3867. }
  3868. }
  3869. }
  3870. judgeLeftRight(distance, angle, starY) {
  3871. let flag = -Math.cos(angle * Math.PI / 180);
  3872. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3873. if (distance >= 0) {
  3874. if (flag > 0) {
  3875. if (temp < this.borderRect.y + this.borderRect.height) {
  3876. return distance;
  3877. }
  3878. }
  3879. else {
  3880. if (temp > this.borderRect.y) {
  3881. return distance;
  3882. }
  3883. }
  3884. }
  3885. }
  3886. clearBallAllEft() {
  3887. let temp;
  3888. for (let index = 0; index < this.ballArr.length; index++) {
  3889. temp = this.ballArr[index];
  3890. temp.clearBallEft();
  3891. }
  3892. }
  3893. showBallRightEft() {
  3894. let gameMgr = xGame.common.gameMgr;
  3895. let temp;
  3896. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3897. if (targetArr.length <= 0)
  3898. return;
  3899. for (let index = 0; index < this.ballArr.length; index++) {
  3900. temp = this.ballArr[index];
  3901. if (targetArr.indexOf(temp.number) > -1) {
  3902. temp.showRightEft();
  3903. }
  3904. }
  3905. }
  3906. showBallWrongEft() {
  3907. let gameMgr = xGame.common.gameMgr;
  3908. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3909. if (targetArr.length <= 0)
  3910. return;
  3911. let temp;
  3912. for (let index = 0; index < this.ballArr.length; index++) {
  3913. temp = this.ballArr[index];
  3914. if (this.targetBall && this.targetBall.number == temp.number) {
  3915. if (targetArr.indexOf(temp.number) <= -1) {
  3916. temp.showWrongEft();
  3917. }
  3918. else {
  3919. temp.clearBallWrongEft();
  3920. }
  3921. }
  3922. else {
  3923. temp.clearBallWrongEft();
  3924. }
  3925. }
  3926. }
  3927. getColliPos(x, y, radius, angle) {
  3928. this.d2HelpLine.ui.x = x;
  3929. this.d2HelpLine.ui.y = y;
  3930. let dirX = x - this.rootBall.gameObj.x;
  3931. let dirY = y - this.rootBall.gameObj.y;
  3932. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3933. if (rectH <= 0)
  3934. rectH = 0;
  3935. this.d2HelpLine.ui.rect.height = 0;
  3936. this.d2HelpLine.ui.rect.height = rectH;
  3937. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3938. if (rectH < this.rootBall.gameObj.width) {
  3939. this.d2HelpLine.ui.rect.visible = false;
  3940. }
  3941. else {
  3942. this.d2HelpLine.ui.rect.visible = true;
  3943. }
  3944. this.d2HelpLine.ui.dir.visible = false;
  3945. this.d2HelpLine.ui.rootDir.visible = false;
  3946. }
  3947. getReflectLine(x, y, radius, target) {
  3948. this.d2HelpLine.ui.dir.visible = true;
  3949. let dirX = target.x - x;
  3950. let dirY = target.y - y;
  3951. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3952. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3953. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3954. this.d2HelpLine.ui.dir.height = 48;
  3955. this.d2HelpLine.ui.dir.rotation = angle;
  3956. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3957. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3958. return angle;
  3959. }
  3960. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3961. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3962. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3963. let targetX = target.gameObj.x;
  3964. let targetY = target.gameObj.y;
  3965. this.outDir.setValue(targetX - xx, targetY - yy);
  3966. this.rootDir.setValue(rtX - xx, rtY - yy);
  3967. let ver = Math.PI / 2;
  3968. let sin = Math.sin(ver);
  3969. let cos = Math.cos(ver);
  3970. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3971. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3972. this.outDir.setValue(outX, outY);
  3973. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3974. Laya.Vector2.normalize(this.outDir, this.outDir);
  3975. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3976. if (Math.abs(result) <= 0.08) {
  3977. this.d2HelpLine.ui.rootDir.visible = false;
  3978. return;
  3979. }
  3980. if (result > 0) {
  3981. angle += 90;
  3982. }
  3983. else if (result < 0) {
  3984. angle -= 90;
  3985. }
  3986. this.d2HelpLine.ui.rootDir.visible = true;
  3987. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3988. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3989. this.d2HelpLine.ui.rootDir.rotation = angle;
  3990. }
  3991. delayReflectLine(obj, angle) {
  3992. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3993. return;
  3994. }
  3995. this.isOnSameLine = false;
  3996. let startX = obj.gameObj.x;
  3997. let startY = obj.gameObj.y;
  3998. let dis = this.getBorderDot(startX, startY, angle);
  3999. if (dis == null) {
  4000. this.d2HelpLine.ui.dirDot.visible = false;
  4001. return;
  4002. }
  4003. this.d2HelpLine.ui.visible = true;
  4004. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4005. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4006. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4007. if (colliObj == null) {
  4008. this.setDelayLine(disX, disY, obj, angle);
  4009. }
  4010. else {
  4011. let radius = 16;
  4012. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4013. dis1 = Math.sqrt(dis1);
  4014. let realDis = colliObj.disHon - dis1;
  4015. let dir = colliObj.dir;
  4016. let xx = startX + dir.x * realDis;
  4017. let yy = startY + dir.y * realDis;
  4018. this.setDelayLine(xx, yy, obj, angle);
  4019. }
  4020. }
  4021. setDelayLine(x, y, obj, angle) {
  4022. let dirX = x - obj.gameObj.x;
  4023. let dirY = y - obj.gameObj.y;
  4024. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4025. if (rectH <= 0)
  4026. rectH = 0;
  4027. this.d2HelpLine.ui.dir.height = rectH;
  4028. this.d2HelpLine.ui.dirDot.visible = true;
  4029. this.d2HelpLine.ui.dirDot.x = 17;
  4030. this.d2HelpLine.ui.dirDot.y = 17;
  4031. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4032. ;
  4033. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4034. }
  4035. changePlayerView() {
  4036. if (Math.random() >= 0.7)
  4037. return;
  4038. if (!this.targetBall) {
  4039. return;
  4040. }
  4041. if (!xGame.common.gameMgr.selfTurn)
  4042. return;
  4043. switch (xGame.common.gameMode) {
  4044. case GameMode.classic:
  4045. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4046. if (this.targetBall.number != 8) {
  4047. return;
  4048. }
  4049. }
  4050. break;
  4051. case GameMode.bigMove:
  4052. return;
  4053. case GameMode.placeBall:
  4054. break;
  4055. default:
  4056. break;
  4057. }
  4058. let startX = this.targetBall.gameObj.x;
  4059. let startY = this.targetBall.gameObj.y;
  4060. let angle = this.reflectAngle;
  4061. let dis = this.getBorderDot(startX, startY, angle);
  4062. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4063. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4064. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4065. if (colliObj) {
  4066. return;
  4067. }
  4068. let offset = 40;
  4069. let posObj = xGame.common.gameMgr.posObj;
  4070. let temp;
  4071. let radius;
  4072. let tarX, tarY;
  4073. for (const key in posObj) {
  4074. temp = posObj[key];
  4075. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4076. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4077. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4078. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4079. xGame.common.showOneCamera("angle" + key);
  4080. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4081. Laya.physicsTimer.scale = 0.7;
  4082. break;
  4083. }
  4084. }
  4085. }
  4086. selectBestEnterOne(arr) {
  4087. this.aiLv = xGame.tools.random(1, 11);
  4088. this.aiLv = 10;
  4089. this.wBall = xGame.common.d2World.rootBall;
  4090. this.rootPos.x = this.wBall.gameObj.x;
  4091. this.rootPos.y = this.wBall.gameObj.y;
  4092. this.initHoleBall(arr);
  4093. return this.selectBall();
  4094. }
  4095. selectBall() {
  4096. let ball = null;
  4097. this.destRot = 0;
  4098. let ai = 110 - this.aiLv * 10;
  4099. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4100. let score = false;
  4101. if (this.scoreBall.length < 1) {
  4102. if (this.lineBall.length < 1) {
  4103. for (let i = 0; i < this.kickBall.length; i++) {
  4104. let list = [];
  4105. let bo = this.kickBall[i];
  4106. let bobj = bo.gameObj;
  4107. let rect = xGame.common.d2World.borderRect;
  4108. let mobj = this.wBall.gameObj;
  4109. let minb = bobj.y - rect.y - 20;
  4110. let minw = mobj.y - rect.y - 50;
  4111. if (minb > 0 && minw > 0) {
  4112. let dlenx = 0;
  4113. let dleny = mobj.y - rect.y;
  4114. let spx = mobj.x;
  4115. let spy = rect.y - dleny;
  4116. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4117. }
  4118. minb = rect.y + rect.height - bobj.y - 20;
  4119. minw = rect.y + rect.height - mobj.y - 50;
  4120. if (minb > 0 && minw > 0) {
  4121. let dlenx = 0;
  4122. let dleny = rect.y + rect.height - mobj.y;
  4123. let spx = mobj.x;
  4124. let spy = rect.y + rect.height + dleny;
  4125. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4126. }
  4127. minb = bobj.x - rect.x - 20;
  4128. minw = mobj.x - rect.x - 50;
  4129. if (minb > 0 && minw > 0) {
  4130. let dlenx = mobj.x - rect.x;
  4131. let dleny = 0;
  4132. let spx = rect.x - dlenx;
  4133. let spy = mobj.y;
  4134. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4135. }
  4136. minb = rect.x + rect.width - bobj.x - 20;
  4137. minw = rect.x + rect.width - mobj.x - 50;
  4138. if (minb > 0 && minw > 0) {
  4139. let dlenx = rect.x + rect.width - mobj.x;
  4140. let dleny = 0;
  4141. let spx = rect.x + rect.width + dlenx;
  4142. let spy = mobj.y;
  4143. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4144. }
  4145. list.sort(function (a, b) {
  4146. return a.order - b.order;
  4147. });
  4148. for (let i = 0; i < list.length; i++) {
  4149. let data = list[i];
  4150. let mx = mobj.x - bobj.x;
  4151. let my = mobj.y - bobj.y;
  4152. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4153. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4154. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4155. if (num > 1)
  4156. num = 1;
  4157. let cos = Math.acos(num);
  4158. if (cos > 1.57)
  4159. cos = 1.57;
  4160. else if (cos < 0.01)
  4161. cos = 0.01;
  4162. let tan = Math.tan(cos);
  4163. let dx = tan * data.dleny;
  4164. let dy = tan * data.dlenx;
  4165. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4166. if (Math.abs(bx - 667) < 40)
  4167. continue;
  4168. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4169. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4170. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4171. this.forceMax = dis * 0.08;
  4172. this.destRot += mis * 0.1;
  4173. this.setKick(bx, by);
  4174. return true;
  4175. }
  4176. }
  4177. }
  4178. }
  4179. else {
  4180. ball = xGame.common.getRandArrEle(this.lineBall);
  4181. }
  4182. }
  4183. else {
  4184. for (let i = 0; i < this.scoreBall.length; i++) {
  4185. if (i < this.scoreBall.length - 1) {
  4186. let rand = 70 + this.aiLv * 10 + i * 10;
  4187. if (xGame.tools.random(0, 100) < rand) {
  4188. ball = this.scoreBall[i];
  4189. break;
  4190. }
  4191. }
  4192. else {
  4193. ball = this.scoreBall[i];
  4194. break;
  4195. }
  4196. }
  4197. score = true;
  4198. this.selectNum++;
  4199. }
  4200. if (!ball)
  4201. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4202. let dx = ball.gameObj.x;
  4203. let dy = ball.gameObj.y;
  4204. let kickAngle = 0;
  4205. if (score) {
  4206. dx = ball.kickPos.x;
  4207. dy = ball.kickPos.y;
  4208. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4209. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4210. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4211. if (adot > 1)
  4212. adot = 1;
  4213. kickAngle = Math.acos(adot) * 57.3;
  4214. if (kickAngle > 45) {
  4215. let kdx = ball.kickPos.x - ball.gameObj.x;
  4216. let kdy = ball.kickPos.y - ball.gameObj.y;
  4217. dx = ball.kickPos.x - kdx * mis * 0.3;
  4218. dy = ball.kickPos.y - kdy * mis * 0.3;
  4219. }
  4220. else
  4221. this.destRot += mis;
  4222. }
  4223. else if (ball.poleAngle != 0) {
  4224. this.destRot += ball.poleAngle;
  4225. }
  4226. if (xGame.common.gameMode == 0) {
  4227. let af = kickAngle * 0.08;
  4228. this.forceMax = ball.hard * 0.1 + af * af;
  4229. }
  4230. this.setKick(dx, dy);
  4231. return ball;
  4232. }
  4233. initHoleBall(arr) {
  4234. this.kickBall = [];
  4235. this.lineBall = [];
  4236. this.scoreBall = [];
  4237. this.holeBall = [];
  4238. this.selectNum = 0;
  4239. this.forceNum = 0;
  4240. this.forceMax = 0;
  4241. this.turnNum = 0;
  4242. let list = arr;
  4243. let holes = xGame.common.gameMgr.holePosList;
  4244. let self = xGame.common.aiPlayer;
  4245. for (let i = 0; i < list.length; i++) {
  4246. let obj = list[i];
  4247. if (!obj)
  4248. continue;
  4249. obj.kickPos.x = 0;
  4250. obj.kickPos.y = 0;
  4251. obj.poleAngle = 0;
  4252. obj.hard = 0;
  4253. obj.borderDis = 0;
  4254. obj.kickAngle = 180;
  4255. let b = obj.gameObj;
  4256. let wbp = this.rootPos;
  4257. let bx = wbp.x - b.x;
  4258. let by = wbp.y - b.y;
  4259. obj.borderDis = xGame.tools.random(0, 100);
  4260. this.kickBall.push(obj);
  4261. if (!this.isLine(wbp, obj))
  4262. continue;
  4263. obj.kickAngle = xGame.tools.random(90, 180);
  4264. obj.kickPos.x = b.x;
  4265. obj.kickPos.y = b.y;
  4266. this.lineBall.push(obj);
  4267. let minDis = 999999;
  4268. let hole = false;
  4269. for (let j = 0; j < holes.length; j++) {
  4270. let hp = holes[j];
  4271. if (bx >= 0 && hp.x > b.x + 100)
  4272. continue;
  4273. if (bx <= 0 && hp.x < b.x - 100)
  4274. continue;
  4275. if (by < -10 && hp.y < wbp.y)
  4276. continue;
  4277. if (by > 10 && hp.y > wbp.y)
  4278. continue;
  4279. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4280. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4281. if (dis < minDis) {
  4282. let dx = b.x - this.tempDir1.x * this.ballSize;
  4283. let dy = b.y - this.tempDir1.y * this.ballSize;
  4284. this.tempDir3.x = this.tempDir1.x;
  4285. this.tempDir3.y = this.tempDir1.y;
  4286. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4287. obj.kickPos.x = dx;
  4288. obj.kickPos.y = dy;
  4289. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4290. if (num > 1)
  4291. num = 1;
  4292. obj.kickAngle = Math.acos(num) * 57.3;
  4293. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4294. dis = dis * 2;
  4295. if (Math.abs(hp.x - 600) < 100)
  4296. dis += 50;
  4297. obj.hard = dis + obj.kickAngle * 3;
  4298. hole = true;
  4299. }
  4300. }
  4301. }
  4302. }
  4303. if (hole) {
  4304. this.scoreBall.push(obj);
  4305. this.holeBall.push(obj);
  4306. }
  4307. }
  4308. this.scoreBall.sort(function (a, b) {
  4309. return a.hard - b.hard;
  4310. });
  4311. this.holeBall.sort(function (a, b) {
  4312. return a.kickAngle - b.kickAngle;
  4313. });
  4314. this.kickBall.sort(function (a, b) {
  4315. return a.borderDis - b.borderDis;
  4316. });
  4317. }
  4318. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4319. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4320. let balls = xGame.common.d2World.ballArr;
  4321. let max = xGame.tools.getDis(hx, hy, bx, by);
  4322. for (let index = 0; index < balls.length; index++) {
  4323. let obj = balls[index];
  4324. if (obj.number == 0)
  4325. continue;
  4326. if (obj.number == bn || obj.number == dn)
  4327. continue;
  4328. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4329. if (dis * dis > max)
  4330. continue;
  4331. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4332. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4333. if (num > 1)
  4334. num = 1;
  4335. if (num < 0)
  4336. continue;
  4337. let gap = Math.sin(Math.acos(num)) * dis;
  4338. if (gap < this.ballSize)
  4339. return true;
  4340. }
  4341. return false;
  4342. }
  4343. isLine(xy, ball) {
  4344. let bx = xy.x;
  4345. let by = xy.y;
  4346. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4347. let dis = ball.getDestDis(xy);
  4348. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4349. let sin = Math.sin(angle);
  4350. let cos = Math.cos(angle);
  4351. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4352. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4353. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4354. let dx = bx + this.tempDir2.x * dis;
  4355. let dy = by + this.tempDir2.y * dis;
  4356. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4357. sin = Math.sin(-angle);
  4358. cos = Math.cos(-angle);
  4359. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4360. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4361. dx = bx + this.tempDir2.x * dis;
  4362. dy = by + this.tempDir2.y * dis;
  4363. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4364. if (isr && isl)
  4365. return false;
  4366. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4367. }
  4368. return true;
  4369. }
  4370. setKick(dx, dy) {
  4371. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4372. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4373. this.tempDir1.x = 0;
  4374. this.tempDir1.y = 1;
  4375. this.tempDir2.y = -this.tempDir2.y;
  4376. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4377. if (num > 1)
  4378. num = 1;
  4379. let rot = Math.acos(num) * 57.3;
  4380. if (this.tempDir2.x < 0)
  4381. rot = 360 - rot;
  4382. this.destRot += rot;
  4383. }
  4384. }
  4385. class ui_UIGame extends fgui.GComponent {
  4386. static createInstance() {
  4387. return (fgui.UIPackage.createObject("game", "UIGame"));
  4388. }
  4389. onConstruct() {
  4390. this.c1 = this.getController("c1");
  4391. this.d3Root = (this.getChild("d3Root"));
  4392. this.clickNode = (this.getChild("clickNode"));
  4393. this.d2Root = (this.getChild("d2Root"));
  4394. this.topNode = (this.getChild("topNode"));
  4395. this.n72 = (this.getChild("n72"));
  4396. this.n40 = (this.getChild("n40"));
  4397. this.rulerNode = (this.getChild("rulerNode"));
  4398. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4399. this.n50 = (this.getChild("n50"));
  4400. this.keduNode = (this.getChild("keduNode"));
  4401. this.powerTxt = (this.getChild("powerTxt"));
  4402. this.powerNode = (this.getChild("powerNode"));
  4403. this.colorNode = (this.getChild("colorNode"));
  4404. this.powerEft = (this.getChild("powerEft"));
  4405. this.myPowerNode = (this.getChild("myPowerNode"));
  4406. this.ganNode = (this.getChild("ganNode"));
  4407. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4408. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4409. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4410. this.skillRod = (this.getChild("skillRod"));
  4411. this.border = (this.getChild("border"));
  4412. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4413. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4414. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4415. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4416. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4417. this.guanyuNode = (this.getChild("guanyuNode"));
  4418. this.helpBtn = (this.getChild("helpBtn"));
  4419. this.wordsBtn = (this.getChild("wordsBtn"));
  4420. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4421. this.returnBtn = (this.getChild("returnBtn"));
  4422. this.ballNode = (this.getChild("ballNode"));
  4423. this.whiteAni = (this.getChild("whiteAni"));
  4424. this.blackAni = (this.getChild("blackAni"));
  4425. this.selfTurn = (this.getChild("selfTurn"));
  4426. this.aiTurn = (this.getChild("aiTurn"));
  4427. this.deskNode = (this.getChild("deskNode"));
  4428. this.moveNode = (this.getChild("moveNode"));
  4429. this.selfTalk = (this.getChild("selfTalk"));
  4430. this.aiTalk = (this.getChild("aiTalk"));
  4431. this.d2Node = (this.getChild("d2Node"));
  4432. this.snowNode = (this.getChild("snowNode"));
  4433. this.guide2 = (this.getChild("guide2"));
  4434. this.guide1 = (this.getChild("guide1"));
  4435. this.guide3 = (this.getChild("guide3"));
  4436. this.guideNode = (this.getChild("guideNode"));
  4437. }
  4438. }
  4439. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4440. class ui_UIGameEnd extends fgui.GComponent {
  4441. static createInstance() {
  4442. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4443. }
  4444. onConstruct() {
  4445. this.c1 = this.getController("c1");
  4446. this.n22 = (this.getChild("n22"));
  4447. this.n2 = (this.getChild("n2"));
  4448. this.n52 = (this.getChild("n52"));
  4449. this.n53 = (this.getChild("n53"));
  4450. this.coinNode = (this.getChild("coinNode"));
  4451. this.closeNode = (this.getChild("closeNode"));
  4452. this.moneyNode = (this.getChild("moneyNode"));
  4453. this.secretary = (this.getChild("secretary"));
  4454. this.n27 = (this.getChild("n27"));
  4455. this.n29 = (this.getChild("n29"));
  4456. this.talkNode = (this.getChild("talkNode"));
  4457. this.n38 = (this.getChild("n38"));
  4458. this.n39 = (this.getChild("n39"));
  4459. this.n40 = (this.getChild("n40"));
  4460. this.awardNode = (this.getChild("awardNode"));
  4461. this.starNumNode = (this.getChild("starNumNode"));
  4462. this.n47 = (this.getChild("n47"));
  4463. this.conditionNode = (this.getChild("conditionNode"));
  4464. this.isGetAward = (this.getChild("isGetAward"));
  4465. this.leftBtn = (this.getChild("leftBtn"));
  4466. this.rightBtn = (this.getChild("rightBtn"));
  4467. this.btnNode = (this.getChild("btnNode"));
  4468. }
  4469. }
  4470. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4471. class ui_UIAddCoin extends fgui.GComponent {
  4472. static createInstance() {
  4473. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4474. }
  4475. onConstruct() {
  4476. this.n11 = (this.getChild("n11"));
  4477. this.myNode = (this.getChild("myNode"));
  4478. this.t0 = this.getTransition("t0");
  4479. }
  4480. }
  4481. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4482. class UIAddCoin extends UIBase {
  4483. constructor() {
  4484. super();
  4485. this.coinNum = 2000;
  4486. }
  4487. onConstructor() {
  4488. this.ui = ui_UIAddCoin.createInstance();
  4489. this.contentPane = this.ui;
  4490. this.isEject = false;
  4491. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4492. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4493. }
  4494. show() {
  4495. super.show();
  4496. this.ui.t0.play();
  4497. this.setGlobalFont(this.ui);
  4498. }
  4499. videoAddCoin() {
  4500. console.log('zh:qjff_AD_for_UIAddCoin');
  4501. if (Laya.Browser.onAndroid) {
  4502. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4503. if (!boo) {
  4504. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4505. return;
  4506. }
  4507. }
  4508. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4509. }
  4510. else {
  4511. console.log('zh:AD 失败,直接发放奖励');
  4512. this.qjff_AD_for_UIAddCoin();
  4513. }
  4514. }
  4515. qjff_AD_for_UIAddCoin() {
  4516. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4517. this.hide();
  4518. }
  4519. }
  4520. UIAddCoin.uiName = "UIAddCoin";
  4521. class ui_UIInvitation extends fgui.GComponent {
  4522. static createInstance() {
  4523. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4524. }
  4525. onConstruct() {
  4526. this.n14 = (this.getChild("n14"));
  4527. this.myNode = (this.getChild("myNode"));
  4528. this.t0 = this.getTransition("t0");
  4529. }
  4530. }
  4531. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4532. class UIInvitation extends UIBase {
  4533. constructor() {
  4534. super();
  4535. }
  4536. onConstructor() {
  4537. this.ui = ui_UIInvitation.createInstance();
  4538. this.contentPane = this.ui;
  4539. this.isEject = false;
  4540. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4541. }
  4542. show() {
  4543. super.show();
  4544. this.setGlobalFont(this.ui);
  4545. }
  4546. enterGame() {
  4547. xGame.common.gameMode = GameMode.classic;
  4548. DataMgr.setChallengeTimes(1);
  4549. xGame.common.passAwardCoin = 2000;
  4550. let need = xGame.common.classicNiceNeddCoin;
  4551. if (DataMgr.coinEnough(need)) {
  4552. DataMgr.setCoin(-need);
  4553. xGame.eventMgr.event(RESTART_GAME, true);
  4554. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4555. }
  4556. else {
  4557. xGame.eventMgr.event(RESTART_GAME, true);
  4558. }
  4559. this.hide();
  4560. }
  4561. hide() {
  4562. super.hide();
  4563. }
  4564. }
  4565. UIInvitation.uiName = "UIInvitation";
  4566. class ui_UIMain extends fgui.GComponent {
  4567. static createInstance() {
  4568. return (fgui.UIPackage.createObject("game", "UIMain"));
  4569. }
  4570. onConstruct() {
  4571. this.n47 = (this.getChild("n47"));
  4572. this.n10 = (this.getChild("n10"));
  4573. this.secretary = (this.getChild("secretary"));
  4574. this.moneyNode = (this.getChild("moneyNode"));
  4575. this.headNode = (this.getChild("headNode"));
  4576. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4577. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4578. this.classicBtn = (this.getChild("classicBtn"));
  4579. this.globalBtn = (this.getChild("globalBtn"));
  4580. this.n44 = (this.getChild("n44"));
  4581. this.n_dengLu = (this.getChild("n_dengLu"));
  4582. this.settingNode = (this.getChild("settingNode"));
  4583. this.drawBtn = (this.getChild("drawBtn"));
  4584. this.signBtn = (this.getChild("signBtn"));
  4585. this.shopBtn = (this.getChild("shopBtn"));
  4586. this.n45 = (this.getChild("n45"));
  4587. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4588. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4589. this.rankBtn = (this.getChild("rankBtn"));
  4590. this.n46 = (this.getChild("n46"));
  4591. this.liucheng1 = (this.getChild("liucheng1"));
  4592. this.rightBtn = (this.getChild("rightBtn"));
  4593. this.n75 = (this.getChild("n75"));
  4594. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4595. this.liucheng2 = (this.getChild("liucheng2"));
  4596. this.guideBtn = (this.getChild("guideBtn"));
  4597. this.n73 = (this.getChild("n73"));
  4598. this.wordsNode = (this.getChild("wordsNode"));
  4599. this.enterGuide = (this.getChild("enterGuide"));
  4600. this.talkNode = (this.getChild("talkNode"));
  4601. this.n83 = (this.getChild("n83"));
  4602. this.n84 = (this.getChild("n84"));
  4603. this.n_yd_challenge_1_mask = (this.getChild("n_yd_challenge_1_mask"));
  4604. this.n_yd_challenge_1_btn = (this.getChild("n_yd_challenge_1_btn"));
  4605. this.n_yd_challenge_1_hand = (this.getChild("n_yd_challenge_1_hand"));
  4606. this.n_yd_challenge_1 = (this.getChild("n_yd_challenge_1"));
  4607. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4608. }
  4609. }
  4610. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4611. class ui_UIMoyu extends fgui.GComponent {
  4612. static createInstance() {
  4613. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4614. }
  4615. onConstruct() {
  4616. this.ageTip = (this.getChild("ageTip"));
  4617. this.mainBg = (this.getChild("mainBg"));
  4618. this.xyNode = (this.getChild("xyNode"));
  4619. this.rnNode = (this.getChild("rnNode"));
  4620. this.fcmNode = (this.getChild("fcmNode"));
  4621. this.ageNode = (this.getChild("ageNode"));
  4622. this.tipNode = (this.getChild("tipNode"));
  4623. this.msgNode = (this.getChild("msgNode"));
  4624. }
  4625. }
  4626. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4627. class MoyuMgr {
  4628. static initMoyu() {
  4629. this.moyuView = new MoyuView();
  4630. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4631. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4632. this.moyuView.ui.displayObject.zOrder = 1000;
  4633. this.moyuView.init();
  4634. this.moyuView.showTip(true);
  4635. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4636. window['XApk'] = this;
  4637. }
  4638. static showAge(show) {
  4639. if (this.moyuView)
  4640. this.moyuView.showAge(show);
  4641. }
  4642. static onPlatMsg(idx) {
  4643. if (!MoyuMgr.moyuView)
  4644. return;
  4645. if (idx == '0') {
  4646. MoyuMgr.moyuView.showTip(false);
  4647. }
  4648. }
  4649. static showAgree(call) {
  4650. if (this.moyuView)
  4651. this.moyuView.showAgree(call);
  4652. else
  4653. call && call();
  4654. }
  4655. static showXy(type = 1) {
  4656. if (this.moyuView)
  4657. this.moyuView.showXy(type);
  4658. }
  4659. }
  4660. MoyuMgr.isAdvise = false;
  4661. class MoyuView {
  4662. constructor() {
  4663. this.ysxyNum = 1;
  4664. this.ysJson = null;
  4665. this.ui = ui_UIMoyu.createInstance();
  4666. }
  4667. init() {
  4668. this.ui.mainBg.visible = false;
  4669. this.ui.xyNode.visible = false;
  4670. this.ui.ageNode.visible = false;
  4671. this.ui.tipNode.visible = false;
  4672. this.ui.rnNode.visible = false;
  4673. this.ui.fcmNode.visible = false;
  4674. this.ui.ageTip.visible = false;
  4675. this.ui.msgNode.visible = false;
  4676. this.ui.visible = false;
  4677. this.ui.xyNode.xyList.setVirtual();
  4678. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4679. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4680. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4681. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4682. this.ui.xyNode.btnKnown.visible = false;
  4683. this.ui.xyNode.xy1.visible = false;
  4684. this.ui.xyNode.xy2.visible = false;
  4685. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4686. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4687. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4688. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4689. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4690. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4691. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4692. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4693. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4694. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4695. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4696. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4697. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4698. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4699. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4700. this.ysxyNum = 2;
  4701. }
  4702. }
  4703. onClick(obj) {
  4704. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4705. switch (obj) {
  4706. case this.ui.ageTip:
  4707. if (Moyu.isTTApk) {
  4708. this.ui.ageNode.visible = true;
  4709. this.ui.mainBg.visible = true;
  4710. }
  4711. break;
  4712. case this.ui.tipNode:
  4713. this.showTip(false);
  4714. break;
  4715. case this.ui.ageNode.btnAge:
  4716. this.ui.ageNode.visible = false;
  4717. this.ui.mainBg.visible = false;
  4718. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4719. this.ui.visible = false;
  4720. break;
  4721. case this.ui.xyNode.btnXy3:
  4722. case this.ui.xyNode.btnXy1:
  4723. this.loadXy(1);
  4724. break;
  4725. case this.ui.xyNode.btnXy2:
  4726. this.loadXy(2);
  4727. break;
  4728. case this.ui.xyNode.btnBack:
  4729. this.ui.xyNode.xy1.visible = true;
  4730. this.ui.xyNode.xy2.visible = false;
  4731. break;
  4732. case this.ui.xyNode.btnKnown:
  4733. this.ui.xyNode.visible = false;
  4734. this.ui.mainBg.visible = false;
  4735. this.ui.visible = false;
  4736. break;
  4737. case this.ui.rnNode.btnCheck:
  4738. this.check();
  4739. break;
  4740. case this.ui.rnNode.btnExit:
  4741. case this.ui.xyNode.btnNo:
  4742. this.ysxyNum--;
  4743. if (this.ysxyNum > 0)
  4744. this.showMsg("Refuse to quit the game once again");
  4745. else {
  4746. Moyu.userAgree(false);
  4747. Moyu.exit();
  4748. }
  4749. break;
  4750. case this.ui.xyNode.btnSure:
  4751. case this.ui.xyNode.btnYes:
  4752. DataMgr.userData.isAgree = true;
  4753. DataMgr.saveUserData();
  4754. this.onAgree();
  4755. break;
  4756. case this.ui.rnNode.btnDone:
  4757. this.ui.rnNode.visible = false;
  4758. this.ui.visible = false;
  4759. break;
  4760. case this.ui.fcmNode.btnRn:
  4761. this.showRn();
  4762. break;
  4763. }
  4764. }
  4765. showTip(show) {
  4766. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4767. return;
  4768. if (show) {
  4769. MoyuMgr.isAdvise = true;
  4770. this.ui.visible = true;
  4771. this.ui.tipNode.visible = true;
  4772. this.ui.tipNode.alpha = 1;
  4773. Laya.timer.once(1000, this, this.showTip, [false]);
  4774. }
  4775. else {
  4776. this.ui.tipNode.alpha = 1;
  4777. this.ui.tipNode.visible = true;
  4778. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4779. this.ui.tipNode.visible = false;
  4780. MoyuMgr.isAdvise = false;
  4781. }), 1000);
  4782. }
  4783. }
  4784. showAge(show, px = 0, py = 0) {
  4785. if (Moyu.platType > 10 && !Moyu.isIos) {
  4786. this.ui.ageTip.x = px;
  4787. this.ui.ageTip.y = py;
  4788. this.ui.ageTip.visible = show;
  4789. if (show)
  4790. this.ui.visible = true;
  4791. }
  4792. }
  4793. showAgree(call) {
  4794. this.agreeCall = call;
  4795. this.onAgree();
  4796. return;
  4797. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4798. this.showXy(0);
  4799. }
  4800. else
  4801. this.onAgree();
  4802. }
  4803. onAgree() {
  4804. if (!this.ui.ageNode.visible)
  4805. this.ui.visible = false;
  4806. this.ui.xyNode.visible = false;
  4807. Moyu.userAgree(true);
  4808. this.showAge(false);
  4809. this.agreeCall && this.agreeCall();
  4810. this.showRn();
  4811. }
  4812. showMsg(txt) {
  4813. this.ui.msgNode.txtMsg.text = txt;
  4814. this.ui.msgNode.visible = true;
  4815. this.ui.msgNode.alpha = 1;
  4816. this.ui.visible = true;
  4817. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4818. this.ui.msgNode.visible = false;
  4819. }), 2500, true);
  4820. }
  4821. showRn() {
  4822. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4823. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4824. this.ui.rnNode.rn1.visible = true;
  4825. this.ui.rnNode.rn2.visible = false;
  4826. this.ui.rnNode.rn3.visible = false;
  4827. this.ui.rnNode.rn4.visible = false;
  4828. this.ui.rnNode.visible = true;
  4829. this.ui.mainBg.visible = true;
  4830. this.ui.rnNode.btnDone.visible = false;
  4831. this.ui.rnNode.btnExit.visible = true;
  4832. this.ui.rnNode.btnCheck.visible = true;
  4833. this.ui.fcmNode.visible = false;
  4834. this.ui.visible = true;
  4835. return;
  4836. }
  4837. }
  4838. this.showFcm();
  4839. }
  4840. showFcm() {
  4841. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4842. Moyu.initFCM(true);
  4843. if (Moyu.gameTime < 1)
  4844. this.fcmLoop();
  4845. else if (Moyu.gameTime < 999)
  4846. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4847. }
  4848. }
  4849. fcmLoop() {
  4850. if (Moyu.gameTime < 1) {
  4851. this.ui.rnNode.visible = false;
  4852. this.ui.fcmNode.visible = true;
  4853. this.ui.mainBg.visible = true;
  4854. this.ui.visible = true;
  4855. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4856. Laya.timer.clear(this.ui, this.fcmLoop);
  4857. }
  4858. }
  4859. check() {
  4860. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4861. this.ui.rnNode.rn1.visible = false;
  4862. this.ui.rnNode.rn2.visible = false;
  4863. this.ui.rnNode.rn4.visible = true;
  4864. }
  4865. else if (this.ui.rnNode.rn4.visible) {
  4866. let name = this.ui.rnNode.inputName.text;
  4867. let code = this.ui.rnNode.inputCode.text;
  4868. if (code && code.length == 18) {
  4869. this.ui.rnNode.rn1.visible = false;
  4870. this.ui.rnNode.rn4.visible = false;
  4871. Moyu.authenticate(name, code, (res) => {
  4872. this.ui.rnNode.rn2.visible = !res;
  4873. this.ui.rnNode.rn3.visible = res;
  4874. this.ui.rnNode.btnDone.visible = res;
  4875. this.ui.rnNode.btnExit.visible = !res;
  4876. this.ui.rnNode.btnCheck.visible = !res;
  4877. if (res)
  4878. this.showFcm();
  4879. });
  4880. }
  4881. else
  4882. this.showMsg("信息填写不完整");
  4883. }
  4884. }
  4885. loadXy(type = 0) {
  4886. this.ui.xyNode.xy1.visible = false;
  4887. this.ui.xyNode.xy2.visible = true;
  4888. this.ui.xyNode.xyList.scrollToView(0);
  4889. if (type == 1) {
  4890. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4891. }
  4892. else if (type == 2) {
  4893. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4894. }
  4895. }
  4896. showXy(type = 0) {
  4897. this.xyBtn();
  4898. if (type == 0) {
  4899. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4900. this.ui.xyNode.btnSure.visible = true;
  4901. }
  4902. else {
  4903. this.ui.xyNode.btnYes.visible = true;
  4904. this.ui.xyNode.btnNo.visible = true;
  4905. }
  4906. }
  4907. else {
  4908. this.ui.xyNode.btnKnown.visible = true;
  4909. this.ui.mainBg.visible = true;
  4910. }
  4911. this.ui.xyNode.xy1.visible = true;
  4912. this.ui.xyNode.xy2.visible = false;
  4913. this.ui.xyNode.visible = true;
  4914. this.ui.visible = true;
  4915. }
  4916. xyBtn() {
  4917. this.ui.xyNode.btnSure.visible = false;
  4918. this.ui.xyNode.btnYes.visible = false;
  4919. this.ui.xyNode.btnNo.visible = false;
  4920. this.ui.xyNode.btnKnown.visible = false;
  4921. {
  4922. this.ui.xyNode.btnXy3.visible = false;
  4923. this.ui.xyNode.btnXy2.visible = true;
  4924. this.ui.xyNode.btnXy1.visible = true;
  4925. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4926. }
  4927. }
  4928. createXY(json) {
  4929. this.ysJson = json.content;
  4930. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4931. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4932. this.ui.xyNode.xy2.visible = true;
  4933. }
  4934. renderListItem(idx, cell) {
  4935. let xy = this.ysJson[idx];
  4936. cell.height = xy.line * 30;
  4937. cell.xyItem.text = xy.text;
  4938. }
  4939. onDestroy() {
  4940. this.agreeCall = null;
  4941. }
  4942. }
  4943. class SettingNode {
  4944. constructor(ui) {
  4945. this.showSetting = false;
  4946. this.openSound = true;
  4947. this.openShake = true;
  4948. this.ui = ui;
  4949. this.ui.soundBtn.onClick(this, this.switchSound);
  4950. this.ui.shakeBtn.onClick(this, this.switchShake);
  4951. this.ui.xyBtn.onClick(this, this.onXy);
  4952. this.ui.clickNode.onClick(this, this.changeSetting);
  4953. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4954. this.ui.xyBtn.visible = false;
  4955. this.ui.shakeBtn.visible = false;
  4956. }
  4957. changeSetting() {
  4958. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4959. this.showSetting = !this.showSetting;
  4960. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4961. }
  4962. switchSound() {
  4963. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4964. this.openSound = !this.openSound;
  4965. Moyu.onSetting(this.openSound, this.openShake);
  4966. xGame.soundMgr.onSetting(this.openSound);
  4967. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4968. }
  4969. switchShake() {
  4970. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4971. this.openShake = !this.openShake;
  4972. Moyu.onSetting(this.openSound, this.openShake);
  4973. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4974. }
  4975. onXy() {
  4976. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4977. MoyuMgr.showXy(1);
  4978. }
  4979. }
  4980. class ui_UILevelDisplay extends fgui.GComponent {
  4981. static createInstance() {
  4982. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4983. }
  4984. onConstruct() {
  4985. this.n9 = (this.getChild("n9"));
  4986. this.myNode = (this.getChild("myNode"));
  4987. this.closeNode = (this.getChild("closeNode"));
  4988. }
  4989. }
  4990. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4991. class ui_UILevelProp extends fgui.GComponent {
  4992. static createInstance() {
  4993. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4994. }
  4995. onConstruct() {
  4996. this.n16 = (this.getChild("n16"));
  4997. this.myNode = (this.getChild("myNode"));
  4998. this.closeBtn = (this.getChild("closeBtn"));
  4999. this.moneyNode = (this.getChild("moneyNode"));
  5000. this.t1 = this.getTransition("t1");
  5001. }
  5002. }
  5003. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  5004. class ui_ShowItem extends fgui.GComponent {
  5005. static createInstance() {
  5006. return (fgui.UIPackage.createObject("game", "ShowItem"));
  5007. }
  5008. onConstruct() {
  5009. this.myImg = (this.getChild("myImg"));
  5010. }
  5011. }
  5012. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5013. class ShowItem {
  5014. constructor() {
  5015. this.ui = ui_ShowItem.createInstance();
  5016. }
  5017. destroySelf() {
  5018. if (!this.ui.isDisposed) {
  5019. this.ui.removeFromParent();
  5020. this.ui.dispose();
  5021. }
  5022. }
  5023. setParent(parent) {
  5024. parent.addChild(this.ui);
  5025. }
  5026. setPos(x, y) {
  5027. this.ui.x = x;
  5028. this.ui.y = y;
  5029. }
  5030. setUrl(index) {
  5031. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5032. }
  5033. }
  5034. class ui_UIPower extends fgui.GComponent {
  5035. static createInstance() {
  5036. return (fgui.UIPackage.createObject("game", "UIPower"));
  5037. }
  5038. onConstruct() {
  5039. this.n11 = (this.getChild("n11"));
  5040. this.myNode = (this.getChild("myNode"));
  5041. this.t0 = this.getTransition("t0");
  5042. }
  5043. }
  5044. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5045. class UIPower extends UIBase {
  5046. constructor() {
  5047. super();
  5048. }
  5049. onConstructor() {
  5050. this.ui = ui_UIPower.createInstance();
  5051. this.contentPane = this.ui;
  5052. this.isEject = false;
  5053. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5054. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5055. }
  5056. show() {
  5057. super.show();
  5058. this.ui.t0.play();
  5059. this.setGlobalFont(this.ui);
  5060. }
  5061. videoGetPower() {
  5062. console.log('zh:qjff_AD_for_uipower');
  5063. if (Laya.Browser.onAndroid) {
  5064. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5065. if (!boo) {
  5066. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5067. return;
  5068. }
  5069. }
  5070. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5071. }
  5072. else {
  5073. console.log('zh:AD 失败,直接发放奖励');
  5074. this.qjff_AD_for_uipower();
  5075. }
  5076. }
  5077. qjff_AD_for_uipower() {
  5078. DataMgr.setPower(xGame.common.videoPower, true);
  5079. xGame.eventMgr.event(POWER_TIME);
  5080. this.hide();
  5081. }
  5082. }
  5083. UIPower.uiName = "UIPower";
  5084. class UILevelProp extends UIBase {
  5085. constructor() {
  5086. super();
  5087. this.firstPos = 385;
  5088. this.secondPos = 467;
  5089. this.showItemArr = [];
  5090. }
  5091. onConstructor() {
  5092. this.ui = ui_UILevelProp.createInstance();
  5093. this.contentPane = this.ui;
  5094. this.isEject = false;
  5095. this.addUIClick(this.ui.closeBtn, this.hideWin);
  5096. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5097. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5098. }
  5099. show(level) {
  5100. console.log('zh:show.');
  5101. super.show();
  5102. this.ui.t1.play();
  5103. this.level = level;
  5104. this.data = cfgTable.placeballData[this.level];
  5105. this.updateSelf();
  5106. this.showPreView();
  5107. this.moneyNode.ui.c1.selectedIndex = 2;
  5108. this.moneyNode.checkPowerTime();
  5109. this.moneyNode.powerChange();
  5110. this.setGlobalFont(this.ui);
  5111. }
  5112. showPreView() {
  5113. let item;
  5114. let data;
  5115. for (let index = 0; index < this.showItemArr.length; index++) {
  5116. item = this.showItemArr[index];
  5117. item.destroySelf();
  5118. }
  5119. this.showItemArr = [];
  5120. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5121. for (const key in cfgData) {
  5122. data = cfgData[key];
  5123. item = new ShowItem();
  5124. item.setParent(this.ui.myNode.displayRoot);
  5125. item.setPos(data.x, data.y);
  5126. item.setUrl(data.value);
  5127. this.showItemArr.push(item);
  5128. }
  5129. }
  5130. updateSelf() {
  5131. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5132. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5133. if (this.data.ball == -1) {
  5134. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5135. }
  5136. else {
  5137. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5138. }
  5139. let localData = DataMgr.getPlaceBallLevel(this.level);
  5140. let getAward = localData.getAward;
  5141. let cfg = cfgTable.placeballData[this.level];
  5142. let coin = this.data.award[0];
  5143. let diamond = this.data.award[1];
  5144. if (cfg.type == PlaceBallType.challenge) {
  5145. diamond = 0;
  5146. coin = 100;
  5147. }
  5148. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5149. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5150. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5151. if (cfg.type == PlaceBallType.challenge) {
  5152. this.ui.myNode.coinNode.numTxt.text = "";
  5153. }
  5154. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5155. if (coin > 0 && diamond > 0) {
  5156. this.ui.myNode.diamondNode.x = 385;
  5157. this.ui.myNode.coinNode.x = 467;
  5158. }
  5159. else {
  5160. this.ui.myNode.diamondNode.x = 385;
  5161. this.ui.myNode.coinNode.x = 385;
  5162. }
  5163. if (!getAward) {
  5164. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5165. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5166. }
  5167. else {
  5168. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5169. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5170. }
  5171. }
  5172. startGame() {
  5173. console.log("zh:startGame");
  5174. if (DataMgr.powerEnough()) {
  5175. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5176. this.ui.myNode.startBtn.touchable = false;
  5177. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5178. console.log('zh:startGame dh ');
  5179. this.ui.myNode.startBtn.touchable = true;
  5180. DataMgr.setPower(-1);
  5181. xGame.eventMgr.event(POWER_TIME);
  5182. xGame.common.gameMode = GameMode.placeBall;
  5183. xGame.common.placeBallCurLevel = this.level;
  5184. xGame.uiMgr.Show(UIGame);
  5185. xGame.uiMgr.Hide(UILevelDisplay);
  5186. xGame.uiMgr.Hide(UIMain);
  5187. this.logEventForChallenge_level_start(this.level);
  5188. this.hideWin();
  5189. }));
  5190. console.log('zh:eeeee');
  5191. }
  5192. else {
  5193. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5194. xGame.uiMgr.Show(UIPower);
  5195. }
  5196. }
  5197. logEventForChallenge_level_start(level) {
  5198. let keyStr = 'sjmd_challenge_level_start';
  5199. let jsonStr = {
  5200. "count": 1,
  5201. "gold_balance ": DataMgr.getCoin(),
  5202. "level": level,
  5203. "diamond_balance ": DataMgr.getDiamond()
  5204. };
  5205. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5206. const d = LocalStorageManager.getItem(keyStr);
  5207. if (level > d.level) {
  5208. jsonStr.count = d.count + 1;
  5209. LocalStorageManager.setItem(keyStr, jsonStr);
  5210. }
  5211. else {
  5212. }
  5213. }
  5214. else {
  5215. LocalStorageManager.setItem(keyStr, jsonStr);
  5216. }
  5217. const reqStr = JSON.stringify(jsonStr);
  5218. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5219. }
  5220. hideWin() {
  5221. super.hide();
  5222. if (this.ui.myNode.startBtn) {
  5223. this.ui.myNode.startBtn.touchable = true;
  5224. if (this.ui.myNode.startBtn.powerEft.t0) {
  5225. this.ui.myNode.startBtn.powerEft.t0.stop();
  5226. }
  5227. }
  5228. }
  5229. }
  5230. UILevelProp.uiName = "UILevelProp";
  5231. class PutBallLevelDisplay {
  5232. constructor(ui, index) {
  5233. this.index = 0;
  5234. this.ui = ui;
  5235. this.index = index;
  5236. this.ui.onClick(this, this.clickSelf);
  5237. this.updateSelf();
  5238. this.ui.levelTxt.text = (this.index + 1) + "";
  5239. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5240. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5241. }
  5242. updateSelf() {
  5243. let level = this.index + 1;
  5244. this.data = DataMgr.getPlaceBallLevel(level);
  5245. this.ui.starNode.c1.selectedIndex = this.data.star;
  5246. let isChallenge = cfgTable.placeballData[level].type;
  5247. if (this.data.isCur) {
  5248. if (isChallenge) {
  5249. this.ui.c1.selectedIndex = 5;
  5250. }
  5251. else {
  5252. this.ui.c1.selectedIndex = 2;
  5253. }
  5254. }
  5255. else {
  5256. if (this.data.play) {
  5257. if (this.data.star == 3) {
  5258. this.ui.c1.selectedIndex = 0;
  5259. }
  5260. else {
  5261. this.ui.c1.selectedIndex = 1;
  5262. }
  5263. }
  5264. else {
  5265. if (isChallenge) {
  5266. this.ui.c1.selectedIndex = 4;
  5267. }
  5268. else {
  5269. this.ui.c1.selectedIndex = 3;
  5270. }
  5271. }
  5272. }
  5273. }
  5274. clickSelf() {
  5275. if (!this.data.play)
  5276. return;
  5277. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5278. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5279. }
  5280. }
  5281. class UILevelDisplay extends UIBase {
  5282. constructor() {
  5283. super();
  5284. }
  5285. onConstructor() {
  5286. this.ui = ui_UILevelDisplay.createInstance();
  5287. this.contentPane = this.ui;
  5288. this.isEject = false;
  5289. this.myList = this.ui.myNode.myList;
  5290. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5291. this.levelItemArr = [];
  5292. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5293. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5294. this.myList.numItems = levelNum;
  5295. }
  5296. levelItemRender(index, target) {
  5297. let item = new PutBallLevelDisplay(target, index);
  5298. this.levelItemArr.push(item);
  5299. }
  5300. show() {
  5301. super.show();
  5302. this.updateLevel();
  5303. this.scrollToPlace();
  5304. this.setGlobalFont(this.ui);
  5305. }
  5306. updateLevel() {
  5307. let temp;
  5308. for (let index = 0; index < this.levelItemArr.length; index++) {
  5309. temp = this.levelItemArr[index];
  5310. temp.updateSelf();
  5311. }
  5312. }
  5313. scrollToPlace() {
  5314. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5315. let passArr = DataMgr.getPlaceBallLevelList();
  5316. let offest = passArr.length;
  5317. if (offest >= maxNum - 1)
  5318. offest = maxNum - 1;
  5319. this.myList.scrollToView(offest, true, true);
  5320. }
  5321. hide() {
  5322. super.hide();
  5323. }
  5324. }
  5325. UILevelDisplay.uiName = "UILevelDisplay";
  5326. class ui_UIMatching extends fgui.GComponent {
  5327. static createInstance() {
  5328. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5329. }
  5330. onConstruct() {
  5331. this.n5 = (this.getChild("n5"));
  5332. this.n49 = (this.getChild("n49"));
  5333. this.n51 = (this.getChild("n51"));
  5334. this.n64 = (this.getChild("n64"));
  5335. this.n2 = (this.getChild("n2"));
  5336. this.n53 = (this.getChild("n53"));
  5337. this.n54 = (this.getChild("n54"));
  5338. this.n56 = (this.getChild("n56"));
  5339. this.n58 = (this.getChild("n58"));
  5340. this.n59 = (this.getChild("n59"));
  5341. this.n57 = (this.getChild("n57"));
  5342. this.n60 = (this.getChild("n60"));
  5343. this.n62 = (this.getChild("n62"));
  5344. this.awardTxt = (this.getChild("awardTxt"));
  5345. this.n61 = (this.getChild("n61"));
  5346. this.selfHead = (this.getChild("selfHead"));
  5347. this.aiHead = (this.getChild("aiHead"));
  5348. this.n82 = (this.getChild("n82"));
  5349. this.n84 = (this.getChild("n84"));
  5350. this.n83 = (this.getChild("n83"));
  5351. this.t1 = this.getTransition("t1");
  5352. this.t2 = this.getTransition("t2");
  5353. this.t3 = this.getTransition("t3");
  5354. this.t4 = this.getTransition("t4");
  5355. }
  5356. }
  5357. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5358. class UIMatching extends UIBase {
  5359. constructor() {
  5360. super();
  5361. }
  5362. onConstructor() {
  5363. this.ui = ui_UIMatching.createInstance();
  5364. this.contentPane = this.ui;
  5365. this.isEject = false;
  5366. }
  5367. show(callback) {
  5368. super.show();
  5369. PlatMgr.showBanner(true);
  5370. this.callback = callback;
  5371. let user = Moyu.getUserInfo();
  5372. if (!this.selfPot) {
  5373. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5374. }
  5375. if (!this.aiPot) {
  5376. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5377. }
  5378. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5379. this.ui.selfHead.nameTxt.text = user.nickName;
  5380. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5381. this.ui.aiHead.nameTxt.text = "???";
  5382. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5383. this.ui.selfHead.c1.selectedIndex = 0;
  5384. this.ui.aiHead.c1.selectedIndex = 0;
  5385. this.ui.selfHead.x = this.selfPot.x;
  5386. this.ui.selfHead.y = this.selfPot.y;
  5387. this.ui.aiHead.x = this.aiPot.x;
  5388. this.ui.aiHead.y = this.aiPot.y;
  5389. switch (xGame.common.gameMode) {
  5390. case GameMode.classic:
  5391. break;
  5392. case GameMode.bigMove:
  5393. this.initSkillData();
  5394. break;
  5395. default:
  5396. break;
  5397. }
  5398. this.ui.t1.play(Laya.Handler.create(this, () => {
  5399. this.ui.t2.play(Laya.Handler.create(this, () => {
  5400. switch (xGame.common.gameMode) {
  5401. case GameMode.classic:
  5402. this.waitingPeople();
  5403. break;
  5404. case GameMode.bigMove:
  5405. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5406. break;
  5407. default:
  5408. break;
  5409. }
  5410. }));
  5411. }));
  5412. this.setGlobalFont(this.ui);
  5413. }
  5414. initSkillData() {
  5415. this.skillSelectData = [];
  5416. let skillUrl = xGame.common.skillIconList;
  5417. let skillName = xGame.common.skillNameList;
  5418. let skillLevel = DataMgr.getBigSkillList();
  5419. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5420. for (let index = 0; index < 5; index++) {
  5421. let obj = {};
  5422. obj.skillImg = skillUrl[index];
  5423. obj.skillName = skillName[index];
  5424. obj.skillType = skillType[index];
  5425. obj.skillLevel = skillLevel[index];
  5426. this.skillSelectData.push(obj);
  5427. }
  5428. }
  5429. getAISkillLevel(myLevel) {
  5430. let video = xGame.common.upSkillLevel;
  5431. let aiLevel;
  5432. let temp;
  5433. if (video) {
  5434. temp = xGame.common.randomNum(-2, -1);
  5435. }
  5436. else {
  5437. if (myLevel <= 5) {
  5438. temp = xGame.common.randomNum(1, 3);
  5439. }
  5440. else if (myLevel <= 9) {
  5441. temp = xGame.common.randomNum(-2, 1);
  5442. }
  5443. else {
  5444. temp = xGame.common.randomNum(-4, 0);
  5445. }
  5446. }
  5447. aiLevel = temp + myLevel;
  5448. if (aiLevel <= 1)
  5449. aiLevel = 1;
  5450. if (aiLevel >= 10)
  5451. aiLevel = 10;
  5452. return aiLevel;
  5453. }
  5454. getAISkillType() {
  5455. return xGame.common.randomNum(1, 4);
  5456. let successTimes = DataMgr.getSkillSuccessTimes();
  5457. let info = cfgTable.aiskillData[successTimes];
  5458. if (!info) {
  5459. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5460. info = cfgTable.aiskillData[max];
  5461. }
  5462. let dataArr = info.skillselect;
  5463. let myCfg = {};
  5464. for (let index = 0; index < dataArr.length; index++) {
  5465. let temp = dataArr[index].split('-');
  5466. myCfg[temp[0]] = {};
  5467. myCfg[temp[0]].id = parseInt(temp[0]);
  5468. myCfg[temp[0]].weight = parseInt(temp[1]);
  5469. }
  5470. let aiCfg = xGame.common.initWeight(myCfg);
  5471. let curData = xGame.common.getRandomWeightData(aiCfg);
  5472. return parseInt(curData.id);
  5473. }
  5474. getAISkillData(index) {
  5475. let myLevel = this.skillSelectData[index].skillLevel;
  5476. let aiLevel = this.getAISkillLevel(myLevel);
  5477. let aiType = this.getAISkillType() - 1;
  5478. return { aiLevel, aiType } = { aiLevel, aiType };
  5479. }
  5480. skillSelectFinish(index) {
  5481. let aiInfo = this.getAISkillData(index);
  5482. xGame.common.gameMgr.selfCurSkill = index;
  5483. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5484. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5485. this.ui.selfHead.c1.selectedIndex = 1;
  5486. this.ui.aiHead.c1.selectedIndex = 1;
  5487. let myData = this.skillSelectData[index];
  5488. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5489. let guide = DataMgr.getSkillGuide();
  5490. if (guide == 0) {
  5491. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5492. }
  5493. else {
  5494. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5495. }
  5496. let aiData = this.skillSelectData[aiInfo.aiType];
  5497. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5498. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5499. this.waitingPeople();
  5500. }
  5501. waitingPeople() {
  5502. let time = xGame.common.randomNum(1000, 3000);
  5503. time += 1000;
  5504. Laya.timer.once(time, this, () => {
  5505. this.matchingSuccess();
  5506. });
  5507. }
  5508. matchingSuccess() {
  5509. let gameUI = xGame.common.gameUI;
  5510. let name = gameUI.ui.topNode.aiNameTxt.text;
  5511. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5512. this.ui.aiHead.nameTxt.text = name;
  5513. this.ui.aiHead.headImg.url = url;
  5514. name = gameUI.ui.topNode.selfNameTxt.text;
  5515. url = gameUI.ui.topNode.selfHeadLoader.url;
  5516. this.ui.selfHead.nameTxt.text = name;
  5517. this.ui.selfHead.headImg.url = url;
  5518. this.ui.t3.play(Laya.Handler.create(this, () => {
  5519. this.callback && this.callback();
  5520. this.ui.t4.play(Laya.Handler.create(this, () => {
  5521. this.destroySelf();
  5522. }));
  5523. }));
  5524. }
  5525. destroySelf() {
  5526. this.callback = null;
  5527. this.skillSelectData = null;
  5528. this.selfPot = null;
  5529. this.aiPot = null;
  5530. if (!this.ui.isDisposed) {
  5531. this.ui.removeFromParent();
  5532. this.ui.dispose();
  5533. }
  5534. xGame.uiMgr.destroyUI(this);
  5535. }
  5536. }
  5537. UIMatching.uiName = "UIMatching";
  5538. class ui_UIRanking extends fgui.GComponent {
  5539. static createInstance() {
  5540. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5541. }
  5542. onConstruct() {
  5543. this.n26 = (this.getChild("n26"));
  5544. this.myNode = (this.getChild("myNode"));
  5545. }
  5546. }
  5547. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5548. class UIRanking extends UIBase {
  5549. constructor() {
  5550. super();
  5551. this.showSelf = true;
  5552. this.rankType = 1;
  5553. this.rankList = [];
  5554. this.topX = 10;
  5555. this.myIndex = this.topX + 1;
  5556. this.myStar = 0;
  5557. }
  5558. onConstructor() {
  5559. this.ui = ui_UIRanking.createInstance();
  5560. this.contentPane = this.ui;
  5561. this.isEject = false;
  5562. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5563. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5564. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5565. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5566. this.ui.myNode.myList.setVirtual();
  5567. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5568. }
  5569. show() {
  5570. super.show();
  5571. this.getPaiHangBangDataFormJosnFile();
  5572. this.updateSelf();
  5573. let self = Moyu.getUserInfo();
  5574. if (!self.isAuth) {
  5575. Moyu.initUser(this, () => {
  5576. DataMgr.upRankData();
  5577. });
  5578. }
  5579. this.setGlobalFont(this.ui);
  5580. }
  5581. getPaiHangBangDataFormJosnFile() {
  5582. const rankingList = cfgTable.paiHangBangData.list;
  5583. this.updateItemData(rankingList);
  5584. }
  5585. updateSelfItem() {
  5586. console.log('zh:Moyu.platType =' + Moyu.platType);
  5587. let self = Moyu.getUserInfo();
  5588. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5589. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5590. if (this.myIndex > this.topX) {
  5591. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5592. }
  5593. else {
  5594. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5595. }
  5596. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5597. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5598. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5599. }
  5600. updateItemData(data) {
  5601. this.myStar = xGame.common.getAllStarNum();
  5602. if (this.rankList.length < 2) {
  5603. this.rankList = data;
  5604. let self = Moyu.getUserInfo();
  5605. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5606. self.headIcon = self.headIcon;
  5607. for (let i = 0; i < data.length; i++) {
  5608. let data = this.rankList[i];
  5609. if (data.userId == self.userId) {
  5610. this.rankList.splice(i, 1);
  5611. break;
  5612. }
  5613. }
  5614. for (let i = 0; i < data.length; i++) {
  5615. let data = this.rankList[i];
  5616. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5617. this.myIndex = i + 1;
  5618. let user = { headIcon: self.headIcon, nickName: "myself" };
  5619. let ud = { user: user, data: {} };
  5620. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5621. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5622. if (Moyu.platType < 11) {
  5623. user.headIcon = self.headIcon;
  5624. user.nickName = self.nickName;
  5625. }
  5626. this.rankList.splice(i, 0, md);
  5627. break;
  5628. }
  5629. }
  5630. }
  5631. this.updateSelfItem();
  5632. this.ui.myNode.myList.numItems = this.rankList.length;
  5633. }
  5634. updateItemUI(index, obj) {
  5635. let data = this.rankList[index];
  5636. let userData = JSON.parse(data.userData).user;
  5637. obj.nameTxt.text = userData.nickName.toString();
  5638. obj.valueTxt.text = data.rankScore;
  5639. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5640. obj.rankTxt.text = index + 1;
  5641. switch (index) {
  5642. case 0:
  5643. this.setImg(obj, 1, 0, 0);
  5644. obj.rankTxt.color = "#FFC047";
  5645. break;
  5646. case 1:
  5647. this.setImg(obj, 0, 1, 0);
  5648. obj.rankTxt.color = "#ACACAC";
  5649. break;
  5650. case 2:
  5651. this.setImg(obj, 0, 0, 1);
  5652. obj.rankTxt.color = "#D09672";
  5653. break;
  5654. default:
  5655. this.setImg(obj, 0, 0, 0);
  5656. obj.rankTxt.color = "#496FAB";
  5657. break;
  5658. }
  5659. }
  5660. setImg(obj, a, b, c) {
  5661. obj.img1.visible = a ? true : false;
  5662. obj.img2.visible = b ? true : false;
  5663. obj.img3.visible = c ? true : false;
  5664. }
  5665. changeList(type) {
  5666. this.rankType = type;
  5667. this.updateSelf();
  5668. }
  5669. changeSelfNode() {
  5670. this.showSelf = !this.showSelf;
  5671. this.updateSelf();
  5672. }
  5673. updateSelf() {
  5674. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5675. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5676. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5677. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5678. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5679. }
  5680. }
  5681. UIRanking.uiName = "UIRanking";
  5682. class ui_UISecretary extends fgui.GComponent {
  5683. static createInstance() {
  5684. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5685. }
  5686. onConstruct() {
  5687. this.n0 = (this.getChild("n0"));
  5688. this.myNode = (this.getChild("myNode"));
  5689. this.closeBtn = (this.getChild("closeBtn"));
  5690. this.t0 = this.getTransition("t0");
  5691. }
  5692. }
  5693. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5694. class UISecretary extends UIBase {
  5695. constructor() {
  5696. super();
  5697. this.curIndex = 1;
  5698. }
  5699. onConstructor() {
  5700. this.ui = ui_UISecretary.createInstance();
  5701. this.contentPane = this.ui;
  5702. this.isEject = false;
  5703. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5704. this.nodeObj = { left: null, right: null, cur: null };
  5705. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5706. }
  5707. show() {
  5708. super.show();
  5709. this.ui.t0.play();
  5710. this.updateData();
  5711. this.setGlobalFont(this.ui);
  5712. }
  5713. addSecretarySpine(node, spineName) {
  5714. if (spineName == "mishu") {
  5715. if (this.secretarySpine1) {
  5716. node.displayObject.destroyChildren();
  5717. this.playWoman(this.secretarySpine1, node.displayObject);
  5718. }
  5719. else {
  5720. let spine1 = new SpineMgr("mishu", () => {
  5721. this.secretarySpine1 = spine1;
  5722. this.playWoman(this.secretarySpine1, node.displayObject);
  5723. });
  5724. }
  5725. }
  5726. else {
  5727. if (this.secretarySpine2) {
  5728. node.displayObject.destroyChildren();
  5729. this.playWoman(this.secretarySpine2, node.displayObject);
  5730. }
  5731. else {
  5732. let spine2 = new SpineMgr("xiaomishu2", () => {
  5733. this.secretarySpine2 = spine2;
  5734. this.playWoman(this.secretarySpine2, node.displayObject);
  5735. });
  5736. }
  5737. }
  5738. }
  5739. playWoman(node, parent) {
  5740. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5741. let yy = this.ui.myNode.gameNode3.secretary.height;
  5742. let scale = 1.5;
  5743. if (node == this.secretarySpine2) {
  5744. scale = 1.2;
  5745. }
  5746. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5747. node.play(data, 0, true, parent);
  5748. }
  5749. turnLeft() {
  5750. this.curIndex--;
  5751. if (this.curIndex < 1) {
  5752. this.curIndex = 2;
  5753. }
  5754. let left = this.nodeObj.left;
  5755. let right = this.nodeObj.right;
  5756. let cur = this.nodeObj.cur;
  5757. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5758. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5759. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5760. this.updateData();
  5761. }));
  5762. this.ui.myNode.setChildIndex(right, 2);
  5763. this.nodeObj.left = cur;
  5764. this.nodeObj.right = left;
  5765. this.nodeObj.cur = right;
  5766. }
  5767. turnRight() {
  5768. this.curIndex++;
  5769. if (this.curIndex > 2) {
  5770. this.curIndex = 1;
  5771. }
  5772. let left = this.nodeObj.left;
  5773. let right = this.nodeObj.right;
  5774. let cur = this.nodeObj.cur;
  5775. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5776. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5777. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5778. this.updateData();
  5779. }));
  5780. this.ui.myNode.setChildIndex(left, 2);
  5781. this.nodeObj.left = right;
  5782. this.nodeObj.right = cur;
  5783. this.nodeObj.cur = left;
  5784. }
  5785. updateData() {
  5786. console.log('zh: updateData FFFFFFFFFF');
  5787. let data = cfgTable.secretaryshopData;
  5788. let children = this.ui.myNode._children;
  5789. let temp;
  5790. let curData;
  5791. for (let index = 0; index < children.length; index++) {
  5792. temp = children[index];
  5793. curData = data[1];
  5794. temp.heightTxt.text = curData.height;
  5795. temp.foodTxt.text = curData.food;
  5796. temp.historyTxt.text = curData.history;
  5797. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5798. this.addSecretarySpine(temp.secretary, curData.spine);
  5799. let womanIndex = curData.id - 1;
  5800. let getWoman = DataMgr.getSecretary(womanIndex);
  5801. let curUse = DataMgr.getCurSecretary();
  5802. if (getWoman) {
  5803. if (curUse == womanIndex) {
  5804. temp.purchaseBtn.c1.selectedIndex = 1;
  5805. }
  5806. else {
  5807. temp.purchaseBtn.c1.selectedIndex = 2;
  5808. }
  5809. }
  5810. else {
  5811. temp.purchaseBtn.c1.selectedIndex = 0;
  5812. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5813. }
  5814. temp.purchaseBtn.visible = false;
  5815. }
  5816. }
  5817. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5818. console.log('zh: 点击了clickSecretary ');
  5819. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5820. if (getWoman) {
  5821. if (curUse != womanIndex) {
  5822. console.log();
  5823. DataMgr.setCurSecretary(womanIndex);
  5824. this.updateData();
  5825. }
  5826. }
  5827. else {
  5828. console.log('zh:点击购买了');
  5829. let need = needDiamond;
  5830. if (DataMgr.diamondEnough(need)) {
  5831. DataMgr.setDiamond(-need);
  5832. DataMgr.setSecretary(womanIndex, 1);
  5833. DataMgr.setCurSecretary(womanIndex);
  5834. this.updateData();
  5835. }
  5836. else {
  5837. xGame.uiMgr.Show(UIAddProp, 1);
  5838. }
  5839. }
  5840. }
  5841. closeSelf() {
  5842. this.hide();
  5843. }
  5844. }
  5845. UISecretary.uiName = "UISecretary";
  5846. class ui_UIShop extends fgui.GComponent {
  5847. static createInstance() {
  5848. return (fgui.UIPackage.createObject("game", "UIShop"));
  5849. }
  5850. onConstruct() {
  5851. this.n48 = (this.getChild("n48"));
  5852. this.n0 = (this.getChild("n0"));
  5853. this.secretary = (this.getChild("secretary"));
  5854. this.talkNode = (this.getChild("talkNode"));
  5855. this.closeNode = (this.getChild("closeNode"));
  5856. this.moneyNode = (this.getChild("moneyNode"));
  5857. this.myNode = (this.getChild("myNode"));
  5858. }
  5859. }
  5860. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5861. class ui_UIMsg extends fgui.GComponent {
  5862. static createInstance() {
  5863. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5864. }
  5865. onConstruct() {
  5866. this.tipsNode = (this.getChild("tipsNode"));
  5867. }
  5868. }
  5869. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5870. class UIMsg extends UIBase {
  5871. constructor() {
  5872. super();
  5873. }
  5874. onConstructor() {
  5875. this.ui = ui_UIMsg.createInstance();
  5876. this.contentPane = this.ui;
  5877. this.isEject = false;
  5878. this.isMuti = true;
  5879. }
  5880. show(msg, callback) {
  5881. super.show();
  5882. this.ui.tipsNode.msgTxt.text = msg;
  5883. this.ui.alpha = 1;
  5884. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5885. this.hide();
  5886. callback && callback();
  5887. }), 1000);
  5888. this.setGlobalFont(this.ui);
  5889. }
  5890. }
  5891. UIMsg.uiName = "UIMsg";
  5892. class BallRodDisplay {
  5893. constructor(ui, index) {
  5894. this.index = 0;
  5895. this.uiIndex = 0;
  5896. this.ui = ui;
  5897. this.index = index;
  5898. this.initData();
  5899. }
  5900. initData() {
  5901. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5902. let data = cfgTable.ballrodData[this.index + 1];
  5903. this.ui.nameTxt.text = data.name;
  5904. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5905. this.ui.levelNode.c1.selectedIndex = data.quality;
  5906. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5907. if (data.spine) {
  5908. this.mySpine = new SpineMgr(data.spine, () => {
  5909. let xx = 150;
  5910. let yy = 70;
  5911. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5912. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5913. });
  5914. }
  5915. }
  5916. updateSelf() {
  5917. let get = DataMgr.getBallRod(this.index);
  5918. if (get == null)
  5919. get = 1;
  5920. let curUse = DataMgr.getCurBallRod();
  5921. if (get) {
  5922. if (curUse == this.index) {
  5923. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5924. }
  5925. else {
  5926. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5927. }
  5928. }
  5929. else {
  5930. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5931. }
  5932. }
  5933. buyBallRod() {
  5934. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5935. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5936. switch (selectedIndex) {
  5937. case 0:
  5938. break;
  5939. case 1:
  5940. console.log('zh:点击了 USE THIS');
  5941. DataMgr.setCurBallRod(this.index);
  5942. let curUse = DataMgr.getCurBallRod();
  5943. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5944. let ui = xGame.uiMgr.getUI(UIShop);
  5945. ui.updateBallRod();
  5946. break;
  5947. case 2:
  5948. let data = cfgTable.ballrodData[this.index + 1];
  5949. let need = data.price;
  5950. if (DataMgr.diamondEnough(need)) {
  5951. this.buyQiuGan(data);
  5952. DataMgr.setDiamond(-need);
  5953. DataMgr.setBallRod(this.index, 1);
  5954. DataMgr.setCurBallRod(this.index);
  5955. let ui = xGame.uiMgr.getUI(UIShop);
  5956. ui.updateBallRod();
  5957. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5958. }
  5959. else {
  5960. xGame.uiMgr.Show(UIAddProp, 1);
  5961. }
  5962. break;
  5963. default:
  5964. break;
  5965. }
  5966. }
  5967. buyQiuGan(qgItem) {
  5968. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5969. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5970. if (userInfo == null) {
  5971. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5972. return;
  5973. }
  5974. let reqData = xGame.httpMgr.getReqData();
  5975. let pd = JSON.parse(reqData);
  5976. pd.qiuGanData = qgItem;
  5977. reqData = JSON.stringify(pd);
  5978. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5979. try {
  5980. console.log('zh:buySp res = ' + JSON.stringify(res));
  5981. let code = res.code;
  5982. let msg = res.msg;
  5983. if (code == 401) {
  5984. Laya.LocalStorage.removeItem(keyForLoginInfo);
  5985. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  5986. return;
  5987. }
  5988. if (code == 200) {
  5989. xGame.uiMgr.Show(UIMsg, msg);
  5990. DataMgr.getUserZiChanInfo(false);
  5991. }
  5992. else {
  5993. xGame.uiMgr.Show(UIMsg, msg);
  5994. }
  5995. }
  5996. catch (error) {
  5997. console.log('error=' + error);
  5998. alert(error);
  5999. }
  6000. finally {
  6001. }
  6002. });
  6003. }
  6004. logEventForGouMaiGan(qiuGanName) {
  6005. const ev = {
  6006. value: qiuGanName
  6007. };
  6008. const jsonStr = JSON.stringify(ev);
  6009. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  6010. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  6011. }
  6012. }
  6013. class DaoJuDisplay {
  6014. constructor(ui, index) {
  6015. this.index = 0;
  6016. this.uiIndex = 0;
  6017. this.ggSpid = "";
  6018. this.spid = 0;
  6019. this.ui = ui;
  6020. this.index = index;
  6021. this.initData();
  6022. }
  6023. initData() {
  6024. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6025. let data = cfgTable.daoJuData[this.index + 1];
  6026. this.ui.nameTxt.text = data.spbt;
  6027. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6028. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6029. this.ggSpid = data.ggSpid;
  6030. this.spid = data.spid;
  6031. let baseUrl = "asset/sound/ogg/";
  6032. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6033. }
  6034. gotoBuy() {
  6035. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6036. if (userInfo != null) {
  6037. let token = userInfo.token;
  6038. let ggSpid = this.ggSpid;
  6039. let spid = this.spid;
  6040. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6041. console.log('zh:gotoBuy1 spid =' + spid);
  6042. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6043. return;
  6044. }
  6045. else {
  6046. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6047. }
  6048. }
  6049. gotoBuy1() {
  6050. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6051. let djItem = cfgTable.daoJuData[this.index + 1];
  6052. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6053. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6054. if (userInfo == null) {
  6055. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6056. return;
  6057. }
  6058. let reqData = xGame.httpMgr.getReqData();
  6059. let pd = JSON.parse(reqData);
  6060. pd.spItem = djItem;
  6061. reqData = JSON.stringify(pd);
  6062. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6063. try {
  6064. console.log('zh:buySp res = ' + JSON.stringify(res));
  6065. let code = res.code;
  6066. let msg = res.msg;
  6067. if (code == 401) {
  6068. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6069. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6070. return;
  6071. }
  6072. if (code == 200) {
  6073. xGame.uiMgr.Show(UIMsg, msg);
  6074. DataMgr.getUserZiChanInfo(false);
  6075. }
  6076. else {
  6077. xGame.uiMgr.Show(UIMsg, msg);
  6078. }
  6079. }
  6080. catch (error) {
  6081. console.log('error=' + error);
  6082. alert(error);
  6083. }
  6084. finally {
  6085. }
  6086. });
  6087. }
  6088. }
  6089. class UIShop extends UIBase {
  6090. constructor() {
  6091. super();
  6092. this.itemNums = 0;
  6093. this.itemNumsForDj = 0;
  6094. this.curType = "";
  6095. }
  6096. onConstructor() {
  6097. this.ui = ui_UIShop.createInstance();
  6098. this.contentPane = this.ui;
  6099. this.isEject = false;
  6100. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6101. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6102. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6103. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6104. this.addUIClick(this.ui, this.interuptSecretary);
  6105. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6106. this.ballRodArr = [];
  6107. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6108. this.ui.myNode.myList.numItems = this.itemNums;
  6109. this.loadDjdata_old();
  6110. }
  6111. loadDjdata_old() {
  6112. let fff = cfgTable.daoJuData;
  6113. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6114. this.daoJuArr = [];
  6115. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6116. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6117. }
  6118. getProductList() {
  6119. let reqData = xGame.httpMgr.getReqData();
  6120. let pd = JSON.parse(reqData);
  6121. pd.splx = "Consumable";
  6122. reqData = JSON.stringify(pd);
  6123. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6124. try {
  6125. let code = res.code;
  6126. let msg = res.msg;
  6127. if (code == 401) {
  6128. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6129. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6130. return;
  6131. }
  6132. if (code == 200) {
  6133. let data = res.data;
  6134. for (let index = 0; index < data.length; index++) {
  6135. let element = data[index];
  6136. cfgTable.daoJuData[element.spid] = element;
  6137. }
  6138. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6139. }
  6140. else {
  6141. xGame.uiMgr.Show(UIMsg, msg);
  6142. }
  6143. }
  6144. catch (error) {
  6145. console.log('error=' + error);
  6146. alert(error);
  6147. }
  6148. finally {
  6149. }
  6150. });
  6151. }
  6152. show(type) {
  6153. super.show();
  6154. this.curType = type == 0 ? "qiugan" : "daoju";
  6155. this.switchBtn("");
  6156. this.playSecretaryIdle();
  6157. this.updateBallRod();
  6158. this.setGlobalFont(this.ui);
  6159. }
  6160. test123() {
  6161. console.log('zh:test123 ');
  6162. }
  6163. switchBtn(type) {
  6164. console.log('zh:1111切換 sel type=' + type);
  6165. if (type == "") {
  6166. type = this.curType;
  6167. }
  6168. else {
  6169. if (this.curType == type) {
  6170. return;
  6171. }
  6172. else {
  6173. this.curType = type;
  6174. }
  6175. }
  6176. if (type == "qiugan") {
  6177. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6178. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6179. this.ui.myNode.c1.selectedIndex = 0;
  6180. this.ui.myNode.myList.visible = true;
  6181. this.ui.myNode.djList.visible = false;
  6182. }
  6183. else {
  6184. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6185. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6186. this.ui.myNode.c1.selectedIndex = 1;
  6187. this.ui.myNode.myList.visible = false;
  6188. this.ui.myNode.djList.visible = true;
  6189. }
  6190. }
  6191. updateBallRod() {
  6192. for (let index = 0; index < this.ballRodArr.length; index++) {
  6193. this.ballRodArr[index].updateSelf();
  6194. }
  6195. }
  6196. renderBallRod(sort, obj) {
  6197. let index = this.getIndexBySort(sort + 1) - 1;
  6198. let ballRod = new BallRodDisplay(obj, index);
  6199. this.ballRodArr.push(ballRod);
  6200. }
  6201. renderDaoJu(idx, obj) {
  6202. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6203. let b = new DaoJuDisplay(obj, index);
  6204. this.daoJuArr.push(b);
  6205. }
  6206. getIndexBySort(sort) {
  6207. let object = cfgTable.ballrodData;
  6208. for (const key in object) {
  6209. if (object[key].sort == sort) {
  6210. return parseInt(key);
  6211. }
  6212. }
  6213. }
  6214. getIndexBySortForDj(idx) {
  6215. let object = cfgTable.daoJuData;
  6216. for (const key in object) {
  6217. if (object[key].idx == idx) {
  6218. return parseInt(key);
  6219. }
  6220. }
  6221. }
  6222. playSecretaryIdle() {
  6223. let parent = this.ui.secretary.displayObject;
  6224. parent.destroyChildren();
  6225. let xx = this.ui.secretary.width / 2;
  6226. let yy = this.ui.secretary.height;
  6227. let scale = xGame.common.getSecretaryScale();
  6228. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6229. xGame.common.secretary.play(data, 0, true, parent);
  6230. }
  6231. interuptSecretary() {
  6232. Laya.timer.clearAll(this);
  6233. this.playSecretaryRandomSound();
  6234. }
  6235. playSecretaryRandomSound() {
  6236. if (this.isHide)
  6237. return;
  6238. let time = xGame.common.randomNum(45000, 60000);
  6239. Laya.timer.once(time, this, () => {
  6240. if (this.isHide)
  6241. return;
  6242. let index = xGame.common.randomNum(4, 7);
  6243. xGame.soundMgr.playSound("s_main0" + index);
  6244. let words = 1;
  6245. switch (index) {
  6246. case 4:
  6247. words = 5;
  6248. break;
  6249. case 5:
  6250. words = 3;
  6251. break;
  6252. case 6:
  6253. words = 6;
  6254. break;
  6255. case 7:
  6256. words = 7;
  6257. break;
  6258. default:
  6259. break;
  6260. }
  6261. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6262. this.playSecretaryRandomSound();
  6263. });
  6264. }
  6265. closeSelf() {
  6266. this.hide();
  6267. }
  6268. }
  6269. UIShop.uiName = "UIShop";
  6270. class ui_UISign extends fgui.GComponent {
  6271. static createInstance() {
  6272. return (fgui.UIPackage.createObject("game", "UISign"));
  6273. }
  6274. onConstruct() {
  6275. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6276. this.n6 = (this.getChild("n6"));
  6277. this.closeNode = (this.getChild("closeNode"));
  6278. this.myNode = (this.getChild("myNode"));
  6279. this.moneyNode = (this.getChild("moneyNode"));
  6280. this.secretary = (this.getChild("secretary"));
  6281. this.talkNode = (this.getChild("talkNode"));
  6282. this.tripleBtn = (this.getChild("tripleBtn"));
  6283. this.normalBtn = (this.getChild("normalBtn"));
  6284. this.tipsNode = (this.getChild("tipsNode"));
  6285. this.againBtn = (this.getChild("againBtn"));
  6286. this.t0 = this.getTransition("t0");
  6287. }
  6288. }
  6289. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6290. class SignMax {
  6291. constructor(ui) {
  6292. this.ui = ui;
  6293. }
  6294. updateSelf(index, sameDay, curDayIndex) {
  6295. let data = cfgTable.signData[index + 1];
  6296. this.ui.titleTxt.text = data.title;
  6297. let arr1 = data.award[0].split('-');
  6298. let arr2 = data.award[1].split('-');
  6299. let num1 = parseInt(arr1[1]);
  6300. let num2 = parseInt(arr2[1]);
  6301. this.ui.numTxt1.text = num1 + "";
  6302. this.ui.numTxt2.text = num2 + "";
  6303. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6304. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6305. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6306. this.ui.numTxt1.visible = false;
  6307. }
  6308. else {
  6309. this.ui.numTxt1.visible = true;
  6310. }
  6311. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6312. this.ui.numTxt2.visible = false;
  6313. }
  6314. else {
  6315. this.ui.numTxt2.visible = true;
  6316. }
  6317. if (index < curDayIndex) {
  6318. this.ui.c1.selectedIndex = 1;
  6319. }
  6320. else if (index == curDayIndex) {
  6321. if (sameDay) {
  6322. this.ui.c1.selectedIndex = 2;
  6323. }
  6324. else {
  6325. this.ui.c1.selectedIndex = 2;
  6326. }
  6327. }
  6328. else {
  6329. this.ui.c1.selectedIndex = 0;
  6330. }
  6331. }
  6332. }
  6333. class SignNormal {
  6334. constructor(ui) {
  6335. this.ui = ui;
  6336. }
  6337. updateSelf(index, sameDay, curDayIndex) {
  6338. let data = cfgTable.signData[index + 1];
  6339. this.ui.titleTxt.text = data.title;
  6340. let arr = data.award[0].split('-');
  6341. let type = parseInt(arr[0]);
  6342. let num = parseInt(arr[1]);
  6343. this.ui.numTxt.text = num + "";
  6344. if (type > 2) {
  6345. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6346. this.ui.myIcon.rotation = 0;
  6347. }
  6348. else {
  6349. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6350. this.ui.myIcon.rotation = 0;
  6351. }
  6352. if (xGame.common.signAwardContainsRod(data.award)) {
  6353. this.ui.numTxt.visible = false;
  6354. }
  6355. else {
  6356. this.ui.numTxt.visible = true;
  6357. }
  6358. if (index < curDayIndex) {
  6359. this.ui.c1.selectedIndex = 1;
  6360. }
  6361. else if (index == curDayIndex) {
  6362. if (sameDay) {
  6363. this.ui.c1.selectedIndex = 2;
  6364. }
  6365. else {
  6366. this.ui.c1.selectedIndex = 2;
  6367. }
  6368. }
  6369. else {
  6370. this.ui.c1.selectedIndex = 0;
  6371. }
  6372. }
  6373. }
  6374. class UISign extends UIBase {
  6375. constructor() {
  6376. super();
  6377. this.curDayIndex = 0;
  6378. this.starX = 0;
  6379. }
  6380. onConstructor() {
  6381. this.ui = ui_UISign.createInstance();
  6382. this.contentPane = this.ui;
  6383. this.isEject = false;
  6384. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6385. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6386. this.initSignItem();
  6387. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6388. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6389. }
  6390. show() {
  6391. super.show();
  6392. this.ui.t0.play();
  6393. this.playSecretaryIdle();
  6394. this.updateSign();
  6395. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6396. this.setGlobalFont(this.ui);
  6397. }
  6398. initSignItem() {
  6399. this.signArr = [];
  6400. for (let index = 0; index < 6; index++) {
  6401. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6402. this.signArr.push(temp);
  6403. }
  6404. this.signMax = new SignMax(this.ui.myNode.day7);
  6405. if (Moyu.isKs)
  6406. this.ui.closeNode.closeBtn.x += 100;
  6407. }
  6408. updateSign() {
  6409. let sameDay = xGame.common.judgeSameDay();
  6410. let max = 7;
  6411. this.curDayIndex = DataMgr.getSignData();
  6412. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6413. this.curDayIndex = 0;
  6414. if (!sameDay) {
  6415. this.ui.normalBtn.visible = true;
  6416. this.ui.tipsNode.visible = false;
  6417. this.ui.againBtn.visible = false;
  6418. }
  6419. else {
  6420. this.ui.normalBtn.visible = false;
  6421. let again = DataMgr.getExtraSign();
  6422. let isCurrency = false;
  6423. let index = this.curDayIndex;
  6424. if (index == 0)
  6425. index = 7;
  6426. let award = cfgTable.signData[index].award;
  6427. let num = award[0].split("-")[0];
  6428. if (num == "1" || num == "2")
  6429. isCurrency = true;
  6430. let showAgain = again == 0 && isCurrency;
  6431. this.ui.againBtn.visible = showAgain;
  6432. this.ui.tipsNode.visible = !showAgain;
  6433. }
  6434. for (let index = 0; index < this.signArr.length; index++) {
  6435. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6436. }
  6437. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6438. }
  6439. playSecretaryIdle() {
  6440. let parent = this.ui.secretary.displayObject;
  6441. parent.destroyChildren();
  6442. let xx = this.ui.secretary.width / 2;
  6443. let yy = this.ui.secretary.height;
  6444. let scale = xGame.common.getSecretaryScale();
  6445. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6446. xGame.common.secretary.play(data, 0, true, parent);
  6447. }
  6448. closeSelf() {
  6449. this.hide();
  6450. }
  6451. normalGetAward() {
  6452. let sameDay = xGame.common.judgeSameDay();
  6453. if (!sameDay) {
  6454. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6455. let temp;
  6456. let type;
  6457. let num;
  6458. let arr = [];
  6459. for (let index = 0; index < award.length; index++) {
  6460. temp = award[index].split("-");
  6461. type = parseInt(temp[0]);
  6462. num = parseInt(temp[1]);
  6463. let awardType = new AwardType();
  6464. awardType.num = num;
  6465. awardType.type = type;
  6466. arr.push(awardType);
  6467. }
  6468. xGame.common.getAward(arr, (watchVideo) => {
  6469. this.curDayIndex++;
  6470. if (this.curDayIndex > 7)
  6471. this.curDayIndex = 0;
  6472. DataMgr.setSignData(this.curDayIndex);
  6473. this.updateSignData2Server(this.curDayIndex);
  6474. DataMgr.setSignTime(new Date().getTime());
  6475. if (watchVideo) {
  6476. DataMgr.setExtraSign(1);
  6477. Moyu.sendDataEvent("signIn1");
  6478. }
  6479. this.updateSign();
  6480. });
  6481. }
  6482. }
  6483. againGetAward() {
  6484. Moyu.sendDataEvent("signIn2");
  6485. console.log('zh:qjff_AD_for_uisign');
  6486. if (Laya.Browser.onAndroid) {
  6487. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6488. if (!boo) {
  6489. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6490. return;
  6491. }
  6492. }
  6493. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6494. }
  6495. else {
  6496. console.log('zh:AD 失败,直接发放奖励');
  6497. this.qjff_AD_for_uisign();
  6498. }
  6499. }
  6500. qjff_AD_for_uisign() {
  6501. let index = this.curDayIndex;
  6502. if (index == 0)
  6503. index = 7;
  6504. let award = cfgTable.signData[index].award;
  6505. let temp;
  6506. let type;
  6507. let num;
  6508. for (let index = 0; index < award.length; index++) {
  6509. temp = award[index].split("-");
  6510. type = parseInt(temp[0]);
  6511. num = parseInt(temp[1]) * 3;
  6512. xGame.common.playObjFlyAnim(num, type);
  6513. }
  6514. DataMgr.setExtraSign(1);
  6515. this.updateSign();
  6516. }
  6517. updateSignData2Server(day) {
  6518. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6519. if (userInfo == null) {
  6520. return;
  6521. }
  6522. let reqData = xGame.httpMgr.getReqData();
  6523. let pd = JSON.parse(reqData);
  6524. pd.signData = day;
  6525. reqData = JSON.stringify(pd);
  6526. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6527. try {
  6528. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6529. let code = res.code;
  6530. let msg = res.msg;
  6531. if (code == 401) {
  6532. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6533. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6534. return;
  6535. }
  6536. if (code == 200) {
  6537. let data = res.data;
  6538. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6539. }
  6540. else {
  6541. xGame.uiMgr.Show(UIMsg, msg);
  6542. }
  6543. }
  6544. catch (error) {
  6545. console.log('error=' + error);
  6546. alert(error);
  6547. }
  6548. finally {
  6549. }
  6550. });
  6551. }
  6552. }
  6553. UISign.uiName = "UISign";
  6554. class ui_UISkill extends fgui.GComponent {
  6555. static createInstance() {
  6556. return (fgui.UIPackage.createObject("game", "UISkill"));
  6557. }
  6558. onConstruct() {
  6559. this.n48 = (this.getChild("n48"));
  6560. this.n0 = (this.getChild("n0"));
  6561. this.secretary = (this.getChild("secretary"));
  6562. this.talkNode = (this.getChild("talkNode"));
  6563. this.closeNode = (this.getChild("closeNode"));
  6564. this.moneyNode = (this.getChild("moneyNode"));
  6565. this.skillNode = (this.getChild("skillNode"));
  6566. this.guideNode = (this.getChild("guideNode"));
  6567. }
  6568. }
  6569. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6570. class SkillDisplay {
  6571. constructor(ui, data, uiIndex) {
  6572. this.starX = 0;
  6573. this.starY = 0;
  6574. this.index = 0;
  6575. this.ui = ui;
  6576. this.data = data;
  6577. this.index = uiIndex;
  6578. this.initSelf();
  6579. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6580. }
  6581. initSelf() {
  6582. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6583. this.ui.nameTxt.text = this.data.name;
  6584. this.ui.describeTxt.text = this.data.describe;
  6585. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6586. this.ui.startBtn.onClick(this, this.startGame);
  6587. this.updateSelf();
  6588. }
  6589. updateSelf() {
  6590. this.checkTry();
  6591. let level = DataMgr.getBigSkillByIndex(this.index);
  6592. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6593. }
  6594. checkTry() {
  6595. let index = this.index;
  6596. let level = DataMgr.getBigSkillByIndex(index);
  6597. if (level == null) {
  6598. DataMgr.setBigSkill(index, 1, false);
  6599. level = 1;
  6600. }
  6601. this.ui.levelTxt.text = "LV." + level;
  6602. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6603. this.ui.tryNode.visible = true;
  6604. else
  6605. this.ui.tryNode.visible = false;
  6606. }
  6607. clickAddLevel() {
  6608. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6609. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6610. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6611. if (Laya.Browser.onAndroid) {
  6612. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6613. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6614. }
  6615. else {
  6616. console.log('zh:AD 失败,直接发放奖励');
  6617. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6618. }
  6619. }
  6620. else {
  6621. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6622. }
  6623. }
  6624. qjff_AD_for_skilldisplay_clickAddLevel() {
  6625. DataMgr.setBigSkill(this.data.index, 1);
  6626. this.updateSelf();
  6627. xGame.common.upSkillLevel = true;
  6628. }
  6629. startGame() {
  6630. console.log('zh:rod skill startgame');
  6631. if (this.data.index == 3) {
  6632. alert('Coming soon!');
  6633. return;
  6634. }
  6635. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6636. let needCoin = xGame.common.bigMoveNeedCoin;
  6637. xGame.common.passAwardCoin = 2000;
  6638. let guide = DataMgr.getSkillGuide();
  6639. console.log('zh:startGame guide=' + guide);
  6640. xGame.common.temSelfLevel = 0;
  6641. if (guide == 0) {
  6642. needCoin = 0;
  6643. xGame.common.temSelfLevel = 100;
  6644. }
  6645. if (DataMgr.coinEnough(needCoin)) {
  6646. DataMgr.setCoin(-needCoin);
  6647. xGame.common.curPlayerSkillType = this.index;
  6648. if (guide == 0)
  6649. xGame.common.curPlayerSkillType = 0;
  6650. console.log('zh: skilldisplay 1');
  6651. xGame.uiMgr.Show(UIGame);
  6652. xGame.uiMgr.Hide(UIMain);
  6653. xGame.uiMgr.Show(UIMatching, () => {
  6654. xGame.common.gameUI.ui.alpha = 1;
  6655. xGame.common.gameUI.startGame();
  6656. xGame.uiMgr.Hide(UISkill);
  6657. });
  6658. this.logEventForRod_start();
  6659. }
  6660. else {
  6661. console.log('zh: skilldisplay 2');
  6662. xGame.uiMgr.Show(UIAddProp, 0);
  6663. Moyu.sendDataEvent("AddCoinVideo");
  6664. }
  6665. }
  6666. logEventForRod_start() {
  6667. let gfmsIdx = xGame.common.curPlayerSkillType;
  6668. console.log('zh:选择的技能=' + gfmsIdx);
  6669. let gfmc = 'Skyfall Shot';
  6670. if (gfmsIdx == 0) {
  6671. gfmc = 'Skyfall Shot';
  6672. }
  6673. if (gfmsIdx == 1) {
  6674. gfmc = 'Surging break';
  6675. }
  6676. if (gfmsIdx == 2) {
  6677. gfmc = 'Frost Lock';
  6678. }
  6679. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6680. let jsonStr = {
  6681. "count": 0,
  6682. "name": gfmc
  6683. };
  6684. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6685. const d = LocalStorageManager.getItem(keyStr);
  6686. jsonStr.count = d.count + 1;
  6687. LocalStorageManager.setItem(keyStr, jsonStr);
  6688. }
  6689. else {
  6690. LocalStorageManager.setItem(keyStr, jsonStr);
  6691. }
  6692. const reqStr = JSON.stringify(jsonStr);
  6693. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6694. }
  6695. }
  6696. class UISkill extends UIBase {
  6697. constructor() {
  6698. super();
  6699. this.skillData = [];
  6700. }
  6701. onConstructor() {
  6702. this.ui = ui_UISkill.createInstance();
  6703. this.contentPane = this.ui;
  6704. this.isEject = false;
  6705. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6706. this.initSkillData();
  6707. console.log('zh:aaaaaa1111111111');
  6708. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6709. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6710. console.log('zh:aaaaaa22222222');
  6711. this.displayList = [];
  6712. this.ui.skillNode.skillList.numItems = 3;
  6713. this.addUIClick(this.ui, this.interuptSecretary);
  6714. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6715. this.ui.talkNode.visible = false;
  6716. if (Moyu.isKs)
  6717. this.ui.closeNode.closeBtn.x += 100;
  6718. }
  6719. show() {
  6720. super.show();
  6721. this.playSecretaryIdle();
  6722. this.moneyNode.ui.c1.selectedIndex = 1;
  6723. Laya.timer.clearAll(this);
  6724. xGame.soundMgr.playSound("s_start");
  6725. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6726. let guide = DataMgr.getSkillGuide();
  6727. this.ui.guideNode.visible = guide == 0;
  6728. let item = this.getSkillItemByUIIndex(0);
  6729. if (guide == 0) {
  6730. item.ui.c1.selectedIndex = 1;
  6731. }
  6732. else {
  6733. item.ui.c1.selectedIndex = 0;
  6734. }
  6735. this.ui.guideNode.guideBtn.visible = guide == 0;
  6736. for (let index = 0; index < this.displayList.length; index++) {
  6737. this.displayList[index].checkTry();
  6738. }
  6739. this.setGlobalFont(this.ui);
  6740. }
  6741. getSkillItemByUIIndex(cur) {
  6742. for (let index = 0; index < this.displayList.length; index++) {
  6743. if (this.displayList[index].index == cur) {
  6744. return this.displayList[index];
  6745. }
  6746. }
  6747. }
  6748. enterGuideLevel() {
  6749. let item = this.getSkillItemByUIIndex(0);
  6750. item.startGame();
  6751. if (DataMgr.getNewUser())
  6752. Moyu.sendDataEvent("gameStart1");
  6753. }
  6754. initSkillData() {
  6755. this.skillData = [];
  6756. let nameList = xGame.common.skillNameList;
  6757. let iconList = xGame.common.skillIconList;
  6758. let describeList = [
  6759. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6760. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6761. "The power of frost descends—freezing the flow and taking full control of the game!"
  6762. ];
  6763. console.log('zh:initSkillData 111111111');
  6764. let data;
  6765. for (let index = 0; index < nameList.length; index++) {
  6766. data = {};
  6767. data.name = nameList[index];
  6768. data.icon = iconList[index];
  6769. data.describe = describeList[index];
  6770. data.index = index;
  6771. this.skillData.push(data);
  6772. }
  6773. }
  6774. updateSkillItem(index, target) {
  6775. if (this.displayList[index] == null) {
  6776. let uiIndex;
  6777. switch (index) {
  6778. case 0:
  6779. uiIndex = 1;
  6780. break;
  6781. case 1:
  6782. uiIndex = 0;
  6783. break;
  6784. case 2:
  6785. uiIndex = 2;
  6786. break;
  6787. case 3:
  6788. uiIndex = 3;
  6789. break;
  6790. default:
  6791. break;
  6792. }
  6793. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6794. this.displayList.push(temp);
  6795. }
  6796. }
  6797. playSecretaryIdle() {
  6798. let parent = this.ui.secretary.displayObject;
  6799. parent.destroyChildren();
  6800. let xx = this.ui.secretary.width / 2;
  6801. let yy = this.ui.secretary.height;
  6802. let scale = xGame.common.getSecretaryScale();
  6803. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6804. xGame.common.secretary.play(data, 0, true, parent);
  6805. }
  6806. returnUIMain() {
  6807. this.hide();
  6808. xGame.common.stopGirlPop(this.ui.talkNode);
  6809. xGame.uiMgr.Show(UIMain);
  6810. }
  6811. interuptSecretary() {
  6812. Laya.timer.clearAll(this);
  6813. this.playSecretaryRandomSound();
  6814. }
  6815. playSecretaryRandomSound() {
  6816. if (this.isHide)
  6817. return;
  6818. let time = xGame.common.randomNum(45000, 60000);
  6819. Laya.timer.once(time, this, () => {
  6820. if (this.isHide)
  6821. return;
  6822. let index = xGame.common.randomNum(4, 7);
  6823. xGame.soundMgr.playSound("s_main0" + index);
  6824. let words = 1;
  6825. switch (index) {
  6826. case 4:
  6827. words = 5;
  6828. break;
  6829. case 5:
  6830. words = 3;
  6831. break;
  6832. case 6:
  6833. words = 6;
  6834. break;
  6835. case 7:
  6836. words = 7;
  6837. break;
  6838. default:
  6839. break;
  6840. }
  6841. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6842. this.playSecretaryRandomSound();
  6843. });
  6844. }
  6845. }
  6846. UISkill.uiName = "UISkill";
  6847. class ui_UIModeSelection extends fgui.GComponent {
  6848. static createInstance() {
  6849. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6850. }
  6851. onConstruct() {
  6852. this.n19 = (this.getChild("n19"));
  6853. this.closeBtn = (this.getChild("closeBtn"));
  6854. this.myNode = (this.getChild("myNode"));
  6855. this.t0 = this.getTransition("t0");
  6856. }
  6857. }
  6858. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6859. class UIModeSelection extends UIBase {
  6860. constructor() {
  6861. super();
  6862. }
  6863. onConstructor() {
  6864. this.ui = ui_UIModeSelection.createInstance();
  6865. this.contentPane = this.ui;
  6866. this.isEject = false;
  6867. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6868. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6869. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6870. this.addUIClick(this.ui.closeBtn, this.hide);
  6871. this.peopleArr = [65, 990, 580];
  6872. this.peopleOffest = [5, 10, 10];
  6873. }
  6874. show(callback) {
  6875. this.updateSelf();
  6876. super.show();
  6877. this.ui.t0.play();
  6878. this.callback = callback;
  6879. this.setGlobalFont(this.ui);
  6880. }
  6881. updateSelf() {
  6882. let cfg = cfgTable.modeselectData;
  6883. for (let index = 1; index <= 3; index++) {
  6884. let node = this.ui.myNode["type" + index];
  6885. node.need.text = cfg[index].need;
  6886. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6887. node.peopleTxt.text = this.getRandPeople(index - 1);
  6888. }
  6889. }
  6890. enterGame(type) {
  6891. console.log('zh: 进入经典模式 type: ' + type);
  6892. xGame.common.classicRoomType = type;
  6893. let cfg = cfgTable.modeselectData[type];
  6894. let need = cfg.need;
  6895. xGame.common.passAwardCoin = cfg.award;
  6896. if (DataMgr.coinEnough(need)) {
  6897. DataMgr.setCoin(-need);
  6898. this.ui.myNode["type" + type].t0.play();
  6899. Laya.timer.once(200, this, () => {
  6900. this.callback && this.callback();
  6901. });
  6902. this.logEventForClassic_start();
  6903. }
  6904. else {
  6905. Moyu.sendDataEvent("AddCoinVideo");
  6906. xGame.uiMgr.Show(UIAddProp, 0);
  6907. }
  6908. }
  6909. getRandPeople(index) {
  6910. let rand = this.peopleOffest[index];
  6911. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6912. }
  6913. logEventForClassic_start() {
  6914. let rtype = xGame.common.classicRoomType;
  6915. let msmc = '';
  6916. if (rtype == 1) {
  6917. msmc = 'beginner';
  6918. }
  6919. if (rtype == 2) {
  6920. msmc = 'expert';
  6921. }
  6922. if (rtype == 3) {
  6923. msmc = 'master';
  6924. }
  6925. let keyStr = 'sjmd_classic_start_' + rtype;
  6926. let jsonStr = {
  6927. "difficulty": msmc,
  6928. "classic_count": 1,
  6929. "difficulty_count": 1
  6930. };
  6931. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6932. const d = LocalStorageManager.getItem(keyStr);
  6933. jsonStr.classic_count = d.classic_count + 1;
  6934. jsonStr.difficulty_count = d.difficulty_count + 1;
  6935. LocalStorageManager.setItem(keyStr, jsonStr);
  6936. }
  6937. else {
  6938. LocalStorageManager.setItem(keyStr, jsonStr);
  6939. }
  6940. const reqStr = JSON.stringify(jsonStr);
  6941. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6942. }
  6943. }
  6944. UIModeSelection.uiName = "UIModeSelection";
  6945. class ui_UIReg extends fgui.GComponent {
  6946. static createInstance() {
  6947. return (fgui.UIPackage.createObject("game", "UIReg"));
  6948. }
  6949. onConstruct() {
  6950. this.n38 = (this.getChild("n38"));
  6951. this.n51 = (this.getChild("n51"));
  6952. this.closeBtn = (this.getChild("closeBtn"));
  6953. this.lab_tip = (this.getChild("lab_tip"));
  6954. this.txt_ua = (this.getChild("txt_ua"));
  6955. this.txt_up1 = (this.getChild("txt_up1"));
  6956. this.txt_up2 = (this.getChild("txt_up2"));
  6957. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6958. this.btn_reg = (this.getChild("btn_reg"));
  6959. }
  6960. }
  6961. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6962. class ui_UILogin extends fgui.GComponent {
  6963. static createInstance() {
  6964. return (fgui.UIPackage.createObject("game", "UILogin"));
  6965. }
  6966. onConstruct() {
  6967. this.c1 = this.getController("c1");
  6968. this.n18 = (this.getChild("n18"));
  6969. this.n21 = (this.getChild("n21"));
  6970. this.closeBtn = (this.getChild("closeBtn"));
  6971. this.txt_ua = (this.getChild("txt_ua"));
  6972. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6973. this.btn_login = (this.getChild("btn_login"));
  6974. this.txt_up = (this.getChild("txt_up"));
  6975. }
  6976. }
  6977. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6978. class UILogin extends UIBase {
  6979. constructor() {
  6980. super();
  6981. this.fontStr = 'big-john-woff2-2';
  6982. try {
  6983. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  6984. console.log("zh: constructor加载arial字体成功");
  6985. }
  6986. catch (error) {
  6987. console.log("zh: constructor加载arial字体失败");
  6988. }
  6989. }
  6990. onFontLoaded() {
  6991. try {
  6992. Laya.Text.defaultFont = this.fontStr;
  6993. this.ui.txt_ua.font = this.fontStr;
  6994. this.ui.txt_up.font = this.fontStr;
  6995. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  6996. }
  6997. catch (error) {
  6998. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  6999. }
  7000. }
  7001. onConstructor() {
  7002. this.ui = ui_UILogin.createInstance();
  7003. this.contentPane = this.ui;
  7004. this.isEject = false;
  7005. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7006. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  7007. this.addUIClick(this.ui.btn_login, this.userLogin);
  7008. }
  7009. show() {
  7010. super.show();
  7011. this.x = (Laya.stage.width - this.width) / 2;
  7012. this.y = (Laya.stage.height - this.height) / 2;
  7013. this.onFontLoaded();
  7014. }
  7015. closeSelf() {
  7016. this.hide();
  7017. }
  7018. userLogin() {
  7019. let ua = this.ui.txt_ua.text;
  7020. let up = this.ui.txt_up.text;
  7021. console.log('zh:ua font' + this.ui.txt_ua.font);
  7022. if (ua && up) {
  7023. let reqData = JSON.stringify({
  7024. username: ua.trim(),
  7025. password: up.trim(),
  7026. fromMark: 'app_game'
  7027. });
  7028. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7029. try {
  7030. console.log('zh:res = ' + JSON.stringify(res));
  7031. let code = res.code;
  7032. let msg = res.msg;
  7033. if (code == 200) {
  7034. let keyStr = keyForLoginInfo;
  7035. let jsonStr = {
  7036. "username": res.username,
  7037. "token": res.token,
  7038. "buySpids": { 1: false, 7: false }
  7039. };
  7040. LocalStorageManager.setItem(keyStr, jsonStr);
  7041. let myu = Moyu.getUserInfo();
  7042. console.log('zh:myu = ' + JSON.stringify(myu));
  7043. DataMgr.updateUserNickName(res.username);
  7044. Moyu.updateUserInfo(res.username);
  7045. xGame.uiMgr.Show(UIMsg, msg);
  7046. DataMgr.loadUserSpOrderForAd();
  7047. DataMgr.getUserZiChanInfo(false);
  7048. xGame.eventMgr.event(LOGIN_IN);
  7049. this.closeSelf();
  7050. }
  7051. else {
  7052. xGame.uiMgr.Show(UIMsg, msg);
  7053. }
  7054. }
  7055. catch (error) {
  7056. console.log('error=' + error);
  7057. alert(error);
  7058. }
  7059. finally {
  7060. }
  7061. });
  7062. }
  7063. else {
  7064. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7065. }
  7066. }
  7067. gotoRegPage() {
  7068. this.closeSelf();
  7069. xGame.uiMgr.Show(UIReg);
  7070. }
  7071. }
  7072. UILogin.uiName = "UILogin";
  7073. class UIReg extends UIBase {
  7074. constructor() {
  7075. super();
  7076. this.fontStr = 'big-john-woff2-2';
  7077. try {
  7078. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7079. console.log("zh: constructor加载arial字体成功");
  7080. }
  7081. catch (error) {
  7082. console.log("zh: constructor加载arial字体失败");
  7083. }
  7084. }
  7085. onFontLoaded() {
  7086. try {
  7087. Laya.Text.defaultFont = this.fontStr;
  7088. this.ui.txt_ua.font = this.fontStr;
  7089. this.ui.txt_up1.font = this.fontStr;
  7090. this.ui.txt_up2.font = this.fontStr;
  7091. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7092. }
  7093. catch (error) {
  7094. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7095. }
  7096. }
  7097. onConstructor() {
  7098. this.ui = ui_UIReg.createInstance();
  7099. this.contentPane = this.ui;
  7100. this.isEject = false;
  7101. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7102. this.addUIClick(this.ui.btn_reg, this.regUser);
  7103. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7104. }
  7105. show() {
  7106. super.show();
  7107. this.x = (Laya.stage.width - this.width) / 2;
  7108. this.y = (Laya.stage.height - this.height) / 2;
  7109. this.onFontLoaded();
  7110. }
  7111. closeSelf() {
  7112. this.hide();
  7113. }
  7114. regUser() {
  7115. this.ui.lab_tip.visible = false;
  7116. let ua = this.ui.txt_ua.text;
  7117. let up1 = this.ui.txt_up1.text;
  7118. let up2 = this.ui.txt_up2.text;
  7119. if (ua && up1 && up2 && up1 == up2) {
  7120. let reqData = JSON.stringify({
  7121. username: ua.trim(),
  7122. password: up1.trim(),
  7123. fromMark: 'app_game'
  7124. });
  7125. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7126. try {
  7127. console.log('zh:res = ' + JSON.stringify(res));
  7128. let code = res.code;
  7129. let msg = res.msg;
  7130. xGame.uiMgr.Show(UIMsg, msg);
  7131. if (code == 200) {
  7132. this.ui.lab_tip.color = "#FFFFFF";
  7133. xGame.uiMgr.Show(UIMsg, msg);
  7134. this.closeSelf();
  7135. }
  7136. else {
  7137. this.ui.lab_tip.color = "#FF0000";
  7138. xGame.uiMgr.Show(UIMsg, msg);
  7139. }
  7140. }
  7141. catch (error) {
  7142. console.log('error=' + error);
  7143. alert(error);
  7144. }
  7145. finally {
  7146. }
  7147. });
  7148. }
  7149. else {
  7150. if (up1 != up2) {
  7151. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7152. }
  7153. else {
  7154. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7155. }
  7156. }
  7157. }
  7158. gotoLogin() {
  7159. this.closeSelf();
  7160. xGame.uiMgr.Show(UILogin);
  7161. }
  7162. }
  7163. UIReg.uiName = "UIReg";
  7164. class ui_UIGetAward extends fgui.GComponent {
  7165. static createInstance() {
  7166. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7167. }
  7168. onConstruct() {
  7169. this.n4 = (this.getChild("n4"));
  7170. this.n0 = (this.getChild("n0"));
  7171. this.myList = (this.getChild("myList"));
  7172. this.n1 = (this.getChild("n1"));
  7173. this.eftNode = (this.getChild("eftNode"));
  7174. this.btnNode = (this.getChild("btnNode"));
  7175. this.t0 = this.getTransition("t0");
  7176. }
  7177. }
  7178. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7179. class UIGetAward extends UIBase {
  7180. constructor() {
  7181. super();
  7182. this.showTriple = true;
  7183. }
  7184. onConstructor() {
  7185. this.ui = ui_UIGetAward.createInstance();
  7186. this.contentPane = this.ui;
  7187. this.isEject = false;
  7188. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7189. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7190. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7191. }
  7192. show(arr, showTriple, callback) {
  7193. super.show();
  7194. this.ui.t0.play();
  7195. this.ui.eftNode.visible = true;
  7196. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7197. this.ui.eftNode.visible = false;
  7198. }), 1, 0, 0, 0.9);
  7199. this.awardArr = arr;
  7200. this.showTriple = showTriple;
  7201. this.callback = callback;
  7202. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7203. this.ui.myList.numItems = arr.length;
  7204. xGame.soundMgr.playSound("getaward");
  7205. this.setGlobalFont(this.ui);
  7206. }
  7207. updateSelf(index, obj) {
  7208. let temp = this.awardArr[index];
  7209. let icon = this.getIcon(temp.type);
  7210. let str = icon;
  7211. if (temp.type > 2) {
  7212. str = "s" + icon;
  7213. }
  7214. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7215. obj.myIcon.rotation = 0;
  7216. obj.numTxt.text = temp.num + "";
  7217. obj.numTxt.visible = temp.type > 2 ? false : true;
  7218. obj.nameTxt.text = this.getNameStr(temp.type);
  7219. }
  7220. renderItem(index, obj) {
  7221. this.updateSelf(index, obj);
  7222. }
  7223. tripleGetAward() {
  7224. console.log('zh:qjff_AD_for_uigetAward');
  7225. if (Laya.Browser.onAndroid) {
  7226. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7227. if (!boo) {
  7228. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7229. return;
  7230. }
  7231. }
  7232. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7233. }
  7234. else {
  7235. console.log('zh:AD 失败,直接发放奖励');
  7236. this.qjff_AD_for_uigetAward();
  7237. }
  7238. }
  7239. qjff_AD_for_uigetAward() {
  7240. this.getAward(3);
  7241. }
  7242. normalGetAward() {
  7243. if (PlatMgr.isMisVideo())
  7244. this.tripleGetAward();
  7245. else
  7246. this.getAward();
  7247. }
  7248. getAward(times = 1) {
  7249. this.hide();
  7250. for (let index = 0; index < this.awardArr.length; index++) {
  7251. this.awardArr[index].num *= times;
  7252. }
  7253. this.callback && this.callback(times != 1);
  7254. }
  7255. getIcon(type) {
  7256. switch (type) {
  7257. case Prop.diamond:
  7258. return "ty_zs";
  7259. case Prop.coin:
  7260. return "ty_jb";
  7261. case Prop.gan1:
  7262. return "qg1";
  7263. case Prop.gan2:
  7264. return "qg2";
  7265. case Prop.gan3:
  7266. return "qg3";
  7267. case Prop.gan4:
  7268. return "qg4";
  7269. default:
  7270. break;
  7271. }
  7272. }
  7273. getNameStr(type) {
  7274. switch (type) {
  7275. case Prop.diamond:
  7276. return "Diamond";
  7277. case Prop.coin:
  7278. return "Coins";
  7279. case Prop.gan1:
  7280. case Prop.gan2:
  7281. case Prop.gan3:
  7282. case Prop.gan4:
  7283. return cfgTable.ballrodData[type - 1].name;
  7284. default:
  7285. break;
  7286. }
  7287. }
  7288. }
  7289. UIGetAward.uiName = "UIGetAward";
  7290. class ui_UIRepentProp extends fgui.GComponent {
  7291. static createInstance() {
  7292. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7293. }
  7294. onConstruct() {
  7295. this.c1 = this.getController("c1");
  7296. this.n11 = (this.getChild("n11"));
  7297. this.regretNode = (this.getChild("regretNode"));
  7298. this.helpLineNode = (this.getChild("helpLineNode"));
  7299. this.t0 = this.getTransition("t0");
  7300. }
  7301. }
  7302. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7303. class UIRepentProp extends UIBase {
  7304. constructor() {
  7305. super();
  7306. this.viewType = 0;
  7307. this.regretType = 0;
  7308. }
  7309. onConstructor() {
  7310. this.ui = ui_UIRepentProp.createInstance();
  7311. this.contentPane = this.ui;
  7312. this.isEject = false;
  7313. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7314. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7315. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7316. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7317. }
  7318. show(viewType, regretType, callback) {
  7319. PlatMgr.showInsert(true);
  7320. this.viewType = viewType;
  7321. this.regretType = regretType;
  7322. this.callback = callback;
  7323. super.show();
  7324. this.ui.t0.play();
  7325. this.ui.c1.selectedIndex = this.viewType;
  7326. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7327. if (this.viewType == 0) {
  7328. let guide = DataMgr.getGuideHelpLine();
  7329. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7330. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7331. }
  7332. xGame.common.gameMgr.gamePause = true;
  7333. this.setGlobalFont(this.ui);
  7334. }
  7335. hideSelf() {
  7336. xGame.common.gameMgr.gamePause = false;
  7337. this.callback && this.callback(false);
  7338. this.hide();
  7339. }
  7340. videoRegret() {
  7341. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7342. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7343. }
  7344. else {
  7345. console.log('zh:AD 失败,直接发放奖励');
  7346. this.qjff_AD_for_UIrepentProp_videoRegret();
  7347. }
  7348. }
  7349. qjff_AD_for_UIrepentProp_videoRegret() {
  7350. this.callback && this.callback(true);
  7351. this.hideSelf();
  7352. }
  7353. videoAddHelpLine() {
  7354. let guide = DataMgr.getGuideHelpLine();
  7355. if (guide == 0) {
  7356. this.callback && this.callback(true);
  7357. this.hideSelf();
  7358. DataMgr.setGuideHelpLine();
  7359. xGame.common.gameUI.ui.guideNode.visible = false;
  7360. }
  7361. else {
  7362. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7363. if (Laya.Browser.onAndroid) {
  7364. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7365. if (!boo) {
  7366. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7367. return;
  7368. }
  7369. }
  7370. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7371. }
  7372. else {
  7373. console.log('zh:AD 失败,直接发放奖励');
  7374. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7375. }
  7376. }
  7377. }
  7378. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7379. this.callback && this.callback(true);
  7380. this.hideSelf();
  7381. }
  7382. }
  7383. UIRepentProp.uiName = "UIRepentProp";
  7384. class ui_UITips extends fgui.GComponent {
  7385. static createInstance() {
  7386. return (fgui.UIPackage.createObject("game", "UITips"));
  7387. }
  7388. onConstruct() {
  7389. this.n0 = (this.getChild("n0"));
  7390. this.myNode = (this.getChild("myNode"));
  7391. this.t0 = this.getTransition("t0");
  7392. }
  7393. }
  7394. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7395. class UITips extends UIBase {
  7396. constructor() {
  7397. super();
  7398. this.type = 0;
  7399. }
  7400. onConstructor() {
  7401. this.ui = ui_UITips.createInstance();
  7402. this.contentPane = this.ui;
  7403. this.isEject = false;
  7404. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7405. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7406. }
  7407. show(tipsTxt, womanTxt, type) {
  7408. super.show();
  7409. this.ui.t0.play();
  7410. this.ui.myNode.tipsTxt.text = tipsTxt;
  7411. this.ui.myNode.womanTxt.text = womanTxt;
  7412. PlatMgr.showInsert(true);
  7413. this.ui.myNode.c1.selectedIndex = type;
  7414. this.type = type;
  7415. switch (this.type) {
  7416. case TipsType.exitGame:
  7417. xGame.common.gameMgr.gamePause = true;
  7418. break;
  7419. case TipsType.foul:
  7420. Laya.timer.once(200, this, () => {
  7421. if (xGame.common.gameMgr) {
  7422. xGame.common.gameMgr.gamePause = true;
  7423. }
  7424. else {
  7425. console.log("zh:gameMgr is null");
  7426. }
  7427. });
  7428. break;
  7429. default:
  7430. break;
  7431. }
  7432. this.setGlobalFont(this.ui);
  7433. }
  7434. clickLeftBtn() {
  7435. this.hide();
  7436. xGame.common.gameMgr.gamePause = false;
  7437. switch (this.type) {
  7438. case TipsType.exitGame:
  7439. break;
  7440. case TipsType.foul:
  7441. break;
  7442. default:
  7443. break;
  7444. }
  7445. }
  7446. clickRightBtn() {
  7447. this.hide();
  7448. switch (this.type) {
  7449. case TipsType.exitGame:
  7450. xGame.eventMgr.event(RESET_GAME);
  7451. xGame.uiMgr.Show(UIMain);
  7452. Moyu.recordEnd(this, null);
  7453. xGame.common.longHelpLine = false;
  7454. break;
  7455. case TipsType.foul:
  7456. if (xGame.common.gameMgr) {
  7457. xGame.common.gameMgr.gamePause = false;
  7458. }
  7459. Laya.timer.clearAll(this);
  7460. break;
  7461. default:
  7462. break;
  7463. }
  7464. }
  7465. }
  7466. UITips.uiName = "UITips";
  7467. class UIMain extends UIBase {
  7468. constructor() {
  7469. super();
  7470. this.firstEnter = true;
  7471. this.moni_click_count = 0;
  7472. }
  7473. nativeCallJs(msg) {
  7474. let t = msg;
  7475. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7476. switch (t) {
  7477. case 'qjff_chouJiang':
  7478. let dui = xGame.uiMgr.getUI(UIDraw);
  7479. dui.qjff_chouJiang();
  7480. break;
  7481. case 'qjff_AD_for_uisign':
  7482. let dui2 = xGame.uiMgr.getUI(UISign);
  7483. dui2.qjff_AD_for_uisign();
  7484. break;
  7485. case 'qjff_AD_for_uitry':
  7486. let dui3 = xGame.uiMgr.getUI(UITry);
  7487. dui3.qjff_AD_for_uitry();
  7488. break;
  7489. case 'qjff_AD_for_uipower':
  7490. let dui4 = xGame.uiMgr.getUI(UIPower);
  7491. dui4.qjff_AD_for_uipower();
  7492. break;
  7493. case 'qjff_AD_for_uigetAward':
  7494. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7495. dui5.qjff_AD_for_uigetAward();
  7496. break;
  7497. case 'qjff_AD_for_uiGameEnd':
  7498. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7499. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7500. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7501. break;
  7502. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7503. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7504. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7505. break;
  7506. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7507. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7508. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7509. break;
  7510. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7511. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7512. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7513. break;
  7514. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7515. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7516. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7517. break;
  7518. case 'qjff_AD_for_UIBOX_onOpenBox':
  7519. let dui11 = xGame.uiMgr.getUI(UIBox);
  7520. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7521. break;
  7522. case 'qjff_AD_for_UIAddCoin':
  7523. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7524. dui12.qjff_AD_for_UIAddCoin();
  7525. break;
  7526. case 'app_sign_for_buyProduct_onSuccess':
  7527. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7528. DataMgr.getUserZiChanInfo(false);
  7529. break;
  7530. case '222axxxxxx':
  7531. let dui15 = xGame.uiMgr.getUI(UISign);
  7532. dui15.qjff_AD_for_uisign();
  7533. break;
  7534. case '333axsxxxxxx':
  7535. let dui16 = xGame.uiMgr.getUI(UISign);
  7536. dui16.qjff_AD_for_uisign();
  7537. break;
  7538. default:
  7539. console.log('zh:未知的方法名字' + t);
  7540. break;
  7541. }
  7542. }
  7543. onConstructor() {
  7544. console.log('zh: UIMain onConstructor');
  7545. this.ui = ui_UIMain.createInstance();
  7546. this.contentPane = this.ui;
  7547. this.isEject = false;
  7548. this.addEvent();
  7549. this.addClickSpine();
  7550. this.settingNode = new SettingNode(this.ui.settingNode);
  7551. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7552. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7553. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7554. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7555. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7556. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7557. let curUse = DataMgr.getCurSecretary();
  7558. this.changeSecretary(curUse);
  7559. this.ui.talkNode.visible = false;
  7560. let guide = DataMgr.getSkillGuide();
  7561. if (xGame.common.isNewDay && guide == 1) {
  7562. xGame.common.isNewDay = false;
  7563. xGame.soundMgr.playSound("s_main01");
  7564. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7565. console.log("zh:播放小秘书每天语音");
  7566. }
  7567. this.onGetUserInfo();
  7568. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7569. DataMgr.getUserZiChanInfo(false);
  7570. }
  7571. this.ui.n83.visible = false;
  7572. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7573. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7574. let ua = d.username;
  7575. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7576. }
  7577. this.c_btn_for_user();
  7578. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7579. }
  7580. Logout() {
  7581. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7582. LocalStorageManager.removeItem(keyForLoginInfo);
  7583. this.freshUser();
  7584. }
  7585. JSBridgeUtils.instance.loginOutForApp();
  7586. this.setUserDefaultNickname();
  7587. DataMgr.setCoin2(4000);
  7588. DataMgr.setDiamond2(0);
  7589. this.setDefaultQiuGanInfo();
  7590. DataMgr.setPlaceBallLevelList("");
  7591. DataMgr.setChallengeMode_overLev(1);
  7592. this.setDefaultSignData();
  7593. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7594. }
  7595. setDefaultSignData() {
  7596. DataMgr.setSignData(1);
  7597. DataMgr.setSignTime(new Date().getTime());
  7598. }
  7599. setDefaultQiuGanInfo() {
  7600. DataMgr.setBallRod(0, 1);
  7601. DataMgr.setBallRod(1, 0);
  7602. DataMgr.setBallRod(2, 0);
  7603. DataMgr.setBallRod(3, 0);
  7604. DataMgr.setBallRod(4, 0);
  7605. DataMgr.setBallRod(5, 1);
  7606. }
  7607. setUserDefaultNickname() {
  7608. let defUsername = "player";
  7609. this.ui.headNode.nameTxt.text = defUsername;
  7610. DataMgr.updateUserNickName(defUsername);
  7611. Moyu.updateUserInfo(defUsername);
  7612. }
  7613. gotoLogin() {
  7614. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7615. xGame.uiMgr.Show(UILogin);
  7616. }
  7617. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7618. this.Logout();
  7619. }
  7620. }
  7621. gotoRegUser() {
  7622. xGame.uiMgr.Show(UIReg);
  7623. }
  7624. showFuLiSp1() {
  7625. console.log('zh:福利1');
  7626. DataMgr.checkForShowFuLi17AndAlert(1);
  7627. }
  7628. showFuLiSp7() {
  7629. console.log('zh:福利7');
  7630. DataMgr.checkForShowFuLi17AndAlert(7);
  7631. }
  7632. c_btn_for_user() {
  7633. this.ui.n_dengLu.c1.selectedIndex = 0;
  7634. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7635. this.ui.n_dengLu.c1.selectedIndex = 1;
  7636. }
  7637. else {
  7638. this.ui.n_dengLu.c1.selectedIndex = 0;
  7639. }
  7640. }
  7641. changeSecretary(curUse) {
  7642. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7643. xGame.common.secretary && xGame.common.secretary.dispose();
  7644. this.addSecretarySpine(name);
  7645. }
  7646. addSecretarySpine(name) {
  7647. let spine = new SpineMgr(name, () => {
  7648. this.playSecretaryIdle();
  7649. });
  7650. xGame.common.secretary = spine;
  7651. }
  7652. addClickSpine() {
  7653. let clickSpine = new SpineMgr("dianji", () => {
  7654. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7655. let parent = Laya.stage;
  7656. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7657. clickSpine.play(data, 0, false, parent, (spine) => {
  7658. spine.destroy(true);
  7659. });
  7660. });
  7661. });
  7662. }
  7663. addEvent() {
  7664. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7665. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7666. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7667. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7668. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7669. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7670. this.addUIClick(this.ui, this.interuptSecretary);
  7671. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7672. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7673. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7674. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7675. this.addUIClick(this.ui.signBtn, this.openSignView);
  7676. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7677. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7678. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7679. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  7680. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7681. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7682. }
  7683. show(showFailWords) {
  7684. super.show();
  7685. DataMgr.loadUserSpOrderForAd();
  7686. this.moneyNode.ui.c1.selectedIndex = 1;
  7687. this.playSecretaryIdle();
  7688. xGame.soundMgr.playMusic("caromhall01", 0);
  7689. Laya.timer.clearAll(this);
  7690. this.playSecretaryRandomSound();
  7691. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7692. if (showFailWords) {
  7693. console.log('zh:uimain.ts ');
  7694. setTimeout(() => {
  7695. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7696. let words = -1;
  7697. if (str == "s_main02") {
  7698. words = 2;
  7699. }
  7700. else {
  7701. words = 3;
  7702. }
  7703. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7704. xGame.soundMgr.playSound(str);
  7705. }, 300);
  7706. }
  7707. this.showGuide();
  7708. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7709. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7710. let guide = DataMgr.getSkillGuide();
  7711. if (guide == 1) {
  7712. let randTime = xGame.common.randomNum(300, 800);
  7713. if (this.firstEnter) {
  7714. console.log("zh: firstEnter");
  7715. this.firstEnter = false;
  7716. randTime += 900;
  7717. }
  7718. else {
  7719. console.log("zh: no firstEnter");
  7720. }
  7721. Laya.timer.once(randTime, this, () => {
  7722. });
  7723. Laya.timer.once(1000, this, () => {
  7724. console.log('zh: 1秒后 showFuLiSp7');
  7725. this.showFuLiSp7();
  7726. });
  7727. this.showTipForGuest();
  7728. }
  7729. this.setGlobalFont(this.ui);
  7730. }
  7731. yinDaoForLianxi() {
  7732. let x = this.ui.placeBallBtn.x;
  7733. let y = this.ui.placeBallBtn.y;
  7734. this.ui.n_yd_challenge_1.visible = true;
  7735. this.ui.n_yd_challenge_1_hand.x = x + 150;
  7736. this.ui.n_yd_challenge_1_hand.y = y;
  7737. this.ui.n_yd_challenge_1_btn.x = x;
  7738. this.ui.n_yd_challenge_1_btn.y = y;
  7739. console.log('zh:yinDaoForLianxi set ok');
  7740. }
  7741. showTipForGuest() {
  7742. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7743. if (userInfo == null) {
  7744. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7745. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7746. let woman = "this is an important notice.";
  7747. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7748. return;
  7749. }
  7750. }
  7751. checkActive(show) {
  7752. }
  7753. showGuide() {
  7754. let guide = DataMgr.getSkillGuide();
  7755. this.ui.guideBtn.visible = guide == 0;
  7756. this.ui.enterGuide.visible = false;
  7757. this.ui.secretaryGuide.visible = guide == 0;
  7758. if (guide == 0) {
  7759. console.log("zh:显示引导");
  7760. xGame.soundMgr.playSound("s_guide");
  7761. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7762. }
  7763. else {
  7764. console.log("zh:不需要显示引导");
  7765. }
  7766. }
  7767. ensureSecretary() {
  7768. console.log('zh: ensureSecretary ');
  7769. this.ui.secretaryGuide.visible = false;
  7770. this.ui.enterGuide.visible = true;
  7771. this.ui.wordsNode.t0.play();
  7772. if (DataMgr.getNewUser())
  7773. Moyu.sendDataEvent("gameReady");
  7774. }
  7775. playSecretaryIdle() {
  7776. let parent = this.ui.secretary.displayObject;
  7777. parent.destroyChildren();
  7778. let xx = this.ui.secretary.width / 2;
  7779. let yy = this.ui.secretary.height;
  7780. let scale = xGame.common.getSecretaryScale();
  7781. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7782. xGame.common.secretary.play(data, 0, true, parent);
  7783. }
  7784. startGame(type) {
  7785. if (!this.isReadyForLoadNetSource()) {
  7786. return;
  7787. }
  7788. xGame.common.gameMode = type;
  7789. Moyu.sendDataEvent("PlayGame", { type: type });
  7790. let gm = xGame.common.gameMode;
  7791. console.log('zh:进入游戏gameMode =' + gm);
  7792. switch (gm) {
  7793. case GameMode.classic:
  7794. console.log('zh:进入经典模式111111111');
  7795. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7796. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7797. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7798. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7799. console.log('zh:判断是否可以玩该模式classic =NO');
  7800. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7801. xGame.uiMgr.Show(UIMsg, tipStr);
  7802. return;
  7803. }
  7804. else {
  7805. console.log('zh:可以玩该模式classic');
  7806. this.beginGame();
  7807. }
  7808. }
  7809. else {
  7810. console.log('zh:不需要判断是否可以玩该classic');
  7811. let challengeTimes = DataMgr.getChallengeTimes();
  7812. if (challengeTimes == 0) {
  7813. xGame.uiMgr.Show(UIInvitation);
  7814. }
  7815. else {
  7816. this.beginGame();
  7817. }
  7818. }
  7819. break;
  7820. case GameMode.bigMove:
  7821. console.info('zh:bigMove check 大招');
  7822. let guide = DataMgr.getSkillGuide();
  7823. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7824. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7825. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7826. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7827. console.log('zh:提示不可以玩');
  7828. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7829. xGame.uiMgr.Show(UIMsg, tipStr);
  7830. return;
  7831. }
  7832. else {
  7833. console.log('zh:可以玩该模式 bigMove');
  7834. this.beginGame();
  7835. if (DataMgr.getNewUser())
  7836. Moyu.sendDataEvent("gameStart0");
  7837. }
  7838. }
  7839. else {
  7840. this.beginGame();
  7841. if (DataMgr.getNewUser())
  7842. Moyu.sendDataEvent("gameStart0");
  7843. }
  7844. break;
  7845. default:
  7846. console.error('zh:未知错误!!!!');
  7847. break;
  7848. }
  7849. }
  7850. beginGame(isNice = false) {
  7851. console.log('zh:beginGame ');
  7852. let guide = DataMgr.getSkillGuide();
  7853. if (guide == 1) {
  7854. console.log('zh:非新手引导,showInternAd ');
  7855. JSBridgeUtils.instance.showInternAd('beginGame');
  7856. }
  7857. else {
  7858. console.log('zh:新手引导,不显示AD ');
  7859. }
  7860. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7861. console.log('zh:beginGame 1');
  7862. if (xGame.common.gameMode == GameMode.classic) {
  7863. console.log('zh:beginGame 2');
  7864. if (isNice) {
  7865. console.log('zh:进入巅峰赛');
  7866. this.enterClassic();
  7867. }
  7868. else {
  7869. console.log('zh:beginGame 3-1');
  7870. xGame.uiMgr.Show(UIModeSelection, () => {
  7871. console.log('zh:beginGame 3-2');
  7872. this.enterClassic();
  7873. });
  7874. }
  7875. }
  7876. else if (xGame.common.gameMode == GameMode.bigMove) {
  7877. console.log('zh:beginGame 5');
  7878. this.ui.enterGuide.visible = false;
  7879. xGame.uiMgr.Show(UISkill);
  7880. }
  7881. }
  7882. enterClassic() {
  7883. console.log('zh:beginGame 7');
  7884. xGame.uiMgr.Show(UIGame);
  7885. xGame.uiMgr.Show(UIMatching, () => {
  7886. if (!this.isHide)
  7887. this.hide();
  7888. xGame.common.gameUI.ui.alpha = 1;
  7889. console.log('zh:beginGame 8');
  7890. xGame.common.gameUI.startGame();
  7891. xGame.uiMgr.Hide(UIGameEnd);
  7892. });
  7893. }
  7894. start_debug_for_moni_payOk() {
  7895. let ccc = this.moni_click_count + 1;
  7896. this.moni_click_count = ccc;
  7897. if (ccc % 5 == 0) {
  7898. console.log('zh:start_debug_for_moni_payOk');
  7899. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7900. if (userInfo != null) {
  7901. let token = userInfo.token;
  7902. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7903. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7904. alert('模拟支付OK');
  7905. return;
  7906. }
  7907. else {
  7908. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7909. }
  7910. }
  7911. }
  7912. startGlobal() {
  7913. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7914. }
  7915. startWeekly() {
  7916. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7917. }
  7918. zhouSaiMonth() {
  7919. console.log('zh: zhouSaiMonth 被调用');
  7920. }
  7921. isReadyForLoadNetSource() {
  7922. let reqCount = xGame.cfgMgr.httpReqCount;
  7923. let ok = xGame.cfgMgr.httpReqOkCount;
  7924. if (reqCount > ok) {
  7925. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7926. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7927. Laya.timer.once(5000, this, () => {
  7928. let retryCount = 0;
  7929. const maxRetries = 3;
  7930. const tryFetchConfig = () => {
  7931. try {
  7932. xGame.cfgMgr.getConfigFromServer();
  7933. }
  7934. catch (error) {
  7935. if (retryCount < maxRetries) {
  7936. retryCount++;
  7937. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7938. Laya.timer.once(5000, this, tryFetchConfig);
  7939. }
  7940. else {
  7941. console.error("❌ 达到最大重试次数,配置获取失败");
  7942. }
  7943. }
  7944. };
  7945. tryFetchConfig();
  7946. });
  7947. return false;
  7948. }
  7949. return true;
  7950. }
  7951. startPlaceBall() {
  7952. if (!this.isReadyForLoadNetSource()) {
  7953. return;
  7954. }
  7955. xGame.uiMgr.Show(UILevelDisplay);
  7956. }
  7957. hide() {
  7958. console.log('zh:uimain hide ...');
  7959. super.hide();
  7960. xGame.common.stopGirlPop(this.ui.talkNode);
  7961. }
  7962. onGetUserInfo(force = false) {
  7963. if (Moyu.isWx) {
  7964. let info = Moyu.getSystemInfo();
  7965. if (info)
  7966. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7967. }
  7968. else {
  7969. Moyu.initUser(this, this.freshUser, force);
  7970. }
  7971. this.freshUser();
  7972. console.log('zh:5秒后更新用户信息');
  7973. setTimeout(() => {
  7974. DataMgr.getUserZiChanInfo(true);
  7975. }, 5000);
  7976. }
  7977. event_login_in() {
  7978. console.log("zh:event_login_in被触发");
  7979. this.freshUser();
  7980. }
  7981. freshUser() {
  7982. let user = Moyu.getUserInfo();
  7983. if (!user.isAuth) {
  7984. user.headIcon = 'res/ty_touxiang.png';
  7985. }
  7986. else {
  7987. DataMgr.upRankData();
  7988. }
  7989. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7990. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7991. let keyStr = keyForLoginInfo;
  7992. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7993. const d = LocalStorageManager.getItem(keyStr);
  7994. let ua = d.username;
  7995. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7996. }
  7997. else {
  7998. }
  7999. this.c_btn_for_user();
  8000. }
  8001. interuptSecretary() {
  8002. Laya.timer.clearAll(this);
  8003. this.playSecretaryRandomSound();
  8004. }
  8005. playSecretaryRandomSound() {
  8006. if (this.isHide)
  8007. return;
  8008. let time = xGame.common.randomNum(45000, 60000);
  8009. Laya.timer.once(time, this, () => {
  8010. if (this.isHide)
  8011. return;
  8012. let index = xGame.common.randomNum(4, 7);
  8013. xGame.soundMgr.playSound("s_main0" + index);
  8014. let words = 1;
  8015. switch (index) {
  8016. case 4:
  8017. words = 5;
  8018. break;
  8019. case 5:
  8020. words = 3;
  8021. break;
  8022. case 6:
  8023. words = 6;
  8024. break;
  8025. case 7:
  8026. words = 7;
  8027. break;
  8028. default:
  8029. break;
  8030. }
  8031. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8032. this.playSecretaryRandomSound();
  8033. });
  8034. }
  8035. openSecretaryView() {
  8036. xGame.uiMgr.Show(UISecretary);
  8037. Moyu.sendDataEvent("secretary");
  8038. }
  8039. openShopView() {
  8040. xGame.uiMgr.Show(UIShop, 1);
  8041. }
  8042. openShopView0() {
  8043. xGame.uiMgr.Show(UIShop, 0);
  8044. }
  8045. openSignView() {
  8046. xGame.uiMgr.Show(UISign);
  8047. }
  8048. openDrawView() {
  8049. xGame.uiMgr.Show(UIDraw);
  8050. }
  8051. openRanking() {
  8052. console.log('zh:phb openRanking');
  8053. xGame.uiMgr.Show(UIRanking);
  8054. Moyu.sendDataEvent("rankingList");
  8055. }
  8056. }
  8057. UIMain.uiName = "UIMain";
  8058. class UIGameEnd extends UIBase {
  8059. constructor() {
  8060. super();
  8061. this.success = false;
  8062. this.awardCoinNum = 1000;
  8063. this.awardDiamondNum = 10;
  8064. }
  8065. onConstructor() {
  8066. this.ui = ui_UIGameEnd.createInstance();
  8067. this.contentPane = this.ui;
  8068. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8069. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8070. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8071. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8072. this.ui.talkNode.visible = false;
  8073. if (Moyu.isKs)
  8074. this.ui.closeNode.closeBtn.x += 100;
  8075. }
  8076. updateType() {
  8077. switch (xGame.common.gameMode) {
  8078. case GameMode.classic:
  8079. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8080. this.ui.coinNode.visible = this.success;
  8081. if (!this.success) {
  8082. Laya.timer.once(500, this, () => {
  8083. xGame.uiMgr.Show(UIAddCoin);
  8084. });
  8085. }
  8086. else {
  8087. this.logEventForClassic_win();
  8088. }
  8089. this.logEventForClassic_complete();
  8090. this.ui.isGetAward.visible = false;
  8091. this.ui.leftBtn.c1.selectedIndex = 3;
  8092. this.ui.rightBtn.c1.selectedIndex = 0;
  8093. this.moneyNode.ui.c1.selectedIndex = 1;
  8094. break;
  8095. case GameMode.bigMove:
  8096. console.log('zh:招法模式 aaaaaa bigMove');
  8097. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8098. this.ui.coinNode.visible = this.success;
  8099. if (xGame.common.gameMode == GameMode.bigMove) {
  8100. if (this.success) {
  8101. DataMgr.setSkillSuccessTimes(1, true);
  8102. DataMgr.setSkillAccTimes(1);
  8103. }
  8104. else {
  8105. DataMgr.setSkillSuccessTimes(0, false);
  8106. }
  8107. }
  8108. this.logEventForRod_complete_N();
  8109. if (!this.success) {
  8110. Laya.timer.once(500, this, () => {
  8111. xGame.uiMgr.Show(UIAddCoin);
  8112. });
  8113. }
  8114. else {
  8115. this.logEventForRod_win();
  8116. }
  8117. this.ui.isGetAward.visible = false;
  8118. this.ui.leftBtn.c1.selectedIndex = 3;
  8119. this.ui.rightBtn.c1.selectedIndex = 0;
  8120. this.moneyNode.ui.c1.selectedIndex = 1;
  8121. break;
  8122. case GameMode.placeBall:
  8123. this.ui.coinNode.visible = false;
  8124. if (this.success) {
  8125. if (xGame.common.placeBallStarNum == 3) {
  8126. this.ui.c1.selectedIndex = 2;
  8127. }
  8128. else {
  8129. this.ui.c1.selectedIndex = 3;
  8130. }
  8131. let level = xGame.common.placeBallCurLevel;
  8132. if (level > 59) {
  8133. this.logEventForChallenge_level_complete(level);
  8134. }
  8135. else {
  8136. this.logEventForChallenge_level_N(level);
  8137. }
  8138. }
  8139. else {
  8140. this.ui.c1.selectedIndex = 4;
  8141. }
  8142. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8143. if (cfg.type == PlaceBallType.challenge) {
  8144. this.ui.c1.selectedIndex = 2;
  8145. }
  8146. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8147. this.updatePlaceBallBtn();
  8148. this.updatePlaceBallStarNum();
  8149. this.updatePlaceBallAwardState();
  8150. this.moneyNode.ui.c1.selectedIndex = 2;
  8151. this.moneyNode.checkPowerTime();
  8152. this.moneyNode.powerChange();
  8153. DataMgr.upRankData();
  8154. break;
  8155. default:
  8156. break;
  8157. }
  8158. }
  8159. logEventForRod_complete_N() {
  8160. let gfmsIdx = xGame.common.curPlayerSkillType;
  8161. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8162. let gfmc = 'Skyfall Shot';
  8163. if (gfmsIdx == 0) {
  8164. gfmc = 'Skyfall Shot';
  8165. }
  8166. if (gfmsIdx == 1) {
  8167. gfmc = 'Surging break';
  8168. }
  8169. if (gfmsIdx == 2) {
  8170. gfmc = 'Frost Lock';
  8171. }
  8172. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8173. console.log('zh:logEventForRod_complete_N level = ' + level);
  8174. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8175. let jsonStr = {
  8176. "count": 0,
  8177. "name": gfmc
  8178. };
  8179. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8180. const d = LocalStorageManager.getItem(keyStr);
  8181. jsonStr.count = d.count + 1;
  8182. LocalStorageManager.setItem(keyStr, jsonStr);
  8183. }
  8184. else {
  8185. LocalStorageManager.setItem(keyStr, jsonStr);
  8186. }
  8187. const d2 = LocalStorageManager.getItem(keyStr);
  8188. let count = d2.count;
  8189. console.log('zh:logEventForRod_complete_N count = ' + count);
  8190. if (count % 5 == 0) {
  8191. const reqStr = JSON.stringify(jsonStr);
  8192. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8193. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8194. }
  8195. }
  8196. logEventForRod_win() {
  8197. console.log('zh:logEventForRod_win,胜利');
  8198. let gfmsIdx = xGame.common.curPlayerSkillType;
  8199. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8200. let gfmc = 'Skyfall Shot';
  8201. if (gfmsIdx == 0) {
  8202. gfmc = 'Skyfall Shot';
  8203. }
  8204. if (gfmsIdx == 1) {
  8205. gfmc = 'Surging break';
  8206. }
  8207. if (gfmsIdx == 2) {
  8208. gfmc = 'Frost Lock';
  8209. }
  8210. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8211. console.log('zh:logEventForRod_win level = ' + level);
  8212. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8213. let jsonStr = {
  8214. "count": 1,
  8215. "name": gfmc + ' Lev' + level
  8216. };
  8217. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8218. const d = LocalStorageManager.getItem(keyStr);
  8219. jsonStr.count = d.count + 1;
  8220. LocalStorageManager.setItem(keyStr, jsonStr);
  8221. }
  8222. else {
  8223. LocalStorageManager.setItem(keyStr, jsonStr);
  8224. }
  8225. const reqStr = JSON.stringify(jsonStr);
  8226. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8227. }
  8228. logEventForClassic_win() {
  8229. console.log('zh:logEventForClassic_win,胜利');
  8230. let rtype = xGame.common.classicRoomType;
  8231. let msmc = '';
  8232. if (rtype == 1) {
  8233. msmc = 'beginner';
  8234. }
  8235. if (rtype == 2) {
  8236. msmc = 'expert';
  8237. }
  8238. if (rtype == 3) {
  8239. msmc = 'master';
  8240. }
  8241. let keyStr = 'sjmd_classic_win_' + rtype;
  8242. let jsonStr = {
  8243. "difficulty": msmc,
  8244. "classic_count": 1,
  8245. "difficulty_count": 1
  8246. };
  8247. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8248. const d = LocalStorageManager.getItem(keyStr);
  8249. jsonStr.classic_count = d.classic_count + 1;
  8250. jsonStr.difficulty_count = d.difficulty_count + 1;
  8251. LocalStorageManager.setItem(keyStr, jsonStr);
  8252. }
  8253. else {
  8254. LocalStorageManager.setItem(keyStr, jsonStr);
  8255. }
  8256. const reqStr = JSON.stringify(jsonStr);
  8257. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8258. }
  8259. logEventForClassic_complete() {
  8260. console.log('zh:logEventForClassic_complete,胜利');
  8261. let rtype = xGame.common.classicRoomType;
  8262. let msmc = '';
  8263. if (rtype == 1) {
  8264. msmc = 'beginner';
  8265. }
  8266. if (rtype == 2) {
  8267. msmc = 'expert';
  8268. }
  8269. if (rtype == 3) {
  8270. msmc = 'master';
  8271. }
  8272. let keyStr = 'sjmd_classic_complete_' + rtype;
  8273. let jsonStr = {
  8274. "msmc": msmc,
  8275. "count": 0
  8276. };
  8277. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8278. const d = LocalStorageManager.getItem(keyStr);
  8279. jsonStr.count = d.count + 1;
  8280. LocalStorageManager.setItem(keyStr, jsonStr);
  8281. }
  8282. else {
  8283. LocalStorageManager.setItem(keyStr, jsonStr);
  8284. }
  8285. if (jsonStr.count % 5 == 0) {
  8286. const reqStr = JSON.stringify(jsonStr);
  8287. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8288. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8289. }
  8290. }
  8291. updatePlaceBallBtn() {
  8292. this.ui.leftBtn.c1.selectedIndex = 5;
  8293. if (this.success) {
  8294. this.ui.rightBtn.c1.selectedIndex = 14;
  8295. }
  8296. else {
  8297. if (xGame.common.placeBallStarNum == 3) {
  8298. this.ui.rightBtn.c1.selectedIndex = 14;
  8299. }
  8300. else {
  8301. this.ui.rightBtn.c1.selectedIndex = 1;
  8302. }
  8303. }
  8304. }
  8305. updatePlaceBallStarNum() {
  8306. let starNum = xGame.common.placeBallStarNum;
  8307. if (starNum == 0)
  8308. this.ui.starNumNode.c1.selectedIndex = 3;
  8309. else {
  8310. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8311. }
  8312. }
  8313. updatePlaceBallAwardState() {
  8314. let level = xGame.common.placeBallCurLevel;
  8315. let starNum = xGame.common.placeBallStarNum;
  8316. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8317. let data = cfgTable.placeballData[level].award;
  8318. let cfg = cfgTable.placeballData[level];
  8319. this.awardDiamondNum = data[1];
  8320. this.awardCoinNum = data[0];
  8321. if (cfg.type == PlaceBallType.challenge) {
  8322. this.awardDiamondNum = 0;
  8323. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8324. }
  8325. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8326. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8327. if (cfg.type == PlaceBallType.challenge) {
  8328. this.ui.awardNode.coinNode.visible = true;
  8329. }
  8330. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8331. this.ui.awardNode.diamondNode.x = 265;
  8332. this.ui.awardNode.coinNode.x = 354;
  8333. }
  8334. else {
  8335. this.ui.awardNode.diamondNode.x = 291;
  8336. this.ui.awardNode.coinNode.x = 291;
  8337. }
  8338. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8339. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8340. if (this.awardCoinNum == 0) {
  8341. this.ui.awardNode.coinNode.numTxt.text = "";
  8342. }
  8343. if (getAward) {
  8344. this.ui.isGetAward.visible = true;
  8345. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8346. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8347. }
  8348. else {
  8349. this.ui.isGetAward.visible = false;
  8350. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8351. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8352. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8353. }
  8354. else {
  8355. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8356. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8357. }
  8358. }
  8359. }
  8360. show(success) {
  8361. super.show();
  8362. xGame.eventMgr.event(RESET_GAME);
  8363. this.success = success;
  8364. Laya.timer.clearAll(this);
  8365. this.playSecretaryAni();
  8366. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8367. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8368. offsetTime = Math.floor(offsetTime / 1000);
  8369. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8370. this.updateType();
  8371. Laya.timer.once(200, this, () => {
  8372. this.addAward(() => {
  8373. this.updateType();
  8374. Laya.timer.once(500, this, () => {
  8375. this.showChallengeLevel();
  8376. });
  8377. });
  8378. });
  8379. if (this.success) {
  8380. JSBridgeUtils.instance.showInternAd('gameend_success');
  8381. console.log('zh:game end 成功');
  8382. xGame.soundMgr.playSound('slots_roll01');
  8383. xGame.soundMgr.playSound("s_win");
  8384. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8385. this.diyGameDataUtilForGameWin();
  8386. this.updateGamePlaceBallData2Server();
  8387. }
  8388. else {
  8389. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8390. console.log('zh:game end失败');
  8391. xGame.soundMgr.playSound('matchwin01');
  8392. xGame.soundMgr.playSound("s_lose");
  8393. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8394. }
  8395. console.log('zh:开始弹出福利框2个');
  8396. Laya.timer.once(1000, this, () => {
  8397. console.log('zh: 1秒后 showFuLiSp1');
  8398. DataMgr.checkForShowFuLi17AndAlert(1);
  8399. });
  8400. let challengeNum = DataMgr.getChallengeTimes();
  8401. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8402. DataMgr.setChallengeTimes(1);
  8403. }
  8404. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8405. DataMgr.setClassicTimes();
  8406. }
  8407. this.setGlobalFont(this.ui);
  8408. }
  8409. diyGameDataUtilForGameWin() {
  8410. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8411. switch (xGame.common.gameMode) {
  8412. case GameMode.classic:
  8413. console.log('zh:DiyGameDataUtilForGameWin 111');
  8414. case GameMode.bigMove:
  8415. console.log('zh:DiyGameDataUtilForGameWin 222');
  8416. this.restartGame();
  8417. break;
  8418. case GameMode.placeBall:
  8419. console.log('zh:DiyGameDataUtilForGameWin 333');
  8420. var level = xGame.common.placeBallCurLevel;
  8421. console.log('zh:练习模式 联系了多少LEV=' + level);
  8422. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8423. if (level > db_over_lev) {
  8424. DataMgr.setChallengeMode_overLev(level);
  8425. }
  8426. break;
  8427. default:
  8428. console.log('zh:DiyGameDataUtilForGameWin 444');
  8429. break;
  8430. }
  8431. }
  8432. updateGamePlaceBallData2Server() {
  8433. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8434. if (userInfo == null) {
  8435. return;
  8436. }
  8437. let pbdObj = DataMgr.getPlaceBallLevelList();
  8438. let reqData = xGame.httpMgr.getReqData();
  8439. let pd = JSON.parse(reqData);
  8440. pd.placeBallData = JSON.stringify(pbdObj);
  8441. reqData = JSON.stringify(pd);
  8442. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8443. try {
  8444. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8445. let code = res.code;
  8446. let msg = res.msg;
  8447. if (code == 401) {
  8448. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8449. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8450. return;
  8451. }
  8452. if (code == 200) {
  8453. let data = res.data;
  8454. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8455. }
  8456. else {
  8457. xGame.uiMgr.Show(UIMsg, msg);
  8458. }
  8459. }
  8460. catch (error) {
  8461. console.log('error=' + error);
  8462. alert(error);
  8463. }
  8464. finally {
  8465. }
  8466. });
  8467. }
  8468. showChallengeLevel() {
  8469. if (DataMgr.getChallengeTimes() != 0)
  8470. return;
  8471. let skill = DataMgr.getSkillAccTimes();
  8472. let put = DataMgr.getPlaceBallLevelList().length;
  8473. if (skill >= 3 || put >= 5) {
  8474. xGame.uiMgr.Show(UIInvitation);
  8475. this.hide();
  8476. }
  8477. }
  8478. addAward(callback) {
  8479. if (!this.success) {
  8480. callback && callback();
  8481. return;
  8482. }
  8483. switch (xGame.common.gameMode) {
  8484. case GameMode.classic:
  8485. this.awardCoinNum = xGame.common.passAwardCoin;
  8486. this.awardDiamondNum = 0;
  8487. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8488. break;
  8489. case GameMode.bigMove:
  8490. this.awardCoinNum = xGame.common.passAwardCoin;
  8491. this.awardDiamondNum = 0;
  8492. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8493. callback && callback();
  8494. break;
  8495. case GameMode.placeBall:
  8496. let level = xGame.common.placeBallCurLevel;
  8497. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8498. if (xGame.common.placeBallStarNum != 3) {
  8499. callback && callback();
  8500. return;
  8501. }
  8502. else {
  8503. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8504. if (getAward) {
  8505. callback && callback();
  8506. return;
  8507. }
  8508. }
  8509. let cfg = cfgTable.placeballData[level];
  8510. let data = cfgTable.placeballData[level].award;
  8511. this.awardCoinNum = data[0];
  8512. this.awardDiamondNum = data[1];
  8513. if (cfg.type == PlaceBallType.challenge) {
  8514. this.awardDiamondNum = 0;
  8515. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8516. }
  8517. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8518. let diamondAward;
  8519. if (this.awardDiamondNum > 0) {
  8520. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8521. xGame.common.getAward([diamondAward, coinAward], callback);
  8522. }
  8523. else {
  8524. xGame.common.getAward([coinAward], callback);
  8525. }
  8526. if (cfg.type == PlaceBallType.normal) {
  8527. DataMgr.setPlaceBallAward(level);
  8528. }
  8529. break;
  8530. default:
  8531. break;
  8532. }
  8533. }
  8534. playSecretaryAni_old() {
  8535. let parent = this.ui.secretary.displayObject;
  8536. parent.destroyChildren();
  8537. let xx = this.ui.secretary.width / 2;
  8538. let yy = this.ui.secretary.height;
  8539. let scale = xGame.common.getSecretaryScale();
  8540. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8541. if (this.success) {
  8542. let rand = Math.random() <= 0.5 ? 2 : 3;
  8543. xGame.common.secretary.play(data, rand, false, parent, () => {
  8544. xGame.common.secretary.play(data, 1, true, parent);
  8545. });
  8546. }
  8547. else {
  8548. xGame.common.secretary.play(data, 0, true, parent);
  8549. }
  8550. }
  8551. playSecretaryAni() {
  8552. let parent = this.ui.secretary.displayObject;
  8553. parent.destroyChildren();
  8554. let xx = this.ui.secretary.width / 2;
  8555. let yy = this.ui.secretary.height;
  8556. let scale = xGame.common.getSecretaryScale();
  8557. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8558. if (this.success) {
  8559. let rand = 0;
  8560. xGame.common.secretary.play(data, 0, true, parent);
  8561. }
  8562. else {
  8563. xGame.common.secretary.play(data, 0, true, parent);
  8564. }
  8565. }
  8566. restartGame() {
  8567. switch (xGame.common.gameMode) {
  8568. case GameMode.classic:
  8569. xGame.eventMgr.event(RESTART_GAME);
  8570. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8571. break;
  8572. case GameMode.bigMove:
  8573. this.hide();
  8574. xGame.eventMgr.event(RESTART_GAME);
  8575. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8576. break;
  8577. default:
  8578. break;
  8579. }
  8580. }
  8581. hide() {
  8582. super.hide();
  8583. xGame.common.stopGirlPop(this.ui.talkNode);
  8584. PlatMgr.showBanner(false);
  8585. }
  8586. returnHome() {
  8587. this.hide();
  8588. let showFailWords = !this.success;
  8589. xGame.uiMgr.Show(UIMain, showFailWords);
  8590. }
  8591. clickLeftBtn() {
  8592. switch (xGame.common.gameMode) {
  8593. case GameMode.classic:
  8594. case GameMode.bigMove:
  8595. this.returnHome();
  8596. break;
  8597. case GameMode.placeBall:
  8598. let level = xGame.common.placeBallCurLevel;
  8599. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8600. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8601. break;
  8602. default:
  8603. break;
  8604. }
  8605. }
  8606. powerStartPlaceBallLevel(level, btn) {
  8607. if (DataMgr.powerEnough()) {
  8608. btn.touchable = false;
  8609. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8610. btn.touchable = true;
  8611. DataMgr.setPower(-1);
  8612. xGame.eventMgr.event(POWER_TIME);
  8613. this.startPlaceBallLevel(level);
  8614. this.logEventForChallenge_level_start(level);
  8615. }));
  8616. }
  8617. else {
  8618. xGame.uiMgr.Show(UIPower, 0);
  8619. }
  8620. }
  8621. clickRightBtn() {
  8622. switch (xGame.common.gameMode) {
  8623. case GameMode.classic:
  8624. console.log('zh:clickRightBtn 111');
  8625. case GameMode.bigMove:
  8626. console.log('zh:clickRightBtn 222');
  8627. this.restartGame();
  8628. break;
  8629. case GameMode.placeBall:
  8630. console.log('zh:clickRightBtn 333');
  8631. let level = xGame.common.placeBallCurLevel;
  8632. let data = DataMgr.getPlaceBallLevel(level);
  8633. let curPss = data.play && !data.isCur;
  8634. if (curPss) {
  8635. console.log('zh:clickRightBtn 333-111');
  8636. console.log('zh:当前LV=' + level);
  8637. if (level == 60) {
  8638. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8639. Laya.timer.once(3000, this, () => {
  8640. this.returnHome();
  8641. });
  8642. }
  8643. else {
  8644. let lev = level + 1;
  8645. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8646. }
  8647. }
  8648. else {
  8649. console.log('zh:clickRightBtn 333-000');
  8650. Moyu.sendDataEvent("placeBallNextLevel");
  8651. console.log('zh:qjff_AD_for_uiGameEnd');
  8652. if (Laya.Browser.onAndroid) {
  8653. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8654. if (!boo) {
  8655. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8656. return;
  8657. }
  8658. }
  8659. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8660. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8661. }
  8662. else {
  8663. console.log('zh:AD 失败,直接发放奖励');
  8664. this.qjff_AD_for_uiGameEnd(level);
  8665. }
  8666. }
  8667. break;
  8668. default:
  8669. console.log('zh:clickRightBtn 444');
  8670. break;
  8671. }
  8672. }
  8673. logEventForChallenge_level_start(level) {
  8674. let keyStr = 'sjmd_challenge_level_start';
  8675. let jsonStr = {
  8676. "count": 0,
  8677. "gold_balance ": DataMgr.getCoin(),
  8678. "level": level,
  8679. "diamond_balance ": DataMgr.getDiamond()
  8680. };
  8681. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8682. const d = LocalStorageManager.getItem(keyStr);
  8683. if (level > d.level) {
  8684. jsonStr.count = d.count + 1;
  8685. LocalStorageManager.setItem(keyStr, jsonStr);
  8686. }
  8687. else {
  8688. }
  8689. }
  8690. else {
  8691. LocalStorageManager.setItem(keyStr, jsonStr);
  8692. }
  8693. const reqStr = JSON.stringify(jsonStr);
  8694. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8695. }
  8696. qjff_AD_for_uiGameEnd(level) {
  8697. DataMgr.setPlaceBallLevel(level, 1);
  8698. this.startPlaceBallLevel(level + 1);
  8699. }
  8700. startPlaceBallLevel(level) {
  8701. xGame.common.gameMode = GameMode.placeBall;
  8702. xGame.common.placeBallCurLevel = level;
  8703. xGame.uiMgr.Show(UIGame);
  8704. this.hide();
  8705. }
  8706. logEventForChallenge_level_complete(level) {
  8707. let keyStr = 'sjmd_challenge_level_complete';
  8708. let jsonStr = {
  8709. "count": 1,
  8710. "gold_balance ": DataMgr.getCoin(),
  8711. "level": level,
  8712. "diamond_balance ": DataMgr.getDiamond()
  8713. };
  8714. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8715. const d = LocalStorageManager.getItem(keyStr);
  8716. jsonStr.count = d.count + 1;
  8717. LocalStorageManager.setItem(keyStr, jsonStr);
  8718. }
  8719. else {
  8720. LocalStorageManager.setItem(keyStr, jsonStr);
  8721. }
  8722. const reqStr = JSON.stringify(jsonStr);
  8723. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8724. }
  8725. logEventForChallenge_level_N(level) {
  8726. console.log('zh:logEventForChallenge_level_N ' + level);
  8727. let keyStr = 'sjmd_challenge_level_N';
  8728. if (LocalStorageManager.hasKey(keyStr)) {
  8729. let lev = LocalStorageManager.getItem(keyStr);
  8730. if (level > lev) {
  8731. LocalStorageManager.setItem(keyStr, level);
  8732. }
  8733. if ((level) % 5 == 0) {
  8734. console.log('zh:每5关上报1次');
  8735. let sjmc = 'challenge_level_' + level;
  8736. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8737. let sjmcForFirebase = 'challenge_level_' + level;
  8738. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8739. }
  8740. else {
  8741. console.log('zh:5 no 上报');
  8742. }
  8743. }
  8744. else {
  8745. LocalStorageManager.setItem(keyStr, level);
  8746. }
  8747. }
  8748. }
  8749. UIGameEnd.uiName = "UIGameEnd";
  8750. class ui_UIVideoShare extends fgui.GComponent {
  8751. static createInstance() {
  8752. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8753. }
  8754. onConstruct() {
  8755. this.n10 = (this.getChild("n10"));
  8756. this.myNode = (this.getChild("myNode"));
  8757. this.t0 = this.getTransition("t0");
  8758. }
  8759. }
  8760. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8761. class UIVideoShare extends UIBase {
  8762. constructor() {
  8763. super();
  8764. this.success = false;
  8765. this.awardNum = 0;
  8766. this.isShared = true;
  8767. }
  8768. onConstructor() {
  8769. this.ui = ui_UIVideoShare.createInstance();
  8770. this.contentPane = this.ui;
  8771. this.isEject = false;
  8772. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8773. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8774. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8775. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8776. }
  8777. show(success) {
  8778. super.show();
  8779. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8780. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8781. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8782. this.success = success;
  8783. let time = xGame.common.randomNum(600, 1500);
  8784. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8785. if (success)
  8786. xGame.soundMgr.playSound("applause");
  8787. this.ui.t0.play();
  8788. this.checkShareState();
  8789. let times = DataMgr.getDailyVideoShareTimes();
  8790. this.awardNum = times == 0 ? 2000 : 200;
  8791. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8792. this.setGlobalFont(this.ui);
  8793. }
  8794. checkShareState() {
  8795. if (PlatMgr.forceShare == 0) {
  8796. this.ui.myNode.closeBtn.visible = true;
  8797. this.ui.myNode.tipsNode.visible = false;
  8798. this.ui.myNode.closeBtn.x = 90;
  8799. this.ui.myNode.shareBtn.x = 342;
  8800. }
  8801. else if (PlatMgr.forceShare == 1) {
  8802. this.ui.myNode.closeBtn.visible = false;
  8803. this.ui.myNode.tipsNode.visible = true;
  8804. this.ui.myNode.shareBtn.x = 218;
  8805. this.isShared = true;
  8806. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8807. }
  8808. }
  8809. checkForceShare() {
  8810. this.isShared = !this.isShared;
  8811. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8812. }
  8813. videoShare() {
  8814. if (PlatMgr.forceShare == 1) {
  8815. if (this.isShared) {
  8816. this.shareGame();
  8817. }
  8818. else {
  8819. this.hideSelf();
  8820. }
  8821. }
  8822. else {
  8823. this.shareGame();
  8824. }
  8825. }
  8826. shareGame() {
  8827. Moyu.sendDataEvent("VideoShare");
  8828. if (Moyu.canShare() > 100) {
  8829. Moyu.shareGame((success) => {
  8830. if (success) {
  8831. DataMgr.setDailyVideoShareTimes(1);
  8832. DataMgr.setCoin(this.awardNum);
  8833. }
  8834. this.hideSelf();
  8835. }, this);
  8836. }
  8837. else {
  8838. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8839. this.hideSelf();
  8840. }
  8841. }
  8842. hideSelf() {
  8843. this.hide();
  8844. xGame.uiMgr.Show(UIGameEnd, this.success);
  8845. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8846. xGame.common.screenImg.destroy();
  8847. xGame.common.screenImg = null;
  8848. }
  8849. }
  8850. }
  8851. UIVideoShare.uiName = "UIVideoShare";
  8852. class GameMgr {
  8853. constructor() {
  8854. this.selfCamp = "";
  8855. this.selfFoulNum = 0;
  8856. this.selfBallArr = [];
  8857. this.selfTimer = 0;
  8858. this.selfScore = 0;
  8859. this.aiCamp = "";
  8860. this.aiFoulNum = 0;
  8861. this.aiBallArr = [];
  8862. this.aiTimer = 0;
  8863. this.aiScore = 0;
  8864. this.aiSkillLevelNum = 1;
  8865. this.targertScore = 0;
  8866. this.setTime = 30;
  8867. this.selfTurnRate = 0.5;
  8868. this.accTime = 0;
  8869. this.curFoul = "";
  8870. this.maxFoulTimes = 3;
  8871. this.isFirstInGame = true;
  8872. this.firstColliObj = null;
  8873. this.inHoleBalls = [];
  8874. this.blackNum = 8;
  8875. this.success = false;
  8876. this.holePosList = [];
  8877. this.posObj = {};
  8878. this._selfTurn = false;
  8879. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8880. this.ensureBallType = false;
  8881. this.isOpenBall = true;
  8882. this.finishOneShoot = true;
  8883. this.isEnd = false;
  8884. this.isChangeTurn = false;
  8885. this.isInterrupt = false;
  8886. this.aiPlayedBreakArmy = false;
  8887. this.isTouchedBall = false;
  8888. this.finishBalls = 0;
  8889. this.needBalls = 0;
  8890. this.allBallNum = 0;
  8891. this.placeBallPosData = {};
  8892. this.curHP = 0;
  8893. this.showLongView = false;
  8894. this.firstShoot = true;
  8895. this._gamePause = false;
  8896. this.trunCount = 0;
  8897. this.isBlackInHole = false;
  8898. this.isEnter = true;
  8899. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8900. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8901. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8902. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8903. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8904. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8905. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8906. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8907. }
  8908. get gamePause() {
  8909. return this._gamePause;
  8910. }
  8911. set gamePause(v) {
  8912. if (v) {
  8913. Laya.physicsTimer.pause();
  8914. }
  8915. else {
  8916. Laya.physicsTimer.resume();
  8917. }
  8918. this._gamePause = v;
  8919. }
  8920. get selfTurn() {
  8921. return this._selfTurn;
  8922. }
  8923. set selfTurn(val) {
  8924. this.trunCount++;
  8925. this._selfTurn = val;
  8926. if (val) {
  8927. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8928. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8929. }
  8930. else {
  8931. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8932. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8933. if (this.trunCount > 1)
  8934. PlatMgr.openBox();
  8935. }
  8936. }
  8937. resetGame() {
  8938. this.inHoleBalls = [];
  8939. this.isFirstInGame = true;
  8940. this.firstColliObj = null;
  8941. this.aiCamp = "";
  8942. this.selfCamp = "";
  8943. this.aiFoulNum = 0;
  8944. this.selfFoulNum = 0;
  8945. this.selfBallArr = [];
  8946. this.aiBallArr = [];
  8947. this.gamePause = false;
  8948. this.ensureBallType = false;
  8949. this.isInterrupt = false;
  8950. this.updateLeftBall();
  8951. this.clearTime();
  8952. this.aiPlayedBreakArmy = false;
  8953. this.isBlackInHole = false;
  8954. this.placeBallPosData = {};
  8955. if (xGame.common.d3World.knifeRoot) {
  8956. xGame.common.d3World.knifeRoot.destroyChildren();
  8957. }
  8958. }
  8959. gameReady() {
  8960. this.trunCount = 0;
  8961. this.firstColliObj = null;
  8962. this.isFirstInGame = true;
  8963. this.selfTurn = Math.random() <= this.selfTurnRate;
  8964. let challengeNum = DataMgr.getChallengeTimes();
  8965. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8966. this.selfTurn = true;
  8967. }
  8968. if (xGame.common.gameMode == GameMode.placeBall)
  8969. this.selfTurn = true;
  8970. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8971. this.selfTurn = true;
  8972. }
  8973. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8974. this.checkGuide();
  8975. if (xGame.common.uiRodMethod)
  8976. xGame.common.uiRodMethod.resetRod();
  8977. xGame.common.d2World.getHelpLine();
  8978. this.isOpenBall = true;
  8979. this.isTouchedBall = false;
  8980. xGame.common.aiPlayer.stopRun();
  8981. this.setTime = 30;
  8982. let ui = xGame.common.gameUI.ui;
  8983. switch (xGame.common.gameMode) {
  8984. case GameMode.classic:
  8985. xGame.common.aiPlayer.init();
  8986. this.blackNum = 8;
  8987. this.placeRootBall();
  8988. this.peoplePlay(9, 10);
  8989. ui.wordsBtn.visible = true;
  8990. ui.aiWordsBtn.visible = true;
  8991. xGame.common.talkMgr.changeAIState(true);
  8992. DataMgr.gameData.gameCount++;
  8993. DataMgr.saveGameData();
  8994. break;
  8995. case GameMode.bigMove:
  8996. this.blackNum = -1;
  8997. this.selfScore = 0;
  8998. this.aiScore = 0;
  8999. xGame.common.aiPlayer.init();
  9000. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9001. this.updateSelfScore();
  9002. this.updateAIScore();
  9003. this.updateTargetSroce();
  9004. this.placeRootBall();
  9005. this.peoplePlay(9, 10);
  9006. ui.wordsBtn.visible = true;
  9007. ui.aiWordsBtn.visible = true;
  9008. xGame.common.talkMgr.changeAIState(true);
  9009. if (DataMgr.getSkillGuide() < 1)
  9010. DataMgr.gameData.gameCount = 0;
  9011. else {
  9012. DataMgr.gameData.gameCount++;
  9013. DataMgr.saveGameData();
  9014. PlatMgr.openTry();
  9015. }
  9016. if (xGame.common.d3World.knifeRoot) {
  9017. xGame.common.d3World.knifeRoot.destroyChildren();
  9018. }
  9019. break;
  9020. case GameMode.placeBall:
  9021. this.blackNum = -1;
  9022. this.selfTurn = true;
  9023. this.setTime = 10000;
  9024. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9025. this.curHP = this.placeBallData.hp;
  9026. if (this.placeBallData.ball == -1)
  9027. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9028. else
  9029. this.needBalls = this.placeBallData.ball;
  9030. console.log("需要的进球数目", this.needBalls);
  9031. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9032. this.finishBalls = 0;
  9033. this.placeBallPosData = {};
  9034. this.updatePlaceBallPos();
  9035. this.updatePlaceBallState();
  9036. this.finishOneShoot = true;
  9037. xGame.common.gameUI.ui.moveNode.visible = false;
  9038. this.isOpenBall = false;
  9039. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9040. ui.wordsBtn.visible = false;
  9041. ui.aiWordsBtn.visible = false;
  9042. xGame.common.talkMgr.changeAIState(false);
  9043. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9044. PlatMgr.openBox();
  9045. });
  9046. break;
  9047. default:
  9048. break;
  9049. }
  9050. this.showLongView = false;
  9051. xGame.common.wordsMgr.comboTimes = 1;
  9052. let guide = DataMgr.getSkillGuide();
  9053. if (guide)
  9054. xGame.eventMgr.event(WAIT_SHOOT);
  9055. xGame.common.upSkillLevel = false;
  9056. xGame.common.gameStartTime = new Date().getTime();
  9057. this.firstShoot = true;
  9058. }
  9059. checkGuide() {
  9060. let guide = DataMgr.getSkillGuide();
  9061. let gameUI = xGame.common.gameUI.ui;
  9062. gameUI.guide1.visible = false;
  9063. gameUI.guide2.visible = false;
  9064. gameUI.guide3.visible = false;
  9065. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9066. this.selfTurn = true;
  9067. }
  9068. else {
  9069. return;
  9070. }
  9071. let oneBall = this.getOneBall();
  9072. gameUI.guide1.visible = true;
  9073. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9074. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9075. }
  9076. getOneBall() {
  9077. let arr = xGame.common.d2World.ballArr;
  9078. for (let index = 0; index < arr.length; index++) {
  9079. if (arr[index].number == 0)
  9080. continue;
  9081. return arr[index];
  9082. }
  9083. }
  9084. updateSelfScore() {
  9085. let ui = xGame.common.gameUI.ui.topNode;
  9086. ui.selfScoreTxt.text = this.selfScore + "";
  9087. }
  9088. updateAIScore() {
  9089. let ui = xGame.common.gameUI.ui.topNode;
  9090. ui.aiScoreTxt.text = this.aiScore + "";
  9091. }
  9092. updateTargetSroce() {
  9093. let ui = xGame.common.gameUI.ui.topNode;
  9094. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9095. }
  9096. updateLeftBall() {
  9097. let topUI = xGame.common.gameUI.ui.topNode;
  9098. topUI.selfBallList.numItems = this.selfBallArr.length;
  9099. topUI.aiBallList.numItems = this.aiBallArr.length;
  9100. }
  9101. ballShoot() {
  9102. this.clearTime();
  9103. this.finishOneShoot = false;
  9104. xGame.common.gameUI.ui.moveNode.visible = false;
  9105. if (xGame.common.gameUI.ui.guideNode.visible) {
  9106. xGame.common.gameUI.ui.guideNode.visible = false;
  9107. }
  9108. if (this.firstShoot) {
  9109. this.firstShoot = false;
  9110. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9111. }
  9112. }
  9113. ensureCamp(number) {
  9114. this.ensureBallType = true;
  9115. this.isOpenBall = false;
  9116. if (xGame.common.gameMode != GameMode.classic)
  9117. return;
  9118. let full = [1, 2, 3, 4, 5, 6, 7];
  9119. let flower = [9, 10, 11, 12, 13, 14, 15];
  9120. let sayWords = "";
  9121. if (this.selfTurn) {
  9122. if (number <= 7) {
  9123. this.selfCamp = ballCamp.full;
  9124. this.selfBallArr = full;
  9125. this.aiCamp = ballCamp.flower;
  9126. this.aiBallArr = flower;
  9127. sayWords = cfgTable.wordsData[3].msg;
  9128. }
  9129. else {
  9130. this.selfCamp = ballCamp.flower;
  9131. this.selfBallArr = flower;
  9132. this.aiCamp = ballCamp.full;
  9133. this.aiBallArr = full;
  9134. sayWords = cfgTable.wordsData[4].msg;
  9135. }
  9136. }
  9137. else {
  9138. if (number <= 7) {
  9139. this.selfCamp = ballCamp.flower;
  9140. this.selfBallArr = flower;
  9141. this.aiCamp = ballCamp.full;
  9142. this.aiBallArr = full;
  9143. sayWords = cfgTable.wordsData[2].msg;
  9144. }
  9145. else {
  9146. this.selfCamp = ballCamp.full;
  9147. this.selfBallArr = full;
  9148. this.aiCamp = ballCamp.flower;
  9149. this.aiBallArr = flower;
  9150. sayWords = cfgTable.wordsData[1].msg;
  9151. }
  9152. }
  9153. this.updateLeftBall();
  9154. xGame.uiMgr.Show(UIMsg, sayWords);
  9155. }
  9156. updatePlaceBallState() {
  9157. let ui = xGame.common.gameUI.ui;
  9158. switch (this.placeBallData.type) {
  9159. case PlaceBallType.normal:
  9160. let normal = ui.placeNormalNode;
  9161. normal.hpTxt.text = this.curHP + "";
  9162. this.updatePlaceBallStar(normal);
  9163. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9164. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9165. break;
  9166. case PlaceBallType.challenge:
  9167. let challenge = ui.placeChallengeNode;
  9168. challenge.hpTxt.text = "Shots:" + this.curHP;
  9169. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9170. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9171. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9172. break;
  9173. default:
  9174. break;
  9175. }
  9176. }
  9177. playSubHpAni() {
  9178. let ui = xGame.common.gameUI.ui;
  9179. switch (this.placeBallData.type) {
  9180. case PlaceBallType.normal:
  9181. let normal = ui.placeNormalNode;
  9182. normal.hpTxt.visible = false;
  9183. normal.starAni.c1.selectedIndex = 1;
  9184. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9185. normal.hpTxt.visible = true;
  9186. normal.starAni.c1.selectedIndex = 0;
  9187. }));
  9188. break;
  9189. default:
  9190. break;
  9191. }
  9192. }
  9193. getEndStarNum() {
  9194. let num;
  9195. let level = xGame.common.placeBallCurLevel;
  9196. if (this.curHP == this.placeBallData.hp) {
  9197. num = 3;
  9198. }
  9199. else if (this.curHP <= 1) {
  9200. num = 1;
  9201. }
  9202. else {
  9203. num = 2;
  9204. }
  9205. if (!this.success) {
  9206. num = 0;
  9207. }
  9208. else {
  9209. DataMgr.setPlaceBallLevel(level, num);
  9210. }
  9211. let myType = cfgTable.placeballData[level].type;
  9212. if (this.success && myType == 1) {
  9213. num = 3;
  9214. }
  9215. xGame.common.placeBallStarNum = num;
  9216. }
  9217. updatePlaceBallStar(node) {
  9218. let star = 0;
  9219. if (this.curHP == this.placeBallData.hp) {
  9220. star = 3;
  9221. }
  9222. else if (this.curHP >= 2) {
  9223. star = 2;
  9224. }
  9225. else if (this.curHP == 1) {
  9226. star = 1;
  9227. }
  9228. else {
  9229. star = 0;
  9230. }
  9231. let temp;
  9232. for (let index = 1; index <= 3; index++) {
  9233. temp = node["star" + index];
  9234. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9235. }
  9236. node.myProgress.value = (star / 3) * 100;
  9237. }
  9238. openRegretView(isFoul, GoalNum, challenge = false) {
  9239. let regretType = -1;
  9240. if (isFoul) {
  9241. regretType = 1;
  9242. }
  9243. else {
  9244. if (GoalNum <= 0) {
  9245. regretType = 0;
  9246. }
  9247. }
  9248. if (challenge) {
  9249. regretType = 1;
  9250. }
  9251. if (regretType != -1) {
  9252. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9253. if (success) {
  9254. this.curHP++;
  9255. this.updatePlaceBallState();
  9256. this.setPlaceBallAllPos();
  9257. xGame.common.gameUI.ui.moveNode.visible = false;
  9258. }
  9259. else {
  9260. if (this.curHP <= 0) {
  9261. this.success = false;
  9262. this.gameEnd();
  9263. }
  9264. this.playSubHpAni();
  9265. }
  9266. this.updatePlaceBallState();
  9267. this.updatePlaceBallPos();
  9268. });
  9269. }
  9270. }
  9271. setPlaceBallAllPos() {
  9272. let allBall = xGame.common.d2World.ballArr;
  9273. let cfgArr = this.placeBallPosData;
  9274. let temp;
  9275. let obj;
  9276. for (let index = 0; index < allBall.length; index++) {
  9277. temp = allBall[index];
  9278. if (temp.destroyed)
  9279. continue;
  9280. obj = cfgArr[temp.myUNID];
  9281. if (obj && obj.src && !obj.src.destroyed) {
  9282. temp.gameObj.x = obj.posX;
  9283. temp.gameObj.y = obj.posY;
  9284. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9285. }
  9286. }
  9287. xGame.common.d2World.getHelpLine();
  9288. }
  9289. updatePlaceBallPos() {
  9290. let arr = xGame.common.d2World.ballArr;
  9291. let temp;
  9292. for (let index = 0; index < arr.length; index++) {
  9293. temp = arr[index];
  9294. if (!this.placeBallPosData[temp.myUNID]) {
  9295. this.placeBallPosData[temp.myUNID] = {
  9296. src: temp,
  9297. posX: temp.gameObj.x,
  9298. posY: temp.gameObj.y
  9299. };
  9300. }
  9301. else {
  9302. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9303. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9304. }
  9305. }
  9306. let check;
  9307. for (const key in this.placeBallPosData) {
  9308. check = this.placeBallPosData[key];
  9309. if (check.src.destroyed) {
  9310. delete this.placeBallPosData[key];
  9311. }
  9312. }
  9313. }
  9314. gameRun(type) {
  9315. if (this.gamePause)
  9316. return;
  9317. this.curFoul = this.getFoulType();
  9318. if (type) {
  9319. xGame.common.d2World.d2Gan.shoot();
  9320. xGame.common.gameUI.forceCancel();
  9321. this.curFoul = type;
  9322. }
  9323. this.isEnd = false;
  9324. this.isChangeTurn = true;
  9325. if (xGame.common.gameMode == GameMode.classic) {
  9326. this.judgeClassic(this.curFoul);
  9327. this.checkClassicWords(() => {
  9328. xGame.common.destroyClassicEmotion();
  9329. if (this.isEnd) {
  9330. if (this.isBlackInHole) {
  9331. xGame.common.gameUI.ui.blackAni.visible = true;
  9332. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9333. xGame.common.gameUI.ui.blackAni.visible = false;
  9334. this.gameEnd();
  9335. }));
  9336. }
  9337. else {
  9338. this.gameEnd();
  9339. }
  9340. }
  9341. else {
  9342. this.waitShoot();
  9343. xGame.eventMgr.event(WAIT_SHOOT);
  9344. }
  9345. });
  9346. }
  9347. else if (xGame.common.gameMode == GameMode.bigMove) {
  9348. xGame.common.aiPlayer.stopRun();
  9349. let scoreArr = this.getScore(this.curFoul);
  9350. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9351. this.isEnd = true;
  9352. }
  9353. this.checkBigSkillWords(() => {
  9354. if (this.isEnd) {
  9355. this.gameEnd();
  9356. }
  9357. else {
  9358. this.waitShoot();
  9359. xGame.eventMgr.event(WAIT_SHOOT);
  9360. }
  9361. });
  9362. }
  9363. else if (xGame.common.gameMode == GameMode.placeBall) {
  9364. xGame.common.destroyAwardSpine();
  9365. let isFoul = this.curFoul == FoulType.rootHole;
  9366. let GoalNum = this.inHoleBalls.length;
  9367. if (this.inHoleBalls.indexOf(0) > -1)
  9368. GoalNum -= 1;
  9369. if (isFoul) {
  9370. this.placeRootBall();
  9371. }
  9372. console.log("neeballs", this.needBalls);
  9373. console.log("当前完成的goalNum", GoalNum);
  9374. this.finishBalls += GoalNum;
  9375. console.log("当前完成的finishballs", this.finishBalls);
  9376. let need = this.needBalls;
  9377. if (this.placeBallData.type == PlaceBallType.challenge) {
  9378. need += 100;
  9379. }
  9380. if (this.finishBalls >= need) {
  9381. this.success = true;
  9382. this.gameEnd();
  9383. }
  9384. else {
  9385. switch (this.placeBallData.type) {
  9386. case PlaceBallType.normal:
  9387. if (!isFoul && GoalNum > 0) {
  9388. this.updatePlaceBallPos();
  9389. this.updatePlaceBallState();
  9390. }
  9391. else {
  9392. this.curHP--;
  9393. this.openRegretView(isFoul, GoalNum);
  9394. }
  9395. this.waitShoot();
  9396. xGame.eventMgr.event(WAIT_SHOOT);
  9397. break;
  9398. case PlaceBallType.challenge:
  9399. this.curHP--;
  9400. this.updatePlaceBallState();
  9401. if (isFoul) {
  9402. this.openRegretView(isFoul, GoalNum, true);
  9403. }
  9404. else {
  9405. this.updatePlaceBallPos();
  9406. if (this.curHP <= 0) {
  9407. this.success = true;
  9408. this.gameEnd();
  9409. }
  9410. }
  9411. this.waitShoot();
  9412. xGame.eventMgr.event(WAIT_SHOOT);
  9413. break;
  9414. default:
  9415. break;
  9416. }
  9417. }
  9418. }
  9419. }
  9420. checkClassicWords(callback) {
  9421. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9422. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9423. let type = this.getClassicWordsType();
  9424. if (condition && type != -1) {
  9425. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9426. xGame.soundMgr.playSound(str);
  9427. xGame.common.wordsMgr.playClassicWords(type, callback);
  9428. }
  9429. else {
  9430. Laya.timer.once(300, this, () => {
  9431. callback && callback();
  9432. });
  9433. }
  9434. }
  9435. getClassicWordsType() {
  9436. let d2world = xGame.common.d2World;
  9437. let type = -1;
  9438. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9439. type = ClassicWordsType.perfectShow;
  9440. return type;
  9441. }
  9442. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9443. type = ClassicWordsType.directShoot;
  9444. return type;
  9445. }
  9446. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9447. type = ClassicWordsType.anotherShoot;
  9448. return type;
  9449. }
  9450. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9451. type = ClassicWordsType.bigPower;
  9452. return type;
  9453. }
  9454. let minSpeed = 1;
  9455. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9456. type = ClassicWordsType.hardShoot;
  9457. return type;
  9458. }
  9459. if (this.inHoleBalls.length > 0) {
  9460. type = ClassicWordsType.directShoot;
  9461. return type;
  9462. }
  9463. return type;
  9464. }
  9465. checkBigSkillWords(callback) {
  9466. if (this.curFoul == FoulType.timeOut) {
  9467. callback && callback();
  9468. }
  9469. else {
  9470. let playSkill = false;
  9471. if (this.selfTurn) {
  9472. playSkill = true;
  9473. }
  9474. else {
  9475. if (!this.aiPlayedBreakArmy) {
  9476. this.aiPlayedBreakArmy = true;
  9477. playSkill = true;
  9478. }
  9479. if (this.aiCurSkill != SkillType.breakArmy) {
  9480. playSkill = true;
  9481. }
  9482. }
  9483. if (xGame.common.skillMgr.playedLastSkill) {
  9484. xGame.common.skillMgr.playedLastSkill = false;
  9485. playSkill = false;
  9486. }
  9487. if (playSkill) {
  9488. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9489. let selfExtra = 0;
  9490. let aiExtra = 0;
  9491. if (this.selfTurn)
  9492. selfExtra += extraScore;
  9493. else
  9494. aiExtra += extraScore;
  9495. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9496. this.isEnd = true;
  9497. }
  9498. this.playBigSkillTimes(callback);
  9499. });
  9500. }
  9501. else {
  9502. this.playBigSkillTimes(callback);
  9503. }
  9504. }
  9505. }
  9506. playBigSkillTimes(callback) {
  9507. let length = this.inHoleBalls.length;
  9508. if (this.inHoleBalls.indexOf(0) > -1) {
  9509. length = this.inHoleBalls.length - 1;
  9510. }
  9511. if (length <= 0) {
  9512. callback && callback();
  9513. return;
  9514. }
  9515. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9516. callback && callback();
  9517. });
  9518. }
  9519. playSkillTips() {
  9520. let levelNum = 0;
  9521. let curType;
  9522. if (this.selfTurn) {
  9523. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9524. curType = this.selfCurSkill;
  9525. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9526. levelNum += 5;
  9527. }
  9528. }
  9529. else {
  9530. levelNum = this.aiSkillLevelNum;
  9531. curType = this.aiCurSkill;
  9532. }
  9533. let str = ``;
  9534. switch (curType) {
  9535. case SkillType.highSpace:
  9536. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9537. break;
  9538. case SkillType.breakArmy:
  9539. str = `You pocketed ${levelNum} extra balls`;
  9540. break;
  9541. case SkillType.ice:
  9542. str = `${levelNum * 2} extra balls were frozen`;
  9543. break;
  9544. case SkillType.fireworks:
  9545. str = `${levelNum} extra balls exploded `;
  9546. break;
  9547. case SkillType.GuanYu:
  9548. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9549. break;
  9550. default:
  9551. break;
  9552. }
  9553. xGame.uiMgr.Show(UIMsg, str);
  9554. }
  9555. getFoulType() {
  9556. let foulType = "";
  9557. if (this.firstColliObj == null) {
  9558. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9559. return FoulType.rootHole;
  9560. }
  9561. return FoulType.notTouch;
  9562. }
  9563. else {
  9564. if (this.selfTurn) {
  9565. if (this.selfBallArr.length > 0) {
  9566. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9567. foulType = FoulType.wrongTouch;
  9568. }
  9569. }
  9570. else {
  9571. if (this.ensureBallType) {
  9572. }
  9573. else {
  9574. if (this.firstColliObj == this.blackNum) {
  9575. foulType = FoulType.wrongTouch;
  9576. }
  9577. }
  9578. }
  9579. }
  9580. else {
  9581. if (this.aiBallArr.length > 0) {
  9582. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9583. foulType = FoulType.wrongTouch;
  9584. }
  9585. }
  9586. else {
  9587. if (this.ensureBallType) {
  9588. }
  9589. else {
  9590. if (this.firstColliObj == this.blackNum) {
  9591. foulType = FoulType.wrongTouch;
  9592. }
  9593. }
  9594. }
  9595. }
  9596. if (this.inHoleBalls.length <= 0) {
  9597. return foulType;
  9598. }
  9599. let temp;
  9600. if (this.inHoleBalls.indexOf(0) > -1) {
  9601. foulType = FoulType.rootHole;
  9602. }
  9603. else {
  9604. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9605. temp = this.inHoleBalls[index];
  9606. if (this.selfTurn) {
  9607. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9608. foulType = FoulType.wrongHole;
  9609. break;
  9610. }
  9611. }
  9612. else {
  9613. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9614. foulType = FoulType.wrongHole;
  9615. break;
  9616. }
  9617. }
  9618. }
  9619. }
  9620. let foo;
  9621. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9622. temp = this.inHoleBalls[index];
  9623. foo = this.selfBallArr.indexOf(temp);
  9624. if (foo > -1) {
  9625. this.selfBallArr.splice(foo, 1);
  9626. }
  9627. foo = this.aiBallArr.indexOf(temp);
  9628. if (foo > -1) {
  9629. this.aiBallArr.splice(foo, 1);
  9630. }
  9631. }
  9632. this.updateLeftBall();
  9633. }
  9634. return foulType;
  9635. }
  9636. judgeGameEndByBlack(arr) {
  9637. if (this.selfTurn) {
  9638. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9639. this.selfFoulNum = this.maxFoulTimes;
  9640. return true;
  9641. }
  9642. }
  9643. else {
  9644. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9645. this.aiFoulNum = this.maxFoulTimes;
  9646. return true;
  9647. }
  9648. }
  9649. }
  9650. judgeClassic(type) {
  9651. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9652. xGame.common.aiPlayer.stopRun();
  9653. if (this.judgeNormalSuccess()) {
  9654. this.isEnd = true;
  9655. return;
  9656. }
  9657. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9658. if (this.selfTurn) {
  9659. if (isFoul) {
  9660. this.selfFoulNum++;
  9661. }
  9662. if (this.selfFoulNum >= this.maxFoulTimes) {
  9663. this.success = false;
  9664. this.isEnd = true;
  9665. return;
  9666. }
  9667. }
  9668. else {
  9669. if (isFoul)
  9670. this.aiFoulNum++;
  9671. if (this.aiFoulNum >= this.maxFoulTimes) {
  9672. this.success = true;
  9673. this.isEnd = true;
  9674. return;
  9675. }
  9676. }
  9677. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9678. this.isChangeTurn = false;
  9679. }
  9680. else {
  9681. this.isInterrupt = true;
  9682. }
  9683. }
  9684. waitShoot() {
  9685. if (xGame.common.gameMode == GameMode.classic) {
  9686. switch (this.curFoul) {
  9687. case FoulType.timeOut:
  9688. case FoulType.rootHole:
  9689. this.selfTurn = !this.selfTurn;
  9690. this.peoplePlay(5, 6, true);
  9691. break;
  9692. case FoulType.notTouch:
  9693. this.selfTurn = !this.selfTurn;
  9694. this.peoplePlay(7, 7);
  9695. break;
  9696. case FoulType.wrongHole:
  9697. this.selfTurn = !this.selfTurn;
  9698. this.peoplePlay(11, 11);
  9699. break;
  9700. default:
  9701. if (this.inHoleBalls.length > 0) {
  9702. this.peoplePlay(0, 0, false, false);
  9703. }
  9704. else {
  9705. this.selfTurn = !this.selfTurn;
  9706. this.peoplePlay(7, 7);
  9707. }
  9708. break;
  9709. }
  9710. }
  9711. else if (xGame.common.gameMode == GameMode.bigMove) {
  9712. if (this.curFoul == FoulType.timeOut) {
  9713. this.selfTurn = !this.selfTurn;
  9714. this.peoplePlay(14, 15);
  9715. this.placeRootBall();
  9716. }
  9717. else {
  9718. this.selfTurn = !this.selfTurn;
  9719. if (this.curFoul == FoulType.rootHole) {
  9720. this.peoplePlay(12, 13);
  9721. this.placeRootBall();
  9722. }
  9723. else {
  9724. this.peoplePlay(0, 0, false, false);
  9725. }
  9726. }
  9727. }
  9728. else if (xGame.common.gameMode == GameMode.placeBall) {
  9729. this.finishOneShoot = true;
  9730. }
  9731. this.gameResult();
  9732. }
  9733. gameResult() {
  9734. this.firstColliObj = null;
  9735. this.inHoleBalls = [];
  9736. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9737. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9738. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9739. if (xGame.common.uiRodMethod)
  9740. xGame.common.uiRodMethod.resetRod();
  9741. xGame.common.d2World.rootBall.showSelf();
  9742. this.clearIceSkill();
  9743. if (this.selfTurn) {
  9744. PlatMgr.gameInsert();
  9745. }
  9746. xGame.common.d3World.knifeRoot.destroyChildren();
  9747. if (this.selfTurn) {
  9748. xGame.common.gameUI.showHelpLineGuide();
  9749. xGame.common.gameUI.setTurnAlpha(true);
  9750. }
  9751. else {
  9752. xGame.common.gameUI.setTurnAlpha(false);
  9753. }
  9754. }
  9755. getScore(type) {
  9756. let selfAdd = 0;
  9757. let aiAdd = 0;
  9758. if (type == FoulType.timeOut) {
  9759. if (this.selfTurn)
  9760. aiAdd += 3;
  9761. else
  9762. selfAdd += 3;
  9763. }
  9764. else {
  9765. if (this.inHoleBalls.length > 0) {
  9766. if (this.selfTurn) {
  9767. if (type == FoulType.rootHole) {
  9768. aiAdd += 3;
  9769. if (this.inHoleBalls.length - 1 > 0) {
  9770. selfAdd += this.inHoleBalls.length - 1;
  9771. }
  9772. }
  9773. else {
  9774. selfAdd += this.inHoleBalls.length;
  9775. }
  9776. }
  9777. else {
  9778. if (type == FoulType.rootHole) {
  9779. selfAdd += 3;
  9780. if (this.inHoleBalls.length - 1 > 0) {
  9781. aiAdd += this.inHoleBalls.length - 1;
  9782. }
  9783. }
  9784. else {
  9785. aiAdd += this.inHoleBalls.length;
  9786. }
  9787. }
  9788. }
  9789. }
  9790. return [selfAdd, aiAdd];
  9791. }
  9792. judgeScoreEnd(selfAdd, aiAdd) {
  9793. this.selfScore += selfAdd;
  9794. this.aiScore += aiAdd;
  9795. this.updateAIScore();
  9796. this.updateSelfScore();
  9797. if (this.selfScore >= this.targertScore) {
  9798. this.success = true;
  9799. return true;
  9800. }
  9801. if (this.aiScore >= this.targertScore) {
  9802. this.success = false;
  9803. return true;
  9804. }
  9805. let ballArr = xGame.common.d2World.ballArr;
  9806. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9807. if (this.selfScore > this.aiScore) {
  9808. this.success = true;
  9809. return true;
  9810. }
  9811. else if (this.selfScore < this.aiScore) {
  9812. this.success = false;
  9813. return true;
  9814. }
  9815. else {
  9816. if (this.selfTurn) {
  9817. this.success = false;
  9818. }
  9819. else {
  9820. this.success = true;
  9821. }
  9822. return true;
  9823. }
  9824. }
  9825. }
  9826. clearIceSkill() {
  9827. let arr = xGame.common.d2World.ballArr;
  9828. let temp;
  9829. if (this.selfTurn) {
  9830. if (this.selfCurSkill == SkillType.ice) {
  9831. for (let index = 0; index < arr.length; index++) {
  9832. temp = arr[index];
  9833. if (temp.ballFunc == "ice") {
  9834. temp.setBallFunc("normal", "self");
  9835. }
  9836. }
  9837. }
  9838. }
  9839. else {
  9840. if (this.aiCurSkill == SkillType.ice) {
  9841. for (let index = 0; index < arr.length; index++) {
  9842. temp = arr[index];
  9843. if (temp.ballFunc == "ice") {
  9844. temp.setBallFunc("normal", "ai");
  9845. }
  9846. }
  9847. }
  9848. }
  9849. }
  9850. judgeNormalSuccess() {
  9851. if (this.selfTurn) {
  9852. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9853. this.success = true;
  9854. return true;
  9855. }
  9856. }
  9857. else {
  9858. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9859. this.success = false;
  9860. return true;
  9861. }
  9862. }
  9863. }
  9864. gameEnd() {
  9865. if (Moyu.isTT) {
  9866. xGame.common.screenImg = getScreenImg();
  9867. }
  9868. console.log("游戏结束", this.success);
  9869. xGame.common.aiPlayer.stopRun();
  9870. if (xGame.common.gameMode == GameMode.placeBall) {
  9871. this.getEndStarNum();
  9872. this.updatePlaceBallState();
  9873. }
  9874. this.isEnter = false;
  9875. Moyu.recordEnd(this, () => {
  9876. if (this.isEnter)
  9877. return;
  9878. this.isEnter = true;
  9879. console.log("进入录结束回调");
  9880. this.enterNext();
  9881. });
  9882. Laya.timer.once(1000, this, () => {
  9883. if (this.isEnter)
  9884. return;
  9885. this.isEnter = true;
  9886. this.enterNext();
  9887. });
  9888. xGame.common.longHelpLine = false;
  9889. }
  9890. enterNext() {
  9891. Laya.timer.clearAll(this);
  9892. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9893. xGame.uiMgr.Show(UIVideoShare, this.success);
  9894. }
  9895. else {
  9896. xGame.uiMgr.Show(UIGameEnd, this.success);
  9897. }
  9898. }
  9899. aiLeave() {
  9900. let ui = xGame.common.gameUI.ui;
  9901. ui.topNode.aiNameTxt.text = "offline";
  9902. }
  9903. aiGameEnd(suc) {
  9904. this.success = suc;
  9905. xGame.common.aiPlayer.stopRun();
  9906. if (this.success) {
  9907. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9908. Laya.timer.once(1000, this, () => {
  9909. this.clearTime();
  9910. this.gameEnd();
  9911. });
  9912. }
  9913. }
  9914. openTimer() {
  9915. let src = xGame.common.gameUI;
  9916. if (this.selfTurn) {
  9917. src.ui.topNode.selfProgress.visible = true;
  9918. src.ui.topNode.aiProgress.visible = false;
  9919. this.curTimer = src.ui.topNode.selfProgress;
  9920. }
  9921. else {
  9922. src.ui.topNode.selfProgress.visible = false;
  9923. src.ui.topNode.aiProgress.visible = true;
  9924. this.curTimer = src.ui.topNode.aiProgress;
  9925. }
  9926. this.accTime = 0;
  9927. Laya.timer.clearAll(this);
  9928. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9929. this.curTimer.value = 100;
  9930. }
  9931. updateTime(dt) {
  9932. if (this.gamePause)
  9933. return;
  9934. this.accTime += dt;
  9935. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9936. if (this.accTime >= this.setTime) {
  9937. this.clearTime();
  9938. console.log("时钟进入了gameRun");
  9939. this.gameRun(FoulType.timeOut);
  9940. }
  9941. }
  9942. clearTime() {
  9943. let src = xGame.common.gameUI;
  9944. src.ui.topNode.selfProgress.visible = false;
  9945. src.ui.topNode.aiProgress.visible = false;
  9946. Laya.timer.clearAll(this);
  9947. }
  9948. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9949. let ui = xGame.common.gameUI.ui;
  9950. let selfMsg, aiMsg;
  9951. if (sayWords) {
  9952. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9953. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9954. if (Foul) {
  9955. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9956. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9957. this.placeRootBall();
  9958. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9959. if (this.curFoul == FoulType.rootHole) {
  9960. if (!DataMgr.getRootBallFoul()) {
  9961. DataMgr.setRootBallFoul();
  9962. aiMsg = "";
  9963. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9964. let woman = "Boss, pay attention next time~";
  9965. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9966. }
  9967. }
  9968. else if (this.curFoul == FoulType.timeOut) {
  9969. if (!DataMgr.getTimeoutFoul()) {
  9970. DataMgr.setTimeoutFoul();
  9971. aiMsg = "";
  9972. let tips = "Game timeout, 3 fouls, this game failed.";
  9973. let woman = "Boss, pay attention to the timeline~";
  9974. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9975. }
  9976. }
  9977. }
  9978. }
  9979. }
  9980. if (this.selfTurn) {
  9981. if (sayWords) {
  9982. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9983. ui.selfTurn.visible = true;
  9984. ui.aiTurn.visible = false;
  9985. ui.selfTurn.t0.play();
  9986. Moyu.vibration();
  9987. });
  9988. }
  9989. }
  9990. else {
  9991. let aiNum = xGame.tools.random(1, 11);
  9992. let challengeNum = DataMgr.getChallengeTimes();
  9993. let delay = false;
  9994. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9995. aiNum = 9;
  9996. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9997. aiNum = 3;
  9998. if (challengeNum == 3) {
  9999. if (!this.showLongView) {
  10000. this.showLongView = true;
  10001. delay = true;
  10002. }
  10003. }
  10004. }
  10005. }
  10006. if (delay) {
  10007. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10008. if (success) {
  10009. xGame.common.longHelpLine = true;
  10010. xGame.common.d2World.getHelpLine();
  10011. }
  10012. else {
  10013. aiNum = 10;
  10014. }
  10015. xGame.common.aiPlayer.setAiLevel(aiNum);
  10016. if (sayWords) {
  10017. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10018. xGame.common.aiPlayer.runAI();
  10019. ui.selfTurn.visible = false;
  10020. ui.aiTurn.visible = true;
  10021. ui.aiTurn.t0.play();
  10022. });
  10023. }
  10024. else {
  10025. xGame.common.aiPlayer.runAI();
  10026. }
  10027. this.openTimer();
  10028. this.finishOneShoot = true;
  10029. if (this.selfTurn) {
  10030. ui.topNode.selfKuang.visible = true;
  10031. ui.topNode.aiKuang.visible = false;
  10032. ui.topNode.selfTips.visible = true;
  10033. ui.topNode.aiTips.visible = false;
  10034. }
  10035. else {
  10036. ui.topNode.selfKuang.visible = false;
  10037. ui.topNode.aiKuang.visible = true;
  10038. ui.topNode.selfTips.visible = false;
  10039. ui.topNode.aiTips.visible = true;
  10040. }
  10041. });
  10042. return;
  10043. }
  10044. if (xGame.common.gameMode == GameMode.classic) {
  10045. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10046. if (cfg) {
  10047. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10048. aiNum = aiLevel;
  10049. }
  10050. }
  10051. xGame.common.aiPlayer.setAiLevel(aiNum);
  10052. if (sayWords) {
  10053. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10054. xGame.common.aiPlayer.runAI();
  10055. ui.selfTurn.visible = false;
  10056. ui.aiTurn.visible = true;
  10057. ui.aiTurn.t0.play();
  10058. });
  10059. }
  10060. else {
  10061. xGame.common.aiPlayer.runAI();
  10062. }
  10063. }
  10064. this.openTimer();
  10065. this.finishOneShoot = true;
  10066. if (this.selfTurn) {
  10067. ui.topNode.selfKuang.visible = true;
  10068. ui.topNode.aiKuang.visible = false;
  10069. ui.topNode.selfTips.visible = true;
  10070. ui.topNode.aiTips.visible = false;
  10071. }
  10072. else {
  10073. ui.topNode.selfKuang.visible = false;
  10074. ui.topNode.aiKuang.visible = true;
  10075. ui.topNode.selfTips.visible = false;
  10076. ui.topNode.aiTips.visible = true;
  10077. }
  10078. }
  10079. placeRootBall() {
  10080. let rootBall = xGame.common.d2World.rootBall;
  10081. if (!rootBall)
  10082. return;
  10083. rootBall.gameObj.x = this.lastRootBallPos.x;
  10084. rootBall.gameObj.y = this.lastRootBallPos.y;
  10085. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10086. let moveNode = xGame.common.gameUI.ui.moveNode;
  10087. moveNode.visible = true;
  10088. moveNode.x = this.lastRootBallPos.x;
  10089. moveNode.y = this.lastRootBallPos.y;
  10090. if (!this.selfTurn) {
  10091. xGame.common.aiPlayer.resetRoot();
  10092. }
  10093. }
  10094. }
  10095. class ui_guanyuAni extends fgui.GComponent {
  10096. static createInstance() {
  10097. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10098. }
  10099. onConstruct() {
  10100. this.n0 = (this.getChild("n0"));
  10101. }
  10102. }
  10103. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10104. class UIFireworks extends UIBase {
  10105. constructor() {
  10106. super();
  10107. }
  10108. onConstructor() {
  10109. this.isEject = false;
  10110. }
  10111. show(callback) {
  10112. super.show();
  10113. }
  10114. }
  10115. UIFireworks.uiName = "UIFireworks";
  10116. class ui_UIGuanYu extends fgui.GComponent {
  10117. static createInstance() {
  10118. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10119. }
  10120. onConstruct() {
  10121. this.n2 = (this.getChild("n2"));
  10122. this.n1 = (this.getChild("n1"));
  10123. this.n3 = (this.getChild("n3"));
  10124. this.n4 = (this.getChild("n4"));
  10125. this.n5 = (this.getChild("n5"));
  10126. this.n6 = (this.getChild("n6"));
  10127. this.n8 = (this.getChild("n8"));
  10128. this.n7 = (this.getChild("n7"));
  10129. this.t0 = this.getTransition("t0");
  10130. }
  10131. }
  10132. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10133. class UIGuanYu extends UIBase {
  10134. constructor() {
  10135. super();
  10136. }
  10137. onConstructor() {
  10138. this.ui = ui_UIGuanYu.createInstance();
  10139. this.contentPane = this.ui;
  10140. this.isEject = false;
  10141. }
  10142. show(callback) {
  10143. super.show();
  10144. this.ui.t0.play(Laya.Handler.create(this, () => {
  10145. callback && callback();
  10146. this.hide();
  10147. }));
  10148. this.setGlobalFont(this.ui);
  10149. }
  10150. }
  10151. UIGuanYu.uiName = "UIGuanYu";
  10152. class SkillMgr {
  10153. constructor() {
  10154. this.leveNum = 0;
  10155. this.extraScore = 0;
  10156. this.selfTurn = false;
  10157. this.playedLastSkill = false;
  10158. this.tweenArr = [];
  10159. this._finishNum = 0;
  10160. this._curFinish = 0;
  10161. this._rootX = 0;
  10162. this._rootY = 0;
  10163. this.knifeTimes = 0;
  10164. this.knifeV2 = new Laya.Vector2();
  10165. this.knifeV3 = new Laya.Vector3();
  10166. this.rtStarX = 0;
  10167. this.rtStarY = 0;
  10168. this.addBigSkillSpine();
  10169. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10170. }
  10171. addBigSkillSpine() {
  10172. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10173. console.log("extra2 success");
  10174. });
  10175. }
  10176. runBigSkill(callback) {
  10177. this.tweenArr = [];
  10178. this.callback = callback;
  10179. this.judgeSkill();
  10180. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10181. let guide = DataMgr.getSkillGuide();
  10182. if (!xGame.common.gameMgr.selfTurn) {
  10183. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10184. }
  10185. else {
  10186. if (xGame.common.temSelfLevel != 0) {
  10187. this.leveNum = xGame.common.temSelfLevel;
  10188. }
  10189. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10190. this.leveNum += 5;
  10191. }
  10192. }
  10193. if (guide == 0) {
  10194. DataMgr.setSkillGuide(1);
  10195. if (DataMgr.getNewUser()) {
  10196. Moyu.sendDataEvent("gameFirstPlay");
  10197. DataMgr.setNewUser();
  10198. }
  10199. }
  10200. this.playSpineAni(() => {
  10201. switch (this.curSkill) {
  10202. case SkillType.highSpace:
  10203. this.runHighSpace();
  10204. break;
  10205. case SkillType.breakArmy:
  10206. this.runBreakArmy();
  10207. break;
  10208. case SkillType.ice:
  10209. this.runIce();
  10210. break;
  10211. case SkillType.fireworks:
  10212. this.runFireworks();
  10213. break;
  10214. case SkillType.GuanYu:
  10215. this.runGuanYu();
  10216. break;
  10217. default:
  10218. break;
  10219. }
  10220. });
  10221. }
  10222. judgeSkill() {
  10223. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10224. let gameMgr = xGame.common.gameMgr;
  10225. let type;
  10226. for (let index = 0; index < typeArr.length; index++) {
  10227. type = typeArr[index];
  10228. if (gameMgr.selfTurn) {
  10229. if (gameMgr.selfCurSkill == type) {
  10230. this.selfTurn = true;
  10231. this.curSkill = type;
  10232. return;
  10233. }
  10234. }
  10235. else {
  10236. if (gameMgr.aiCurSkill == type) {
  10237. this.selfTurn = false;
  10238. this.curSkill = type;
  10239. return;
  10240. }
  10241. }
  10242. }
  10243. }
  10244. playSpineAni(callback) {
  10245. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10246. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10247. parent.destroyChildren();
  10248. let aniIndex = 0;
  10249. let skillSpine;
  10250. switch (this.curSkill) {
  10251. case SkillType.highSpace:
  10252. aniIndex = 1;
  10253. xGame.soundMgr.playSound("skill01");
  10254. skillSpine = this.skillSpine2;
  10255. data.scaleX = 0.5;
  10256. data.scaleY = 0.5;
  10257. skillSpine.play(data, 1, false, parent, () => {
  10258. callback && callback();
  10259. });
  10260. break;
  10261. case SkillType.breakArmy:
  10262. aniIndex = 2;
  10263. xGame.soundMgr.playSound("skill02");
  10264. skillSpine = this.skillSpine2;
  10265. data.scaleX = 0.5;
  10266. data.scaleY = 0.5;
  10267. skillSpine.play(data, 2, false, parent, () => {
  10268. callback && callback();
  10269. });
  10270. break;
  10271. case SkillType.ice:
  10272. aniIndex = 0;
  10273. xGame.soundMgr.playSound("skill03");
  10274. skillSpine = this.skillSpine2;
  10275. data.scaleX = 0.5;
  10276. data.scaleY = 0.5;
  10277. skillSpine.play(data, 0, false, parent, () => {
  10278. callback && callback();
  10279. });
  10280. break;
  10281. case SkillType.fireworks:
  10282. xGame.soundMgr.playSound("skill_04_01");
  10283. xGame.soundMgr.playSound("skill04");
  10284. xGame.uiMgr.Show(UIFireworks, callback);
  10285. break;
  10286. case SkillType.GuanYu:
  10287. xGame.soundMgr.playSound("skill05_1");
  10288. xGame.soundMgr.playSound("skill05");
  10289. xGame.uiMgr.Show(UIGuanYu, callback);
  10290. break;
  10291. default:
  10292. break;
  10293. }
  10294. }
  10295. getAllBallArr() {
  10296. let arr = xGame.common.d2World.ballArr;
  10297. let outArr = [];
  10298. for (let index = 0; index < arr.length; index++) {
  10299. if (arr[index] instanceof D2RootBallSrc)
  10300. continue;
  10301. if (arr[index].ballFunc == "ice")
  10302. continue;
  10303. if (arr[index].destroyed)
  10304. continue;
  10305. outArr.push(arr[index]);
  10306. }
  10307. return outArr;
  10308. }
  10309. getOneArr(deletObj) {
  10310. let allArr = this.getAllBallArr();
  10311. let temp;
  10312. for (let index = 0; index < allArr.length; index++) {
  10313. temp = allArr[index];
  10314. if (temp.id == deletObj.id) {
  10315. allArr.splice(index, 1);
  10316. break;
  10317. }
  10318. }
  10319. return allArr;
  10320. }
  10321. getNearBallBag(ball) {
  10322. let ui = xGame.common.gameUI.ui;
  10323. let circleArr = [];
  10324. for (let index = 1; index <= 6; index++) {
  10325. circleArr.push(ui.border["circle" + index]);
  10326. }
  10327. let outIndex = 0;
  10328. let temp;
  10329. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10330. ;
  10331. let dis = 0;
  10332. for (let index = 1; index < circleArr.length; index++) {
  10333. temp = circleArr[index];
  10334. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10335. if (dis < min) {
  10336. min = dis;
  10337. outIndex = index;
  10338. }
  10339. }
  10340. return [circleArr[outIndex], outIndex];
  10341. }
  10342. ballFlyToBag(ballArr, time = 300) {
  10343. let temp;
  10344. let hole;
  10345. this._finishNum = ballArr.length;
  10346. this._curFinish = 0;
  10347. let holeObj = {};
  10348. let holeCfg = {
  10349. "1": 0,
  10350. "2": 0,
  10351. "3": 0,
  10352. "4": 0,
  10353. "5": 0,
  10354. "6": 0
  10355. };
  10356. for (let index = 0; index < ballArr.length; index++) {
  10357. temp = ballArr[index];
  10358. temp.outColli.isSensor = true;
  10359. temp.innerColli.isSensor = true;
  10360. temp.isRunSkillAni = true;
  10361. let holeArr = this.getNearBallBag(temp);
  10362. hole = holeArr[0];
  10363. holeObj[index] = holeArr[1];
  10364. temp.d3BallSrc.scaleXYZ = 0.5;
  10365. this.tweenArr.push(temp.d3BallSrc, temp);
  10366. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10367. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10368. }));
  10369. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10370. let mIndex = holeObj[this._curFinish];
  10371. let isDone = holeCfg[mIndex];
  10372. if (isDone) {
  10373. ballArr[this._curFinish].checkWrongBall(false);
  10374. }
  10375. else {
  10376. holeCfg[mIndex] = 1;
  10377. ballArr[this._curFinish].checkWrongBall();
  10378. }
  10379. this._curFinish++;
  10380. if (this._curFinish >= this._finishNum) {
  10381. if (this.curSkill == SkillType.highSpace) {
  10382. }
  10383. else if (this.curSkill == SkillType.breakArmy) {
  10384. let rootBall = xGame.common.d2World.rootBall;
  10385. rootBall.gameObj.x = this._rootX;
  10386. rootBall.gameObj.y = this._rootY;
  10387. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10388. xGame.common.d2World.d2Gan.ui.visible = true;
  10389. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10390. xGame.common.d2World.getHelpLine();
  10391. this.callback && this.callback(this.extraScore);
  10392. }
  10393. }
  10394. }));
  10395. }
  10396. }
  10397. runHighSpace() {
  10398. let rootBall = xGame.common.d2World.rootBall;
  10399. rootBall.showSelf();
  10400. let d3Src = rootBall.d3BallSrc;
  10401. let allArr = this.getAllBallArr();
  10402. if (allArr.length <= 0) {
  10403. this.callback && this.callback(0);
  10404. return;
  10405. }
  10406. let selectBall = xGame.common.d2World.targetBall;
  10407. let wrong = selectBall && selectBall.destroyed;
  10408. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10409. selectBall = xGame.common.getRandArrEle(allArr);
  10410. }
  10411. let targetD3Src = selectBall.d3BallSrc;
  10412. xGame.common.d2World.d2Gan.ui.visible = false;
  10413. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10414. d3Src.scaleXYZ = 0.5;
  10415. this.tweenArr.push(d3Src);
  10416. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10417. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10418. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10419. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10420. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10421. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10422. let outArr = [selectBall];
  10423. let other = this.leveNum - 1;
  10424. if (other > 0) {
  10425. let nearArr = this.getOneArr(selectBall);
  10426. if (nearArr.length > 0) {
  10427. xGame.common.botherArr(nearArr);
  10428. if (other >= nearArr.length)
  10429. other = nearArr.length;
  10430. for (let index = 0; index < other; index++) {
  10431. outArr.push(nearArr[index]);
  10432. }
  10433. }
  10434. }
  10435. xGame.common.extraMoveNum = other + 1;
  10436. this.extraScore = other + 1;
  10437. this._rootX = selectBall.gameObj.x;
  10438. this._rootY = selectBall.gameObj.y;
  10439. rootBall.gameObj.x = this._rootX;
  10440. rootBall.gameObj.y = this._rootY;
  10441. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10442. Laya.Tween.clearAll(d3Src);
  10443. this.addRandomForce(outArr);
  10444. }));
  10445. }));
  10446. }
  10447. addRandomForce(outArr) {
  10448. if (outArr.length > 0) {
  10449. xGame.common.d2World.openCheckStill = true;
  10450. this.playedLastSkill = true;
  10451. }
  10452. let temp;
  10453. for (let index = 0; index < outArr.length; index++) {
  10454. let angle = xGame.common.randomNum(0, 360);
  10455. let linearPercent = xGame.common.randomNum(65, 100);
  10456. temp = outArr[index];
  10457. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10458. }
  10459. }
  10460. setLinearSpeed(angle, rigy, linearPercent) {
  10461. let sin = Math.sin(angle * Math.PI / 180);
  10462. let cos = Math.cos(angle * Math.PI / 180);
  10463. let maxSpeed = 4;
  10464. let speed = new Laya.Vector2();
  10465. speed.x = maxSpeed * linearPercent * sin;
  10466. speed.y = -maxSpeed * linearPercent * cos;
  10467. rigy.applyLinearImpulseToCenter(speed);
  10468. }
  10469. runBreakArmy() {
  10470. xGame.common.d2World.d2Gan.ui.visible = false;
  10471. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10472. let gameUI = xGame.common.gameUI.ui;
  10473. gameUI.skillRod.visible = true;
  10474. gameUI.skillRod.rotation = 110;
  10475. let outArr = this.getAllBallArr();
  10476. if (outArr.length <= 0) {
  10477. gameUI.skillRod.visible = false;
  10478. this.callback && this.callback(0);
  10479. return;
  10480. }
  10481. xGame.common.botherArr(outArr);
  10482. if (this.leveNum >= outArr.length)
  10483. this.leveNum = outArr.length;
  10484. let deleteNum = outArr.length - this.leveNum;
  10485. outArr.splice(0, deleteNum);
  10486. this.extraScore = this.leveNum;
  10487. let potX = gameUI.skillRod.x;
  10488. let potY = gameUI.skillRod.y;
  10489. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10490. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10491. let disArr = [];
  10492. for (let index = 0; index < outArr.length; index++) {
  10493. let obj = outArr[index];
  10494. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10495. dis = Math.pow(dis, 0.5);
  10496. disArr.push(dis);
  10497. }
  10498. this.tweenArr.push(gameUI.skillRod);
  10499. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10500. })).update = Laya.Handler.create(this, (e, t, c) => {
  10501. let angle = gameUI.skillRod.rotation;
  10502. let xx;
  10503. let yy;
  10504. let temp;
  10505. for (let index = 0; index < outArr.length; index++) {
  10506. temp = outArr[index];
  10507. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10508. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10509. yy -= 20;
  10510. temp.gameObj.x = xx;
  10511. temp.gameObj.y = yy;
  10512. temp.d3BallSrc.setTransPos(xx, yy);
  10513. }
  10514. if (angle <= 60) {
  10515. Laya.Tween.clearAll(gameUI.skillRod);
  10516. this.ballFlyToBag(outArr, 150);
  10517. gameUI.skillRod.visible = false;
  10518. }
  10519. }, null, false);
  10520. }
  10521. runIce() {
  10522. let ballArr = xGame.common.d2World.ballArr;
  10523. this.leveNum *= 2;
  10524. if (this.leveNum >= ballArr.length - 1)
  10525. this.leveNum = ballArr.length - 1;
  10526. let tempArr = [];
  10527. let outArr = [];
  10528. for (let index = 0; index < ballArr.length; index++) {
  10529. if (ballArr[index] instanceof D2RootBallSrc)
  10530. continue;
  10531. tempArr.push(ballArr[index]);
  10532. }
  10533. if (tempArr.length <= 0) {
  10534. this.callback && this.callback(0);
  10535. return;
  10536. }
  10537. xGame.common.botherArr(tempArr);
  10538. for (let index = 0; index < this.leveNum; index++) {
  10539. outArr.push(tempArr[index]);
  10540. }
  10541. this.extraScore = this.leveNum;
  10542. let temp;
  10543. for (let index = 0; index < outArr.length; index++) {
  10544. temp = outArr[index];
  10545. temp.d3BallSrc.playIceEft();
  10546. }
  10547. Laya.timer.once(2000, this, () => {
  10548. for (let index = 0; index < outArr.length; index++) {
  10549. temp = outArr[index];
  10550. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10551. temp.setBallFunc("ice", str);
  10552. }
  10553. this.callback && this.callback(0);
  10554. });
  10555. }
  10556. runFireworks() {
  10557. let allArr = this.getAllBallArr();
  10558. if (allArr.length <= 0) {
  10559. this.callback && this.callback(0);
  10560. return;
  10561. }
  10562. xGame.common.d2World.d2Gan.ui.visible = false;
  10563. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10564. let outArr = [];
  10565. let other = this.leveNum;
  10566. if (other > 0) {
  10567. if (allArr.length > 0) {
  10568. xGame.common.botherArr(allArr);
  10569. if (other >= allArr.length)
  10570. other = allArr.length;
  10571. for (let index = 0; index < other; index++) {
  10572. outArr.push(allArr[index]);
  10573. }
  10574. }
  10575. }
  10576. xGame.common.extraMoveNum = other;
  10577. this.extraScore = other;
  10578. this.addRandmomFireworks(outArr);
  10579. }
  10580. addRandmomFireworks(outArr) {
  10581. Laya.timer.once(1100, this, () => {
  10582. if (outArr.length > 0) {
  10583. xGame.common.d2World.openCheckStill = true;
  10584. this.playedLastSkill = true;
  10585. }
  10586. });
  10587. xGame.soundMgr.playSound("skill_04_02");
  10588. let temp;
  10589. let delay = -200;
  10590. for (let index = 0; index < outArr.length; index++) {
  10591. temp = outArr[index];
  10592. delay += 200;
  10593. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10594. let angle = xGame.common.randomNum(0, 360);
  10595. angle = this.getFireworksAngle(obj);
  10596. let linearPercent = xGame.common.randomNum(45, 80);
  10597. if (!obj.destroyed)
  10598. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10599. });
  10600. }
  10601. }
  10602. getFireworksAngle(obj) {
  10603. let rootBall = xGame.common.d2World.rootBall;
  10604. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10605. }
  10606. resetGame() {
  10607. Laya.timer.clearAll(this);
  10608. if (this.tweenArr) {
  10609. for (let index = 0; index < this.tweenArr.length; index++) {
  10610. Laya.Tween.clearAll(this.tweenArr[index]);
  10611. }
  10612. }
  10613. this.tweenArr = null;
  10614. }
  10615. runGuanYu() {
  10616. xGame.common.d2World.d2Gan.ui.visible = false;
  10617. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10618. let rootBall = xGame.common.d2World.rootBall;
  10619. if (rootBall.isInHole) {
  10620. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10621. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10622. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10623. rootBall.showSelf();
  10624. }
  10625. this.rtStarX = rootBall.gameObj.x;
  10626. this.rtStarY = rootBall.gameObj.y;
  10627. this.knifeTimes = 0;
  10628. this.playedLastSkill = true;
  10629. rootBall.forceRun = true;
  10630. rootBall.rigy.type = "static";
  10631. xGame.common.d2World.openCheckStill = true;
  10632. this.guanyuRandomKnife();
  10633. }
  10634. guanyuRandomKnife() {
  10635. let rootBall = xGame.common.d2World.rootBall;
  10636. let dir = this.getRandDir();
  10637. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10638. console.log("当前angle", angle);
  10639. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10640. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10641. let dis = 324;
  10642. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10643. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10644. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10645. this.rtStarX = rootBall.gameObj.x;
  10646. this.rtStarY = rootBall.gameObj.y;
  10647. this.knifeTimes++;
  10648. let skillLevel;
  10649. if (xGame.common.gameMgr.selfTurn) {
  10650. skillLevel = DataMgr.getBigSkillByIndex(4);
  10651. }
  10652. else {
  10653. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10654. }
  10655. if (!skillLevel)
  10656. skillLevel = 1;
  10657. skillLevel += 2;
  10658. if (this.knifeTimes < skillLevel) {
  10659. Laya.timer.once(400, this, () => {
  10660. this.guanyuRandomKnife();
  10661. });
  10662. }
  10663. else {
  10664. rootBall.forceRun = false;
  10665. rootBall.rigy.type = "dynamic";
  10666. xGame.common.extraMoveNum = skillLevel;
  10667. }
  10668. }));
  10669. }
  10670. getRandDir() {
  10671. let rootBall = xGame.common.d2World.rootBall;
  10672. let allBall = this.getAllBallArr();
  10673. let target = xGame.common.getRandArrEle(allBall);
  10674. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10675. return this.knifeV2;
  10676. }
  10677. cloneKnife(x, y, rotation) {
  10678. let parent = xGame.common.d3World.knifeRoot;
  10679. let prefab = xGame.common.d3World.knife;
  10680. let clone = prefab.clone();
  10681. parent.addChild(clone);
  10682. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10683. clone.transform.localPositionX = this.knifeV3.x;
  10684. clone.transform.localPositionY = 0;
  10685. clone.transform.localPositionZ = this.knifeV3.z;
  10686. clone.transform.localRotationEulerX = 0;
  10687. clone.transform.localRotationEulerY = rotation;
  10688. clone.transform.localRotationEulerZ = 0;
  10689. clone.active = true;
  10690. return clone;
  10691. }
  10692. cloneGuanYuEft(x, y, angle) {
  10693. return;
  10694. let parent = xGame.common.gameUI.ui.guanyuNode;
  10695. let eft = new ui_guanyuAni();
  10696. eft.parent = parent;
  10697. eft.x = x;
  10698. eft.y = y;
  10699. eft.rotation = angle;
  10700. }
  10701. }
  10702. class ui_UIWordsList extends fgui.GComponent {
  10703. static createInstance() {
  10704. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10705. }
  10706. onConstruct() {
  10707. this.c1 = this.getController("c1");
  10708. this.n74 = (this.getChild("n74"));
  10709. this.clickNode = (this.getChild("clickNode"));
  10710. this.myNode = (this.getChild("myNode"));
  10711. this.n68 = (this.getChild("n68"));
  10712. this.n66 = (this.getChild("n66"));
  10713. this.n55 = (this.getChild("n55"));
  10714. this.wordsBtn = (this.getChild("wordsBtn"));
  10715. this.emotionBtn = (this.getChild("emotionBtn"));
  10716. this.mybggg = (this.getChild("mybggg"));
  10717. this.wordsList = (this.getChild("wordsList"));
  10718. this.emotionList = (this.getChild("emotionList"));
  10719. this.myRoot = (this.getChild("myRoot"));
  10720. }
  10721. }
  10722. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10723. class EmotionDisplay {
  10724. constructor(index, ui) {
  10725. this.ui = ui;
  10726. this.index = index;
  10727. this.ui.onClick(this, this.clickSelf);
  10728. this.updateSelf();
  10729. }
  10730. updateSelf() {
  10731. let data = cfgTable.emotionData[this.index + 1];
  10732. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10733. }
  10734. clickSelf() {
  10735. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10736. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10737. xGame.common.talkMgr.closeTalkView();
  10738. }
  10739. }
  10740. class WordsDisplay {
  10741. constructor(index, ui) {
  10742. this.ui = ui;
  10743. this.index = index;
  10744. this.ui.onClick(this, this.clickSelf);
  10745. this.updateSelf();
  10746. }
  10747. updateSelf() {
  10748. let data = cfgTable.talkwordsData[this.index + 1];
  10749. this.ui.txt.text = data.msg;
  10750. }
  10751. clickSelf() {
  10752. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10753. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10754. xGame.common.talkMgr.closeTalkView();
  10755. }
  10756. }
  10757. class UIWordsList extends UIBase {
  10758. constructor() {
  10759. super();
  10760. }
  10761. onConstructor() {
  10762. this.ui = ui_UIWordsList.createInstance();
  10763. this.contentPane = this.ui;
  10764. this.isEject = false;
  10765. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10766. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10767. this.addUIClick(this.ui.clickNode, this.hide);
  10768. this.initTalkList();
  10769. this.initEmotionList();
  10770. }
  10771. show() {
  10772. super.show();
  10773. this.setGlobalFont(this.ui);
  10774. }
  10775. initTalkList() {
  10776. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10777. let data = cfgTable.talkwordsData;
  10778. let length = Object.keys(data).length;
  10779. this.ui.wordsList.numItems = length;
  10780. }
  10781. initEmotionList() {
  10782. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10783. let data = cfgTable.emotionData;
  10784. let length = Object.keys(data).length;
  10785. this.ui.emotionList.numItems = length;
  10786. }
  10787. renderTalkItem(index, obj) {
  10788. let temp = new WordsDisplay(index, obj);
  10789. }
  10790. renderEmotionItem(index, obj) {
  10791. let temp = new EmotionDisplay(index, obj);
  10792. }
  10793. openTalkList() {
  10794. this.ui.c1.selectedIndex = 0;
  10795. }
  10796. openEmotionList() {
  10797. this.ui.c1.selectedIndex = 1;
  10798. }
  10799. }
  10800. UIWordsList.uiName = "UIWordsList";
  10801. class TalkMgr {
  10802. constructor() {
  10803. this.aiSpeak = true;
  10804. this.emotionList = [];
  10805. this.talkList = [];
  10806. this.addEvent();
  10807. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10808. this.emotionList = [];
  10809. this.talkList = [];
  10810. for (let k in cfgTable.emotionData) {
  10811. this.emotionList.push(cfgTable.emotionData[k].id);
  10812. }
  10813. for (let k in cfgTable.talkwordsData) {
  10814. this.talkList.push(cfgTable.talkwordsData[k].id);
  10815. }
  10816. }
  10817. addEvent() {
  10818. let ui = xGame.common.gameUI.ui;
  10819. ui.wordsBtn.visible = true;
  10820. ui.wordsBtn.onClick(this, this.openTalkView);
  10821. ui.aiWordsBtn.visible = true;
  10822. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10823. }
  10824. openTalkView() {
  10825. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10826. xGame.uiMgr.Show(UIWordsList);
  10827. }
  10828. closeTalkView() {
  10829. xGame.uiMgr.Hide(UIWordsList);
  10830. }
  10831. clickAIState() {
  10832. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10833. this.aiSpeak = !this.aiSpeak;
  10834. this.changeAIState(this.aiSpeak);
  10835. }
  10836. changeAIState(speak) {
  10837. this.aiSpeak = speak;
  10838. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10839. if (speak) {
  10840. btn.c1.selectedIndex = 0;
  10841. }
  10842. else {
  10843. btn.c1.selectedIndex = 1;
  10844. }
  10845. }
  10846. showSelfTalk(wordsId) {
  10847. let ui = xGame.common.gameUI.ui;
  10848. ui.selfTalk.visible = true;
  10849. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10850. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10851. ui.selfTalk.t0.play();
  10852. }
  10853. showSelfEmotion(emotionId) {
  10854. let ui = xGame.common.gameUI.ui;
  10855. ui.selfTalk.visible = true;
  10856. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10857. this.selfSpine && this.selfSpine.dispose();
  10858. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10859. let spineData = cfgTable.emotionData[emotionId].spine;
  10860. this.selfSpine = new SpineMgr(spineData, () => {
  10861. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10862. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10863. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10864. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10865. });
  10866. ui.selfTalk.t0.play();
  10867. }
  10868. showAITalk(wordsId) {
  10869. if (!this.aiSpeak)
  10870. return;
  10871. if (DataMgr.gameData.gameCount < 2)
  10872. return;
  10873. if (wordsId < 1)
  10874. wordsId = this.getRandTalk();
  10875. let ui = xGame.common.gameUI.ui;
  10876. ui.aiTalk.visible = true;
  10877. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10878. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10879. ui.aiTalk.t0.play();
  10880. }
  10881. getRandTalk() {
  10882. let rand = xGame.tools.random(0, this.talkList.length);
  10883. return this.emotionList[rand];
  10884. }
  10885. getRandEmotion() {
  10886. let rand = xGame.tools.random(0, this.emotionList.length);
  10887. return this.emotionList[rand];
  10888. }
  10889. showAIEmotion(emotionId) {
  10890. if (!this.aiSpeak)
  10891. return;
  10892. if (DataMgr.gameData.gameCount < 2)
  10893. return;
  10894. if (emotionId < 1)
  10895. emotionId = this.getRandEmotion();
  10896. let ui = xGame.common.gameUI.ui;
  10897. ui.aiTalk.visible = true;
  10898. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10899. this.aiSpine && this.aiSpine.dispose();
  10900. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10901. let spineData = cfgTable.emotionData[emotionId].spine;
  10902. this.aiSpine = new SpineMgr(spineData, () => {
  10903. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10904. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10905. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10906. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10907. });
  10908. ui.aiTalk.t0.play();
  10909. }
  10910. resetGame() {
  10911. let ui = xGame.common.gameUI.ui;
  10912. ui.aiTalk.visible = false;
  10913. ui.selfTalk.visible = false;
  10914. this.aiSpine && this.aiSpine.dispose();
  10915. this.selfSpine && this.selfSpine.dispose();
  10916. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10917. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10918. this.closeTalkView();
  10919. }
  10920. }
  10921. class WordsMgr {
  10922. constructor() {
  10923. this.comboTimes = 1;
  10924. this.skillTimes = 0;
  10925. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10926. this.comboSpine = new SpineMgr("yxz_liangan");
  10927. this.skillSpine = new SpineMgr("yiganxqiu");
  10928. this.scoreSpine = new SpineMgr("defen");
  10929. }
  10930. setClassicCombo(isInterrupt) {
  10931. if (isInterrupt) {
  10932. this.comboTimes = 0;
  10933. }
  10934. }
  10935. playClassicWords(type, callback) {
  10936. this.callback = callback;
  10937. let aniIndex = type;
  10938. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10939. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10940. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10941. mySpine.destroy(true);
  10942. this.playClassicTimes();
  10943. });
  10944. }
  10945. playClassicTimes() {
  10946. this.comboTimes++;
  10947. if (this.comboTimes <= 1) {
  10948. this.callback && this.callback();
  10949. }
  10950. else {
  10951. let aniIndex = this.comboTimes - 1;
  10952. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10953. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10954. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10955. mySpine.destroy(true);
  10956. this.callback && this.callback();
  10957. });
  10958. }
  10959. }
  10960. playBigSkillTimes(times, callback) {
  10961. if (times <= 0) {
  10962. callback && callback();
  10963. return;
  10964. }
  10965. this.callback = callback;
  10966. let pre = "sz_0";
  10967. let aniIndex = 0;
  10968. this.getWordsImg(times, pre, () => {
  10969. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10970. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10971. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10972. let r1 = ``;
  10973. let r2 = ``;
  10974. if (times <= 9) {
  10975. r1 = `res/d2Res/${pre}${times}.png`;
  10976. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10977. aniIndex = 0;
  10978. }
  10979. else {
  10980. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10981. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10982. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10983. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10984. aniIndex = 1;
  10985. }
  10986. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10987. mySpine.destroy(true);
  10988. xGame.common.gameMgr.playSkillTips();
  10989. this.playScore(times);
  10990. xGame.common.playRandomMutiBallBigSkillSound();
  10991. }, mySpine);
  10992. });
  10993. }
  10994. playScore(score) {
  10995. let pre = "sz_";
  10996. let aniIndex = 0;
  10997. this.getWordsImg(score, pre, () => {
  10998. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10999. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11000. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11001. let r1 = ``;
  11002. let r2 = ``;
  11003. if (score <= 9) {
  11004. r1 = `res/d2Res/${pre}${score}.png`;
  11005. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11006. aniIndex = 0;
  11007. }
  11008. else {
  11009. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11010. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11011. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11012. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11013. aniIndex = 1;
  11014. }
  11015. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11016. mySpine.destroy(true);
  11017. this.callback && this.callback();
  11018. }, mySpine);
  11019. });
  11020. }
  11021. getWordsImg(number, pre = "", callback) {
  11022. let arr = [];
  11023. if (number <= 9) {
  11024. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11025. }
  11026. else {
  11027. 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 });
  11028. }
  11029. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11030. callback && callback();
  11031. }));
  11032. }
  11033. }
  11034. class ui_UIRodMethod extends fgui.GComponent {
  11035. static createInstance() {
  11036. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11037. }
  11038. onConstruct() {
  11039. this.n24 = (this.getChild("n24"));
  11040. this.white = (this.getChild("white"));
  11041. this.dot = (this.getChild("dot"));
  11042. this.sureBtn = (this.getChild("sureBtn"));
  11043. this.n20 = (this.getChild("n20"));
  11044. this.n21 = (this.getChild("n21"));
  11045. this.n22 = (this.getChild("n22"));
  11046. this.n23 = (this.getChild("n23"));
  11047. this.n5 = (this.getChild("n5"));
  11048. this.n14 = (this.getChild("n14"));
  11049. this.t0 = this.getTransition("t0");
  11050. }
  11051. }
  11052. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11053. class UIRodMethod extends UIBase {
  11054. constructor() {
  11055. super();
  11056. this.isPressd = false;
  11057. }
  11058. onConstructor() {
  11059. this.ui = ui_UIRodMethod.createInstance();
  11060. this.contentPane = this.ui;
  11061. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11062. this.moveDir = new Laya.Vector2();
  11063. this.moveDest = new Laya.Vector2();
  11064. this.centerPos = new Laya.Vector2();
  11065. xGame.common.uiRodMethod = this;
  11066. }
  11067. show() {
  11068. super.show();
  11069. xGame.common.gameMgr.gamePause = true;
  11070. this.openPressDotEvent();
  11071. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11072. this.centerPos.x = this.ui.white.x;
  11073. this.centerPos.y = this.ui.white.y;
  11074. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11075. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11076. this.setDot();
  11077. this.setGlobalFont(this.ui);
  11078. }
  11079. setDot() {
  11080. this.ui.dot.x = this.moveDest.x;
  11081. this.ui.dot.y = this.moveDest.y;
  11082. }
  11083. closeSelf() {
  11084. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11085. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11086. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11087. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11088. xGame.common.gameMgr.gamePause = false;
  11089. this.hide();
  11090. }
  11091. openPressDotEvent() {
  11092. this.closePressDotEvent();
  11093. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11094. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11095. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11096. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11097. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11098. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11099. }
  11100. closePressDotEvent() {
  11101. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11102. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11103. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11104. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11105. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11106. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11107. }
  11108. onDown(e) {
  11109. if (e.type == Laya.Event.MOUSE_DOWN)
  11110. this.isPressd = true;
  11111. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11112. this.isPressd = false;
  11113. if (!this.isPressd)
  11114. return;
  11115. this.moveDest.x = e.stageX;
  11116. this.moveDest.y = e.stageY;
  11117. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11118. if (dis > 6724) {
  11119. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11120. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11121. }
  11122. this.setDot();
  11123. }
  11124. resetRod() {
  11125. this.ui.dot.x = this.ui.white.x;
  11126. this.ui.dot.y = this.ui.white.y;
  11127. this.gameRod.dot.x = this.gameRod.bg.x;
  11128. this.gameRod.dot.y = this.gameRod.bg.y;
  11129. xGame.common.rodOffest.x = 0;
  11130. xGame.common.rodOffest.y = 0;
  11131. }
  11132. }
  11133. UIRodMethod.uiName = "UIRodMethod";
  11134. class UIGame extends UIBase {
  11135. constructor() {
  11136. super();
  11137. this.powerNum = 0;
  11138. this.isD3Inited = false;
  11139. this.isPrePlay = false;
  11140. this.isMoveRod = false;
  11141. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11142. this.rulerDis = 20;
  11143. this.rulerOffset = 0;
  11144. }
  11145. onConstructor() {
  11146. this.ui = ui_UIGame.createInstance();
  11147. this.contentPane = this.ui;
  11148. this.ui.x += xGame.common.sysOffestNum;
  11149. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11150. this.isEject = false;
  11151. xGame.common.gameUI = this;
  11152. this.initSelf();
  11153. }
  11154. isTurnSelf() {
  11155. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11156. return true;
  11157. }
  11158. }
  11159. initSelf() {
  11160. let topUI = this.ui.topNode;
  11161. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11162. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11163. this.barInfo = {};
  11164. this.barInfo.curY = 0;
  11165. this.barInfo.height = this.ui.powerNode.height;
  11166. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11167. this.barInfo.powerStartY = this.ui.powerNode.y;
  11168. xGame.common.aiPlayer = new AIPlayer();
  11169. xGame.common.gameMgr = new GameMgr();
  11170. xGame.common.skillMgr = new SkillMgr();
  11171. xGame.common.wordsMgr = new WordsMgr();
  11172. xGame.common.talkMgr = new TalkMgr();
  11173. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11174. });
  11175. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11176. });
  11177. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11178. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11179. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11180. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11181. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11182. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11183. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11184. }
  11185. getGanZiImg() {
  11186. let index = DataMgr.getCurBallRod();
  11187. let data = cfgTable.ballrodData[index + 1];
  11188. let gan_url = xGame.common.getGameIconUrl(data.img);
  11189. this.ui.powerNode.showImg.url = gan_url;
  11190. }
  11191. returnHome() {
  11192. let tips = "Are you sure to exit the game?";
  11193. let woman = "Boss, why don't you play for a while longer?";
  11194. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11195. }
  11196. addRodMethodClick() {
  11197. if (this.isTurnSelf()) {
  11198. xGame.uiMgr.Show(UIRodMethod);
  11199. }
  11200. }
  11201. clickHelpLineBtn(force = false) {
  11202. if (!this.isTurnSelf())
  11203. return;
  11204. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11205. if (success) {
  11206. xGame.common.longHelpLine = true;
  11207. xGame.common.d2World.getHelpLine();
  11208. Moyu.sendDataEvent("guideNum");
  11209. }
  11210. else {
  11211. }
  11212. });
  11213. }
  11214. renderSelfDisplayBalls(index, target) {
  11215. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11216. target.myImg.url = xGame.common.getGameIconUrl(str);
  11217. }
  11218. renderAIDisplayBalls(index, target) {
  11219. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11220. target.myImg.url = xGame.common.getGameIconUrl(str);
  11221. ;
  11222. }
  11223. updateMode() {
  11224. if (xGame.common.gameMode == GameMode.classic) {
  11225. this.ui.topNode.scoreNode.visible = false;
  11226. }
  11227. else if (xGame.common.gameMode == GameMode.bigMove) {
  11228. this.ui.topNode.scoreNode.visible = true;
  11229. }
  11230. }
  11231. show() {
  11232. super.show();
  11233. this.ui.alpha = 0;
  11234. this.updateSelf();
  11235. xGame.common.gameMgr.gamePause = false;
  11236. xGame.common.gameUI.ui.blackAni.visible = false;
  11237. xGame.common.gameUI.ui.whiteAni.visible = false;
  11238. this.ui.powerEft.visible = false;
  11239. this.ui.colorNode.visible = false;
  11240. this.updateHead();
  11241. let curUse = DataMgr.getCurBallRod();
  11242. this.getGanZiImg();
  11243. this.setGlobalFont(this.ui);
  11244. }
  11245. updateSelf() {
  11246. if (xGame.common.gameMode == GameMode.classic) {
  11247. this.ui.c1.selectedIndex = 0;
  11248. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11249. this.ui.topNode.middleNode.visible = true;
  11250. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11251. }
  11252. else if (xGame.common.gameMode == GameMode.bigMove) {
  11253. this.ui.c1.selectedIndex = 0;
  11254. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11255. this.ui.topNode.middleNode.visible = false;
  11256. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11257. let rand = xGame.common.randomNum(1, max);
  11258. let guide = DataMgr.getSkillGuide();
  11259. if (guide == 0)
  11260. rand = 1;
  11261. xGame.common.bigMoveLevelIndex = rand;
  11262. }
  11263. else if (xGame.common.gameMode == GameMode.placeBall) {
  11264. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11265. this.ui.c1.selectedIndex = 1 + data.type;
  11266. this.ui.alpha = 1;
  11267. this.startGame();
  11268. }
  11269. this.updateMode();
  11270. this.initD3world();
  11271. this.initD2world();
  11272. }
  11273. startGame() {
  11274. this.ui.snowNode.visible = Math.random() <= 0.1;
  11275. this.ui.d2Node.visible = false;
  11276. xGame.common.d3World.d3Hand.gameObj.active = false;
  11277. xGame.common.d3World.tableSrc.init();
  11278. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11279. this.cameraViewChange(() => {
  11280. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11281. switch (xGame.common.gameMode) {
  11282. case GameMode.classic:
  11283. xGame.common.d3World.d3Hand.gameObj.active = true;
  11284. this.playPutBallD3Ani();
  11285. break;
  11286. case GameMode.bigMove:
  11287. this.enterGame();
  11288. Laya.timer.once(500, this, () => {
  11289. this.ui.topNode.middleNode.visible = true;
  11290. this.ui.topNode.middleNode.t0.play();
  11291. });
  11292. break;
  11293. case GameMode.placeBall:
  11294. this.enterGame();
  11295. break;
  11296. default:
  11297. break;
  11298. }
  11299. });
  11300. PlatMgr.showBanner(false);
  11301. }
  11302. enterGame() {
  11303. this.ui.d2Node.visible = true;
  11304. xGame.common.d3World.d3Hand.gameObj.active = false;
  11305. xGame.common.showOneCamera("mainCamera");
  11306. Moyu.recordGame(30, true);
  11307. if (!this.isPrePlay) {
  11308. this.isPrePlay = true;
  11309. xGame.common.d3World.prePlayEft();
  11310. }
  11311. xGame.common.gameMgr.gameReady();
  11312. this.openAllEvent();
  11313. this.ui.snowNode.visible = false;
  11314. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11315. this.ui.helpBtn.visible = condition;
  11316. }
  11317. showHelpLineGuide() {
  11318. let longGuide = DataMgr.getGuideHelpLine();
  11319. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11320. this.ui.helpBtn.visible = true;
  11321. this.ui.guideNode.visible = true;
  11322. }
  11323. }
  11324. setTurnAlpha(alpha) {
  11325. this.ui.keduNode.alpha = alpha;
  11326. this.ui.ganNode.alpha = alpha;
  11327. this.ui.rodMethodNode.alpha = alpha;
  11328. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11329. }
  11330. cameraViewChange(callback) {
  11331. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11332. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11333. xGame.common.showOneCamera("visitAngle");
  11334. cameraSrc.localRotationEulerY = 180;
  11335. cameraSrc.localRotationEulerZ = 0;
  11336. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11337. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11338. callback && callback();
  11339. }));
  11340. }));
  11341. }
  11342. playPutBallD3Ani() {
  11343. xGame.common.showOneCamera("mainCamera");
  11344. let handSrc = xGame.common.d3World.d3Hand;
  11345. handSrc.gameObj.active = true;
  11346. handSrc.transform.localPositionZ = 3;
  11347. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11348. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11349. handSrc.gameObj.active = false;
  11350. this.enterGame();
  11351. }), 400);
  11352. }));
  11353. }
  11354. updateHead() {
  11355. let user = Moyu.getUserInfo();
  11356. this.ui.topNode.selfNameTxt.text = user.nickName;
  11357. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11358. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11359. if (DataMgr.getSkillGuide() < 1) {
  11360. this.ui.topNode.aiNameTxt.text = 'billiards';
  11361. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11362. }
  11363. else {
  11364. this.ui.topNode.aiNameTxt.text = aiData.name;
  11365. let randNo = Math.floor(Math.random() * 10) + 1;
  11366. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11367. }
  11368. }
  11369. initD2world() {
  11370. let node = this.ui.d2Root.displayObject;
  11371. let src = node.getComponent(D2World);
  11372. if (!src) {
  11373. xGame.common.d2World = node.addComponent(D2World);
  11374. }
  11375. xGame.common.d2World.initSelf();
  11376. }
  11377. initD3world() {
  11378. if (this.isD3Inited)
  11379. return;
  11380. this.isD3Inited = true;
  11381. let scene3D = xGame.common.d3Scene;
  11382. this.ui.d3Root.displayObject.addChild(scene3D);
  11383. scene3D.active = true;
  11384. xGame.common.d3World.tableSrc.setBorderPos();
  11385. }
  11386. onRootMove(e) {
  11387. let rootBall = xGame.common.d2World.rootBall;
  11388. this.ui.moveNode.x = e.x;
  11389. this.ui.moveNode.y = e.y;
  11390. rootBall.gameObj.x = e.x;
  11391. rootBall.gameObj.y = e.y;
  11392. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11393. }
  11394. aiRootMove(move) {
  11395. if (move)
  11396. this.hideBallUI();
  11397. else {
  11398. this.showBallUI();
  11399. xGame.common.d2World.getHelpLine();
  11400. }
  11401. }
  11402. aiForce(type, force = 0) {
  11403. this.pressTarget = PressType.powerNode;
  11404. if (type == 1)
  11405. this.onEventUp({ force: true });
  11406. else if (type == 2)
  11407. this.onEventMove({ stageY: force, force: true });
  11408. }
  11409. onEventPress(e) {
  11410. if (e.stopPropagation)
  11411. e.stopPropagation();
  11412. if (!this.isTurnSelf())
  11413. return;
  11414. let target = e.target;
  11415. switch (target) {
  11416. case this.ui.myPowerNode.displayObject:
  11417. this.pressTarget = PressType.powerNode;
  11418. this.barInfo.curY = e.stageY;
  11419. this.updateBarInfo();
  11420. break;
  11421. case this.ui.moveNode.displayObject:
  11422. this.pressTarget = PressType.moveNode;
  11423. this.hideBallUI();
  11424. this.eventObj.curX = this.ui.moveNode.x;
  11425. this.eventObj.curY = this.ui.moveNode.y;
  11426. this.ui.moveNode.finger.visible = false;
  11427. this.eventObj.lastX = e.stageX;
  11428. this.eventObj.lastY = e.stageY;
  11429. break;
  11430. case this.ui.rulerClickNode.displayObject:
  11431. this.pressTarget = PressType.rulerNode;
  11432. this.eventObj.lastY = e.stageY;
  11433. break;
  11434. case this.ui.d2Root.displayObject:
  11435. this.pressTarget = PressType.d2Root;
  11436. this.eventObj.lastX = e.stageX;
  11437. this.eventObj.lastY = e.stageY;
  11438. this.eventObj.starX = e.stageX;
  11439. this.eventObj.starY = e.stageY;
  11440. this.eventObj.curX = 0;
  11441. this.eventObj.curY = 0;
  11442. xGame.common.d2World.d2Gan.setGanLastInfo();
  11443. this.rulerOffset = 0;
  11444. break;
  11445. default:
  11446. break;
  11447. }
  11448. }
  11449. onEventMove(e) {
  11450. if (e.stopPropagation)
  11451. e.stopPropagation();
  11452. if (e && e.force) {
  11453. }
  11454. else {
  11455. if (!this.isTurnSelf())
  11456. return;
  11457. }
  11458. switch (this.pressTarget) {
  11459. case PressType.powerNode:
  11460. this.barInfo.curY = e.stageY;
  11461. this.updateBarInfo();
  11462. this.isMoveRod = true;
  11463. break;
  11464. case PressType.moveNode:
  11465. let rootBall = xGame.common.d2World.rootBall;
  11466. let radius = rootBall.gameObj.width / 2;
  11467. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11468. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11469. let border = xGame.common.d2World.borderRect;
  11470. if (curX <= border.x + radius)
  11471. curX = border.x + radius;
  11472. else if (curX >= border.x + border.width - radius)
  11473. curX = border.x + border.width - radius;
  11474. if (curY <= border.y + radius)
  11475. curY = border.y + radius;
  11476. else if (curY >= border.y + border.height - radius)
  11477. curY = border.y + border.height - radius;
  11478. if (xGame.common.gameMgr.isOpenBall) {
  11479. if (curX >= border.x + border.openBallW - radius)
  11480. curX = border.x + border.openBallW - radius;
  11481. }
  11482. this.ui.moveNode.x = curX;
  11483. this.ui.moveNode.y = curY;
  11484. rootBall.gameObj.x = curX;
  11485. rootBall.gameObj.y = curY;
  11486. rootBall.d3BallSrc.setTransPos(curX, curY);
  11487. this.isMoveRod = true;
  11488. break;
  11489. case PressType.rulerNode:
  11490. let yy = e.stageY - this.eventObj.lastY;
  11491. this.eventObj.lastY = e.stageY;
  11492. let ruler1 = this.ui.rulerNode.img1;
  11493. let ruler2 = this.ui.rulerNode.img2;
  11494. ruler1.y += yy;
  11495. ruler2.y += yy;
  11496. this.rulerOffset += yy;
  11497. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11498. this.rulerOffset = 0;
  11499. xGame.soundMgr.playSound("inch", 1, 10);
  11500. }
  11501. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11502. let h = ruler1.height;
  11503. this.checkGuide();
  11504. this.isMoveRod = true;
  11505. if (ruler1.y >= h) {
  11506. ruler1.y = -h;
  11507. ruler2.y = 0;
  11508. return;
  11509. }
  11510. else if (ruler1.y <= -h) {
  11511. ruler1.y = h;
  11512. ruler2.y = 0;
  11513. return;
  11514. }
  11515. if (ruler2.y >= h) {
  11516. ruler2.y = -h;
  11517. ruler1.y = 0;
  11518. return;
  11519. }
  11520. else if (ruler2.y <= -h) {
  11521. ruler2.y = h;
  11522. ruler1.y = 0;
  11523. return;
  11524. }
  11525. break;
  11526. case PressType.d2Root:
  11527. this.eventObj.curX = e.stageX;
  11528. this.eventObj.curY = e.stageY;
  11529. let offset = this.checkRodMoveDir();
  11530. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11531. this.eventObj.lastX = e.stageX;
  11532. this.eventObj.lastY = e.stageY;
  11533. break;
  11534. default:
  11535. break;
  11536. }
  11537. }
  11538. onEventUp(e) {
  11539. if (e.stopPropagation)
  11540. e.stopPropagation();
  11541. if (e && e.force) {
  11542. }
  11543. else {
  11544. if (!this.isTurnSelf())
  11545. return;
  11546. }
  11547. switch (this.pressTarget) {
  11548. case PressType.powerNode:
  11549. this.ui.powerNode.value = 0;
  11550. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11551. this.ui.powerTxt.text = "";
  11552. if (this.powerNum > 0) {
  11553. xGame.eventMgr.event(BALL_SHOOT);
  11554. xGame.common.d2World.shoot(this.powerNum);
  11555. xGame.common.d2World.d2Gan.shoot();
  11556. xGame.common.d2World.d2HelpLine.shoot();
  11557. this.finishGuide();
  11558. this.ui.powerEft.visible = false;
  11559. this.ui.colorNode.visible = false;
  11560. let ganStr = "";
  11561. if (this.powerNum <= 30) {
  11562. ganStr = "gan_30";
  11563. }
  11564. else if (this.powerNum <= 60) {
  11565. ganStr = "gan_50";
  11566. }
  11567. else {
  11568. ganStr = "gan_80";
  11569. }
  11570. xGame.soundMgr.playSound(ganStr);
  11571. }
  11572. break;
  11573. case PressType.moveNode:
  11574. let rootBall = xGame.common.d2World.rootBall;
  11575. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11576. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11577. let isIntersect = this.judgeBallIntersect();
  11578. if (isIntersect) {
  11579. this.ui.moveNode.x = lastX;
  11580. this.ui.moveNode.y = lastY;
  11581. rootBall.gameObj.x = lastX;
  11582. rootBall.gameObj.y = lastY;
  11583. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11584. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11585. }
  11586. else {
  11587. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11588. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11589. }
  11590. this.showBallUI();
  11591. this.ui.moveNode.finger.visible = true;
  11592. xGame.common.d2World.getHelpLine();
  11593. break;
  11594. case PressType.rulerNode:
  11595. break;
  11596. case PressType.d2Root:
  11597. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11598. if (dis <= 25) {
  11599. this.moveToClickDot(e);
  11600. }
  11601. break;
  11602. default:
  11603. break;
  11604. }
  11605. this.pressTarget = -1;
  11606. }
  11607. checkGuide() {
  11608. let guide = DataMgr.getSkillGuide();
  11609. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11610. xGame.common.guideStep++;
  11611. xGame.common.gameUI.ui.guide2.visible = false;
  11612. xGame.common.gameUI.ui.guide3.visible = true;
  11613. }
  11614. }
  11615. finishGuide() {
  11616. let guide = DataMgr.getSkillGuide();
  11617. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11618. xGame.common.guideStep = 10;
  11619. this.closeAllGuide();
  11620. console.log('zh: 新手引导完毕');
  11621. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11622. }
  11623. }
  11624. closeAllGuide() {
  11625. xGame.common.gameUI.ui.guide1.visible = false;
  11626. xGame.common.gameUI.ui.guide2.visible = false;
  11627. xGame.common.gameUI.ui.guide3.visible = false;
  11628. }
  11629. updateBarInfo() {
  11630. let star = this.ui.powerNode.y;
  11631. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11632. if (rate >= 1)
  11633. rate = 1;
  11634. if (rate <= 0)
  11635. rate = 0;
  11636. this.powerNum = Math.ceil(rate * 100);
  11637. this.ui.powerNode.value = this.powerNum;
  11638. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11639. this.ui.colorNode.value = this.powerNum;
  11640. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11641. this.ui.powerEft.visible = this.powerNum != 0;
  11642. this.ui.colorNode.visible = this.powerNum != 0;
  11643. this.ui.powerTxt.text = this.powerNum + "";
  11644. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11645. }
  11646. forceCancel() {
  11647. this.ui.powerNode.value = 0;
  11648. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11649. this.ui.powerTxt.text = "";
  11650. }
  11651. checkRodMoveDir() {
  11652. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11653. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11654. if (tempX >= 0 && tempY <= 0) {
  11655. return this.checkDir();
  11656. }
  11657. else if (tempX < 0 && tempY < 0) {
  11658. return this.checkDir(1, -1);
  11659. }
  11660. else if (tempX < 0 && tempY > 0) {
  11661. return this.checkDir(-1, -1);
  11662. }
  11663. else {
  11664. return this.checkDir(-1, 1);
  11665. }
  11666. }
  11667. checkDir(flagX = 1, flagY = 1) {
  11668. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11669. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11670. if (offsetY == 0) {
  11671. return offsetX * flagX;
  11672. }
  11673. if (offsetX == 0) {
  11674. return offsetY * flagY;
  11675. }
  11676. let angle = offsetY / offsetX;
  11677. if (Math.abs(angle) >= 1) {
  11678. return offsetY * flagY;
  11679. }
  11680. else {
  11681. return offsetX * flagX;
  11682. }
  11683. }
  11684. judgeBallIntersect() {
  11685. let rootBall = xGame.common.d2World.rootBall;
  11686. let ballArr = xGame.common.d2World.ballArr;
  11687. let radius = rootBall.gameObj.width / 2;
  11688. let temp;
  11689. let isIntersect = false;
  11690. for (let index = 0; index < ballArr.length; index++) {
  11691. temp = ballArr[index];
  11692. if (temp.number == rootBall.number)
  11693. continue;
  11694. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11695. if (isIntersect) {
  11696. break;
  11697. }
  11698. }
  11699. return isIntersect;
  11700. }
  11701. hideBallUI() {
  11702. let d2Gan = xGame.common.d2World.d2Gan;
  11703. if (!d2Gan.ui.isDisposed)
  11704. d2Gan.ui.visible = false;
  11705. let d2Help = xGame.common.d2World.d2HelpLine;
  11706. if (!d2Help.ui.isDisposed)
  11707. d2Help.ui.visible = false;
  11708. let rootBall = xGame.common.d2World.rootBall;
  11709. if (!rootBall.destroyed) {
  11710. rootBall.gameObj.active = false;
  11711. }
  11712. }
  11713. showBallUI() {
  11714. let d2Gan = xGame.common.d2World.d2Gan;
  11715. if (!d2Gan.ui.isDisposed)
  11716. d2Gan.ui.visible = true;
  11717. let d2Help = xGame.common.d2World.d2HelpLine;
  11718. if (!d2Help.ui.isDisposed)
  11719. d2Help.ui.visible = true;
  11720. let rootBall = xGame.common.d2World.rootBall;
  11721. if (!rootBall.destroyed) {
  11722. rootBall.gameObj.active = true;
  11723. }
  11724. }
  11725. moveToClickDot(e) {
  11726. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11727. let root = xGame.common.d2World.rootBall.gameObj;
  11728. let xx = e.stageX - xGame.common.sysOffestNum;
  11729. let yy = e.stageY;
  11730. let x = xx - root.x;
  11731. let y = yy - root.y;
  11732. let angle = xGame.common.getfguiRotation(x, y);
  11733. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11734. xGame.common.d2World.getHelpLine();
  11735. }
  11736. this.isMoveRod = false;
  11737. xGame.common.clickedBall = false;
  11738. }
  11739. openAllEvent() {
  11740. this.closeAllEvent();
  11741. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11742. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11743. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11744. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11745. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11746. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11747. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11748. }
  11749. closeAllEvent() {
  11750. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11751. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11752. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11753. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11754. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11755. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11756. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11757. }
  11758. resetGame() {
  11759. this.closeAllEvent();
  11760. this.hideBallUI();
  11761. xGame.common.gameMgr.gamePause = true;
  11762. }
  11763. }
  11764. UIGame.uiName = "UIGame";
  11765. class UIAddProp extends UIBase {
  11766. constructor() {
  11767. super();
  11768. this.curType = "";
  11769. }
  11770. onConstructor() {
  11771. this.ui = ui_UIAddProp.createInstance();
  11772. this.contentPane = this.ui;
  11773. this.isEject = false;
  11774. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11775. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11776. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11777. this.updateUI();
  11778. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11779. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11780. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11781. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11782. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11783. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11784. }
  11785. show(type) {
  11786. super.show();
  11787. this.curType = type == 0 ? "coin" : "diamond";
  11788. this.switchBtn("");
  11789. this.ui.t0.play();
  11790. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11791. PlatMgr.showInsert(true);
  11792. this.setGlobalFont(this.ui);
  11793. }
  11794. closeSelf() {
  11795. this.hide();
  11796. }
  11797. updateUI() {
  11798. let data = cfgTable.moneyData;
  11799. let temp;
  11800. let obj;
  11801. for (const key in data) {
  11802. temp = data[key];
  11803. obj = this.ui.myNode["node" + key];
  11804. if (parseInt(key) <= 2) {
  11805. obj.diamondTxt.text = "+" + temp.num;
  11806. }
  11807. else {
  11808. obj.coinTxt.text = temp.num;
  11809. obj.diamondTxt.text = temp.get.split('_')[1];
  11810. }
  11811. }
  11812. this.updateDiamondShare();
  11813. }
  11814. updateDiamondShare() {
  11815. let data = DataMgr.getShareDiamondTimes();
  11816. if (data >= xGame.common.maxShareDiamondTimes) {
  11817. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11818. this.ui.myNode.node1.touchable = false;
  11819. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11820. }
  11821. else {
  11822. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11823. this.ui.myNode.node1.touchable = true;
  11824. }
  11825. }
  11826. switchBtn(type) {
  11827. if (type == "")
  11828. type = this.curType;
  11829. else {
  11830. if (this.curType == type) {
  11831. return;
  11832. }
  11833. else {
  11834. this.curType = type;
  11835. }
  11836. }
  11837. if (type == "coin") {
  11838. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11839. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11840. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11841. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11842. this.ui.myNode.c1.selectedIndex = 0;
  11843. }
  11844. else {
  11845. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11846. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11847. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11848. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11849. this.ui.myNode.c1.selectedIndex = 1;
  11850. }
  11851. }
  11852. convertCoin(index) {
  11853. let data = cfgTable.moneyData[index];
  11854. let coinNum = data.num;
  11855. let str = data.get.split('_')[1];
  11856. let needDiamond = parseInt(str);
  11857. if (DataMgr.diamondEnough(needDiamond)) {
  11858. DataMgr.setDiamond(-needDiamond);
  11859. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11860. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11861. }
  11862. else {
  11863. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11864. this.switchBtn("diamond");
  11865. }
  11866. }
  11867. videoGetDiamond() {
  11868. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11869. if (Laya.Browser.onAndroid) {
  11870. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11871. if (!boo) {
  11872. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11873. return;
  11874. }
  11875. }
  11876. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11877. }
  11878. else {
  11879. console.log('zh:AD 失败,直接发放奖励');
  11880. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11881. }
  11882. }
  11883. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11884. let num = cfgTable.moneyData[2].num;
  11885. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11886. this.closeSelf();
  11887. }
  11888. videoGetCoin() {
  11889. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11890. if (Laya.Browser.onAndroid) {
  11891. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11892. if (!boo) {
  11893. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11894. return;
  11895. }
  11896. }
  11897. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11898. }
  11899. else {
  11900. console.log('zh:AD 失败,直接发放奖励');
  11901. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11902. }
  11903. }
  11904. qjff_AD_for_uiAddProp_videoGetCoin() {
  11905. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11906. this.closeSelf();
  11907. }
  11908. shareGetDiamond() {
  11909. let times = DataMgr.getShareDiamondTimes();
  11910. if (times >= xGame.common.maxShareDiamondTimes) {
  11911. console.log('zh: 233333333333 maxShareDiamondTimes');
  11912. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11913. }
  11914. else {
  11915. console.log('zh:33333333333333ad');
  11916. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11917. if (Laya.Browser.onAndroid) {
  11918. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11919. if (!boo) {
  11920. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11921. return;
  11922. }
  11923. }
  11924. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11925. }
  11926. else {
  11927. console.log('zh:AD 失败,直接发放奖励');
  11928. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11929. }
  11930. }
  11931. }
  11932. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11933. let diamond = xGame.common.randomNum(50, 100);
  11934. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11935. DataMgr.setShareDiamondTimes(1);
  11936. this.updateDiamondShare();
  11937. }
  11938. openPutBallView() {
  11939. let end = xGame.uiMgr.getUI(UIGameEnd);
  11940. let skill = xGame.uiMgr.getUI(UISkill);
  11941. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11942. let uigame = xGame.uiMgr.getUI(UIGame);
  11943. if (end && !end.isHide) {
  11944. xGame.uiMgr.Hide(UIGameEnd);
  11945. xGame.uiMgr.Show(UIMain);
  11946. }
  11947. if (skill && !skill.isHide)
  11948. xGame.uiMgr.Hide(UISkill);
  11949. if (uigame && !uigame.isHide)
  11950. xGame.uiMgr.Hide(UIGame);
  11951. if (level && !level.isHide) {
  11952. }
  11953. else {
  11954. xGame.uiMgr.Show(UILevelDisplay);
  11955. }
  11956. this.closeSelf();
  11957. }
  11958. }
  11959. UIAddProp.uiName = "UIAddProp";
  11960. class MoneyNode {
  11961. constructor(ui) {
  11962. this.leftTime = 0;
  11963. this.ui = ui;
  11964. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11965. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11966. this.ui.addPowerBtn.onClick(this, this.addPower);
  11967. this.ui.c1.selectedIndex = 1;
  11968. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11969. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11970. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11971. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11972. this.coinChange();
  11973. this.diamondChange();
  11974. this.powerChange();
  11975. }
  11976. addPower() {
  11977. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11978. xGame.uiMgr.Show(UIPower);
  11979. }
  11980. powerChange() {
  11981. let powerNum = DataMgr.getPower();
  11982. this.ui.powerTxt.text = powerNum + "";
  11983. }
  11984. checkPowerTime() {
  11985. let cur = new Date().getTime();
  11986. let last = DataMgr.getPowerTime();
  11987. if (last == 0) {
  11988. last = cur;
  11989. DataMgr.setPowerTime(cur);
  11990. }
  11991. let power = DataMgr.getPower();
  11992. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11993. Laya.timer.clearAll(this);
  11994. if (power >= xGame.common.natureMaxPower) {
  11995. this.ui.powerTimeTxt.text = "";
  11996. DataMgr.setPowerTime(cur);
  11997. return;
  11998. }
  11999. if (power + offset >= xGame.common.natureMaxPower) {
  12000. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12001. this.ui.powerTimeTxt.text = "";
  12002. DataMgr.setPowerTime(cur);
  12003. }
  12004. else {
  12005. if (offset > 0) {
  12006. DataMgr.setPower(offset);
  12007. DataMgr.setPowerTime(cur);
  12008. }
  12009. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12010. this.leftTime = xGame.common.powerRecoverNum - time;
  12011. if (this.leftTime <= 0)
  12012. this.leftTime = 0;
  12013. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12014. Laya.timer.loop(1000, this, this.updatePowerTime);
  12015. }
  12016. }
  12017. updatePowerTime() {
  12018. this.leftTime -= 1;
  12019. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12020. if (this.leftTime <= 0) {
  12021. this.checkPowerTime();
  12022. }
  12023. }
  12024. coinChange() {
  12025. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12026. }
  12027. diamondChange() {
  12028. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12029. }
  12030. addCoin() {
  12031. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12032. Moyu.sendDataEvent("AddCoinBtn");
  12033. xGame.uiMgr.Show(UIAddProp, 0);
  12034. }
  12035. addDiamond() {
  12036. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12037. Moyu.sendDataEvent("AddDiamondBtn");
  12038. xGame.uiMgr.Show(UIAddProp, 1);
  12039. }
  12040. }
  12041. class UIDraw extends UIBase {
  12042. constructor() {
  12043. super();
  12044. this.curKey = 0;
  12045. }
  12046. onConstructor() {
  12047. this.ui = ui_UIDraw.createInstance();
  12048. this.contentPane = this.ui;
  12049. this.isEject = false;
  12050. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12051. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12052. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12053. this.initDraw();
  12054. this.initUI();
  12055. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12056. }
  12057. show() {
  12058. super.show();
  12059. this.ui.t0.play();
  12060. this.playSecretaryIdle();
  12061. this.updateDraw();
  12062. this.checkFree();
  12063. if (PlatMgr.bannerDelay > 0) {
  12064. this.ui.closeNode.closeBtn.visible = false;
  12065. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12066. this.ui.closeNode.closeBtn.visible = true;
  12067. });
  12068. }
  12069. PlatMgr.showRateBanner();
  12070. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12071. this.setGlobalFont(this.ui);
  12072. }
  12073. hide() {
  12074. Laya.timer.clearAll(this);
  12075. super.hide();
  12076. }
  12077. checkFree() {
  12078. let isFree = DataMgr.getDailyfreeDrawTimes();
  12079. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12080. }
  12081. initDraw() {
  12082. this.drawObj = [];
  12083. let data = cfgTable.drawData;
  12084. let temp;
  12085. let weight = 0;
  12086. for (const key in data) {
  12087. temp = data[key];
  12088. weight += temp.weight;
  12089. this.drawObj.push(weight);
  12090. }
  12091. this.allWeight = weight;
  12092. }
  12093. initUI() {
  12094. let data = cfgTable.drawData;
  12095. let temp;
  12096. let img;
  12097. let txt;
  12098. for (const key in data) {
  12099. temp = data[key];
  12100. img = this.ui.myNode.rotNode["img" + key];
  12101. txt = this.ui.myNode.rotNode["txt" + key];
  12102. img.url = xGame.common.getGameIconUrl(temp.icon);
  12103. txt.visible = true;
  12104. if (temp.award > 2) {
  12105. img.rotation = 0;
  12106. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12107. }
  12108. else {
  12109. img.rotation = temp.rotation;
  12110. txt.text = temp.num;
  12111. }
  12112. }
  12113. }
  12114. getCurkey() {
  12115. let rand = Math.random() * this.allWeight;
  12116. let temp;
  12117. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12118. temp = this.drawObj[index];
  12119. if (index == 0) {
  12120. if (rand < temp) {
  12121. return index + 1;
  12122. }
  12123. }
  12124. else {
  12125. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12126. return index + 1;
  12127. }
  12128. }
  12129. }
  12130. return 2;
  12131. }
  12132. startDraw() {
  12133. console.log('zh:开始抽奖');
  12134. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12135. if (freeTimes > 0) {
  12136. console.log('zh:freeTimes=' + freeTimes);
  12137. this.beginDraw();
  12138. DataMgr.setDailyfreeDrawTimes(0);
  12139. this.checkFree();
  12140. }
  12141. else {
  12142. if (Laya.Browser.onAndroid) {
  12143. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12144. if (!boo) {
  12145. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12146. return;
  12147. }
  12148. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12149. }
  12150. else {
  12151. console.log('zh:AD 失败,直接发放奖励');
  12152. this.qjff_chouJiang();
  12153. }
  12154. }
  12155. else {
  12156. this.qjff_chouJiang();
  12157. }
  12158. }
  12159. }
  12160. qjff_chouJiang() {
  12161. this.beginDraw();
  12162. }
  12163. beginDraw() {
  12164. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12165. this.ui.drawBtn.touchable = false;
  12166. this.curKey = this.getCurkey();
  12167. console.log("zh:当前key", this.curKey);
  12168. let cell = 60;
  12169. let lap = 3;
  12170. let angle = cell * (this.curKey - 1) + lap * 360;
  12171. let target = this.ui.myNode.rotNode;
  12172. target.rotation = 0;
  12173. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12174. console.log("zh:旋转完成");
  12175. this.ui.drawBtn.touchable = true;
  12176. this.getAward();
  12177. }));
  12178. }
  12179. getAward() {
  12180. let data = cfgTable.drawData[this.curKey];
  12181. let temp = new AwardType();
  12182. temp.type = data.award;
  12183. temp.num = data.num;
  12184. xGame.common.getAward([temp], () => {
  12185. DataMgr.setDrawTimes(1);
  12186. this.updateDraw();
  12187. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12188. });
  12189. }
  12190. updateDraw() {
  12191. let drawTimes = DataMgr.getDrawTimes();
  12192. let awardTimes = DataMgr.getDrawAwardTimes();
  12193. if (Math.floor(drawTimes / 3) > awardTimes) {
  12194. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12195. this.ui.extraNode.boxBtn.touchable = true;
  12196. this.ui.extraNode.tipsTxt.text = "3/3";
  12197. this.ui.extraNode.barNode.width = 265;
  12198. this.getExtraAward();
  12199. }
  12200. else {
  12201. this.ui.extraNode.boxBtn.t0.stop();
  12202. this.ui.extraNode.boxBtn.touchable = false;
  12203. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12204. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12205. }
  12206. let data = cfgTable.drawData[1];
  12207. if (awardTimes == 0) {
  12208. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12209. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12210. this.ui.myNode.rotNode.img1.rotation = 0;
  12211. }
  12212. else {
  12213. let award = data.nextid;
  12214. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12215. this.ui.myNode.rotNode.txt1.text = award[1];
  12216. this.ui.myNode.rotNode.img1.rotation = 0;
  12217. }
  12218. }
  12219. getExtraAward() {
  12220. let drawTimes = DataMgr.getDrawTimes();
  12221. let awardTimes = DataMgr.getDrawAwardTimes();
  12222. let data = cfgTable.drawData[1];
  12223. let award = new AwardType();
  12224. if (awardTimes == 0) {
  12225. award.num = data.num;
  12226. award.type = data.award;
  12227. xGame.common.getAward([award], () => {
  12228. let all = Math.floor(drawTimes / 3);
  12229. DataMgr.setDrawAwardTimes(all);
  12230. this.updateDraw();
  12231. });
  12232. }
  12233. else {
  12234. award.num = parseInt(data.nextid[1]);
  12235. award.type = parseInt(data.nextid[0]);
  12236. xGame.common.getAward([award], () => {
  12237. let all = Math.floor(drawTimes / 3);
  12238. DataMgr.setDrawAwardTimes(all);
  12239. this.updateDraw();
  12240. });
  12241. }
  12242. }
  12243. closeSelf() {
  12244. this.hide();
  12245. }
  12246. playSecretaryIdle() {
  12247. let parent = this.ui.secretary.displayObject;
  12248. parent.destroyChildren();
  12249. let xx = this.ui.secretary.width / 2;
  12250. let yy = this.ui.secretary.height;
  12251. let scale = xGame.common.getSecretaryScale();
  12252. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12253. xGame.common.secretary.play(data, 0, true, parent);
  12254. }
  12255. }
  12256. UIDraw.uiName = "UIDraw";
  12257. class ui_UIFlyEft extends fgui.GComponent {
  12258. static createInstance() {
  12259. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12260. }
  12261. onConstruct() {
  12262. this.n0 = (this.getChild("n0"));
  12263. this.n1 = (this.getChild("n1"));
  12264. this.n2 = (this.getChild("n2"));
  12265. this.n3 = (this.getChild("n3"));
  12266. this.n4 = (this.getChild("n4"));
  12267. this.n5 = (this.getChild("n5"));
  12268. this.n6 = (this.getChild("n6"));
  12269. this.n7 = (this.getChild("n7"));
  12270. this.iconNode = (this.getChild("iconNode"));
  12271. this.txt = (this.getChild("txt"));
  12272. this.txtNode = (this.getChild("txtNode"));
  12273. }
  12274. }
  12275. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12276. class UIFlyEft extends UIBase {
  12277. constructor() {
  12278. super();
  12279. this.max = 8;
  12280. this.delay = 0;
  12281. }
  12282. onConstructor() {
  12283. this.ui = ui_UIFlyEft.createInstance();
  12284. this.contentPane = this.ui;
  12285. this.isEject = false;
  12286. this.isMuti = true;
  12287. this.ui.x += xGame.common.sysOffestNum;
  12288. }
  12289. getArrPos() {
  12290. if (this.iconPos && this.iconPos.length > 0)
  12291. return;
  12292. this.iconPos = [];
  12293. let temp;
  12294. for (let index = 0; index < this.max; index++) {
  12295. temp = this.ui["n" + index];
  12296. this.iconPos.push([temp.x, temp.y]);
  12297. }
  12298. }
  12299. show(stPos, edPos, num, type, callback) {
  12300. super.show();
  12301. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12302. this.getArrPos();
  12303. this.updateUI(type);
  12304. this.updatePos();
  12305. this.runFly(edPos, callback);
  12306. this.runWorlds(stPos, num);
  12307. this.setGlobalFont(this.ui);
  12308. }
  12309. updateUI(type) {
  12310. let temp;
  12311. let str;
  12312. for (let index = 0; index < this.max; index++) {
  12313. temp = this.ui["n" + index];
  12314. str = this.getIconStr(type);
  12315. temp.url = xGame.common.getGameIconUrl(str);
  12316. }
  12317. }
  12318. getIconStr(type) {
  12319. switch (type) {
  12320. case Prop.diamond:
  12321. return "ty_zs";
  12322. case Prop.coin:
  12323. return "ty_jb";
  12324. default:
  12325. break;
  12326. }
  12327. }
  12328. updatePos() {
  12329. let temp;
  12330. for (let index = 0; index < this.max; index++) {
  12331. temp = this.ui["n" + index];
  12332. temp.x = this.iconPos[index][0];
  12333. temp.y = this.iconPos[index][1];
  12334. }
  12335. }
  12336. runFly(endPos, callback) {
  12337. let all = 0;
  12338. let temp;
  12339. for (let index = 0; index < this.max; index++) {
  12340. temp = this.ui["n" + index];
  12341. temp.visible = true;
  12342. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12343. temp.visible = false;
  12344. all++;
  12345. if (all >= this.max) {
  12346. callback && callback();
  12347. }
  12348. }), 20 * index);
  12349. }
  12350. }
  12351. runWorlds(stPos, num) {
  12352. let str = "+" + num;
  12353. this.ui.txt.text = str;
  12354. let starX = stPos.x;
  12355. let starY = stPos.y + 50;
  12356. this.ui.txt.x = starX;
  12357. this.ui.txt.y = starY;
  12358. this.ui.txt.visible = true;
  12359. this.ui.txt.alpha = 1;
  12360. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12361. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12362. this.ui.txt.visible = false;
  12363. this.hide();
  12364. }));
  12365. }));
  12366. }
  12367. }
  12368. UIFlyEft.uiName = "UIFlyEft";
  12369. class Common {
  12370. constructor() {
  12371. this.convertNum = 0.025;
  12372. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12373. this.scaleV3One = new Laya.Vector3();
  12374. this.scaleV3Two = new Laya.Vector3();
  12375. this.posV4 = new Laya.Vector4();
  12376. this.showDebug = false;
  12377. this.openGuide = true;
  12378. this.rodOffest = new Laya.Vector2(0, 0);
  12379. this.rodAngle = 0;
  12380. this.gameMode = GameMode.classic;
  12381. this.bigMoveLevelIndex = 1;
  12382. this.bigMoveNeedCoin = 1000;
  12383. this.classicNiceNeddCoin = 1000;
  12384. this.passAwardCoin = 2000;
  12385. this.classicRoomType = 1;
  12386. this.maxPower = 20;
  12387. this.natureMaxPower = 5;
  12388. this.videoPower = 2;
  12389. this.powerRecoverNum = 900;
  12390. this.curPlayerSkillType = 0;
  12391. this.isNewDay = false;
  12392. this.clickedBall = false;
  12393. this.placeBallCurLevel = 0;
  12394. this.placeBallStarNum = 0;
  12395. this.longHelpLine = false;
  12396. this.maxShareDiamondTimes = 3;
  12397. this.guideStep = 0;
  12398. this.temSelfLevel = 0;
  12399. this.extraMoveNum = 0;
  12400. this.curRankID = 0;
  12401. this.rankID = {
  12402. normalStar: 12000,
  12403. wxStar: 12001
  12404. };
  12405. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12406. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12407. this.btnClickStr = "buttonclick";
  12408. this.maxSkillLevel = 10;
  12409. this.upSkillLevel = false;
  12410. this.gameStartTime = 0;
  12411. this._sysOffestNum = 0;
  12412. this.angleV2 = new Laya.Vector2();
  12413. this.rootV = new Laya.Vector2(0, 1);
  12414. this.tempDir1 = new Laya.Vector2();
  12415. this.tempDir2 = new Laya.Vector2();
  12416. this.ballSize = 33;
  12417. this.stPos = new Laya.Point();
  12418. this.edPos = new Laya.Point();
  12419. Common._instance = this;
  12420. window["common"] = this;
  12421. }
  12422. static getInstance() {
  12423. if (!this._instance) {
  12424. this._instance = new Common();
  12425. }
  12426. return this._instance;
  12427. }
  12428. get sysOffestNum() {
  12429. if (this._sysOffestNum == 0) {
  12430. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12431. }
  12432. return this._sysOffestNum;
  12433. }
  12434. testShader() {
  12435. let test = new LightShader();
  12436. test.texture = "res/d3Res/ballTexture/ball1.png";
  12437. Laya.stage.addChild(test);
  12438. }
  12439. playScale(node) {
  12440. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12441. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12442. }));
  12443. }));
  12444. }
  12445. setGroup(colli, ...group) {
  12446. let out = 0;
  12447. for (let index = 0; index < group.length; index++) {
  12448. if (index == 0) {
  12449. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12450. }
  12451. else {
  12452. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12453. }
  12454. }
  12455. colli.collisionGroup = out;
  12456. }
  12457. setCanGroupWith(colli, ...group) {
  12458. let out = 0;
  12459. for (let index = 0; index < group.length; index++) {
  12460. if (index == 0) {
  12461. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12462. }
  12463. else {
  12464. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12465. }
  12466. }
  12467. colli.canCollideWith = out;
  12468. }
  12469. loadPrefab(name, callback) {
  12470. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12471. let prefab = new Laya.Prefab();
  12472. prefab.json = obj;
  12473. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12474. callback && callback(img);
  12475. }));
  12476. }
  12477. pos2to3Convert(x, y, d3Pos) {
  12478. x = x + this.sysOffestNum;
  12479. d3Pos.setValue(x, y, 0);
  12480. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12481. if (success) {
  12482. }
  12483. else {
  12484. console.error("转换出错了。。。。。。。。");
  12485. }
  12486. }
  12487. scale2to3Convert(num) {
  12488. this.scaleV3One.setValue(0, 0, 0);
  12489. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12490. this.scaleV3Two.setValue(0, num, 0);
  12491. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12492. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12493. return outNum;
  12494. }
  12495. pos3to2Convert(d3Pos) {
  12496. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12497. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12498. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12499. d3Pos.x -= this.sysOffestNum;
  12500. }
  12501. scale3to2Convert(num) {
  12502. let scale = this.scale2to3Convert(1);
  12503. let d2Out = num / scale;
  12504. return d2Out;
  12505. }
  12506. getCollider(type, restitution = 0.9, density = 10) {
  12507. let colli;
  12508. if (type == "box")
  12509. colli = new Laya.BoxCollider();
  12510. else
  12511. colli = new Laya.CircleCollider();
  12512. colli.friction = 0;
  12513. colli.restitution = restitution;
  12514. colli.density = density;
  12515. return colli;
  12516. }
  12517. getRigbody() {
  12518. let rigy = new Laya.RigidBody();
  12519. rigy.bullet = true;
  12520. rigy.allowRotation = false;
  12521. rigy.allowSleep = false;
  12522. rigy.gravityScale = 0;
  12523. return rigy;
  12524. }
  12525. getfguiRotation(x, y) {
  12526. this.angleV2.setValue(x, y);
  12527. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12528. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12529. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12530. angle = -angle;
  12531. }
  12532. return 180 + angle;
  12533. }
  12534. getAngle(x, y) {
  12535. this.angleV2.setValue(x, y);
  12536. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12537. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12538. return angle;
  12539. }
  12540. randomNum(a, b) {
  12541. return a + Math.floor((b - a + 1) * Math.random());
  12542. }
  12543. getRandArrEle(arr) {
  12544. return arr[Math.floor(arr.length * Math.random())];
  12545. }
  12546. getSign(val) {
  12547. return val >= 0 ? 1 : -1;
  12548. }
  12549. botherArr(arr) {
  12550. let times = arr.length + 2;
  12551. let length = arr.length;
  12552. let a;
  12553. let b;
  12554. let temp;
  12555. for (let index = 0; index < times; index++) {
  12556. a = Math.floor(Math.random() * length);
  12557. b = Math.floor(Math.random() * length);
  12558. temp = arr[a];
  12559. arr[a] = arr[b];
  12560. arr[b] = temp;
  12561. }
  12562. }
  12563. getGameIconUrl(id) {
  12564. return "ui://game/" + id;
  12565. }
  12566. getComponentUrl(id) {
  12567. return "ui://game/" + id;
  12568. }
  12569. getAnimation() {
  12570. }
  12571. judgeSkillType(type = SkillType.highSpace) {
  12572. if (this.gameMode == GameMode.classic)
  12573. return;
  12574. let gameMgr = this.gameMgr;
  12575. if (gameMgr.selfTurn) {
  12576. if (gameMgr.selfCurSkill == type) {
  12577. return true;
  12578. }
  12579. }
  12580. else {
  12581. if (gameMgr.aiCurSkill == type) {
  12582. return true;
  12583. }
  12584. }
  12585. }
  12586. ballColliHole(collider) {
  12587. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12588. xGame.common.gameMgr.isFirstInGame = false;
  12589. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12590. }
  12591. collider.owner.mySrc.checkWrongBall();
  12592. }
  12593. getArrMaxEle(arr) {
  12594. let max = -Infinity;
  12595. for (let index = 0; index < arr.length; index++) {
  12596. max = Math.max(arr[index], max);
  12597. }
  12598. return max;
  12599. }
  12600. getArrMinEle(arr) {
  12601. let min = Infinity;
  12602. for (let index = 0; index < arr.length; index++) {
  12603. min = Math.min(arr[index], min);
  12604. }
  12605. return min;
  12606. }
  12607. playRandomMutiBallBigSkillSound() {
  12608. if (Math.random() <= 0.5)
  12609. return;
  12610. let rand = this.randomNum(1, 6);
  12611. let str = "ganfa0" + rand;
  12612. xGame.soundMgr.playSound(str);
  12613. }
  12614. showOneCamera(type) {
  12615. let object = xGame.common.d3World.cameraObj;
  12616. for (const key in object) {
  12617. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12618. object[key].init();
  12619. object[key].owner.active = key == type;
  12620. }
  12621. }
  12622. }
  12623. checkBallOverBorder(x, y) {
  12624. let radius = 17;
  12625. let condition = this._checkBorder(x + radius, y) ||
  12626. this._checkBorder(x - radius, y) ||
  12627. this._checkBorder(x, y + radius) ||
  12628. this._checkBorder(x, y - radius);
  12629. if (condition) {
  12630. return true;
  12631. }
  12632. }
  12633. _checkBorder(x, y) {
  12634. let borderRect = this.d2World.borderRect;
  12635. let xOffest = 20;
  12636. let yOffest = 20;
  12637. if (y <= borderRect.y - yOffest) {
  12638. return true;
  12639. }
  12640. if (y >= borderRect.y + borderRect.height + yOffest) {
  12641. return true;
  12642. }
  12643. if (x <= borderRect.x - xOffest) {
  12644. return true;
  12645. }
  12646. if (x >= borderRect.x + borderRect.width + xOffest) {
  12647. return true;
  12648. }
  12649. }
  12650. initWeight(cfg) {
  12651. let allCfgData = { data: {}, allWeightNum: 0 };
  12652. let weightCfg = allCfgData.data;
  12653. let weight = 0;
  12654. for (const key in cfg) {
  12655. weightCfg[key] = {};
  12656. weightCfg[key].id = cfg[key].id;
  12657. weightCfg[key].minWeight = weight;
  12658. weight += cfg[key].weight;
  12659. weightCfg[key].maxWeight = weight;
  12660. }
  12661. allCfgData.allWeightNum = weight;
  12662. return allCfgData;
  12663. }
  12664. getRandomWeightData(cfg) {
  12665. let weightCfg = cfg.data;
  12666. let allWeightNum = cfg.allWeightNum;
  12667. let rand = Math.floor(Math.random() * allWeightNum);
  12668. for (const key in weightCfg) {
  12669. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12670. return weightCfg[key];
  12671. }
  12672. }
  12673. return weightCfg[1];
  12674. }
  12675. showGirlTalkPop(wordsIndex, node, msgNode) {
  12676. node.visible = true;
  12677. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12678. node.t0.play(Laya.Handler.create(this, () => {
  12679. node.visible = false;
  12680. }));
  12681. }
  12682. stopGirlPop(node) {
  12683. node.t0.stop();
  12684. node.visible = false;
  12685. }
  12686. createHead(loader, url, size = 107) {
  12687. if (Laya.Browser.name == "Browser") {
  12688. loader.url = url;
  12689. return;
  12690. }
  12691. else {
  12692. console.log('zh:url=', url);
  12693. loader.url = url;
  12694. }
  12695. }
  12696. addTestCoin(num) {
  12697. DataMgr.setCoin(num);
  12698. }
  12699. addTestDiamond(num) {
  12700. DataMgr.setDiamond(num);
  12701. }
  12702. addTestSkill() {
  12703. DataMgr.setBigSkill(0, 99);
  12704. DataMgr.setBigSkill(1, 99);
  12705. DataMgr.setBigSkill(2, 99);
  12706. }
  12707. playClassicEmotion(number, x, y) {
  12708. if (this.gameMode == GameMode.bigMove)
  12709. return;
  12710. let randIndex = this.randomNum(0, 2);
  12711. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12712. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12713. if (this.gameMgr.selfTurn) {
  12714. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12715. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12716. }
  12717. else {
  12718. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12719. }
  12720. else {
  12721. if (number == this.gameMgr.blackNum) {
  12722. if (this.gameMgr.selfBallArr.length == 0) {
  12723. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12724. }
  12725. else {
  12726. }
  12727. }
  12728. else {
  12729. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12730. }
  12731. }
  12732. }
  12733. }
  12734. else {
  12735. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12736. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12737. }
  12738. else {
  12739. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12740. }
  12741. else {
  12742. if (number == this.gameMgr.blackNum) {
  12743. if (this.gameMgr.aiBallArr.length == 0) {
  12744. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12745. }
  12746. else {
  12747. }
  12748. }
  12749. else {
  12750. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12751. }
  12752. }
  12753. }
  12754. }
  12755. }
  12756. playHappySound(number) {
  12757. if (this.gameMode != GameMode.classic)
  12758. return;
  12759. if (number == 8)
  12760. return;
  12761. let play = false;
  12762. if (this.gameMgr.selfTurn) {
  12763. if (this.gameMgr.ensureBallType) {
  12764. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12765. play = true;
  12766. }
  12767. }
  12768. else {
  12769. play = true;
  12770. }
  12771. }
  12772. else {
  12773. if (this.gameMgr.ensureBallType) {
  12774. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12775. play = true;
  12776. }
  12777. }
  12778. else {
  12779. play = true;
  12780. }
  12781. }
  12782. if (play)
  12783. xGame.soundMgr.playSound("applause");
  12784. }
  12785. destroyClassicEmotion() {
  12786. if (this.gameMode == GameMode.bigMove)
  12787. return;
  12788. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12789. parent.destroyChildren();
  12790. }
  12791. playAwardSpine(x, y) {
  12792. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12793. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12794. this.awardSpine.play(data, 0, false, parent);
  12795. }
  12796. destroyAwardSpine() {
  12797. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12798. parent.destroyChildren();
  12799. }
  12800. isBlock(bx, by, hx, hy, except = null) {
  12801. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12802. let balls = xGame.common.d2World.ballArr;
  12803. let outArr = [];
  12804. for (let index = 0; index < balls.length; index++) {
  12805. let obj = balls[index];
  12806. if (obj.number == 0)
  12807. continue;
  12808. if (obj == except)
  12809. continue;
  12810. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12811. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12812. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12813. if (num >= 1)
  12814. num = 1;
  12815. if (num < 0)
  12816. continue;
  12817. let gap = Math.sin(Math.acos(num)) * dis;
  12818. if (gap < this.ballSize) {
  12819. outArr.push({
  12820. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12821. disHon: Math.cos(Math.acos(num)) * dis,
  12822. disVer: Math.sin(Math.acos(num)) * dis,
  12823. src: balls[index],
  12824. dir: this.tempDir1
  12825. });
  12826. }
  12827. }
  12828. if (outArr.length > 0) {
  12829. outArr.sort((a, b) => { return a.dis - b.dis; });
  12830. return outArr[0];
  12831. }
  12832. }
  12833. AngleBetween(vector1, vector2) {
  12834. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12835. return rad * (180 / Math.PI);
  12836. }
  12837. getSecretaryScale() {
  12838. if (this.secretary.spineName == "mishu") {
  12839. return 1.28;
  12840. }
  12841. else {
  12842. return 1.024;
  12843. }
  12844. }
  12845. signAwardContainsRod(arr) {
  12846. let temp;
  12847. for (let index = 0; index < arr.length; index++) {
  12848. temp = arr[index].split('-')[0];
  12849. if (parseInt(temp) > 2) {
  12850. return true;
  12851. }
  12852. }
  12853. }
  12854. judgeSameDay() {
  12855. let lastTime = DataMgr.getSignTime();
  12856. let curTime = new Date().getTime();
  12857. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12858. return true;
  12859. }
  12860. return false;
  12861. }
  12862. getAward(arr, callback) {
  12863. let showTriple = arr[0].type <= 2;
  12864. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12865. let temp;
  12866. for (let index = 0; index < arr.length; index++) {
  12867. temp = arr[index];
  12868. switch (temp.type) {
  12869. case 1:
  12870. this.playObjFlyAnim(temp.num, temp.type);
  12871. break;
  12872. case 2:
  12873. this.playObjFlyAnim(temp.num, temp.type);
  12874. break;
  12875. case 3:
  12876. case 4:
  12877. case 5:
  12878. case 6:
  12879. DataMgr.setBallRod(temp.type - 2, 1);
  12880. DataMgr.setCurBallRod(temp.type - 2);
  12881. break;
  12882. default:
  12883. break;
  12884. }
  12885. }
  12886. callback && callback(watchVideo);
  12887. });
  12888. }
  12889. getMoneyNode() {
  12890. let moneyNode;
  12891. let sign = xGame.uiMgr.getUI(UISign);
  12892. let draw = xGame.uiMgr.getUI(UIDraw);
  12893. let end = xGame.uiMgr.getUI(UIGameEnd);
  12894. let skill = xGame.uiMgr.getUI(UISkill);
  12895. if (sign && !sign.isHide)
  12896. moneyNode = sign.ui.moneyNode;
  12897. if (draw && !draw.isHide)
  12898. moneyNode = draw.ui.moneyNode;
  12899. if (end && !end.isHide)
  12900. moneyNode = end.ui.moneyNode;
  12901. if (skill && !skill.isHide)
  12902. moneyNode = skill.ui.moneyNode;
  12903. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12904. let main = xGame.uiMgr.getUI(UIMain);
  12905. if (condition1 && main && !main.isHide) {
  12906. moneyNode = main.ui.moneyNode;
  12907. }
  12908. return moneyNode;
  12909. }
  12910. playObjFlyAnim(num, type, callback = null) {
  12911. this.stPos.x = Laya.stage.width / 2;
  12912. this.stPos.y = Laya.stage.height / 2;
  12913. let moneyNode = this.getMoneyNode();
  12914. switch (type) {
  12915. case Prop.diamond:
  12916. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12917. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12918. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12919. this.edPos.x /= 2;
  12920. this.edPos.y /= 2;
  12921. break;
  12922. case Prop.coin:
  12923. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12924. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12925. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12926. this.edPos.x /= 2;
  12927. this.edPos.y /= 2;
  12928. break;
  12929. default:
  12930. break;
  12931. }
  12932. xGame.soundMgr.playSound("coinbag");
  12933. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12934. switch (type) {
  12935. case Prop.diamond:
  12936. DataMgr.setDiamond(num);
  12937. break;
  12938. case Prop.coin:
  12939. DataMgr.setCoin(num);
  12940. break;
  12941. default:
  12942. break;
  12943. }
  12944. callback && callback();
  12945. });
  12946. }
  12947. autoPopUIView() {
  12948. let arr = [];
  12949. let sign = this.judgeSameDay() ? false : true;
  12950. if (sign)
  12951. arr.push("sign");
  12952. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12953. if (draw)
  12954. arr.push("draw");
  12955. if (arr.length <= 0)
  12956. return;
  12957. let str = this.getRandArrEle(arr);
  12958. switch (str) {
  12959. case "sign":
  12960. xGame.uiMgr.Show(UISign);
  12961. break;
  12962. case "draw":
  12963. xGame.uiMgr.Show(UIDraw);
  12964. break;
  12965. default:
  12966. break;
  12967. }
  12968. }
  12969. getMSTime(time) {
  12970. let min = Math.floor(time / 60);
  12971. let sec = Math.floor((time - min * 60));
  12972. if (sec < 10)
  12973. sec = "0" + sec;
  12974. if (min < 10)
  12975. min = "0" + min;
  12976. return `${min}:${sec}`;
  12977. }
  12978. testPower() {
  12979. DataMgr.setPower(0, false);
  12980. }
  12981. getAllStarNum() {
  12982. let data = DataMgr.getPlaceBallLevelList();
  12983. let out = 0;
  12984. for (let index = 0; index < data.length; index++) {
  12985. out += data[index].star;
  12986. }
  12987. return out;
  12988. }
  12989. recoverCameraView() {
  12990. Laya.timer.once(900, this, () => {
  12991. xGame.common.showOneCamera("mainCamera");
  12992. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12993. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12994. xGame.common.gameUI.ui.border.alpha = 0;
  12995. if (Laya.physicsTimer.scale < 1) {
  12996. Laya.physicsTimer.scale = 1;
  12997. }
  12998. }
  12999. });
  13000. }
  13001. getClassicLevel() {
  13002. let successTimes = DataMgr.getClassicTimes();
  13003. let needKey = "";
  13004. let lastKey = "";
  13005. let cfg = cfgTable.classictimesData;
  13006. let data;
  13007. for (const key in cfg) {
  13008. data = cfg[key];
  13009. if (successTimes <= data.times) {
  13010. needKey = key;
  13011. }
  13012. lastKey = key;
  13013. }
  13014. if (needKey == "")
  13015. needKey = lastKey;
  13016. return cfg[needKey];
  13017. }
  13018. }
  13019. Common._instance = null;
  13020. class ui_Component92 extends fgui.GComponent {
  13021. static createInstance() {
  13022. return (fgui.UIPackage.createObject("game", "Component92"));
  13023. }
  13024. onConstruct() {
  13025. this.n0 = (this.getChild("n0"));
  13026. }
  13027. }
  13028. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13029. class ui_Component129 extends fgui.GProgressBar {
  13030. static createInstance() {
  13031. return (fgui.UIPackage.createObject("game", "Component129"));
  13032. }
  13033. onConstruct() {
  13034. this.bar_v = (this.getChild("bar_v"));
  13035. this.n84 = (this.getChild("n84"));
  13036. }
  13037. }
  13038. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13039. class ui_Component130 extends fgui.GComponent {
  13040. static createInstance() {
  13041. return (fgui.UIPackage.createObject("game", "Component130"));
  13042. }
  13043. onConstruct() {
  13044. this.ani = (this.getChild("ani"));
  13045. this.t0 = this.getTransition("t0");
  13046. }
  13047. }
  13048. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13049. class ui_powerEft extends fgui.GComponent {
  13050. static createInstance() {
  13051. return (fgui.UIPackage.createObject("game", "powerEft"));
  13052. }
  13053. onConstruct() {
  13054. this.ani = (this.getChild("ani"));
  13055. this.n88 = (this.getChild("n88"));
  13056. this.n89 = (this.getChild("n89"));
  13057. }
  13058. }
  13059. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13060. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13061. static createInstance() {
  13062. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13063. }
  13064. onConstruct() {
  13065. this.c1 = this.getController("c1");
  13066. this.n2 = (this.getChild("n2"));
  13067. this.n22 = (this.getChild("n22"));
  13068. this.n23 = (this.getChild("n23"));
  13069. this.n15 = (this.getChild("n15"));
  13070. this.challenge = (this.getChild("challenge"));
  13071. this.n17 = (this.getChild("n17"));
  13072. this.n3 = (this.getChild("n3"));
  13073. this.starNode = (this.getChild("starNode"));
  13074. this.levelTxt = (this.getChild("levelTxt"));
  13075. this.n14 = (this.getChild("n14"));
  13076. this.n19 = (this.getChild("n19"));
  13077. this.n20 = (this.getChild("n20"));
  13078. this.n21 = (this.getChild("n21"));
  13079. this.special = (this.getChild("special"));
  13080. }
  13081. }
  13082. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13083. class ui_Component79 extends fgui.GComponent {
  13084. static createInstance() {
  13085. return (fgui.UIPackage.createObject("game", "Component79"));
  13086. }
  13087. onConstruct() {
  13088. this.c1 = this.getController("c1");
  13089. this.n7 = (this.getChild("n7"));
  13090. this.n8 = (this.getChild("n8"));
  13091. this.n9 = (this.getChild("n9"));
  13092. this.n10 = (this.getChild("n10"));
  13093. this.n11 = (this.getChild("n11"));
  13094. this.n12 = (this.getChild("n12"));
  13095. }
  13096. }
  13097. ui_Component79.URL = "ui://isxx5ak7avag477";
  13098. class ui_Component80 extends fgui.GComponent {
  13099. static createInstance() {
  13100. return (fgui.UIPackage.createObject("game", "Component80"));
  13101. }
  13102. onConstruct() {
  13103. this.n0 = (this.getChild("n0"));
  13104. this.n1 = (this.getChild("n1"));
  13105. this.myList = (this.getChild("myList"));
  13106. this.t0 = this.getTransition("t0");
  13107. }
  13108. }
  13109. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13110. class ui_SignNormal extends fgui.GComponent {
  13111. static createInstance() {
  13112. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13113. }
  13114. onConstruct() {
  13115. this.c1 = this.getController("c1");
  13116. this.n7 = (this.getChild("n7"));
  13117. this.n15 = (this.getChild("n15"));
  13118. this.titleTxt = (this.getChild("titleTxt"));
  13119. this.n8 = (this.getChild("n8"));
  13120. this.myIcon = (this.getChild("myIcon"));
  13121. this.numTxt = (this.getChild("numTxt"));
  13122. this.n12 = (this.getChild("n12"));
  13123. this.n13 = (this.getChild("n13"));
  13124. this.n17 = (this.getChild("n17"));
  13125. this.n14 = (this.getChild("n14"));
  13126. }
  13127. }
  13128. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13129. class ui_Button_reg extends fgui.GButton {
  13130. static createInstance() {
  13131. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13132. }
  13133. onConstruct() {
  13134. this.button = this.getController("button");
  13135. this.n6 = (this.getChild("n6"));
  13136. }
  13137. }
  13138. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13139. class ui_screenNode extends fgui.GComponent {
  13140. static createInstance() {
  13141. return (fgui.UIPackage.createObject("game", "screenNode"));
  13142. }
  13143. onConstruct() {
  13144. this.n9 = (this.getChild("n9"));
  13145. this.screenImg = (this.getChild("screenImg"));
  13146. }
  13147. }
  13148. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13149. class ui_GetAwrad_com1 extends fgui.GComponent {
  13150. static createInstance() {
  13151. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13152. }
  13153. onConstruct() {
  13154. this.n38 = (this.getChild("n38"));
  13155. this.n39 = (this.getChild("n39"));
  13156. this.n40 = (this.getChild("n40"));
  13157. this.t0 = this.getTransition("t0");
  13158. this.t1 = this.getTransition("t1");
  13159. }
  13160. }
  13161. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13162. class ui_GetAwrad_com2 extends fgui.GComponent {
  13163. static createInstance() {
  13164. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13165. }
  13166. onConstruct() {
  13167. this.n39 = (this.getChild("n39"));
  13168. this.n40 = (this.getChild("n40"));
  13169. this.t0 = this.getTransition("t0");
  13170. }
  13171. }
  13172. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13173. class ui_Component128 extends fgui.GComponent {
  13174. static createInstance() {
  13175. return (fgui.UIPackage.createObject("game", "Component128"));
  13176. }
  13177. onConstruct() {
  13178. this.n38 = (this.getChild("n38"));
  13179. this.n40 = (this.getChild("n40"));
  13180. }
  13181. }
  13182. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13183. class ui_Component100_1 extends fgui.GComponent {
  13184. static createInstance() {
  13185. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13186. }
  13187. onConstruct() {
  13188. this.myNode = (this.getChild("myNode"));
  13189. this.t0 = this.getTransition("t0");
  13190. }
  13191. }
  13192. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13193. class ui_Component142 extends fgui.GComponent {
  13194. static createInstance() {
  13195. return (fgui.UIPackage.createObject("game", "Component142"));
  13196. }
  13197. onConstruct() {
  13198. this.n41 = (this.getChild("n41"));
  13199. this.n42 = (this.getChild("n42"));
  13200. }
  13201. }
  13202. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13203. class ui_main_guang extends fgui.GComponent {
  13204. static createInstance() {
  13205. return (fgui.UIPackage.createObject("game", "main_guang"));
  13206. }
  13207. onConstruct() {
  13208. this.n1 = (this.getChild("n1"));
  13209. this.n2 = (this.getChild("n2"));
  13210. this.n3 = (this.getChild("n3"));
  13211. this.n4 = (this.getChild("n4"));
  13212. this.n5 = (this.getChild("n5"));
  13213. this.n6 = (this.getChild("n6"));
  13214. this.n8 = (this.getChild("n8"));
  13215. this.t0 = this.getTransition("t0");
  13216. }
  13217. }
  13218. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13219. class ui_try_com1 extends fgui.GComponent {
  13220. static createInstance() {
  13221. return (fgui.UIPackage.createObject("game", "try_com1"));
  13222. }
  13223. onConstruct() {
  13224. this.c1 = this.getController("c1");
  13225. this.n0 = (this.getChild("n0"));
  13226. this.n2 = (this.getChild("n2"));
  13227. this.cancelBtn = (this.getChild("cancelBtn"));
  13228. this.videoBtn = (this.getChild("videoBtn"));
  13229. this.n9 = (this.getChild("n9"));
  13230. this.n24 = (this.getChild("n24"));
  13231. this.titleTxt = (this.getChild("titleTxt"));
  13232. this.n32 = (this.getChild("n32"));
  13233. this.n29 = (this.getChild("n29"));
  13234. this.n36 = (this.getChild("n36"));
  13235. this.txtTime = (this.getChild("txtTime"));
  13236. this.t0 = this.getTransition("t0");
  13237. }
  13238. }
  13239. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13240. class ui_try_com2 extends fgui.GComponent {
  13241. static createInstance() {
  13242. return (fgui.UIPackage.createObject("game", "try_com2"));
  13243. }
  13244. onConstruct() {
  13245. this.skillicon = (this.getChild("skillicon"));
  13246. this.n35 = (this.getChild("n35"));
  13247. this.n31 = (this.getChild("n31"));
  13248. this.n32 = (this.getChild("n32"));
  13249. this.n33 = (this.getChild("n33"));
  13250. this.n34 = (this.getChild("n34"));
  13251. }
  13252. }
  13253. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13254. class ui_try_com3 extends fgui.GComponent {
  13255. static createInstance() {
  13256. return (fgui.UIPackage.createObject("game", "try_com3"));
  13257. }
  13258. onConstruct() {
  13259. this.n33 = (this.getChild("n33"));
  13260. this.n34 = (this.getChild("n34"));
  13261. this.n35 = (this.getChild("n35"));
  13262. this.t0 = this.getTransition("t0");
  13263. }
  13264. }
  13265. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13266. class ui_huihe1 extends fgui.GComponent {
  13267. static createInstance() {
  13268. return (fgui.UIPackage.createObject("game", "huihe1"));
  13269. }
  13270. onConstruct() {
  13271. this.n0 = (this.getChild("n0"));
  13272. this.n1 = (this.getChild("n1"));
  13273. this.t0 = this.getTransition("t0");
  13274. }
  13275. }
  13276. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13277. class ui_huihe2 extends fgui.GComponent {
  13278. static createInstance() {
  13279. return (fgui.UIPackage.createObject("game", "huihe2"));
  13280. }
  13281. onConstruct() {
  13282. this.n0 = (this.getChild("n0"));
  13283. this.n1 = (this.getChild("n1"));
  13284. this.t0 = this.getTransition("t0");
  13285. }
  13286. }
  13287. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13288. class ui_Component143 extends fgui.GComponent {
  13289. static createInstance() {
  13290. return (fgui.UIPackage.createObject("game", "Component143"));
  13291. }
  13292. onConstruct() {
  13293. this.n3 = (this.getChild("n3"));
  13294. this.n4 = (this.getChild("n4"));
  13295. this.n5 = (this.getChild("n5"));
  13296. this.n6 = (this.getChild("n6"));
  13297. this.n7 = (this.getChild("n7"));
  13298. this.n8 = (this.getChild("n8"));
  13299. this.n9 = (this.getChild("n9"));
  13300. this.n10 = (this.getChild("n10"));
  13301. this.t0 = this.getTransition("t0");
  13302. }
  13303. }
  13304. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13305. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13306. static createInstance() {
  13307. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13308. }
  13309. onConstruct() {
  13310. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13311. }
  13312. }
  13313. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13314. class ui_dh_jingbi2 extends fgui.GComponent {
  13315. static createInstance() {
  13316. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13317. }
  13318. onConstruct() {
  13319. this.n0 = (this.getChild("n0"));
  13320. this.n1 = (this.getChild("n1"));
  13321. this.n2 = (this.getChild("n2"));
  13322. this.n3 = (this.getChild("n3"));
  13323. this.n4 = (this.getChild("n4"));
  13324. this.n5 = (this.getChild("n5"));
  13325. this.n6 = (this.getChild("n6"));
  13326. this.n8 = (this.getChild("n8"));
  13327. this.n10 = (this.getChild("n10"));
  13328. this.t0 = this.getTransition("t0");
  13329. }
  13330. }
  13331. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13332. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13333. static createInstance() {
  13334. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13335. }
  13336. onConstruct() {
  13337. this.n1 = (this.getChild("n1"));
  13338. this.n4 = (this.getChild("n4"));
  13339. this.t0 = this.getTransition("t0");
  13340. }
  13341. }
  13342. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13343. class ui_dh_jingbi3 extends fgui.GComponent {
  13344. static createInstance() {
  13345. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13346. }
  13347. onConstruct() {
  13348. this.n0 = (this.getChild("n0"));
  13349. this.n1 = (this.getChild("n1"));
  13350. this.n2 = (this.getChild("n2"));
  13351. this.n3 = (this.getChild("n3"));
  13352. this.n4 = (this.getChild("n4"));
  13353. this.n5 = (this.getChild("n5"));
  13354. this.n6 = (this.getChild("n6"));
  13355. this.n8 = (this.getChild("n8"));
  13356. this.n10 = (this.getChild("n10"));
  13357. this.t0 = this.getTransition("t0");
  13358. }
  13359. }
  13360. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13361. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13362. static createInstance() {
  13363. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13364. }
  13365. onConstruct() {
  13366. this.n3 = (this.getChild("n3"));
  13367. this.n1 = (this.getChild("n1"));
  13368. this.t0 = this.getTransition("t0");
  13369. }
  13370. }
  13371. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13372. class ui_hb_jinbi1 extends fgui.GButton {
  13373. static createInstance() {
  13374. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13375. }
  13376. onConstruct() {
  13377. this.n20 = (this.getChild("n20"));
  13378. this.n25 = (this.getChild("n25"));
  13379. this.coinTxt = (this.getChild("coinTxt"));
  13380. this.n28 = (this.getChild("n28"));
  13381. this.n32 = (this.getChild("n32"));
  13382. this.n38 = (this.getChild("n38"));
  13383. this.n45 = (this.getChild("n45"));
  13384. this.getTips = (this.getChild("getTips"));
  13385. this.n39 = (this.getChild("n39"));
  13386. this.diamondTxt = (this.getChild("diamondTxt"));
  13387. this.n41 = (this.getChild("n41"));
  13388. this.n42 = (this.getChild("n42"));
  13389. this.n46 = (this.getChild("n46"));
  13390. this.n47 = (this.getChild("n47"));
  13391. this.n48 = (this.getChild("n48"));
  13392. this.t0 = this.getTransition("t0");
  13393. }
  13394. }
  13395. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13396. class ui_hb_jinbi2 extends fgui.GButton {
  13397. static createInstance() {
  13398. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13399. }
  13400. onConstruct() {
  13401. this.n20 = (this.getChild("n20"));
  13402. this.n25 = (this.getChild("n25"));
  13403. this.coinTxt = (this.getChild("coinTxt"));
  13404. this.n28 = (this.getChild("n28"));
  13405. this.n32 = (this.getChild("n32"));
  13406. this.n38 = (this.getChild("n38"));
  13407. this.n39 = (this.getChild("n39"));
  13408. this.diamondTxt = (this.getChild("diamondTxt"));
  13409. this.n41 = (this.getChild("n41"));
  13410. this.n42 = (this.getChild("n42"));
  13411. this.n43 = (this.getChild("n43"));
  13412. this.n44 = (this.getChild("n44"));
  13413. this.n45 = (this.getChild("n45"));
  13414. this.t0 = this.getTransition("t0");
  13415. }
  13416. }
  13417. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13418. class ui_hb_jinbi3 extends fgui.GButton {
  13419. static createInstance() {
  13420. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13421. }
  13422. onConstruct() {
  13423. this.n20 = (this.getChild("n20"));
  13424. this.n25 = (this.getChild("n25"));
  13425. this.coinTxt = (this.getChild("coinTxt"));
  13426. this.n28 = (this.getChild("n28"));
  13427. this.n32 = (this.getChild("n32"));
  13428. this.n38 = (this.getChild("n38"));
  13429. this.n39 = (this.getChild("n39"));
  13430. this.diamondTxt = (this.getChild("diamondTxt"));
  13431. this.n41 = (this.getChild("n41"));
  13432. this.n42 = (this.getChild("n42"));
  13433. this.n43 = (this.getChild("n43"));
  13434. this.n44 = (this.getChild("n44"));
  13435. this.n45 = (this.getChild("n45"));
  13436. this.t0 = this.getTransition("t0");
  13437. }
  13438. }
  13439. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13440. class ui_Component104 extends fgui.GComponent {
  13441. static createInstance() {
  13442. return (fgui.UIPackage.createObject("game", "Component104"));
  13443. }
  13444. onConstruct() {
  13445. this.c1 = this.getController("c1");
  13446. this.n12 = (this.getChild("n12"));
  13447. this.coinBtn = (this.getChild("coinBtn"));
  13448. this.diamondBtn = (this.getChild("diamondBtn"));
  13449. this.node3 = (this.getChild("node3"));
  13450. this.node4 = (this.getChild("node4"));
  13451. this.node5 = (this.getChild("node5"));
  13452. this.node1 = (this.getChild("node1"));
  13453. this.node2 = (this.getChild("node2"));
  13454. this.node6 = (this.getChild("node6"));
  13455. this.t0 = this.getTransition("t0");
  13456. }
  13457. }
  13458. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13459. class ui_Component105 extends fgui.GButton {
  13460. static createInstance() {
  13461. return (fgui.UIPackage.createObject("game", "Component105"));
  13462. }
  13463. onConstruct() {
  13464. this.c1 = this.getController("c1");
  13465. this.n49 = (this.getChild("n49"));
  13466. this.n18 = (this.getChild("n18"));
  13467. this.n46 = (this.getChild("n46"));
  13468. this.n48 = (this.getChild("n48"));
  13469. }
  13470. }
  13471. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13472. class ui_Component106 extends fgui.GButton {
  13473. static createInstance() {
  13474. return (fgui.UIPackage.createObject("game", "Component106"));
  13475. }
  13476. onConstruct() {
  13477. this.c1 = this.getController("c1");
  13478. this.n49 = (this.getChild("n49"));
  13479. this.n18 = (this.getChild("n18"));
  13480. this.n46 = (this.getChild("n46"));
  13481. this.n48 = (this.getChild("n48"));
  13482. }
  13483. }
  13484. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13485. class ui_hb_zs1 extends fgui.GButton {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13488. }
  13489. onConstruct() {
  13490. this.c1 = this.getController("c1");
  13491. this.n20 = (this.getChild("n20"));
  13492. this.n21 = (this.getChild("n21"));
  13493. this.n26 = (this.getChild("n26"));
  13494. this.n27 = (this.getChild("n27"));
  13495. this.shareTxt = (this.getChild("shareTxt"));
  13496. this.n32 = (this.getChild("n32"));
  13497. this.n38 = (this.getChild("n38"));
  13498. this.n39 = (this.getChild("n39"));
  13499. this.n44 = (this.getChild("n44"));
  13500. this.diamondTxt = (this.getChild("diamondTxt"));
  13501. this.n41 = (this.getChild("n41"));
  13502. this.n45 = (this.getChild("n45"));
  13503. this.n47 = (this.getChild("n47"));
  13504. this.n48 = (this.getChild("n48"));
  13505. this.randTxt = (this.getChild("randTxt"));
  13506. this.n50 = (this.getChild("n50"));
  13507. this.t0 = this.getTransition("t0");
  13508. }
  13509. }
  13510. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13511. class ui_dh_zs1 extends fgui.GComponent {
  13512. static createInstance() {
  13513. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13514. }
  13515. onConstruct() {
  13516. this.n10 = (this.getChild("n10"));
  13517. this.n9 = (this.getChild("n9"));
  13518. this.n1 = (this.getChild("n1"));
  13519. this.n2 = (this.getChild("n2"));
  13520. this.n3 = (this.getChild("n3"));
  13521. this.n4 = (this.getChild("n4"));
  13522. this.n5 = (this.getChild("n5"));
  13523. this.n6 = (this.getChild("n6"));
  13524. this.n8 = (this.getChild("n8"));
  13525. this.n11 = (this.getChild("n11"));
  13526. this.t0 = this.getTransition("t0");
  13527. }
  13528. }
  13529. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13530. class ui_dh_zs1_1 extends fgui.GComponent {
  13531. static createInstance() {
  13532. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13533. }
  13534. onConstruct() {
  13535. this.n3 = (this.getChild("n3"));
  13536. this.n1 = (this.getChild("n1"));
  13537. this.t0 = this.getTransition("t0");
  13538. }
  13539. }
  13540. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13541. class ui_hb_zs2 extends fgui.GButton {
  13542. static createInstance() {
  13543. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13544. }
  13545. onConstruct() {
  13546. this.n20 = (this.getChild("n20"));
  13547. this.n21 = (this.getChild("n21"));
  13548. this.n26 = (this.getChild("n26"));
  13549. this.n27 = (this.getChild("n27"));
  13550. this.n32 = (this.getChild("n32"));
  13551. this.n38 = (this.getChild("n38"));
  13552. this.n39 = (this.getChild("n39"));
  13553. this.n44 = (this.getChild("n44"));
  13554. this.diamondTxt = (this.getChild("diamondTxt"));
  13555. this.n41 = (this.getChild("n41"));
  13556. this.n45 = (this.getChild("n45"));
  13557. this.t0 = this.getTransition("t0");
  13558. }
  13559. }
  13560. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13561. class ui_hb_zs3 extends fgui.GButton {
  13562. static createInstance() {
  13563. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13564. }
  13565. onConstruct() {
  13566. this.n20 = (this.getChild("n20"));
  13567. this.n21 = (this.getChild("n21"));
  13568. this.n26 = (this.getChild("n26"));
  13569. this.n27 = (this.getChild("n27"));
  13570. this.n32 = (this.getChild("n32"));
  13571. this.n38 = (this.getChild("n38"));
  13572. this.n47 = (this.getChild("n47"));
  13573. this.t0 = this.getTransition("t0");
  13574. }
  13575. }
  13576. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13577. class ui_dh_zs2 extends fgui.GComponent {
  13578. static createInstance() {
  13579. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13580. }
  13581. onConstruct() {
  13582. this.n10 = (this.getChild("n10"));
  13583. this.n9 = (this.getChild("n9"));
  13584. this.n1 = (this.getChild("n1"));
  13585. this.n2 = (this.getChild("n2"));
  13586. this.n3 = (this.getChild("n3"));
  13587. this.n4 = (this.getChild("n4"));
  13588. this.n5 = (this.getChild("n5"));
  13589. this.n6 = (this.getChild("n6"));
  13590. this.n8 = (this.getChild("n8"));
  13591. this.n11 = (this.getChild("n11"));
  13592. this.t0 = this.getTransition("t0");
  13593. }
  13594. }
  13595. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13596. class ui_dh_zs2_1 extends fgui.GComponent {
  13597. static createInstance() {
  13598. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13599. }
  13600. onConstruct() {
  13601. this.n3 = (this.getChild("n3"));
  13602. this.n1 = (this.getChild("n1"));
  13603. this.t0 = this.getTransition("t0");
  13604. }
  13605. }
  13606. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13607. class ui_dh_zs3 extends fgui.GComponent {
  13608. static createInstance() {
  13609. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13610. }
  13611. onConstruct() {
  13612. this.n10 = (this.getChild("n10"));
  13613. this.n9 = (this.getChild("n9"));
  13614. this.n1 = (this.getChild("n1"));
  13615. this.n2 = (this.getChild("n2"));
  13616. this.n3 = (this.getChild("n3"));
  13617. this.n4 = (this.getChild("n4"));
  13618. this.n5 = (this.getChild("n5"));
  13619. this.n6 = (this.getChild("n6"));
  13620. this.n8 = (this.getChild("n8"));
  13621. this.n11 = (this.getChild("n11"));
  13622. this.t0 = this.getTransition("t0");
  13623. }
  13624. }
  13625. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13626. class ui_dh_zs3_1 extends fgui.GComponent {
  13627. static createInstance() {
  13628. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13629. }
  13630. onConstruct() {
  13631. this.n3 = (this.getChild("n3"));
  13632. this.n1 = (this.getChild("n1"));
  13633. this.t0 = this.getTransition("t0");
  13634. }
  13635. }
  13636. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13637. class ui_Component107 extends fgui.GComponent {
  13638. static createInstance() {
  13639. return (fgui.UIPackage.createObject("game", "Component107"));
  13640. }
  13641. onConstruct() {
  13642. this.n18 = (this.getChild("n18"));
  13643. this.n19 = (this.getChild("n19"));
  13644. this.n20 = (this.getChild("n20"));
  13645. this.n21 = (this.getChild("n21"));
  13646. this.n22 = (this.getChild("n22"));
  13647. this.levelTxt = (this.getChild("levelTxt"));
  13648. this.t0 = this.getTransition("t0");
  13649. }
  13650. }
  13651. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13652. class ui_box_com1 extends fgui.GComponent {
  13653. static createInstance() {
  13654. return (fgui.UIPackage.createObject("game", "box_com1"));
  13655. }
  13656. onConstruct() {
  13657. this.n14 = (this.getChild("n14"));
  13658. this.n6 = (this.getChild("n6"));
  13659. this.t0 = this.getTransition("t0");
  13660. }
  13661. }
  13662. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13663. class ui_box_com2 extends fgui.GProgressBar {
  13664. static createInstance() {
  13665. return (fgui.UIPackage.createObject("game", "box_com2"));
  13666. }
  13667. onConstruct() {
  13668. this.bg0 = (this.getChild("bg0"));
  13669. this.bg = (this.getChild("bg"));
  13670. this.bar = (this.getChild("bar"));
  13671. this.n7 = (this.getChild("n7"));
  13672. this.n8 = (this.getChild("n8"));
  13673. this.n10 = (this.getChild("n10"));
  13674. this.n11 = (this.getChild("n11"));
  13675. this.n12 = (this.getChild("n12"));
  13676. }
  13677. }
  13678. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13679. class ui_box_com4 extends fgui.GComponent {
  13680. static createInstance() {
  13681. return (fgui.UIPackage.createObject("game", "box_com4"));
  13682. }
  13683. onConstruct() {
  13684. this.n8 = (this.getChild("n8"));
  13685. this.t0 = this.getTransition("t0");
  13686. }
  13687. }
  13688. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13689. class ui_box_com3 extends fgui.GComponent {
  13690. static createInstance() {
  13691. return (fgui.UIPackage.createObject("game", "box_com3"));
  13692. }
  13693. onConstruct() {
  13694. this.n2 = (this.getChild("n2"));
  13695. this.n3 = (this.getChild("n3"));
  13696. this.n4 = (this.getChild("n4"));
  13697. this.n5 = (this.getChild("n5"));
  13698. this.t0 = this.getTransition("t0");
  13699. this.t1 = this.getTransition("t1");
  13700. }
  13701. }
  13702. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13703. class ui_Component97 extends fgui.GComponent {
  13704. static createInstance() {
  13705. return (fgui.UIPackage.createObject("game", "Component97"));
  13706. }
  13707. onConstruct() {
  13708. this.c1 = this.getController("c1");
  13709. this.n46 = (this.getChild("n46"));
  13710. this.diamondNode = (this.getChild("diamondNode"));
  13711. this.coinNode = (this.getChild("coinNode"));
  13712. this.t0 = this.getTransition("t0");
  13713. }
  13714. }
  13715. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13716. class ui_Component98 extends fgui.GButton {
  13717. static createInstance() {
  13718. return (fgui.UIPackage.createObject("game", "Component98"));
  13719. }
  13720. onConstruct() {
  13721. this.n8 = (this.getChild("n8"));
  13722. this.n40 = (this.getChild("n40"));
  13723. }
  13724. }
  13725. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13726. class ui_Component28_11 extends fgui.GButton {
  13727. static createInstance() {
  13728. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13729. }
  13730. onConstruct() {
  13731. this.c1 = this.getController("c1");
  13732. this.n12 = (this.getChild("n12"));
  13733. this.n17 = (this.getChild("n17"));
  13734. this.n13 = (this.getChild("n13"));
  13735. this.diamondTxt = (this.getChild("diamondTxt"));
  13736. this.n15 = (this.getChild("n15"));
  13737. this.n16 = (this.getChild("n16"));
  13738. }
  13739. }
  13740. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13741. class ui_Component58_11 extends fgui.GComponent {
  13742. static createInstance() {
  13743. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13744. }
  13745. onConstruct() {
  13746. this.c1 = this.getController("c1");
  13747. this.n23 = (this.getChild("n23"));
  13748. this.n41 = (this.getChild("n41"));
  13749. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13750. this.n_daoju = (this.getChild("n_daoju"));
  13751. this.myList = (this.getChild("myList"));
  13752. this.djList = (this.getChild("djList"));
  13753. this.t0 = this.getTransition("t0");
  13754. }
  13755. }
  13756. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13757. class ui_Component100 extends fgui.GComponent {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "Component100"));
  13760. }
  13761. onConstruct() {
  13762. this.c1 = this.getController("c1");
  13763. this.n75 = (this.getChild("n75"));
  13764. this.n76 = (this.getChild("n76"));
  13765. this.n80 = (this.getChild("n80"));
  13766. this.txt = (this.getChild("txt"));
  13767. this.spineRoot = (this.getChild("spineRoot"));
  13768. }
  13769. }
  13770. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13771. class ui_Component101 extends fgui.GComponent {
  13772. static createInstance() {
  13773. return (fgui.UIPackage.createObject("game", "Component101"));
  13774. }
  13775. onConstruct() {
  13776. this.c1 = this.getController("c1");
  13777. this.n36 = (this.getChild("n36"));
  13778. this.n35 = (this.getChild("n35"));
  13779. this.n33 = (this.getChild("n33"));
  13780. this.n34 = (this.getChild("n34"));
  13781. }
  13782. }
  13783. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13784. class ui_Component53 extends fgui.GComponent {
  13785. static createInstance() {
  13786. return (fgui.UIPackage.createObject("game", "Component53"));
  13787. }
  13788. onConstruct() {
  13789. this.n0 = (this.getChild("n0"));
  13790. this.n1 = (this.getChild("n1"));
  13791. this.n2 = (this.getChild("n2"));
  13792. this.n3 = (this.getChild("n3"));
  13793. this.n4 = (this.getChild("n4"));
  13794. this.n5 = (this.getChild("n5"));
  13795. this.n6 = (this.getChild("n6"));
  13796. this.n7 = (this.getChild("n7"));
  13797. this.n8 = (this.getChild("n8"));
  13798. this.n9 = (this.getChild("n9"));
  13799. this.n10 = (this.getChild("n10"));
  13800. this.n11 = (this.getChild("n11"));
  13801. this.n12 = (this.getChild("n12"));
  13802. this.n13 = (this.getChild("n13"));
  13803. this.n14 = (this.getChild("n14"));
  13804. this.n15 = (this.getChild("n15"));
  13805. this.n16 = (this.getChild("n16"));
  13806. this.n19 = (this.getChild("n19"));
  13807. this.n20 = (this.getChild("n20"));
  13808. this.n21 = (this.getChild("n21"));
  13809. this.n22 = (this.getChild("n22"));
  13810. this.n23 = (this.getChild("n23"));
  13811. this.n24 = (this.getChild("n24"));
  13812. this.n25 = (this.getChild("n25"));
  13813. this.n26 = (this.getChild("n26"));
  13814. this.n27 = (this.getChild("n27"));
  13815. this.n28 = (this.getChild("n28"));
  13816. this.n29 = (this.getChild("n29"));
  13817. this.n30 = (this.getChild("n30"));
  13818. this.n31 = (this.getChild("n31"));
  13819. this.n32 = (this.getChild("n32"));
  13820. this.n33 = (this.getChild("n33"));
  13821. this.n34 = (this.getChild("n34"));
  13822. this.n35 = (this.getChild("n35"));
  13823. this.t0 = this.getTransition("t0");
  13824. }
  13825. }
  13826. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13827. class ui_Component58 extends fgui.GComponent {
  13828. static createInstance() {
  13829. return (fgui.UIPackage.createObject("game", "Component58"));
  13830. }
  13831. onConstruct() {
  13832. this.n23 = (this.getChild("n23"));
  13833. this.n41 = (this.getChild("n41"));
  13834. this.n8 = (this.getChild("n8"));
  13835. this.skillList = (this.getChild("skillList"));
  13836. this.t0 = this.getTransition("t0");
  13837. }
  13838. }
  13839. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13840. class ui_Component59 extends fgui.GComponent {
  13841. static createInstance() {
  13842. return (fgui.UIPackage.createObject("game", "Component59"));
  13843. }
  13844. onConstruct() {
  13845. this.n3 = (this.getChild("n3"));
  13846. this.msgTxt = (this.getChild("msgTxt"));
  13847. this.t0 = this.getTransition("t0");
  13848. }
  13849. }
  13850. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13851. class ui_RulerNode extends fgui.GComponent {
  13852. static createInstance() {
  13853. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13854. }
  13855. onConstruct() {
  13856. this.n6 = (this.getChild("n6"));
  13857. this.n4 = (this.getChild("n4"));
  13858. this.img1 = (this.getChild("img1"));
  13859. this.img2 = (this.getChild("img2"));
  13860. }
  13861. }
  13862. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13863. class ui_Component108 extends fgui.GComponent {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "Component108"));
  13866. }
  13867. onConstruct() {
  13868. this.n19 = (this.getChild("n19"));
  13869. this.t0 = this.getTransition("t0");
  13870. }
  13871. }
  13872. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13873. class ui_Component63 extends fgui.GComponent {
  13874. static createInstance() {
  13875. return (fgui.UIPackage.createObject("game", "Component63"));
  13876. }
  13877. onConstruct() {
  13878. this.n66 = (this.getChild("n66"));
  13879. this.n56 = (this.getChild("n56"));
  13880. this.n63 = (this.getChild("n63"));
  13881. this.n65 = (this.getChild("n65"));
  13882. this.t0 = this.getTransition("t0");
  13883. }
  13884. }
  13885. ui_Component63.URL = "ui://isxx5ak7h657452";
  13886. class ui_topNode extends fgui.GComponent {
  13887. static createInstance() {
  13888. return (fgui.UIPackage.createObject("game", "topNode"));
  13889. }
  13890. onConstruct() {
  13891. this.selfProgress = (this.getChild("selfProgress"));
  13892. this.aiProgress = (this.getChild("aiProgress"));
  13893. this.selfKuang = (this.getChild("selfKuang"));
  13894. this.aiKuang = (this.getChild("aiKuang"));
  13895. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13896. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13897. this.n33 = (this.getChild("n33"));
  13898. this.n34 = (this.getChild("n34"));
  13899. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13900. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13901. this.selfBallList = (this.getChild("selfBallList"));
  13902. this.aiBallList = (this.getChild("aiBallList"));
  13903. this.middleNode = (this.getChild("middleNode"));
  13904. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13905. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13906. this.scoreNode = (this.getChild("scoreNode"));
  13907. this.selfTips = (this.getChild("selfTips"));
  13908. this.aiTips = (this.getChild("aiTips"));
  13909. }
  13910. }
  13911. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13912. class ui_selfProgress extends fgui.GProgressBar {
  13913. static createInstance() {
  13914. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13915. }
  13916. onConstruct() {
  13917. this.n3 = (this.getChild("n3"));
  13918. this.bar = (this.getChild("bar"));
  13919. }
  13920. }
  13921. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13922. class ui_aiProgress extends fgui.GProgressBar {
  13923. static createInstance() {
  13924. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13925. }
  13926. onConstruct() {
  13927. this.n3 = (this.getChild("n3"));
  13928. this.bar = (this.getChild("bar"));
  13929. }
  13930. }
  13931. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13932. class ui_ballDisplay extends fgui.GComponent {
  13933. static createInstance() {
  13934. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13935. }
  13936. onConstruct() {
  13937. this.myImg = (this.getChild("myImg"));
  13938. }
  13939. }
  13940. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13941. class ui_moveNode extends fgui.GComponent {
  13942. static createInstance() {
  13943. return (fgui.UIPackage.createObject("game", "moveNode"));
  13944. }
  13945. onConstruct() {
  13946. this.n8 = (this.getChild("n8"));
  13947. this.finger = (this.getChild("finger"));
  13948. }
  13949. }
  13950. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13951. class ui_cancelBtn extends fgui.GButton {
  13952. static createInstance() {
  13953. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13954. }
  13955. onConstruct() {
  13956. this.c1 = this.getController("c1");
  13957. this.n0 = (this.getChild("n0"));
  13958. this.n1 = (this.getChild("n1"));
  13959. }
  13960. }
  13961. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13962. class ui_shareBtn extends fgui.GButton {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13965. }
  13966. onConstruct() {
  13967. this.c1 = this.getController("c1");
  13968. this.n2 = (this.getChild("n2"));
  13969. this.n1 = (this.getChild("n1"));
  13970. this.n3 = (this.getChild("n3"));
  13971. this.n4 = (this.getChild("n4"));
  13972. this.n5 = (this.getChild("n5"));
  13973. this.n6 = (this.getChild("n6"));
  13974. }
  13975. }
  13976. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13977. class ui_share2Btn extends fgui.GButton {
  13978. static createInstance() {
  13979. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13980. }
  13981. onConstruct() {
  13982. this.n3 = (this.getChild("n3"));
  13983. }
  13984. }
  13985. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13986. class ui_rodMethodNode extends fgui.GComponent {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13989. }
  13990. onConstruct() {
  13991. this.bg = (this.getChild("bg"));
  13992. this.dot = (this.getChild("dot"));
  13993. }
  13994. }
  13995. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13996. class ui_sureBtn extends fgui.GButton {
  13997. static createInstance() {
  13998. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13999. }
  14000. onConstruct() {
  14001. this.n2 = (this.getChild("n2"));
  14002. this.n1 = (this.getChild("n1"));
  14003. }
  14004. }
  14005. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14006. class ui_Component18 extends fgui.GComponent {
  14007. static createInstance() {
  14008. return (fgui.UIPackage.createObject("game", "Component18"));
  14009. }
  14010. onConstruct() {
  14011. this.c1 = this.getController("c1");
  14012. this.nameTxt = (this.getChild("nameTxt"));
  14013. this.headImg = (this.getChild("headImg"));
  14014. this.n24 = (this.getChild("n24"));
  14015. this.skillImg = (this.getChild("skillImg"));
  14016. this.skillTxt = (this.getChild("skillTxt"));
  14017. }
  14018. }
  14019. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14020. class ui_Component45 extends fgui.GComponent {
  14021. static createInstance() {
  14022. return (fgui.UIPackage.createObject("game", "Component45"));
  14023. }
  14024. onConstruct() {
  14025. this.c1 = this.getController("c1");
  14026. this.n40 = (this.getChild("n40"));
  14027. this.n41 = (this.getChild("n41"));
  14028. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14029. this.n42 = (this.getChild("n42"));
  14030. this.awardTxt = (this.getChild("awardTxt"));
  14031. this.n44 = (this.getChild("n44"));
  14032. this.t0 = this.getTransition("t0");
  14033. }
  14034. }
  14035. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14036. class ui_emotionDisplay extends fgui.GButton {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14039. }
  14040. onConstruct() {
  14041. this.myIcon = (this.getChild("myIcon"));
  14042. }
  14043. }
  14044. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14045. class ui_Component49 extends fgui.GButton {
  14046. static createInstance() {
  14047. return (fgui.UIPackage.createObject("game", "Component49"));
  14048. }
  14049. onConstruct() {
  14050. this.n69 = (this.getChild("n69"));
  14051. this.n56 = (this.getChild("n56"));
  14052. }
  14053. }
  14054. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14055. class ui_Component50 extends fgui.GButton {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "Component50"));
  14058. }
  14059. onConstruct() {
  14060. this.n54 = (this.getChild("n54"));
  14061. this.n65 = (this.getChild("n65"));
  14062. }
  14063. }
  14064. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14065. class ui_Component51 extends fgui.GButton {
  14066. static createInstance() {
  14067. return (fgui.UIPackage.createObject("game", "Component51"));
  14068. }
  14069. onConstruct() {
  14070. this.c1 = this.getController("c1");
  14071. this.n51 = (this.getChild("n51"));
  14072. this.n54 = (this.getChild("n54"));
  14073. }
  14074. }
  14075. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14076. class ui_Button5 extends fgui.GButton {
  14077. static createInstance() {
  14078. return (fgui.UIPackage.createObject("game", "Button5"));
  14079. }
  14080. onConstruct() {
  14081. this.c1 = this.getController("c1");
  14082. this.n0 = (this.getChild("n0"));
  14083. this.n2 = (this.getChild("n2"));
  14084. }
  14085. }
  14086. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14087. class ui_Component124 extends fgui.GComponent {
  14088. static createInstance() {
  14089. return (fgui.UIPackage.createObject("game", "Component124"));
  14090. }
  14091. onConstruct() {
  14092. this.n22 = (this.getChild("n22"));
  14093. this.shareNode = (this.getChild("shareNode"));
  14094. }
  14095. }
  14096. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14097. class ui_Component125 extends fgui.GComponent {
  14098. static createInstance() {
  14099. return (fgui.UIPackage.createObject("game", "Component125"));
  14100. }
  14101. onConstruct() {
  14102. this.n29 = (this.getChild("n29"));
  14103. this.coinTxt = (this.getChild("coinTxt"));
  14104. }
  14105. }
  14106. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14107. class ui_Component52 extends fgui.GButton {
  14108. static createInstance() {
  14109. return (fgui.UIPackage.createObject("game", "Component52"));
  14110. }
  14111. onConstruct() {
  14112. this.n35 = (this.getChild("n35"));
  14113. this.n36 = (this.getChild("n36"));
  14114. }
  14115. }
  14116. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14117. class ui_Component_denglu extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14120. }
  14121. onConstruct() {
  14122. this.c1 = this.getController("c1");
  14123. this.n102 = (this.getChild("n102"));
  14124. this.n103 = (this.getChild("n103"));
  14125. }
  14126. }
  14127. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14128. class ui_UIFuli1 extends fgui.GComponent {
  14129. static createInstance() {
  14130. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14131. }
  14132. onConstruct() {
  14133. this.n1 = (this.getChild("n1"));
  14134. this.n2 = (this.getChild("n2"));
  14135. }
  14136. }
  14137. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14138. class ui_Component_fl_1 extends fgui.GComponent {
  14139. static createInstance() {
  14140. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14141. }
  14142. onConstruct() {
  14143. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14144. this.txt_price = (this.getChild("txt_price"));
  14145. this.n_no = (this.getChild("n_no"));
  14146. this.n_buy = (this.getChild("n_buy"));
  14147. }
  14148. }
  14149. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14150. class ui_Component_fl_2 extends fgui.GComponent {
  14151. static createInstance() {
  14152. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14153. }
  14154. onConstruct() {
  14155. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14156. this.txt_price = (this.getChild("txt_price"));
  14157. this.n_no = (this.getChild("n_no"));
  14158. this.n_buy = (this.getChild("n_buy"));
  14159. }
  14160. }
  14161. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14162. class ui_UIFuli2 extends fgui.GComponent {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14165. }
  14166. onConstruct() {
  14167. this.n1 = (this.getChild("n1"));
  14168. this.n2 = (this.getChild("n2"));
  14169. }
  14170. }
  14171. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14172. class ui_drawBtn extends fgui.GButton {
  14173. static createInstance() {
  14174. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14175. }
  14176. onConstruct() {
  14177. this.c1 = this.getController("c1");
  14178. this.n2 = (this.getChild("n2"));
  14179. this.n1 = (this.getChild("n1"));
  14180. this.n5 = (this.getChild("n5"));
  14181. }
  14182. }
  14183. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14184. class ui_Component43 extends fgui.GButton {
  14185. static createInstance() {
  14186. return (fgui.UIPackage.createObject("game", "Component43"));
  14187. }
  14188. onConstruct() {
  14189. this.n49 = (this.getChild("n49"));
  14190. }
  14191. }
  14192. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14193. class ui_wordsDisplay extends fgui.GComponent {
  14194. static createInstance() {
  14195. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14196. }
  14197. onConstruct() {
  14198. this.txt = (this.getChild("txt"));
  14199. this.n63 = (this.getChild("n63"));
  14200. }
  14201. }
  14202. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14203. class ui_Component_phb extends fgui.GComponent {
  14204. static createInstance() {
  14205. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14206. }
  14207. onConstruct() {
  14208. this.n3 = (this.getChild("n3"));
  14209. this.n4 = (this.getChild("n4"));
  14210. }
  14211. }
  14212. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14213. class ui_Component3 extends fgui.GComponent {
  14214. static createInstance() {
  14215. return (fgui.UIPackage.createObject("game", "Component3"));
  14216. }
  14217. onConstruct() {
  14218. this.n26 = (this.getChild("n26"));
  14219. this.n24 = (this.getChild("n24"));
  14220. this.nameTxt = (this.getChild("nameTxt"));
  14221. this.headRoot = (this.getChild("headRoot"));
  14222. }
  14223. }
  14224. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14225. class ui_Component4 extends fgui.GComponent {
  14226. static createInstance() {
  14227. return (fgui.UIPackage.createObject("game", "Component4"));
  14228. }
  14229. onConstruct() {
  14230. this.headImg = (this.getChild("headImg"));
  14231. }
  14232. }
  14233. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14234. class ui_Component7 extends fgui.GButton {
  14235. static createInstance() {
  14236. return (fgui.UIPackage.createObject("game", "Component7"));
  14237. }
  14238. onConstruct() {
  14239. this.n17 = (this.getChild("n17"));
  14240. }
  14241. }
  14242. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14243. class ui_Component8 extends fgui.GButton {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "Component8"));
  14246. }
  14247. onConstruct() {
  14248. this.n19 = (this.getChild("n19"));
  14249. }
  14250. }
  14251. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14252. class ui_Component10 extends fgui.GButton {
  14253. static createInstance() {
  14254. return (fgui.UIPackage.createObject("game", "Component10"));
  14255. }
  14256. onConstruct() {
  14257. this.c1 = this.getController("c1");
  14258. this.n40 = (this.getChild("n40"));
  14259. }
  14260. }
  14261. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14262. class ui_Component11 extends fgui.GButton {
  14263. static createInstance() {
  14264. return (fgui.UIPackage.createObject("game", "Component11"));
  14265. }
  14266. onConstruct() {
  14267. this.n34 = (this.getChild("n34"));
  14268. }
  14269. }
  14270. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14271. class ui_Component12 extends fgui.GButton {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "Component12"));
  14274. }
  14275. onConstruct() {
  14276. this.n35 = (this.getChild("n35"));
  14277. }
  14278. }
  14279. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14280. class ui_Component13 extends fgui.GButton {
  14281. static createInstance() {
  14282. return (fgui.UIPackage.createObject("game", "Component13"));
  14283. }
  14284. onConstruct() {
  14285. this.n27 = (this.getChild("n27"));
  14286. this.n36 = (this.getChild("n36"));
  14287. }
  14288. }
  14289. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14290. class ui_dh_js_tuowei extends fgui.GComponent {
  14291. static createInstance() {
  14292. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14293. }
  14294. onConstruct() {
  14295. this.n19 = (this.getChild("n19"));
  14296. this.n18 = (this.getChild("n18"));
  14297. this.n0 = (this.getChild("n0"));
  14298. this.n3 = (this.getChild("n3"));
  14299. this.n4 = (this.getChild("n4"));
  14300. this.n5 = (this.getChild("n5"));
  14301. this.n6 = (this.getChild("n6"));
  14302. this.n8 = (this.getChild("n8"));
  14303. this.n9 = (this.getChild("n9"));
  14304. this.n10 = (this.getChild("n10"));
  14305. this.n11 = (this.getChild("n11"));
  14306. this.n12 = (this.getChild("n12"));
  14307. this.n13 = (this.getChild("n13"));
  14308. this.n14 = (this.getChild("n14"));
  14309. this.n15 = (this.getChild("n15"));
  14310. this.n20 = (this.getChild("n20"));
  14311. this.t0 = this.getTransition("t0");
  14312. this.t1 = this.getTransition("t1");
  14313. }
  14314. }
  14315. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14316. class ui_dh_js_tw_g extends fgui.GComponent {
  14317. static createInstance() {
  14318. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14319. }
  14320. onConstruct() {
  14321. this.n0 = (this.getChild("n0"));
  14322. this.n1 = (this.getChild("n1"));
  14323. this.t0 = this.getTransition("t0");
  14324. }
  14325. }
  14326. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14327. class ui_dh_js_xingxing extends fgui.GComponent {
  14328. static createInstance() {
  14329. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14330. }
  14331. onConstruct() {
  14332. this.n1 = (this.getChild("n1"));
  14333. this.n2 = (this.getChild("n2"));
  14334. this.n3 = (this.getChild("n3"));
  14335. this.n4 = (this.getChild("n4"));
  14336. this.n0 = (this.getChild("n0"));
  14337. this.t2 = this.getTransition("t2");
  14338. this.t1 = this.getTransition("t1");
  14339. }
  14340. }
  14341. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14342. class ui_dh_zy_jiazai extends fgui.GComponent {
  14343. static createInstance() {
  14344. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14345. }
  14346. onConstruct() {
  14347. this.c1 = this.getController("c1");
  14348. this.n0 = (this.getChild("n0"));
  14349. this.n1 = (this.getChild("n1"));
  14350. this.n2 = (this.getChild("n2"));
  14351. this.n4 = (this.getChild("n4"));
  14352. this.n5 = (this.getChild("n5"));
  14353. this.n6 = (this.getChild("n6"));
  14354. this.n8 = (this.getChild("n8"));
  14355. this.n7 = (this.getChild("n7"));
  14356. this.t0 = this.getTransition("t0");
  14357. }
  14358. }
  14359. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14360. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14361. static createInstance() {
  14362. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14363. }
  14364. onConstruct() {
  14365. this.c1 = this.getController("c1");
  14366. this.n3 = (this.getChild("n3"));
  14367. this.n5 = (this.getChild("n5"));
  14368. this.n4 = (this.getChild("n4"));
  14369. this.n0 = (this.getChild("n0"));
  14370. this.n1 = (this.getChild("n1"));
  14371. this.n2 = (this.getChild("n2"));
  14372. }
  14373. }
  14374. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14375. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14376. static createInstance() {
  14377. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14378. }
  14379. onConstruct() {
  14380. this.n19 = (this.getChild("n19"));
  14381. this.n21 = (this.getChild("n21"));
  14382. this.n0 = (this.getChild("n0"));
  14383. this.n3 = (this.getChild("n3"));
  14384. this.n4 = (this.getChild("n4"));
  14385. this.n5 = (this.getChild("n5"));
  14386. this.n6 = (this.getChild("n6"));
  14387. this.n8 = (this.getChild("n8"));
  14388. this.n9 = (this.getChild("n9"));
  14389. this.n10 = (this.getChild("n10"));
  14390. this.n11 = (this.getChild("n11"));
  14391. this.n12 = (this.getChild("n12"));
  14392. this.n13 = (this.getChild("n13"));
  14393. this.n14 = (this.getChild("n14"));
  14394. this.n15 = (this.getChild("n15"));
  14395. this.n23 = (this.getChild("n23"));
  14396. this.t0 = this.getTransition("t0");
  14397. this.t1 = this.getTransition("t1");
  14398. }
  14399. }
  14400. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14401. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14404. }
  14405. onConstruct() {
  14406. this.n1 = (this.getChild("n1"));
  14407. this.n2 = (this.getChild("n2"));
  14408. this.t0 = this.getTransition("t0");
  14409. }
  14410. }
  14411. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14412. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14413. static createInstance() {
  14414. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14415. }
  14416. onConstruct() {
  14417. this.n4 = (this.getChild("n4"));
  14418. this.n2 = (this.getChild("n2"));
  14419. this.n3 = (this.getChild("n3"));
  14420. this.idle = this.getTransition("idle");
  14421. this.attack = this.getTransition("attack");
  14422. }
  14423. }
  14424. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14425. class ui_special extends fgui.GComponent {
  14426. static createInstance() {
  14427. return (fgui.UIPackage.createObject("game", "special"));
  14428. }
  14429. onConstruct() {
  14430. this.n18 = (this.getChild("n18"));
  14431. this.n19 = (this.getChild("n19"));
  14432. this.n20 = (this.getChild("n20"));
  14433. this.n21 = (this.getChild("n21"));
  14434. this.n22 = (this.getChild("n22"));
  14435. this.levelTxt = (this.getChild("levelTxt"));
  14436. this.n24 = (this.getChild("n24"));
  14437. this.n25 = (this.getChild("n25"));
  14438. this.t0 = this.getTransition("t0");
  14439. }
  14440. }
  14441. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14442. class ui_Component145 extends fgui.GComponent {
  14443. static createInstance() {
  14444. return (fgui.UIPackage.createObject("game", "Component145"));
  14445. }
  14446. onConstruct() {
  14447. this.guanyuNode = (this.getChild("guanyuNode"));
  14448. }
  14449. }
  14450. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14451. class ui_longBtn extends fgui.GButton {
  14452. static createInstance() {
  14453. return (fgui.UIPackage.createObject("game", "longBtn"));
  14454. }
  14455. onConstruct() {
  14456. this.c1 = this.getController("c1");
  14457. this.n2 = (this.getChild("n2"));
  14458. this.n1 = (this.getChild("n1"));
  14459. this.n4 = (this.getChild("n4"));
  14460. }
  14461. }
  14462. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14463. class ui_Component146 extends fgui.GComponent {
  14464. static createInstance() {
  14465. return (fgui.UIPackage.createObject("game", "Component146"));
  14466. }
  14467. onConstruct() {
  14468. this.n89 = (this.getChild("n89"));
  14469. this.n90 = (this.getChild("n90"));
  14470. this.guideBtn = (this.getChild("guideBtn"));
  14471. }
  14472. }
  14473. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14474. class ui_Component146_11 extends fgui.GComponent {
  14475. static createInstance() {
  14476. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14477. }
  14478. onConstruct() {
  14479. this.n89 = (this.getChild("n89"));
  14480. this.n90 = (this.getChild("n90"));
  14481. this.guideBtn = (this.getChild("guideBtn"));
  14482. }
  14483. }
  14484. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14485. class ui_Component111_1 extends fgui.GComponent {
  14486. static createInstance() {
  14487. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14488. }
  14489. onConstruct() {
  14490. this.n68 = (this.getChild("n68"));
  14491. this.myMask = (this.getChild("myMask"));
  14492. }
  14493. }
  14494. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14495. class ui_Component64_1 extends fgui.GComponent {
  14496. static createInstance() {
  14497. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14498. }
  14499. onConstruct() {
  14500. this.n57 = (this.getChild("n57"));
  14501. this.n54 = (this.getChild("n54"));
  14502. this.n55 = (this.getChild("n55"));
  14503. this.n56 = (this.getChild("n56"));
  14504. this.t1 = this.getTransition("t1");
  14505. }
  14506. }
  14507. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14508. class ui_ModeSelection_com123 extends fgui.GComponent {
  14509. static createInstance() {
  14510. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14511. }
  14512. onConstruct() {
  14513. this.type1 = (this.getChild("type1"));
  14514. this.type2 = (this.getChild("type2"));
  14515. this.type3 = (this.getChild("type3"));
  14516. this.n38 = (this.getChild("n38"));
  14517. this.t0 = this.getTransition("t0");
  14518. }
  14519. }
  14520. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14521. class ui_Component132_2 extends fgui.GComponent {
  14522. static createInstance() {
  14523. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14524. }
  14525. onConstruct() {
  14526. this.n25 = (this.getChild("n25"));
  14527. this.n26 = (this.getChild("n26"));
  14528. this.n27 = (this.getChild("n27"));
  14529. this.t0 = this.getTransition("t0");
  14530. }
  14531. }
  14532. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14533. class ui_UIPower$1 extends fgui.GComponent {
  14534. static createInstance() {
  14535. return (fgui.UIPackage.createObject("game", "UIPower"));
  14536. }
  14537. onConstruct() {
  14538. this.n11 = (this.getChild("n11"));
  14539. this.myNode = (this.getChild("myNode"));
  14540. this.t0 = this.getTransition("t0");
  14541. }
  14542. }
  14543. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14544. class ui_Component133 extends fgui.GComponent {
  14545. static createInstance() {
  14546. return (fgui.UIPackage.createObject("game", "Component133"));
  14547. }
  14548. onConstruct() {
  14549. this.n29 = (this.getChild("n29"));
  14550. this.n30 = (this.getChild("n30"));
  14551. }
  14552. }
  14553. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14554. class ui_Component134 extends fgui.GComponent {
  14555. static createInstance() {
  14556. return (fgui.UIPackage.createObject("game", "Component134"));
  14557. }
  14558. onConstruct() {
  14559. this.n30 = (this.getChild("n30"));
  14560. this.n31 = (this.getChild("n31"));
  14561. this.t0 = this.getTransition("t0");
  14562. }
  14563. }
  14564. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14565. class ui_Component135 extends fgui.GComponent {
  14566. static createInstance() {
  14567. return (fgui.UIPackage.createObject("game", "Component135"));
  14568. }
  14569. onConstruct() {
  14570. this.n30 = (this.getChild("n30"));
  14571. this.t0 = this.getTransition("t0");
  14572. }
  14573. }
  14574. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14575. class ui_Component137 extends fgui.GComponent {
  14576. static createInstance() {
  14577. return (fgui.UIPackage.createObject("game", "Component137"));
  14578. }
  14579. onConstruct() {
  14580. this.n28 = (this.getChild("n28"));
  14581. this.n29 = (this.getChild("n29"));
  14582. this.n30 = (this.getChild("n30"));
  14583. this.n32 = (this.getChild("n32"));
  14584. }
  14585. }
  14586. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14587. class ui_dh_zuanshi extends fgui.GButton {
  14588. static createInstance() {
  14589. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14590. }
  14591. onConstruct() {
  14592. this.n1 = (this.getChild("n1"));
  14593. this.n2 = (this.getChild("n2"));
  14594. this.n0 = (this.getChild("n0"));
  14595. this.n3 = (this.getChild("n3"));
  14596. this.n4 = (this.getChild("n4"));
  14597. }
  14598. }
  14599. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14600. class ui_Component138 extends fgui.GComponent {
  14601. static createInstance() {
  14602. return (fgui.UIPackage.createObject("game", "Component138"));
  14603. }
  14604. onConstruct() {
  14605. this.n1 = (this.getChild("n1"));
  14606. this.n2 = (this.getChild("n2"));
  14607. this.t0 = this.getTransition("t0");
  14608. }
  14609. }
  14610. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14611. class ui_Component139 extends fgui.GComponent {
  14612. static createInstance() {
  14613. return (fgui.UIPackage.createObject("game", "Component139"));
  14614. }
  14615. onConstruct() {
  14616. this.n0 = (this.getChild("n0"));
  14617. this.t0 = this.getTransition("t0");
  14618. }
  14619. }
  14620. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14621. class ui_Component140 extends fgui.GComponent {
  14622. static createInstance() {
  14623. return (fgui.UIPackage.createObject("game", "Component140"));
  14624. }
  14625. onConstruct() {
  14626. this.n2 = (this.getChild("n2"));
  14627. this.n3 = (this.getChild("n3"));
  14628. this.t0 = this.getTransition("t0");
  14629. }
  14630. }
  14631. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14632. class ui_Component141 extends fgui.GComponent {
  14633. static createInstance() {
  14634. return (fgui.UIPackage.createObject("game", "Component141"));
  14635. }
  14636. onConstruct() {
  14637. this.n0 = (this.getChild("n0"));
  14638. this.t0 = this.getTransition("t0");
  14639. }
  14640. }
  14641. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14642. class ui_powerNode extends fgui.GProgressBar {
  14643. static createInstance() {
  14644. return (fgui.UIPackage.createObject("game", "powerNode"));
  14645. }
  14646. onConstruct() {
  14647. this.n2 = (this.getChild("n2"));
  14648. this.bar_v = (this.getChild("bar_v"));
  14649. this.showImg = (this.getChild("showImg"));
  14650. this.n12 = (this.getChild("n12"));
  14651. }
  14652. }
  14653. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14654. class ui_dh_jingbi1 extends fgui.GComponent {
  14655. static createInstance() {
  14656. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14657. }
  14658. onConstruct() {
  14659. this.n0 = (this.getChild("n0"));
  14660. this.n1 = (this.getChild("n1"));
  14661. this.n2 = (this.getChild("n2"));
  14662. this.n3 = (this.getChild("n3"));
  14663. this.n4 = (this.getChild("n4"));
  14664. this.n5 = (this.getChild("n5"));
  14665. this.n6 = (this.getChild("n6"));
  14666. this.n8 = (this.getChild("n8"));
  14667. this.t0 = this.getTransition("t0");
  14668. }
  14669. }
  14670. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14671. class ui_Component94 extends fgui.GButton {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("game", "Component94"));
  14674. }
  14675. onConstruct() {
  14676. this.n77 = (this.getChild("n77"));
  14677. }
  14678. }
  14679. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14680. class ui_Component95 extends fgui.GButton {
  14681. static createInstance() {
  14682. return (fgui.UIPackage.createObject("game", "Component95"));
  14683. }
  14684. onConstruct() {
  14685. this.n77 = (this.getChild("n77"));
  14686. }
  14687. }
  14688. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14689. class ui_Component126 extends fgui.GComponent {
  14690. static createInstance() {
  14691. return (fgui.UIPackage.createObject("game", "Component126"));
  14692. }
  14693. onConstruct() {
  14694. this.c1 = this.getController("c1");
  14695. this.normalBtn = (this.getChild("normalBtn"));
  14696. this.tripleBtn = (this.getChild("tripleBtn"));
  14697. }
  14698. }
  14699. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14700. class ui_Component60 extends fgui.GComponent {
  14701. static createInstance() {
  14702. return (fgui.UIPackage.createObject("game", "Component60"));
  14703. }
  14704. onConstruct() {
  14705. this.c1 = this.getController("c1");
  14706. this.n48 = (this.getChild("n48"));
  14707. this.womanTxt = (this.getChild("womanTxt"));
  14708. this.t0 = this.getTransition("t0");
  14709. }
  14710. }
  14711. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14712. class ui_Button_h extends fgui.GButton {
  14713. static createInstance() {
  14714. return (fgui.UIPackage.createObject("game", "Button_h"));
  14715. }
  14716. onConstruct() {
  14717. this.button = this.getController("button");
  14718. this.n0 = (this.getChild("n0"));
  14719. }
  14720. }
  14721. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14722. class ui_Button_lv extends fgui.GButton {
  14723. static createInstance() {
  14724. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14725. }
  14726. onConstruct() {
  14727. this.button = this.getController("button");
  14728. this.n0 = (this.getChild("n0"));
  14729. }
  14730. }
  14731. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14732. class ui_Component98_3 extends fgui.GButton {
  14733. static createInstance() {
  14734. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14735. }
  14736. onConstruct() {
  14737. this.c1 = this.getController("c1");
  14738. this.n8 = (this.getChild("n8"));
  14739. this.n41 = (this.getChild("n41"));
  14740. this.n40 = (this.getChild("n40"));
  14741. }
  14742. }
  14743. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14744. class ui_ModeSelection_com1 extends fgui.GButton {
  14745. static createInstance() {
  14746. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14747. }
  14748. onConstruct() {
  14749. this.n34 = (this.getChild("n34"));
  14750. this.n36 = (this.getChild("n36"));
  14751. this.n22 = (this.getChild("n22"));
  14752. this.n20 = (this.getChild("n20"));
  14753. this.n23 = (this.getChild("n23"));
  14754. this.n24 = (this.getChild("n24"));
  14755. this.n26 = (this.getChild("n26"));
  14756. this.n33 = (this.getChild("n33"));
  14757. this.coinImg = (this.getChild("coinImg"));
  14758. this.need = (this.getChild("need"));
  14759. this.n35 = (this.getChild("n35"));
  14760. this.n29 = (this.getChild("n29"));
  14761. this.tipsTxt = (this.getChild("tipsTxt"));
  14762. this.n30 = (this.getChild("n30"));
  14763. this.peopleTxt = (this.getChild("peopleTxt"));
  14764. this.t0 = this.getTransition("t0");
  14765. }
  14766. }
  14767. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14768. class ui_ModeSelection_com2 extends fgui.GButton {
  14769. static createInstance() {
  14770. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14771. }
  14772. onConstruct() {
  14773. this.n36 = (this.getChild("n36"));
  14774. this.n34 = (this.getChild("n34"));
  14775. this.n22 = (this.getChild("n22"));
  14776. this.n20 = (this.getChild("n20"));
  14777. this.n23 = (this.getChild("n23"));
  14778. this.n24 = (this.getChild("n24"));
  14779. this.n26 = (this.getChild("n26"));
  14780. this.n33 = (this.getChild("n33"));
  14781. this.coinImg = (this.getChild("coinImg"));
  14782. this.need = (this.getChild("need"));
  14783. this.n35 = (this.getChild("n35"));
  14784. this.n29 = (this.getChild("n29"));
  14785. this.tipsTxt = (this.getChild("tipsTxt"));
  14786. this.n30 = (this.getChild("n30"));
  14787. this.peopleTxt = (this.getChild("peopleTxt"));
  14788. this.t0 = this.getTransition("t0");
  14789. }
  14790. }
  14791. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14792. class ui_ModeSelection_com3 extends fgui.GButton {
  14793. static createInstance() {
  14794. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14795. }
  14796. onConstruct() {
  14797. this.n34 = (this.getChild("n34"));
  14798. this.n36 = (this.getChild("n36"));
  14799. this.n22 = (this.getChild("n22"));
  14800. this.n20 = (this.getChild("n20"));
  14801. this.n23 = (this.getChild("n23"));
  14802. this.n24 = (this.getChild("n24"));
  14803. this.n26 = (this.getChild("n26"));
  14804. this.n33 = (this.getChild("n33"));
  14805. this.coinImg = (this.getChild("coinImg"));
  14806. this.need = (this.getChild("need"));
  14807. this.n35 = (this.getChild("n35"));
  14808. this.n29 = (this.getChild("n29"));
  14809. this.tipsTxt = (this.getChild("tipsTxt"));
  14810. this.n30 = (this.getChild("n30"));
  14811. this.peopleTxt = (this.getChild("peopleTxt"));
  14812. this.t0 = this.getTransition("t0");
  14813. }
  14814. }
  14815. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14816. class ui_Invitation_com1 extends fgui.GComponent {
  14817. static createInstance() {
  14818. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14819. }
  14820. onConstruct() {
  14821. this.n14 = (this.getChild("n14"));
  14822. this.n13 = (this.getChild("n13"));
  14823. this.n3 = (this.getChild("n3"));
  14824. this.n1 = (this.getChild("n1"));
  14825. this.n6 = (this.getChild("n6"));
  14826. this.n7 = (this.getChild("n7"));
  14827. this.enterBtn = (this.getChild("enterBtn"));
  14828. this.n11 = (this.getChild("n11"));
  14829. this.n12 = (this.getChild("n12"));
  14830. this.n15 = (this.getChild("n15"));
  14831. this.t0 = this.getTransition("t0");
  14832. this.t1 = this.getTransition("t1");
  14833. }
  14834. }
  14835. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14836. class ui_Component87_1 extends fgui.GComponent {
  14837. static createInstance() {
  14838. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14839. }
  14840. onConstruct() {
  14841. this.n74 = (this.getChild("n74"));
  14842. this.n73 = (this.getChild("n73"));
  14843. this.ballTxt = (this.getChild("ballTxt"));
  14844. this.n76 = (this.getChild("n76"));
  14845. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14846. this.levelTxt = (this.getChild("levelTxt"));
  14847. this.n87 = (this.getChild("n87"));
  14848. this.n84 = (this.getChild("n84"));
  14849. this.hpTxt = (this.getChild("hpTxt"));
  14850. this.n89 = (this.getChild("n89"));
  14851. this.tipsTxt = (this.getChild("tipsTxt"));
  14852. }
  14853. }
  14854. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14855. class ui_sqg1 extends fgui.GComponent {
  14856. static createInstance() {
  14857. return (fgui.UIPackage.createObject("game", "sqg1"));
  14858. }
  14859. onConstruct() {
  14860. this.n1 = (this.getChild("n1"));
  14861. this.n0 = (this.getChild("n0"));
  14862. }
  14863. }
  14864. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14865. class ui_sqg2 extends fgui.GComponent {
  14866. static createInstance() {
  14867. return (fgui.UIPackage.createObject("game", "sqg2"));
  14868. }
  14869. onConstruct() {
  14870. this.n1 = (this.getChild("n1"));
  14871. this.n0 = (this.getChild("n0"));
  14872. }
  14873. }
  14874. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14875. class ui_sqg3 extends fgui.GComponent {
  14876. static createInstance() {
  14877. return (fgui.UIPackage.createObject("game", "sqg3"));
  14878. }
  14879. onConstruct() {
  14880. this.n1 = (this.getChild("n1"));
  14881. this.n0 = (this.getChild("n0"));
  14882. }
  14883. }
  14884. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14885. class ui_sqg4 extends fgui.GComponent {
  14886. static createInstance() {
  14887. return (fgui.UIPackage.createObject("game", "sqg4"));
  14888. }
  14889. onConstruct() {
  14890. this.n1 = (this.getChild("n1"));
  14891. this.n0 = (this.getChild("n0"));
  14892. }
  14893. }
  14894. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14895. class ui_Component36 extends fgui.GButton {
  14896. static createInstance() {
  14897. return (fgui.UIPackage.createObject("game", "Component36"));
  14898. }
  14899. onConstruct() {
  14900. this.c1 = this.getController("c1");
  14901. this.n53 = (this.getChild("n53"));
  14902. this.n56 = (this.getChild("n56"));
  14903. }
  14904. }
  14905. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14906. class ui_Component37 extends fgui.GButton {
  14907. static createInstance() {
  14908. return (fgui.UIPackage.createObject("game", "Component37"));
  14909. }
  14910. onConstruct() {
  14911. this.c1 = this.getController("c1");
  14912. this.n52 = (this.getChild("n52"));
  14913. this.n54 = (this.getChild("n54"));
  14914. }
  14915. }
  14916. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14917. class ui_UISetting extends fgui.GComponent {
  14918. static createInstance() {
  14919. return (fgui.UIPackage.createObject("game", "UISetting"));
  14920. }
  14921. onConstruct() {
  14922. this.c1 = this.getController("c1");
  14923. this.n4 = (this.getChild("n4"));
  14924. this.soundBtn = (this.getChild("soundBtn"));
  14925. this.shakeBtn = (this.getChild("shakeBtn"));
  14926. this.clickNode = (this.getChild("clickNode"));
  14927. this.xyBtn = (this.getChild("xyBtn"));
  14928. }
  14929. }
  14930. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14931. class ui_Component39 extends fgui.GComponent {
  14932. static createInstance() {
  14933. return (fgui.UIPackage.createObject("game", "Component39"));
  14934. }
  14935. onConstruct() {
  14936. this.n5 = (this.getChild("n5"));
  14937. this.n6 = (this.getChild("n6"));
  14938. this.n7 = (this.getChild("n7"));
  14939. this.t0 = this.getTransition("t0");
  14940. }
  14941. }
  14942. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14943. class ui_Component40 extends fgui.GButton {
  14944. static createInstance() {
  14945. return (fgui.UIPackage.createObject("game", "Component40"));
  14946. }
  14947. onConstruct() {
  14948. this.n46 = (this.getChild("n46"));
  14949. this.n47 = (this.getChild("n47"));
  14950. }
  14951. }
  14952. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14953. class ui_Component41 extends fgui.GComponent {
  14954. static createInstance() {
  14955. return (fgui.UIPackage.createObject("game", "Component41"));
  14956. }
  14957. onConstruct() {
  14958. this.c1 = this.getController("c1");
  14959. this.n0 = (this.getChild("n0"));
  14960. this.titleTxt = (this.getChild("titleTxt"));
  14961. this.n2 = (this.getChild("n2"));
  14962. this.msgTips = (this.getChild("msgTips"));
  14963. this.numTxt = (this.getChild("numTxt"));
  14964. this.n18 = (this.getChild("n18"));
  14965. this.cancelBtn = (this.getChild("cancelBtn"));
  14966. this.videoBtn = (this.getChild("videoBtn"));
  14967. this.n10 = (this.getChild("n10"));
  14968. }
  14969. }
  14970. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14971. class ui_Component42 extends fgui.GComponent {
  14972. static createInstance() {
  14973. return (fgui.UIPackage.createObject("game", "Component42"));
  14974. }
  14975. onConstruct() {
  14976. this.c1 = this.getController("c1");
  14977. this.n1 = (this.getChild("n1"));
  14978. this.n2 = (this.getChild("n2"));
  14979. this.n3 = (this.getChild("n3"));
  14980. this.tipsTxt = (this.getChild("tipsTxt"));
  14981. this.cancelBtn = (this.getChild("cancelBtn"));
  14982. this.sureBtn = (this.getChild("sureBtn"));
  14983. this.n11 = (this.getChild("n11"));
  14984. this.n13 = (this.getChild("n13"));
  14985. this.n14 = (this.getChild("n14"));
  14986. this.womanTxt = (this.getChild("womanTxt"));
  14987. this.t0 = this.getTransition("t0");
  14988. }
  14989. }
  14990. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14991. class ui_dh_js_shengli extends fgui.GComponent {
  14992. static createInstance() {
  14993. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14994. }
  14995. onConstruct() {
  14996. this.n3 = (this.getChild("n3"));
  14997. this.n4 = (this.getChild("n4"));
  14998. this.n1 = (this.getChild("n1"));
  14999. this.n2 = (this.getChild("n2"));
  15000. this.n5 = (this.getChild("n5"));
  15001. this.n6 = (this.getChild("n6"));
  15002. this.n7 = (this.getChild("n7"));
  15003. this.n8 = (this.getChild("n8"));
  15004. this.attack = this.getTransition("attack");
  15005. this.idle = this.getTransition("idle");
  15006. }
  15007. }
  15008. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15009. class ui_dh_js_shengli_g extends fgui.GComponent {
  15010. static createInstance() {
  15011. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15012. }
  15013. onConstruct() {
  15014. this.n3 = (this.getChild("n3"));
  15015. this.n1 = (this.getChild("n1"));
  15016. this.t0 = this.getTransition("t0");
  15017. }
  15018. }
  15019. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15020. class ui_dh_js_shibai extends fgui.GComponent {
  15021. static createInstance() {
  15022. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15023. }
  15024. onConstruct() {
  15025. this.n0 = (this.getChild("n0"));
  15026. this.n1 = (this.getChild("n1"));
  15027. this.n2 = (this.getChild("n2"));
  15028. this.n3 = (this.getChild("n3"));
  15029. this.idle = this.getTransition("idle");
  15030. this.attack = this.getTransition("attack");
  15031. }
  15032. }
  15033. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15034. class ui_dh_zy_ganfa extends fgui.GButton {
  15035. static createInstance() {
  15036. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15037. }
  15038. onConstruct() {
  15039. this.n0 = (this.getChild("n0"));
  15040. }
  15041. }
  15042. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15043. class ui_dh_zy_sc_guang extends fgui.GButton {
  15044. static createInstance() {
  15045. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15046. }
  15047. onConstruct() {
  15048. this.n0 = (this.getChild("n0"));
  15049. this.n2 = (this.getChild("n2"));
  15050. }
  15051. }
  15052. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15053. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15054. static createInstance() {
  15055. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15056. }
  15057. onConstruct() {
  15058. this.n0 = (this.getChild("n0"));
  15059. this.n3 = (this.getChild("n3"));
  15060. }
  15061. }
  15062. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15063. class ui_dh_zy_wanfa extends fgui.GButton {
  15064. static createInstance() {
  15065. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15066. }
  15067. onConstruct() {
  15068. this.n0 = (this.getChild("n0"));
  15069. }
  15070. }
  15071. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15072. class ui_Button_login extends fgui.GButton {
  15073. static createInstance() {
  15074. return (fgui.UIPackage.createObject("game", "Button_login"));
  15075. }
  15076. onConstruct() {
  15077. this.button = this.getController("button");
  15078. this.n5 = (this.getChild("n5"));
  15079. }
  15080. }
  15081. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15082. class ui_Component53_1 extends fgui.GComponent {
  15083. static createInstance() {
  15084. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15085. }
  15086. onConstruct() {
  15087. this.n0 = (this.getChild("n0"));
  15088. this.n1 = (this.getChild("n1"));
  15089. this.n2 = (this.getChild("n2"));
  15090. this.n3 = (this.getChild("n3"));
  15091. this.n4 = (this.getChild("n4"));
  15092. this.n5 = (this.getChild("n5"));
  15093. this.n6 = (this.getChild("n6"));
  15094. this.n7 = (this.getChild("n7"));
  15095. this.n8 = (this.getChild("n8"));
  15096. this.n9 = (this.getChild("n9"));
  15097. this.n10 = (this.getChild("n10"));
  15098. this.n11 = (this.getChild("n11"));
  15099. this.n12 = (this.getChild("n12"));
  15100. this.n13 = (this.getChild("n13"));
  15101. this.n14 = (this.getChild("n14"));
  15102. this.n15 = (this.getChild("n15"));
  15103. this.n16 = (this.getChild("n16"));
  15104. this.n19 = (this.getChild("n19"));
  15105. this.n20 = (this.getChild("n20"));
  15106. this.n21 = (this.getChild("n21"));
  15107. this.n22 = (this.getChild("n22"));
  15108. this.n23 = (this.getChild("n23"));
  15109. this.n24 = (this.getChild("n24"));
  15110. this.n25 = (this.getChild("n25"));
  15111. this.n26 = (this.getChild("n26"));
  15112. this.n27 = (this.getChild("n27"));
  15113. this.n28 = (this.getChild("n28"));
  15114. this.n29 = (this.getChild("n29"));
  15115. this.n30 = (this.getChild("n30"));
  15116. this.n31 = (this.getChild("n31"));
  15117. this.n32 = (this.getChild("n32"));
  15118. this.n33 = (this.getChild("n33"));
  15119. this.n34 = (this.getChild("n34"));
  15120. this.n35 = (this.getChild("n35"));
  15121. this.t0 = this.getTransition("t0");
  15122. }
  15123. }
  15124. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15125. class ui_Component30 extends fgui.GComponent {
  15126. static createInstance() {
  15127. return (fgui.UIPackage.createObject("game", "Component30"));
  15128. }
  15129. onConstruct() {
  15130. this.c1 = this.getController("c1");
  15131. this.n46 = (this.getChild("n46"));
  15132. this.n47 = (this.getChild("n47"));
  15133. this.numTxt = (this.getChild("numTxt"));
  15134. this.n50 = (this.getChild("n50"));
  15135. this.n53 = (this.getChild("n53"));
  15136. this.n54 = (this.getChild("n54"));
  15137. this.n55 = (this.getChild("n55"));
  15138. this.n56 = (this.getChild("n56"));
  15139. }
  15140. }
  15141. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15142. class ui_Component30_1 extends fgui.GComponent {
  15143. static createInstance() {
  15144. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15145. }
  15146. onConstruct() {
  15147. this.c1 = this.getController("c1");
  15148. this.n46 = (this.getChild("n46"));
  15149. this.n47 = (this.getChild("n47"));
  15150. this.numTxt = (this.getChild("numTxt"));
  15151. this.n50 = (this.getChild("n50"));
  15152. this.n51 = (this.getChild("n51"));
  15153. this.n52 = (this.getChild("n52"));
  15154. this.n53 = (this.getChild("n53"));
  15155. this.n54 = (this.getChild("n54"));
  15156. }
  15157. }
  15158. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15159. class ui_Component31 extends fgui.GComponent {
  15160. static createInstance() {
  15161. return (fgui.UIPackage.createObject("game", "Component31"));
  15162. }
  15163. onConstruct() {
  15164. this.n55 = (this.getChild("n55"));
  15165. this.n54 = (this.getChild("n54"));
  15166. this.conditionTxt = (this.getChild("conditionTxt"));
  15167. this.n57 = (this.getChild("n57"));
  15168. this.t0 = this.getTransition("t0");
  15169. }
  15170. }
  15171. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15172. class ui_Component32 extends fgui.GComponent {
  15173. static createInstance() {
  15174. return (fgui.UIPackage.createObject("game", "Component32"));
  15175. }
  15176. onConstruct() {
  15177. this.n5 = (this.getChild("n5"));
  15178. this.n6 = (this.getChild("n6"));
  15179. this.n7 = (this.getChild("n7"));
  15180. this.t0 = this.getTransition("t0");
  15181. }
  15182. }
  15183. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15184. class ui_AwardItem extends fgui.GComponent {
  15185. static createInstance() {
  15186. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15187. }
  15188. onConstruct() {
  15189. this.n9 = (this.getChild("n9"));
  15190. this.myIcon = (this.getChild("myIcon"));
  15191. this.numTxt = (this.getChild("numTxt"));
  15192. this.nameTxt = (this.getChild("nameTxt"));
  15193. this.n16 = (this.getChild("n16"));
  15194. this.n17 = (this.getChild("n17"));
  15195. }
  15196. }
  15197. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15198. class ui_ranking_com1 extends fgui.GButton {
  15199. static createInstance() {
  15200. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15201. }
  15202. onConstruct() {
  15203. this.c1 = this.getController("c1");
  15204. this.n49 = (this.getChild("n49"));
  15205. this.n18 = (this.getChild("n18"));
  15206. this.n46 = (this.getChild("n46"));
  15207. this.n48 = (this.getChild("n48"));
  15208. this.n50 = (this.getChild("n50"));
  15209. }
  15210. }
  15211. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15212. class ui_ranking_com2 extends fgui.GButton {
  15213. static createInstance() {
  15214. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15215. }
  15216. onConstruct() {
  15217. this.c1 = this.getController("c1");
  15218. this.n49 = (this.getChild("n49"));
  15219. this.n18 = (this.getChild("n18"));
  15220. this.n46 = (this.getChild("n46"));
  15221. this.n48 = (this.getChild("n48"));
  15222. this.n50 = (this.getChild("n50"));
  15223. }
  15224. }
  15225. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15226. class ui_ranking_com3 extends fgui.GComponent {
  15227. static createInstance() {
  15228. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15229. }
  15230. onConstruct() {
  15231. this.n17 = (this.getChild("n17"));
  15232. this.myIcon = (this.getChild("myIcon"));
  15233. }
  15234. }
  15235. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15236. class ui_ranking_com4 extends fgui.GComponent {
  15237. static createInstance() {
  15238. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15239. }
  15240. onConstruct() {
  15241. this.n16 = (this.getChild("n16"));
  15242. this.head = (this.getChild("head"));
  15243. }
  15244. }
  15245. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15246. class ui_ranking_com5 extends fgui.GComponent {
  15247. static createInstance() {
  15248. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15249. }
  15250. onConstruct() {
  15251. this.c1 = this.getController("c1");
  15252. this.c2 = this.getController("c2");
  15253. this.n2 = (this.getChild("n2"));
  15254. this.n3 = (this.getChild("n3"));
  15255. this.levelBtn = (this.getChild("levelBtn"));
  15256. this.starBtn = (this.getChild("starBtn"));
  15257. this.n23 = (this.getChild("n23"));
  15258. this.n24 = (this.getChild("n24"));
  15259. this.n25 = (this.getChild("n25"));
  15260. this.myList = (this.getChild("myList"));
  15261. this.selfNode = (this.getChild("selfNode"));
  15262. this.n9 = (this.getChild("n9"));
  15263. this.n12 = (this.getChild("n12"));
  15264. this.n13 = (this.getChild("n13"));
  15265. this.n14 = (this.getChild("n14"));
  15266. this.n39 = (this.getChild("n39"));
  15267. this.n41 = (this.getChild("n41"));
  15268. this.n42 = (this.getChild("n42"));
  15269. this.n45 = (this.getChild("n45"));
  15270. this.changeBtn = (this.getChild("changeBtn"));
  15271. this.closeBtn = (this.getChild("closeBtn"));
  15272. this.t0 = this.getTransition("t0");
  15273. }
  15274. }
  15275. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15276. class ui_RankItem extends fgui.GComponent {
  15277. static createInstance() {
  15278. return (fgui.UIPackage.createObject("game", "RankItem"));
  15279. }
  15280. onConstruct() {
  15281. this.n10 = (this.getChild("n10"));
  15282. this.n11 = (this.getChild("n11"));
  15283. this.rankTxt = (this.getChild("rankTxt"));
  15284. this.headNode = (this.getChild("headNode"));
  15285. this.nameTxt = (this.getChild("nameTxt"));
  15286. this.n19 = (this.getChild("n19"));
  15287. this.valueTxt = (this.getChild("valueTxt"));
  15288. this.img1 = (this.getChild("img1"));
  15289. this.img2 = (this.getChild("img2"));
  15290. this.img3 = (this.getChild("img3"));
  15291. }
  15292. }
  15293. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15294. class ui_ranking_com9 extends fgui.GComponent {
  15295. static createInstance() {
  15296. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15297. }
  15298. onConstruct() {
  15299. this.c1 = this.getController("c1");
  15300. this.n27 = (this.getChild("n27"));
  15301. this.n28 = (this.getChild("n28"));
  15302. this.headNode = (this.getChild("headNode"));
  15303. this.rankTxt = (this.getChild("rankTxt"));
  15304. this.nameTxt = (this.getChild("nameTxt"));
  15305. this.n34 = (this.getChild("n34"));
  15306. this.valueTxt = (this.getChild("valueTxt"));
  15307. this.n36 = (this.getChild("n36"));
  15308. this.n37 = (this.getChild("n37"));
  15309. this.n38 = (this.getChild("n38"));
  15310. this.n39 = (this.getChild("n39"));
  15311. this.n40 = (this.getChild("n40"));
  15312. }
  15313. }
  15314. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15315. class ui_ranking_com10 extends fgui.GComponent {
  15316. static createInstance() {
  15317. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15318. }
  15319. onConstruct() {
  15320. this.n23 = (this.getChild("n23"));
  15321. this.n24 = (this.getChild("n24"));
  15322. }
  15323. }
  15324. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15325. class ui_ranking_com11 extends fgui.GComponent {
  15326. static createInstance() {
  15327. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15328. }
  15329. onConstruct() {
  15330. this.n24 = (this.getChild("n24"));
  15331. this.n25 = (this.getChild("n25"));
  15332. this.t0 = this.getTransition("t0");
  15333. }
  15334. }
  15335. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15336. class ui_ranking_com13 extends fgui.GButton {
  15337. static createInstance() {
  15338. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15339. }
  15340. onConstruct() {
  15341. this.c1 = this.getController("c1");
  15342. this.n44 = (this.getChild("n44"));
  15343. this.n45 = (this.getChild("n45"));
  15344. this.n46 = (this.getChild("n46"));
  15345. }
  15346. }
  15347. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15348. class ui_Component122 extends fgui.GComponent {
  15349. static createInstance() {
  15350. return (fgui.UIPackage.createObject("game", "Component122"));
  15351. }
  15352. onConstruct() {
  15353. this.gameNode3 = (this.getChild("gameNode3"));
  15354. }
  15355. }
  15356. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15357. class ui_skillItem extends fgui.GComponent {
  15358. static createInstance() {
  15359. return (fgui.UIPackage.createObject("game", "skillItem"));
  15360. }
  15361. onConstruct() {
  15362. this.c1 = this.getController("c1");
  15363. this.n31 = (this.getChild("n31"));
  15364. this.n6 = (this.getChild("n6"));
  15365. this.skillImg = (this.getChild("skillImg"));
  15366. this.nameTxt = (this.getChild("nameTxt"));
  15367. this.levelTxt = (this.getChild("levelTxt"));
  15368. this.n28 = (this.getChild("n28"));
  15369. this.describeTxt = (this.getChild("describeTxt"));
  15370. this.n32 = (this.getChild("n32"));
  15371. this.mutiBtn = (this.getChild("mutiBtn"));
  15372. this.tryNode = (this.getChild("tryNode"));
  15373. this.normalBtn = (this.getChild("normalBtn"));
  15374. this.startBtn = (this.getChild("startBtn"));
  15375. this.n42 = (this.getChild("n42"));
  15376. this.n43 = (this.getChild("n43"));
  15377. this.n44 = (this.getChild("n44"));
  15378. }
  15379. }
  15380. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15381. class ui_Component26 extends fgui.GButton {
  15382. static createInstance() {
  15383. return (fgui.UIPackage.createObject("game", "Component26"));
  15384. }
  15385. onConstruct() {
  15386. this.n11 = (this.getChild("n11"));
  15387. this.n30 = (this.getChild("n30"));
  15388. this.n34 = (this.getChild("n34"));
  15389. }
  15390. }
  15391. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15392. class ui_Component28 extends fgui.GButton {
  15393. static createInstance() {
  15394. return (fgui.UIPackage.createObject("game", "Component28"));
  15395. }
  15396. onConstruct() {
  15397. this.n12 = (this.getChild("n12"));
  15398. this.n31 = (this.getChild("n31"));
  15399. this.curTxt = (this.getChild("curTxt"));
  15400. this.n33 = (this.getChild("n33"));
  15401. }
  15402. }
  15403. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15404. class ui_Component1302 extends fgui.GComponent {
  15405. static createInstance() {
  15406. return (fgui.UIPackage.createObject("game", "Component1302"));
  15407. }
  15408. onConstruct() {
  15409. this.n2 = (this.getChild("n2"));
  15410. this.n3 = (this.getChild("n3"));
  15411. }
  15412. }
  15413. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15414. class ui_Component113 extends fgui.GComponent {
  15415. static createInstance() {
  15416. return (fgui.UIPackage.createObject("game", "Component113"));
  15417. }
  15418. onConstruct() {
  15419. this.n85 = (this.getChild("n85"));
  15420. this.n86 = (this.getChild("n86"));
  15421. this.n77 = (this.getChild("n77"));
  15422. this.n79 = (this.getChild("n79"));
  15423. this.n80 = (this.getChild("n80"));
  15424. this.n81 = (this.getChild("n81"));
  15425. this.n82 = (this.getChild("n82"));
  15426. this.n84 = (this.getChild("n84"));
  15427. this.n87 = (this.getChild("n87"));
  15428. this.t0 = this.getTransition("t0");
  15429. }
  15430. }
  15431. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15432. class ui_Component114 extends fgui.GComponent {
  15433. static createInstance() {
  15434. return (fgui.UIPackage.createObject("game", "Component114"));
  15435. }
  15436. onConstruct() {
  15437. this.n77 = (this.getChild("n77"));
  15438. this.t0 = this.getTransition("t0");
  15439. }
  15440. }
  15441. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15442. class ui_Component115 extends fgui.GComponent {
  15443. static createInstance() {
  15444. return (fgui.UIPackage.createObject("game", "Component115"));
  15445. }
  15446. onConstruct() {
  15447. this.n83 = (this.getChild("n83"));
  15448. this.fingerNode = (this.getChild("fingerNode"));
  15449. this.n84 = (this.getChild("n84"));
  15450. }
  15451. }
  15452. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15453. class ui_Component117 extends fgui.GComponent {
  15454. static createInstance() {
  15455. return (fgui.UIPackage.createObject("game", "Component117"));
  15456. }
  15457. onConstruct() {
  15458. this.n87 = (this.getChild("n87"));
  15459. this.n88 = (this.getChild("n88"));
  15460. this.n84 = (this.getChild("n84"));
  15461. this.n85 = (this.getChild("n85"));
  15462. this.n86 = (this.getChild("n86"));
  15463. this.t0 = this.getTransition("t0");
  15464. }
  15465. }
  15466. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15467. class ui_Component98_1 extends fgui.GButton {
  15468. static createInstance() {
  15469. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15470. }
  15471. onConstruct() {
  15472. this.c1 = this.getController("c1");
  15473. this.n8 = (this.getChild("n8"));
  15474. this.n41 = (this.getChild("n41"));
  15475. this.n40 = (this.getChild("n40"));
  15476. }
  15477. }
  15478. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15479. class ui_Component61 extends fgui.GComponent {
  15480. static createInstance() {
  15481. return (fgui.UIPackage.createObject("game", "Component61"));
  15482. }
  15483. onConstruct() {
  15484. this.n14 = (this.getChild("n14"));
  15485. this.n6 = (this.getChild("n6"));
  15486. this.t0 = this.getTransition("t0");
  15487. }
  15488. }
  15489. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15490. class ui_Component62 extends fgui.GComponent {
  15491. static createInstance() {
  15492. return (fgui.UIPackage.createObject("game", "Component62"));
  15493. }
  15494. onConstruct() {
  15495. this.n66 = (this.getChild("n66"));
  15496. this.n56 = (this.getChild("n56"));
  15497. this.n63 = (this.getChild("n63"));
  15498. this.n65 = (this.getChild("n65"));
  15499. this.t0 = this.getTransition("t0");
  15500. }
  15501. }
  15502. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15503. class ui_d3Root extends fgui.GComponent {
  15504. static createInstance() {
  15505. return (fgui.UIPackage.createObject("game", "d3Root"));
  15506. }
  15507. onConstruct() {
  15508. }
  15509. }
  15510. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15511. class ui_d2Root extends fgui.GComponent {
  15512. static createInstance() {
  15513. return (fgui.UIPackage.createObject("game", "d2Root"));
  15514. }
  15515. onConstruct() {
  15516. }
  15517. }
  15518. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15519. class ui_ballNode extends fgui.GComponent {
  15520. static createInstance() {
  15521. return (fgui.UIPackage.createObject("game", "ballNode"));
  15522. }
  15523. onConstruct() {
  15524. }
  15525. }
  15526. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15527. class ui_border extends fgui.GComponent {
  15528. static createInstance() {
  15529. return (fgui.UIPackage.createObject("game", "border"));
  15530. }
  15531. onConstruct() {
  15532. this.bar1 = (this.getChild("bar1"));
  15533. this.bar2 = (this.getChild("bar2"));
  15534. this.bar3 = (this.getChild("bar3"));
  15535. this.bar4 = (this.getChild("bar4"));
  15536. this.bar5 = (this.getChild("bar5"));
  15537. this.bar6 = (this.getChild("bar6"));
  15538. this.circle1 = (this.getChild("circle1"));
  15539. this.circle2 = (this.getChild("circle2"));
  15540. this.circle3 = (this.getChild("circle3"));
  15541. this.circle4 = (this.getChild("circle4"));
  15542. this.circle5 = (this.getChild("circle5"));
  15543. this.circle6 = (this.getChild("circle6"));
  15544. this.n28 = (this.getChild("n28"));
  15545. }
  15546. }
  15547. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15548. class ui_btn_buy extends fgui.GButton {
  15549. static createInstance() {
  15550. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15551. }
  15552. onConstruct() {
  15553. this.button = this.getController("button");
  15554. this.n0 = (this.getChild("n0"));
  15555. this.n1 = (this.getChild("n1"));
  15556. this.n2 = (this.getChild("n2"));
  15557. }
  15558. }
  15559. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15560. class ui_Component41_2 extends fgui.GComponent {
  15561. static createInstance() {
  15562. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15563. }
  15564. onConstruct() {
  15565. this.c1 = this.getController("c1");
  15566. this.n0 = (this.getChild("n0"));
  15567. this.n2 = (this.getChild("n2"));
  15568. this.n19 = (this.getChild("n19"));
  15569. this.cancelBtn = (this.getChild("cancelBtn"));
  15570. this.videoBtn = (this.getChild("videoBtn"));
  15571. this.n9 = (this.getChild("n9"));
  15572. this.n22 = (this.getChild("n22"));
  15573. this.tipsTxt = (this.getChild("tipsTxt"));
  15574. this.n23 = (this.getChild("n23"));
  15575. this.n24 = (this.getChild("n24"));
  15576. this.n26 = (this.getChild("n26"));
  15577. this.n27 = (this.getChild("n27"));
  15578. this.titleTxt = (this.getChild("titleTxt"));
  15579. }
  15580. }
  15581. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15582. class ui_Component41_1 extends fgui.GComponent {
  15583. static createInstance() {
  15584. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15585. }
  15586. onConstruct() {
  15587. this.c1 = this.getController("c1");
  15588. this.n0 = (this.getChild("n0"));
  15589. this.n2 = (this.getChild("n2"));
  15590. this.cancelBtn = (this.getChild("cancelBtn"));
  15591. this.videoBtn = (this.getChild("videoBtn"));
  15592. this.n27 = (this.getChild("n27"));
  15593. this.n30 = (this.getChild("n30"));
  15594. this.n31 = (this.getChild("n31"));
  15595. this.n32 = (this.getChild("n32"));
  15596. this.n33 = (this.getChild("n33"));
  15597. this.n34 = (this.getChild("n34"));
  15598. this.n35 = (this.getChild("n35"));
  15599. this.n36 = (this.getChild("n36"));
  15600. this.n1 = (this.getChild("n1"));
  15601. this.n37 = (this.getChild("n37"));
  15602. this.t0 = this.getTransition("t0");
  15603. this.t1 = this.getTransition("t1");
  15604. this.t2 = this.getTransition("t2");
  15605. this.t3 = this.getTransition("t3");
  15606. }
  15607. }
  15608. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15609. class ui_againBtn extends fgui.GButton {
  15610. static createInstance() {
  15611. return (fgui.UIPackage.createObject("game", "againBtn"));
  15612. }
  15613. onConstruct() {
  15614. this.n2 = (this.getChild("n2"));
  15615. this.n1 = (this.getChild("n1"));
  15616. this.n5 = (this.getChild("n5"));
  15617. }
  15618. }
  15619. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15620. class ui_Component118 extends fgui.GButton {
  15621. static createInstance() {
  15622. return (fgui.UIPackage.createObject("game", "Component118"));
  15623. }
  15624. onConstruct() {
  15625. this.c1 = this.getController("c1");
  15626. this.n14 = (this.getChild("n14"));
  15627. this.n9 = (this.getChild("n9"));
  15628. this.n10 = (this.getChild("n10"));
  15629. this.diamondTxt = (this.getChild("diamondTxt"));
  15630. this.n13 = (this.getChild("n13"));
  15631. this.n15 = (this.getChild("n15"));
  15632. }
  15633. }
  15634. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15635. class ui_Component119 extends fgui.GComponent {
  15636. static createInstance() {
  15637. return (fgui.UIPackage.createObject("game", "Component119"));
  15638. }
  15639. onConstruct() {
  15640. this.n1 = (this.getChild("n1"));
  15641. this.n2 = (this.getChild("n2"));
  15642. this.n13 = (this.getChild("n13"));
  15643. this.n6 = (this.getChild("n6"));
  15644. this.screenNode = (this.getChild("screenNode"));
  15645. this.n15 = (this.getChild("n15"));
  15646. this.closeBtn = (this.getChild("closeBtn"));
  15647. this.share2Btn = (this.getChild("share2Btn"));
  15648. this.shareBtn = (this.getChild("shareBtn"));
  15649. this.tipsNode = (this.getChild("tipsNode"));
  15650. this.awardNode = (this.getChild("awardNode"));
  15651. }
  15652. }
  15653. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15654. class ui_daoJuDisplay extends fgui.GComponent {
  15655. static createInstance() {
  15656. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15657. }
  15658. onConstruct() {
  15659. this.n6 = (this.getChild("n6"));
  15660. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15661. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15662. this.btn_buy = (this.getChild("btn_buy"));
  15663. this.nameTxt = (this.getChild("nameTxt"));
  15664. this.zsImg = (this.getChild("zsImg"));
  15665. }
  15666. }
  15667. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15668. class ui_Component132_1 extends fgui.GComponent {
  15669. static createInstance() {
  15670. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15671. }
  15672. onConstruct() {
  15673. this.n25 = (this.getChild("n25"));
  15674. this.n26 = (this.getChild("n26"));
  15675. this.n27 = (this.getChild("n27"));
  15676. this.t0 = this.getTransition("t0");
  15677. }
  15678. }
  15679. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15680. class ui_Component_lc_challenge1 extends fgui.GComponent {
  15681. static createInstance() {
  15682. return (fgui.UIPackage.createObject("game", "Component_lc_challenge1"));
  15683. }
  15684. onConstruct() {
  15685. this.n0 = (this.getChild("n0"));
  15686. this.n1_bai = (this.getChild("n1_bai"));
  15687. }
  15688. }
  15689. ui_Component_lc_challenge1.URL = "ui://isxx5ak7um3xv5as";
  15690. class ui_Component_shou extends fgui.GComponent {
  15691. static createInstance() {
  15692. return (fgui.UIPackage.createObject("game", "Component_shou"));
  15693. }
  15694. onConstruct() {
  15695. this.n57 = (this.getChild("n57"));
  15696. this.n54 = (this.getChild("n54"));
  15697. this.n55 = (this.getChild("n55"));
  15698. this.n56 = (this.getChild("n56"));
  15699. this.t1 = this.getTransition("t1");
  15700. }
  15701. }
  15702. ui_Component_shou.URL = "ui://isxx5ak7um3xv5aw";
  15703. class ui_SecretaryDisplay extends fgui.GComponent {
  15704. static createInstance() {
  15705. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15706. }
  15707. onConstruct() {
  15708. this.n2 = (this.getChild("n2"));
  15709. this.levelTxt = (this.getChild("levelTxt"));
  15710. this.n4 = (this.getChild("n4"));
  15711. this.secretary = (this.getChild("secretary"));
  15712. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15713. this.n16 = (this.getChild("n16"));
  15714. this.n37 = (this.getChild("n37"));
  15715. this.n41 = (this.getChild("n41"));
  15716. this.n14 = (this.getChild("n14"));
  15717. this.n17 = (this.getChild("n17"));
  15718. this.heightTxt = (this.getChild("heightTxt"));
  15719. this.n46 = (this.getChild("n46"));
  15720. this.n36 = (this.getChild("n36"));
  15721. this.n38 = (this.getChild("n38"));
  15722. this.foodTxt = (this.getChild("foodTxt"));
  15723. this.n47 = (this.getChild("n47"));
  15724. this.n40 = (this.getChild("n40"));
  15725. this.n42 = (this.getChild("n42"));
  15726. this.historyTxt = (this.getChild("historyTxt"));
  15727. this.n48 = (this.getChild("n48"));
  15728. this.nameImg = (this.getChild("nameImg"));
  15729. this.n12 = (this.getChild("n12"));
  15730. this.n49 = (this.getChild("n49"));
  15731. this.t0 = this.getTransition("t0");
  15732. }
  15733. }
  15734. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15735. class ui_BallRodDisplay extends fgui.GComponent {
  15736. static createInstance() {
  15737. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15738. }
  15739. onConstruct() {
  15740. this.c1 = this.getController("c1");
  15741. this.n31 = (this.getChild("n31"));
  15742. this.n6 = (this.getChild("n6"));
  15743. this.nameTxt = (this.getChild("nameTxt"));
  15744. this.rodImg = (this.getChild("rodImg"));
  15745. this.eftRod = (this.getChild("eftRod"));
  15746. this.levelNode = (this.getChild("levelNode"));
  15747. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15748. }
  15749. }
  15750. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15751. class ui_Component111_11 extends fgui.GComponent {
  15752. static createInstance() {
  15753. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15754. }
  15755. onConstruct() {
  15756. this.n68 = (this.getChild("n68"));
  15757. this.n69 = (this.getChild("n69"));
  15758. }
  15759. }
  15760. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15761. class ui_Component112 extends fgui.GComponent {
  15762. static createInstance() {
  15763. return (fgui.UIPackage.createObject("game", "Component112"));
  15764. }
  15765. onConstruct() {
  15766. this.n68 = (this.getChild("n68"));
  15767. this.n70 = (this.getChild("n70"));
  15768. this.myMask = (this.getChild("myMask"));
  15769. }
  15770. }
  15771. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15772. class ui_Component111 extends fgui.GComponent {
  15773. static createInstance() {
  15774. return (fgui.UIPackage.createObject("game", "Component111"));
  15775. }
  15776. onConstruct() {
  15777. this.n68 = (this.getChild("n68"));
  15778. this.myMask = (this.getChild("myMask"));
  15779. }
  15780. }
  15781. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15782. class ui_Component144 extends fgui.GButton {
  15783. static createInstance() {
  15784. return (fgui.UIPackage.createObject("game", "Component144"));
  15785. }
  15786. onConstruct() {
  15787. this.n8 = (this.getChild("n8"));
  15788. }
  15789. }
  15790. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15791. class ui_Sign_com2 extends fgui.GComponent {
  15792. static createInstance() {
  15793. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15794. }
  15795. onConstruct() {
  15796. this.n0 = (this.getChild("n0"));
  15797. this.n1 = (this.getChild("n1"));
  15798. this.t0 = this.getTransition("t0");
  15799. }
  15800. }
  15801. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15802. class ui_Sign_guang extends fgui.GComponent {
  15803. static createInstance() {
  15804. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15805. }
  15806. onConstruct() {
  15807. this.n1 = (this.getChild("n1"));
  15808. this.n2 = (this.getChild("n2"));
  15809. this.n3 = (this.getChild("n3"));
  15810. this.n4 = (this.getChild("n4"));
  15811. this.n5 = (this.getChild("n5"));
  15812. this.n6 = (this.getChild("n6"));
  15813. this.n8 = (this.getChild("n8"));
  15814. }
  15815. }
  15816. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15817. class ui_SignMax extends fgui.GComponent {
  15818. static createInstance() {
  15819. return (fgui.UIPackage.createObject("game", "SignMax"));
  15820. }
  15821. onConstruct() {
  15822. this.c1 = this.getController("c1");
  15823. this.n7 = (this.getChild("n7"));
  15824. this.n15 = (this.getChild("n15"));
  15825. this.n8 = (this.getChild("n8"));
  15826. this.titleTxt = (this.getChild("titleTxt"));
  15827. this.myIcon1 = (this.getChild("myIcon1"));
  15828. this.numTxt1 = (this.getChild("numTxt1"));
  15829. this.myIcon2 = (this.getChild("myIcon2"));
  15830. this.n20 = (this.getChild("n20"));
  15831. this.n17 = (this.getChild("n17"));
  15832. this.numTxt2 = (this.getChild("numTxt2"));
  15833. this.n12 = (this.getChild("n12"));
  15834. this.n13 = (this.getChild("n13"));
  15835. this.n21 = (this.getChild("n21"));
  15836. this.n14 = (this.getChild("n14"));
  15837. }
  15838. }
  15839. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15840. class ui_Sign_com2_1 extends fgui.GComponent {
  15841. static createInstance() {
  15842. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15843. }
  15844. onConstruct() {
  15845. this.n0 = (this.getChild("n0"));
  15846. this.n1 = (this.getChild("n1"));
  15847. this.t0 = this.getTransition("t0");
  15848. }
  15849. }
  15850. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15851. class ui_Sign_com5 extends fgui.GComponent {
  15852. static createInstance() {
  15853. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15854. }
  15855. onConstruct() {
  15856. this.n3 = (this.getChild("n3"));
  15857. this.n29 = (this.getChild("n29"));
  15858. this.n4 = (this.getChild("n4"));
  15859. this.day1 = (this.getChild("day1"));
  15860. this.day2 = (this.getChild("day2"));
  15861. this.day3 = (this.getChild("day3"));
  15862. this.day4 = (this.getChild("day4"));
  15863. this.day5 = (this.getChild("day5"));
  15864. this.day6 = (this.getChild("day6"));
  15865. this.day7 = (this.getChild("day7"));
  15866. this.t0 = this.getTransition("t0");
  15867. }
  15868. }
  15869. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15870. class ui_Sign_com8 extends fgui.GComponent {
  15871. static createInstance() {
  15872. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15873. }
  15874. onConstruct() {
  15875. this.n48 = (this.getChild("n48"));
  15876. this.womanTxt = (this.getChild("womanTxt"));
  15877. this.t0 = this.getTransition("t0");
  15878. }
  15879. }
  15880. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15881. class ui_Sign_com6 extends fgui.GComponent {
  15882. static createInstance() {
  15883. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15884. }
  15885. onConstruct() {
  15886. this.n2 = (this.getChild("n2"));
  15887. this.n3 = (this.getChild("n3"));
  15888. this.t0 = this.getTransition("t0");
  15889. }
  15890. }
  15891. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15892. class ui_Sign_com7 extends fgui.GComponent {
  15893. static createInstance() {
  15894. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15895. }
  15896. onConstruct() {
  15897. this.n29 = (this.getChild("n29"));
  15898. this.n2 = (this.getChild("n2"));
  15899. }
  15900. }
  15901. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15902. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15903. static createInstance() {
  15904. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15905. }
  15906. onConstruct() {
  15907. this.n5 = (this.getChild("n5"));
  15908. this.n4 = (this.getChild("n4"));
  15909. this.t0 = this.getTransition("t0");
  15910. }
  15911. }
  15912. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15913. class ui_UITurntable_com2 extends fgui.GComponent {
  15914. static createInstance() {
  15915. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15916. }
  15917. onConstruct() {
  15918. this.c1 = this.getController("c1");
  15919. this.n4 = (this.getChild("n4"));
  15920. this.n6 = (this.getChild("n6"));
  15921. this.n10 = (this.getChild("n10"));
  15922. this.n11 = (this.getChild("n11"));
  15923. this.n12 = (this.getChild("n12"));
  15924. this.n13 = (this.getChild("n13"));
  15925. this.n14 = (this.getChild("n14"));
  15926. this.n15 = (this.getChild("n15"));
  15927. this.n16 = (this.getChild("n16"));
  15928. this.n17 = (this.getChild("n17"));
  15929. this.n18 = (this.getChild("n18"));
  15930. this.n19 = (this.getChild("n19"));
  15931. this.n20 = (this.getChild("n20"));
  15932. this.n21 = (this.getChild("n21"));
  15933. this.n22 = (this.getChild("n22"));
  15934. this.n23 = (this.getChild("n23"));
  15935. this.n24 = (this.getChild("n24"));
  15936. this.n25 = (this.getChild("n25"));
  15937. this.n26 = (this.getChild("n26"));
  15938. this.n27 = (this.getChild("n27"));
  15939. this.n28 = (this.getChild("n28"));
  15940. this.n29 = (this.getChild("n29"));
  15941. this.n30 = (this.getChild("n30"));
  15942. this.n31 = (this.getChild("n31"));
  15943. this.n32 = (this.getChild("n32"));
  15944. this.n33 = (this.getChild("n33"));
  15945. }
  15946. }
  15947. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15948. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15949. static createInstance() {
  15950. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15951. }
  15952. onConstruct() {
  15953. this.n5 = (this.getChild("n5"));
  15954. this.n4 = (this.getChild("n4"));
  15955. this.t0 = this.getTransition("t0");
  15956. }
  15957. }
  15958. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15959. class ui_UITurntable_com5 extends fgui.GComponent {
  15960. static createInstance() {
  15961. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15962. }
  15963. onConstruct() {
  15964. this.flashNode = (this.getChild("flashNode"));
  15965. this.rotNode = (this.getChild("rotNode"));
  15966. this.n3 = (this.getChild("n3"));
  15967. this.n21 = (this.getChild("n21"));
  15968. this.t0 = this.getTransition("t0");
  15969. }
  15970. }
  15971. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15972. class ui_UITurntable_com7 extends fgui.GComponent {
  15973. static createInstance() {
  15974. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15975. }
  15976. onConstruct() {
  15977. this.n2 = (this.getChild("n2"));
  15978. this.n35 = (this.getChild("n35"));
  15979. this.img1 = (this.getChild("img1"));
  15980. this.img2 = (this.getChild("img2"));
  15981. this.img3 = (this.getChild("img3"));
  15982. this.img4 = (this.getChild("img4"));
  15983. this.img6 = (this.getChild("img6"));
  15984. this.img5 = (this.getChild("img5"));
  15985. this.txt1 = (this.getChild("txt1"));
  15986. this.txt2 = (this.getChild("txt2"));
  15987. this.txt3 = (this.getChild("txt3"));
  15988. this.txt4 = (this.getChild("txt4"));
  15989. this.txt5 = (this.getChild("txt5"));
  15990. this.txt6 = (this.getChild("txt6"));
  15991. }
  15992. }
  15993. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15994. class ui_UITurntable_com9 extends fgui.GComponent {
  15995. static createInstance() {
  15996. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15997. }
  15998. onConstruct() {
  15999. this.n38 = (this.getChild("n38"));
  16000. this.n39 = (this.getChild("n39"));
  16001. }
  16002. }
  16003. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16004. class ui_UITurntable_com10 extends fgui.GComponent {
  16005. static createInstance() {
  16006. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16007. }
  16008. onConstruct() {
  16009. this.n39 = (this.getChild("n39"));
  16010. this.n40 = (this.getChild("n40"));
  16011. this.t0 = this.getTransition("t0");
  16012. }
  16013. }
  16014. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16015. class ui_UITurntable_com11 extends fgui.GComponent {
  16016. static createInstance() {
  16017. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16018. }
  16019. onConstruct() {
  16020. this.n38 = (this.getChild("n38"));
  16021. this.n39 = (this.getChild("n39"));
  16022. this.n40 = (this.getChild("n40"));
  16023. this.t0 = this.getTransition("t0");
  16024. }
  16025. }
  16026. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16027. class ui_UITurntable_com12 extends fgui.GComponent {
  16028. static createInstance() {
  16029. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16030. }
  16031. onConstruct() {
  16032. this.n43 = (this.getChild("n43"));
  16033. this.barNode = (this.getChild("barNode"));
  16034. this.tipsTxt = (this.getChild("tipsTxt"));
  16035. this.n45 = (this.getChild("n45"));
  16036. this.boxBtn = (this.getChild("boxBtn"));
  16037. }
  16038. }
  16039. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16040. class ui_UITurntable_com1 extends fgui.GButton {
  16041. static createInstance() {
  16042. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16043. }
  16044. onConstruct() {
  16045. this.n41 = (this.getChild("n41"));
  16046. this.n42 = (this.getChild("n42"));
  16047. this.t0 = this.getTransition("t0");
  16048. }
  16049. }
  16050. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16051. class ui_UITurntable_com3 extends fgui.GComponent {
  16052. static createInstance() {
  16053. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16054. }
  16055. onConstruct() {
  16056. this.n48 = (this.getChild("n48"));
  16057. this.womanTxt = (this.getChild("womanTxt"));
  16058. this.t0 = this.getTransition("t0");
  16059. }
  16060. }
  16061. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16062. class ui_cancelBtn2 extends fgui.GButton {
  16063. static createInstance() {
  16064. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16065. }
  16066. onConstruct() {
  16067. this.c1 = this.getController("c1");
  16068. this.n0 = (this.getChild("n0"));
  16069. this.n1 = (this.getChild("n1"));
  16070. this.n2 = (this.getChild("n2"));
  16071. this.n3 = (this.getChild("n3"));
  16072. this.n4 = (this.getChild("n4"));
  16073. this.n5 = (this.getChild("n5"));
  16074. this.n6 = (this.getChild("n6"));
  16075. this.n7 = (this.getChild("n7"));
  16076. this.n8 = (this.getChild("n8"));
  16077. this.powerEft = (this.getChild("powerEft"));
  16078. }
  16079. }
  16080. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16081. class ui_shareBtn2 extends fgui.GButton {
  16082. static createInstance() {
  16083. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16084. }
  16085. onConstruct() {
  16086. this.c1 = this.getController("c1");
  16087. this.n2 = (this.getChild("n2"));
  16088. this.n24 = (this.getChild("n24"));
  16089. this.n1 = (this.getChild("n1"));
  16090. this.n3 = (this.getChild("n3"));
  16091. this.n23 = (this.getChild("n23"));
  16092. this.n4 = (this.getChild("n4"));
  16093. this.n5 = (this.getChild("n5"));
  16094. this.n6 = (this.getChild("n6"));
  16095. this.n20 = (this.getChild("n20"));
  16096. this.n21 = (this.getChild("n21"));
  16097. this.n22 = (this.getChild("n22"));
  16098. this.powerEft = (this.getChild("powerEft"));
  16099. }
  16100. }
  16101. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16102. class ui_UIMoney extends fgui.GComponent {
  16103. static createInstance() {
  16104. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16105. }
  16106. onConstruct() {
  16107. this.c1 = this.getController("c1");
  16108. this.n4 = (this.getChild("n4"));
  16109. this.coinImg = (this.getChild("coinImg"));
  16110. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16111. this.coinTxt = (this.getChild("coinTxt"));
  16112. this.n7 = (this.getChild("n7"));
  16113. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16114. this.diamondTxt = (this.getChild("diamondTxt"));
  16115. this.diamondImg = (this.getChild("diamondImg"));
  16116. this.n12 = (this.getChild("n12"));
  16117. this.powerImg = (this.getChild("powerImg"));
  16118. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16119. this.powerTxt = (this.getChild("powerTxt"));
  16120. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16121. }
  16122. }
  16123. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16124. class ui_backBtn extends fgui.GButton {
  16125. static createInstance() {
  16126. return (fgui.UIPackage.createObject("game", "backBtn"));
  16127. }
  16128. onConstruct() {
  16129. this.n0 = (this.getChild("n0"));
  16130. this.t0 = this.getTransition("t0");
  16131. this.t1 = this.getTransition("t1");
  16132. }
  16133. }
  16134. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16135. class ui_MoneyBtn extends fgui.GButton {
  16136. static createInstance() {
  16137. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16138. }
  16139. onConstruct() {
  16140. this.button = this.getController("button");
  16141. this.n0 = (this.getChild("n0"));
  16142. }
  16143. }
  16144. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16145. class ui_UIMoneyBtn extends fgui.GComponent {
  16146. static createInstance() {
  16147. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16148. }
  16149. onConstruct() {
  16150. this.n1 = (this.getChild("n1"));
  16151. this.closeBtn = (this.getChild("closeBtn"));
  16152. }
  16153. }
  16154. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16155. class ui_Component64 extends fgui.GComponent {
  16156. static createInstance() {
  16157. return (fgui.UIPackage.createObject("game", "Component64"));
  16158. }
  16159. onConstruct() {
  16160. this.n57 = (this.getChild("n57"));
  16161. this.n54 = (this.getChild("n54"));
  16162. this.n55 = (this.getChild("n55"));
  16163. this.n56 = (this.getChild("n56"));
  16164. this.t1 = this.getTransition("t1");
  16165. }
  16166. }
  16167. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16168. class ui_Component41_3 extends fgui.GComponent {
  16169. static createInstance() {
  16170. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16171. }
  16172. onConstruct() {
  16173. this.c1 = this.getController("c1");
  16174. this.n0 = (this.getChild("n0"));
  16175. this.n2 = (this.getChild("n2"));
  16176. this.cancelBtn = (this.getChild("cancelBtn"));
  16177. this.videoBtn = (this.getChild("videoBtn"));
  16178. this.n9 = (this.getChild("n9"));
  16179. this.n24 = (this.getChild("n24"));
  16180. this.n27 = (this.getChild("n27"));
  16181. this.titleTxt = (this.getChild("titleTxt"));
  16182. this.n28 = (this.getChild("n28"));
  16183. this.t0 = this.getTransition("t0");
  16184. }
  16185. }
  16186. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16187. class ui_dh_zs_4 extends fgui.GComponent {
  16188. static createInstance() {
  16189. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16190. }
  16191. onConstruct() {
  16192. this.n1 = (this.getChild("n1"));
  16193. this.n2 = (this.getChild("n2"));
  16194. this.n3 = (this.getChild("n3"));
  16195. this.n4 = (this.getChild("n4"));
  16196. this.n5 = (this.getChild("n5"));
  16197. this.n6 = (this.getChild("n6"));
  16198. this.n8 = (this.getChild("n8"));
  16199. this.t0 = this.getTransition("t0");
  16200. }
  16201. }
  16202. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16203. class ui_Component71_1 extends fgui.GButton {
  16204. static createInstance() {
  16205. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16206. }
  16207. onConstruct() {
  16208. this.n17 = (this.getChild("n17"));
  16209. this.t0 = this.getTransition("t0");
  16210. }
  16211. }
  16212. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16213. class ui_Component83 extends fgui.GComponent {
  16214. static createInstance() {
  16215. return (fgui.UIPackage.createObject("game", "Component83"));
  16216. }
  16217. onConstruct() {
  16218. this.c1 = this.getController("c1");
  16219. this.n17 = (this.getChild("n17"));
  16220. this.n19 = (this.getChild("n19"));
  16221. this.n20 = (this.getChild("n20"));
  16222. }
  16223. }
  16224. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16225. class ui_Component84 extends fgui.GComponent {
  16226. static createInstance() {
  16227. return (fgui.UIPackage.createObject("game", "Component84"));
  16228. }
  16229. onConstruct() {
  16230. this.c1 = this.getController("c1");
  16231. this.n4 = (this.getChild("n4"));
  16232. this.n22 = (this.getChild("n22"));
  16233. this.n23 = (this.getChild("n23"));
  16234. this.numTxt = (this.getChild("numTxt"));
  16235. this.n25 = (this.getChild("n25"));
  16236. this.n26 = (this.getChild("n26"));
  16237. }
  16238. }
  16239. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16240. class ui_Component84_1 extends fgui.GComponent {
  16241. static createInstance() {
  16242. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16243. }
  16244. onConstruct() {
  16245. this.c1 = this.getController("c1");
  16246. this.n4 = (this.getChild("n4"));
  16247. this.n22 = (this.getChild("n22"));
  16248. this.n23 = (this.getChild("n23"));
  16249. this.numTxt = (this.getChild("numTxt"));
  16250. this.n25 = (this.getChild("n25"));
  16251. this.n26 = (this.getChild("n26"));
  16252. }
  16253. }
  16254. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16255. class ui_Component85 extends fgui.GComponent {
  16256. static createInstance() {
  16257. return (fgui.UIPackage.createObject("game", "Component85"));
  16258. }
  16259. onConstruct() {
  16260. this.n1 = (this.getChild("n1"));
  16261. this.n6 = (this.getChild("n6"));
  16262. this.n2 = (this.getChild("n2"));
  16263. this.n3 = (this.getChild("n3"));
  16264. this.levelTxt = (this.getChild("levelTxt"));
  16265. this.n10 = (this.getChild("n10"));
  16266. this.n11 = (this.getChild("n11"));
  16267. this.n12 = (this.getChild("n12"));
  16268. this.n13 = (this.getChild("n13"));
  16269. this.n14 = (this.getChild("n14"));
  16270. this.modeNode = (this.getChild("modeNode"));
  16271. this.n18 = (this.getChild("n18"));
  16272. this.conditionTxt = (this.getChild("conditionTxt"));
  16273. this.diamondNode = (this.getChild("diamondNode"));
  16274. this.coinNode = (this.getChild("coinNode"));
  16275. this.startBtn = (this.getChild("startBtn"));
  16276. this.n28 = (this.getChild("n28"));
  16277. this.displayRoot = (this.getChild("displayRoot"));
  16278. this.t0 = this.getTransition("t0");
  16279. }
  16280. }
  16281. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16282. class ui_Component86 extends fgui.GButton {
  16283. static createInstance() {
  16284. return (fgui.UIPackage.createObject("game", "Component86"));
  16285. }
  16286. onConstruct() {
  16287. this.n15 = (this.getChild("n15"));
  16288. this.t0 = this.getTransition("t0");
  16289. }
  16290. }
  16291. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16292. class ui_Component87 extends fgui.GComponent {
  16293. static createInstance() {
  16294. return (fgui.UIPackage.createObject("game", "Component87"));
  16295. }
  16296. onConstruct() {
  16297. this.n66 = (this.getChild("n66"));
  16298. this.myProgress = (this.getChild("myProgress"));
  16299. this.starAni = (this.getChild("starAni"));
  16300. this.hpTxt = (this.getChild("hpTxt"));
  16301. this.n74 = (this.getChild("n74"));
  16302. this.n73 = (this.getChild("n73"));
  16303. this.ballTxt = (this.getChild("ballTxt"));
  16304. this.n76 = (this.getChild("n76"));
  16305. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16306. this.levelTxt = (this.getChild("levelTxt"));
  16307. this.star1 = (this.getChild("star1"));
  16308. this.star2 = (this.getChild("star2"));
  16309. this.star3 = (this.getChild("star3"));
  16310. }
  16311. }
  16312. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16313. class ui_Component88 extends fgui.GProgressBar {
  16314. static createInstance() {
  16315. return (fgui.UIPackage.createObject("game", "Component88"));
  16316. }
  16317. onConstruct() {
  16318. this.n68 = (this.getChild("n68"));
  16319. this.bar = (this.getChild("bar"));
  16320. }
  16321. }
  16322. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16323. class ui_Component89 extends fgui.GComponent {
  16324. static createInstance() {
  16325. return (fgui.UIPackage.createObject("game", "Component89"));
  16326. }
  16327. onConstruct() {
  16328. this.c1 = this.getController("c1");
  16329. this.n71 = (this.getChild("n71"));
  16330. this.n72 = (this.getChild("n72"));
  16331. }
  16332. }
  16333. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16334. class ui_Component90 extends fgui.GComponent {
  16335. static createInstance() {
  16336. return (fgui.UIPackage.createObject("game", "Component90"));
  16337. }
  16338. onConstruct() {
  16339. this.c1 = this.getController("c1");
  16340. this.n64 = (this.getChild("n64"));
  16341. this.n65 = (this.getChild("n65"));
  16342. this.n66 = (this.getChild("n66"));
  16343. this.t0 = this.getTransition("t0");
  16344. }
  16345. }
  16346. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16347. class ui_Component127 extends fgui.GButton {
  16348. static createInstance() {
  16349. return (fgui.UIPackage.createObject("game", "Component127"));
  16350. }
  16351. onConstruct() {
  16352. this.n5 = (this.getChild("n5"));
  16353. }
  16354. }
  16355. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16356. class gameBinder {
  16357. static bindAll() {
  16358. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16359. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16360. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16361. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16362. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16363. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16364. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16365. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16366. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16367. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16368. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16369. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16370. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16371. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16372. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16373. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16374. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16375. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16376. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16377. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16378. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16379. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16380. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16381. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16382. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16383. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16384. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16385. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16386. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16387. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16388. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16389. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16390. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16391. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16392. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16393. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16394. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16395. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16396. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16397. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16398. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16399. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16400. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16401. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16402. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16403. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16404. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16405. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16406. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16407. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16408. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16409. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16410. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16411. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16412. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16413. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16414. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16415. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16416. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16417. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16418. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16419. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16420. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16421. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16422. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16423. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16424. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16425. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16426. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16427. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16428. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16429. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16430. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16431. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16432. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16433. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16434. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16435. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16436. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16437. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16438. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16439. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16440. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16441. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16442. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16443. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16444. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16445. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16446. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16447. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16448. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16449. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16450. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16451. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16452. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16453. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16454. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16455. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16456. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16457. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16458. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16459. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16460. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16461. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16462. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16463. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16464. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16465. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16466. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16467. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16468. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16469. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16470. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16471. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16472. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16473. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16474. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16475. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16476. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16477. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16478. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16479. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16480. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16481. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16482. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16483. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16484. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16485. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16486. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16487. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16488. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16489. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16490. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16491. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16492. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16493. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16494. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16495. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16496. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16497. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16498. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16499. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16500. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16501. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16502. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16503. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16504. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16505. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16506. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16507. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16508. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16509. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16510. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16511. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16512. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16513. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16514. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16515. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16516. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16517. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16518. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16519. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16520. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16521. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16522. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16523. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16524. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16525. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16526. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16527. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16528. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16529. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16530. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16531. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16532. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16533. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16534. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16535. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16536. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16537. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16538. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16539. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16540. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16541. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16542. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16543. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16544. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16545. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16546. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16547. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16548. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16549. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16550. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16551. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16552. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16553. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16554. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16555. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16556. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16557. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16558. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16559. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16560. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16561. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16562. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16563. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16564. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16565. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16566. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16567. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16568. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16569. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16570. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16571. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16572. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16573. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16574. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16575. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16576. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16577. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16578. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16579. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16580. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16581. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16582. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16583. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16584. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16585. fgui.UIObjectFactory.setExtension(ui_Component_lc_challenge1.URL, ui_Component_lc_challenge1);
  16586. fgui.UIObjectFactory.setExtension(ui_Component_shou.URL, ui_Component_shou);
  16587. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16588. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16589. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16590. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16591. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16592. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16593. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16594. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16595. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16596. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16597. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16598. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16599. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16600. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16601. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16602. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16603. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16604. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16605. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16606. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16607. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16608. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16609. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16610. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16611. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16612. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16613. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16614. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16615. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16616. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16617. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16618. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16619. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16620. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16621. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16622. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16623. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16624. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16625. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16626. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16627. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16628. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16629. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16630. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16631. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16632. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16633. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16634. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16635. }
  16636. }
  16637. class ui_btn6 extends fgui.GButton {
  16638. static createInstance() {
  16639. return (fgui.UIPackage.createObject("loading", "btn6"));
  16640. }
  16641. onConstruct() {
  16642. this.n6 = (this.getChild("n6"));
  16643. this.n1 = (this.getChild("n1"));
  16644. }
  16645. }
  16646. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16647. class ui_xyItem extends fgui.GComponent {
  16648. static createInstance() {
  16649. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16650. }
  16651. onConstruct() {
  16652. this.xyItem = (this.getChild("xyItem"));
  16653. }
  16654. }
  16655. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16656. class ui_loadinfo extends fgui.GProgressBar {
  16657. static createInstance() {
  16658. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16659. }
  16660. onConstruct() {
  16661. this.bg = (this.getChild("bg"));
  16662. this.bar = (this.getChild("bar"));
  16663. this.title = (this.getChild("title"));
  16664. this.ani = (this.getChild("ani"));
  16665. }
  16666. }
  16667. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16668. class ui_xyNode extends fgui.GComponent {
  16669. static createInstance() {
  16670. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16671. }
  16672. onConstruct() {
  16673. this.n0 = (this.getChild("n0"));
  16674. this.btnYes = (this.getChild("btnYes"));
  16675. this.btnNo = (this.getChild("btnNo"));
  16676. this.btnKnown = (this.getChild("btnKnown"));
  16677. this.btnSure = (this.getChild("btnSure"));
  16678. this.txtWelcom = (this.getChild("txtWelcom"));
  16679. this.txtXy = (this.getChild("txtXy"));
  16680. this.n75 = (this.getChild("n75"));
  16681. this.btnXy1 = (this.getChild("btnXy1"));
  16682. this.btnXy3 = (this.getChild("btnXy3"));
  16683. this.btnXy2 = (this.getChild("btnXy2"));
  16684. this.n74 = (this.getChild("n74"));
  16685. this.xy1 = (this.getChild("xy1"));
  16686. this.txtTitle = (this.getChild("txtTitle"));
  16687. this.btnBack = (this.getChild("btnBack"));
  16688. this.xyList = (this.getChild("xyList"));
  16689. this.xy2 = (this.getChild("xy2"));
  16690. this.xyNode = (this.getChild("xyNode"));
  16691. }
  16692. }
  16693. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16694. class ui_ageNode extends fgui.GComponent {
  16695. static createInstance() {
  16696. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16697. }
  16698. onConstruct() {
  16699. this.n3 = (this.getChild("n3"));
  16700. this.n7 = (this.getChild("n7"));
  16701. this.n4 = (this.getChild("n4"));
  16702. this.btnAge = (this.getChild("btnAge"));
  16703. this.ageNode = (this.getChild("ageNode"));
  16704. }
  16705. }
  16706. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16707. class ui_rnNode extends fgui.GComponent {
  16708. static createInstance() {
  16709. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16710. }
  16711. onConstruct() {
  16712. this.n28 = (this.getChild("n28"));
  16713. this.n30 = (this.getChild("n30"));
  16714. this.n33 = (this.getChild("n33"));
  16715. this.rn1 = (this.getChild("rn1"));
  16716. this.n40 = (this.getChild("n40"));
  16717. this.n41 = (this.getChild("n41"));
  16718. this.rn3 = (this.getChild("rn3"));
  16719. this.n37 = (this.getChild("n37"));
  16720. this.n39 = (this.getChild("n39"));
  16721. this.rn2 = (this.getChild("rn2"));
  16722. this.n47 = (this.getChild("n47"));
  16723. this.n49 = (this.getChild("n49"));
  16724. this.n44 = (this.getChild("n44"));
  16725. this.inputCode = (this.getChild("inputCode"));
  16726. this.inputName = (this.getChild("inputName"));
  16727. this.n48 = (this.getChild("n48"));
  16728. this.n50 = (this.getChild("n50"));
  16729. this.rn4 = (this.getChild("rn4"));
  16730. this.btnCheck = (this.getChild("btnCheck"));
  16731. this.btnExit = (this.getChild("btnExit"));
  16732. this.btnDone = (this.getChild("btnDone"));
  16733. this.rnNode = (this.getChild("rnNode"));
  16734. }
  16735. }
  16736. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16737. class ui_tipNode extends fgui.GComponent {
  16738. static createInstance() {
  16739. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16740. }
  16741. onConstruct() {
  16742. this.bg = (this.getChild("bg"));
  16743. this.n55 = (this.getChild("n55"));
  16744. this.n56 = (this.getChild("n56"));
  16745. this.tipNode = (this.getChild("tipNode"));
  16746. }
  16747. }
  16748. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16749. class ui_fcmNode extends fgui.GComponent {
  16750. static createInstance() {
  16751. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16752. }
  16753. onConstruct() {
  16754. this.n63 = (this.getChild("n63"));
  16755. this.n62 = (this.getChild("n62"));
  16756. this.btnRn = (this.getChild("btnRn"));
  16757. this.n61 = (this.getChild("n61"));
  16758. this.n58 = (this.getChild("n58"));
  16759. this.fcmNode = (this.getChild("fcmNode"));
  16760. }
  16761. }
  16762. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16763. class ui_msgNode extends fgui.GComponent {
  16764. static createInstance() {
  16765. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16766. }
  16767. onConstruct() {
  16768. this.n69 = (this.getChild("n69"));
  16769. this.txtMsg = (this.getChild("txtMsg"));
  16770. this.msgNode = (this.getChild("msgNode"));
  16771. }
  16772. }
  16773. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16774. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16775. static createInstance() {
  16776. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16777. }
  16778. onConstruct() {
  16779. this.n1 = (this.getChild("n1"));
  16780. this.n13 = (this.getChild("n13"));
  16781. this.n14 = (this.getChild("n14"));
  16782. this.n15 = (this.getChild("n15"));
  16783. this.n3 = (this.getChild("n3"));
  16784. this.n4 = (this.getChild("n4"));
  16785. this.n5 = (this.getChild("n5"));
  16786. this.n6 = (this.getChild("n6"));
  16787. this.n7 = (this.getChild("n7"));
  16788. this.n8 = (this.getChild("n8"));
  16789. this.n9 = (this.getChild("n9"));
  16790. this.n10 = (this.getChild("n10"));
  16791. this.n12 = (this.getChild("n12"));
  16792. this.n11 = (this.getChild("n11"));
  16793. this.n16 = (this.getChild("n16"));
  16794. this.n17 = (this.getChild("n17"));
  16795. this.n18 = (this.getChild("n18"));
  16796. this.n20 = (this.getChild("n20"));
  16797. this.n21 = (this.getChild("n21"));
  16798. this.t0 = this.getTransition("t0");
  16799. }
  16800. }
  16801. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16802. class ui_btn5 extends fgui.GButton {
  16803. static createInstance() {
  16804. return (fgui.UIPackage.createObject("loading", "btn5"));
  16805. }
  16806. onConstruct() {
  16807. this.n9 = (this.getChild("n9"));
  16808. this.n1 = (this.getChild("n1"));
  16809. }
  16810. }
  16811. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16812. class ui_UILoading extends fgui.GComponent {
  16813. static createInstance() {
  16814. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16815. }
  16816. onConstruct() {
  16817. this.n12 = (this.getChild("n12"));
  16818. this.loadinfo = (this.getChild("loadinfo"));
  16819. this.n13 = (this.getChild("n13"));
  16820. this.txtLoad = (this.getChild("txtLoad"));
  16821. this.n18 = (this.getChild("n18"));
  16822. }
  16823. }
  16824. ui_UILoading.URL = "ui://37nctnhwphc33";
  16825. class ui_AgeItem extends fgui.GComponent {
  16826. static createInstance() {
  16827. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16828. }
  16829. onConstruct() {
  16830. this.txtAge = (this.getChild("txtAge"));
  16831. }
  16832. }
  16833. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16834. class ui_btn1 extends fgui.GButton {
  16835. static createInstance() {
  16836. return (fgui.UIPackage.createObject("loading", "btn1"));
  16837. }
  16838. onConstruct() {
  16839. this.n6 = (this.getChild("n6"));
  16840. this.n1 = (this.getChild("n1"));
  16841. }
  16842. }
  16843. ui_btn1.URL = "ui://37nctnhwxe622p";
  16844. class ui_btn3 extends fgui.GButton {
  16845. static createInstance() {
  16846. return (fgui.UIPackage.createObject("loading", "btn3"));
  16847. }
  16848. onConstruct() {
  16849. this.n9 = (this.getChild("n9"));
  16850. this.n1 = (this.getChild("n1"));
  16851. }
  16852. }
  16853. ui_btn3.URL = "ui://37nctnhwxe622s";
  16854. class ui_btn2 extends fgui.GButton {
  16855. static createInstance() {
  16856. return (fgui.UIPackage.createObject("loading", "btn2"));
  16857. }
  16858. onConstruct() {
  16859. this.n6 = (this.getChild("n6"));
  16860. this.n1 = (this.getChild("n1"));
  16861. }
  16862. }
  16863. ui_btn2.URL = "ui://37nctnhwxe622t";
  16864. class ui_btnBack extends fgui.GButton {
  16865. static createInstance() {
  16866. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16867. }
  16868. onConstruct() {
  16869. this.n6 = (this.getChild("n6"));
  16870. this.n7 = (this.getChild("n7"));
  16871. }
  16872. }
  16873. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16874. class ui_btnXy1 extends fgui.GButton {
  16875. static createInstance() {
  16876. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16877. }
  16878. onConstruct() {
  16879. this.n1 = (this.getChild("n1"));
  16880. }
  16881. }
  16882. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16883. class ui_btnXy2 extends fgui.GButton {
  16884. static createInstance() {
  16885. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16886. }
  16887. onConstruct() {
  16888. this.n1 = (this.getChild("n1"));
  16889. }
  16890. }
  16891. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16892. class ui_btnXy3 extends fgui.GButton {
  16893. static createInstance() {
  16894. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16895. }
  16896. onConstruct() {
  16897. this.n1 = (this.getChild("n1"));
  16898. }
  16899. }
  16900. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16901. class ui_btn4 extends fgui.GButton {
  16902. static createInstance() {
  16903. return (fgui.UIPackage.createObject("loading", "btn4"));
  16904. }
  16905. onConstruct() {
  16906. this.n9 = (this.getChild("n9"));
  16907. this.n1 = (this.getChild("n1"));
  16908. }
  16909. }
  16910. ui_btn4.URL = "ui://37nctnhwxe622z";
  16911. class loadingBinder {
  16912. static bindAll() {
  16913. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16914. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16915. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16916. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16917. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16918. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16919. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16920. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16921. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16922. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16923. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16924. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16925. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16926. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16927. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16928. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16929. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16930. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16931. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16932. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16933. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16934. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16935. }
  16936. }
  16937. class UIMgr {
  16938. constructor() {
  16939. this._stage = null;
  16940. this._uiList = [];
  16941. this._showList = [];
  16942. this._bindPkgList = [];
  16943. this.uiIndex = 0;
  16944. }
  16945. static get inst() {
  16946. if (UIMgr._inst == null) {
  16947. UIMgr._inst = new UIMgr();
  16948. }
  16949. return UIMgr._inst;
  16950. }
  16951. setStage(s) {
  16952. if (this._stage) {
  16953. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16954. return;
  16955. }
  16956. this._stage = s;
  16957. }
  16958. clearTempData() {
  16959. console.log('zh:clearTempData start');
  16960. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16961. console.log('zh:clearTempData end');
  16962. }
  16963. init() {
  16964. this.setStage(Laya.stage);
  16965. fairygui.UIConfig.defaultFont = "arial";
  16966. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  16967. fairygui.UIConfig.packageFileExtension = "obj";
  16968. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16969. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16970. fairygui.GRoot.inst.width = Laya.stage.width;
  16971. fairygui.GRoot.inst.height = Laya.stage.height;
  16972. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16973. }
  16974. addAllUpdate() {
  16975. this.uiIndex = 0;
  16976. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16977. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16978. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16979. }
  16980. }
  16981. }
  16982. bindFUI(pkgname) {
  16983. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16984. return;
  16985. }
  16986. switch (pkgname) {
  16987. case fguiRes.loading:
  16988. fairygui.UIPackage.addPackage(pkgname);
  16989. loadingBinder.bindAll();
  16990. this._bindPkgList.push(pkgname);
  16991. break;
  16992. case fguiRes.game:
  16993. fairygui.UIPackage.addPackage(pkgname);
  16994. gameBinder.bindAll();
  16995. this._bindPkgList.push(pkgname);
  16996. break;
  16997. default:
  16998. break;
  16999. }
  17000. }
  17001. Show(cls, ...param) {
  17002. let nameStr = cls.uiName;
  17003. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17004. let temp = this._uiList[i];
  17005. let str = temp.className;
  17006. if (str == nameStr) {
  17007. if (temp.isMuti) {
  17008. if (temp.isHide) {
  17009. temp.show(...param);
  17010. this._uiList.splice(i, 1);
  17011. this._uiList.push(temp);
  17012. return temp;
  17013. }
  17014. }
  17015. else {
  17016. temp.show(...param);
  17017. this._uiList.splice(i, 1);
  17018. this._uiList.push(temp);
  17019. return temp;
  17020. }
  17021. }
  17022. }
  17023. let ui = new cls();
  17024. ui.className = nameStr;
  17025. this._showUI(ui, param);
  17026. return ui;
  17027. }
  17028. destroyUI(ui) {
  17029. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17030. let temp = this._uiList[i].className;
  17031. if (temp == ui.className) {
  17032. this._uiList.splice(i, 1);
  17033. break;
  17034. }
  17035. }
  17036. this.checkUIState();
  17037. }
  17038. _showUI(ui, param) {
  17039. this._uiList.push(ui);
  17040. ui.show(...param);
  17041. }
  17042. Hide(uiClass) {
  17043. let ui = this.getUI(uiClass);
  17044. if (ui && !ui.isHide) {
  17045. ui.hide();
  17046. }
  17047. }
  17048. getUI(ui) {
  17049. let nameStr = ui.uiName;
  17050. for (let index = 0; index < this._uiList.length; index++) {
  17051. let temp = this._uiList[index];
  17052. if (temp.className == nameStr) {
  17053. return temp;
  17054. }
  17055. }
  17056. return null;
  17057. }
  17058. isShow(cls) {
  17059. for (var i of this._uiList) {
  17060. if (i instanceof cls) {
  17061. return i.isShowing;
  17062. }
  17063. }
  17064. return false;
  17065. }
  17066. showUINum() {
  17067. let num = 0;
  17068. for (var i of this._uiList) {
  17069. if (i.isShowing) {
  17070. num++;
  17071. }
  17072. }
  17073. return num;
  17074. }
  17075. checkUIState() {
  17076. Laya.timer.clear(this, this._uiCheck);
  17077. Laya.timer.once(400, this, this._uiCheck);
  17078. }
  17079. _uiCheck() {
  17080. let showList = [];
  17081. for (var i of this._uiList) {
  17082. if (!i.isHide) {
  17083. showList.push(i);
  17084. }
  17085. }
  17086. for (let index = 0; index < showList.length; index++) {
  17087. if (index == showList.length - 1) {
  17088. showList[index].checkActive(true);
  17089. }
  17090. else {
  17091. showList[index].checkActive(false);
  17092. }
  17093. }
  17094. }
  17095. showTip(msg, time = 600, size = 30) {
  17096. }
  17097. }
  17098. class UIShowList {
  17099. }
  17100. class SoundMgr {
  17101. constructor() {
  17102. this.soundMax = 4;
  17103. this.isLoad = false;
  17104. this.soundMap = {};
  17105. this.isSound = true;
  17106. this.openShake = true;
  17107. SoundMgr._instance = this;
  17108. }
  17109. static getInstance() {
  17110. if (!this._instance) {
  17111. this._instance = new SoundMgr();
  17112. }
  17113. return this._instance;
  17114. }
  17115. init() {
  17116. console.log('zh:sm init 1');
  17117. Laya.SoundManager.autoReleaseSound = true;
  17118. Laya.SoundManager.autoStopMusic = true;
  17119. Laya.SoundManager.musicVolume = 0.3;
  17120. Laya.SoundManager.soundVolume = 0.5;
  17121. this.musicPlayed = false;
  17122. this.audioUrl = "asset/sound/ogg/";
  17123. console.log('zh:sm init 2');
  17124. console.log('zh:dev type ');
  17125. if (Laya.Browser.onAndroid) {
  17126. console.log('zh:dev type android');
  17127. this.audioUrl = "asset/sound/ogg/";
  17128. this.isLoad = true;
  17129. }
  17130. else {
  17131. console.log('zh:dev type not android');
  17132. this.audioUrl = "asset/sound/mp3/";
  17133. this.isLoad = true;
  17134. }
  17135. }
  17136. onSetting(isS) {
  17137. this.isSound = isS;
  17138. this.mute(!this.isSound);
  17139. }
  17140. clearCount() {
  17141. for (var key in this.soundMap) {
  17142. delete this.soundMap[key];
  17143. }
  17144. }
  17145. playMusic(path, loop = 0) {
  17146. console.log('zh:playMusic 1 PATH=' + path);
  17147. this.musicPath = path;
  17148. if (!this.isLoad) {
  17149. return;
  17150. }
  17151. if (!path || path == "") {
  17152. return;
  17153. }
  17154. if (!this.isSound) {
  17155. return;
  17156. }
  17157. this.musicPlayed = true;
  17158. let url = this.getUrl(path);
  17159. if (!Laya.Browser.onAndroid) {
  17160. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17161. this.play(url, loop);
  17162. }));
  17163. }
  17164. else {
  17165. this.play(url, loop);
  17166. }
  17167. }
  17168. play(url, loop) {
  17169. Laya.SoundManager.playMusic(url, loop);
  17170. }
  17171. getUrl(path) {
  17172. let url = this.audioUrl + path;
  17173. if (Laya.Browser.onAndroid) {
  17174. url += ".ogg";
  17175. }
  17176. else {
  17177. url += ".mp3";
  17178. }
  17179. return url;
  17180. }
  17181. pauseMusic(pause) {
  17182. if (pause) {
  17183. this.mute(true);
  17184. }
  17185. else if (this.isSound)
  17186. this.mute(false);
  17187. }
  17188. stopMusic() {
  17189. Laya.SoundManager.stopMusic();
  17190. if (Moyu.isNeedPlatAudio) {
  17191. Moyu.stopMusic();
  17192. }
  17193. }
  17194. mute(mute) {
  17195. if (Moyu.isNeedPlatAudio) {
  17196. Moyu.pauseMusic(mute);
  17197. }
  17198. else {
  17199. Laya.SoundManager.musicMuted = mute;
  17200. if (!mute && !this.musicPlayed && this.musicPath) {
  17201. this.playMusic(this.musicPath);
  17202. }
  17203. }
  17204. }
  17205. stopSound(path) {
  17206. let url = this.getUrl(path);
  17207. Laya.SoundManager.stopSound(url);
  17208. }
  17209. playSound(path, loop = 1, soundMax = this.soundMax) {
  17210. if (!this.isLoad)
  17211. return;
  17212. if (!this.isSound)
  17213. return;
  17214. if (!path || path == "")
  17215. return;
  17216. let url = this.getUrl(path);
  17217. if (Moyu.isNeedPlatAudio) {
  17218. Moyu.playSound(path, loop == 0);
  17219. }
  17220. else {
  17221. let count = 1;
  17222. if (this.soundMap[path])
  17223. count = this.soundMap[path] + 1;
  17224. if (count > soundMax)
  17225. return;
  17226. this.soundMap[path] = count;
  17227. Laya.SoundManager.playSound(url, loop);
  17228. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17229. }
  17230. }
  17231. removePath(path) {
  17232. if (this.soundMap[path]) {
  17233. let count = this.soundMap[path];
  17234. count--;
  17235. if (count < 1)
  17236. delete this.soundMap[path];
  17237. else
  17238. this.soundMap[path] = count;
  17239. }
  17240. }
  17241. playBtnSound() {
  17242. this.playSound("btn");
  17243. }
  17244. playGetSound() {
  17245. }
  17246. playCloseUISound() {
  17247. }
  17248. }
  17249. SoundMgr._instance = null;
  17250. var Handler$1 = Laya.Handler;
  17251. var EResType;
  17252. (function (EResType) {
  17253. EResType[EResType["none"] = 0] = "none";
  17254. EResType[EResType["nromal"] = 1] = "nromal";
  17255. EResType[EResType["td"] = 2] = "td";
  17256. EResType[EResType["sk"] = 3] = "sk";
  17257. })(EResType || (EResType = {}));
  17258. class CResLoader {
  17259. constructor(doneCall, proCall) {
  17260. this.completrCall = doneCall;
  17261. this.progressCall = proCall;
  17262. this.progressHander = new Handler$1(this, this.onProgress);
  17263. this.tdResMap = {};
  17264. }
  17265. load(resList) {
  17266. this.resCount = 0;
  17267. this.loadCount = 0;
  17268. for (let i = 0; i < resList.length; i++) {
  17269. let path = resList[i];
  17270. if (!path)
  17271. continue;
  17272. this.resCount++;
  17273. let type = this.getResType(path);
  17274. if (type == EResType.nromal)
  17275. this.loadNromal(path);
  17276. else if (type == EResType.td)
  17277. this.loadTd(path);
  17278. }
  17279. }
  17280. getRes(path) {
  17281. let type = this.getResType(path);
  17282. if (type == EResType.nromal)
  17283. return Laya.loader.getRes(path);
  17284. else if (type == EResType.td) {
  17285. let res = this.tdResMap[path];
  17286. if (res)
  17287. return res.clone();
  17288. return null;
  17289. }
  17290. }
  17291. destroy() {
  17292. this.progressHander.clear();
  17293. this.progressHander = null;
  17294. }
  17295. clearRes(path) {
  17296. let type = this.getResType(path);
  17297. if (type == EResType.nromal)
  17298. Laya.loader.clearRes(path);
  17299. else if (type == EResType.td) {
  17300. let obj = this.tdResMap[path];
  17301. if (obj)
  17302. obj.destroy();
  17303. delete this.tdResMap[path];
  17304. }
  17305. }
  17306. getResType(path) {
  17307. let exs = this.getExtension(path);
  17308. if (exs == "sk")
  17309. return EResType.sk;
  17310. if (exs == "ls" || exs == "lh" || exs == "lm")
  17311. return EResType.td;
  17312. else
  17313. return EResType.nromal;
  17314. }
  17315. getExtension(res) {
  17316. var index = res.lastIndexOf(".");
  17317. return res.substr(index + 1);
  17318. }
  17319. loadNromal(path) {
  17320. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17321. if (res) {
  17322. this.onLoad();
  17323. }
  17324. else
  17325. console.log("load res fail:" + path);
  17326. }), this.progressHander);
  17327. }
  17328. loadSk() {
  17329. }
  17330. loadTd(path) {
  17331. if (this.tdResMap[path]) {
  17332. this.onLoad();
  17333. return;
  17334. }
  17335. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17336. if (res) {
  17337. this.tdResMap[path] = res;
  17338. this.onLoad();
  17339. }
  17340. else
  17341. console.log("load res fail:" + path);
  17342. }));
  17343. }
  17344. onLoad() {
  17345. this.loadCount++;
  17346. this.onProgress(1);
  17347. if (this.loadCount >= this.resCount) {
  17348. this.completrCall.run();
  17349. }
  17350. }
  17351. onProgress(pro) {
  17352. let progress = (this.loadCount + pro) / this.resCount;
  17353. this.progressCall.runWith(progress);
  17354. }
  17355. }
  17356. var Handler$2 = Laya.Handler;
  17357. class ResInfo {
  17358. constructor() {
  17359. this.index = 0;
  17360. }
  17361. }
  17362. class ResMgr {
  17363. constructor() {
  17364. this.resList = [];
  17365. this.doneList = [];
  17366. this.resMap = {};
  17367. this.currentLoad = null;
  17368. this.completeHandler = new Handler$2(this, this.onComplete);
  17369. this.progressHandler = new Handler$2(this, this.onProgress);
  17370. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17371. }
  17372. static getInstance() {
  17373. if (ResMgr._instance == null) {
  17374. ResMgr._instance = new ResMgr();
  17375. }
  17376. return ResMgr._instance;
  17377. }
  17378. loadList(list, completeHandler, progressHandler) {
  17379. if (list.length < 1) {
  17380. completeHandler.run();
  17381. return;
  17382. }
  17383. let info = this.getResInfo();
  17384. info.resList = list;
  17385. info.completeHandler = completeHandler;
  17386. info.progressHandler = progressHandler;
  17387. this.resList.push(info);
  17388. this.startLoad();
  17389. }
  17390. loadFguiRes(list, completeHandler, progressHandler) {
  17391. Laya.loader.load(list, completeHandler, progressHandler);
  17392. }
  17393. loadAny(list, completeHandler, progressHandler) {
  17394. Laya.loader.load(list, completeHandler, progressHandler);
  17395. }
  17396. load(path, completeHandler, progressHandler) {
  17397. let count = this.resMap[path];
  17398. if (count && count > 0) {
  17399. if (completeHandler)
  17400. completeHandler.run();
  17401. }
  17402. else
  17403. this.loadList([path], completeHandler, progressHandler);
  17404. }
  17405. getRes(path) {
  17406. let res = this.resMap[path];
  17407. if (!res)
  17408. this.showLog("资源不存在:" + path);
  17409. else
  17410. return this.loader.getRes(path);
  17411. }
  17412. clearList(list, force = false) {
  17413. if (!list || list.length < 1)
  17414. return;
  17415. let cr = () => {
  17416. for (const k in list) {
  17417. let v = list[k];
  17418. if (!v)
  17419. continue;
  17420. if (force) {
  17421. this.loader.clearRes(v);
  17422. delete this.resMap[v];
  17423. }
  17424. else {
  17425. let count = this.resMap[v];
  17426. if (count && count > 1) {
  17427. count--;
  17428. this.resMap[v] = count;
  17429. }
  17430. else {
  17431. this.loader.clearRes(v);
  17432. delete this.resMap[v];
  17433. }
  17434. }
  17435. }
  17436. if (!window.hasOwnProperty("ks"))
  17437. Laya.Resource.destroyUnusedResources();
  17438. };
  17439. Laya.timer.clearAll(this);
  17440. Laya.timer.once(2000, this, cr);
  17441. }
  17442. clear3D() {
  17443. for (const k in this.loader.tdResMap) {
  17444. this.loader.clearRes(k);
  17445. if (this.resMap[k])
  17446. delete this.resMap[k];
  17447. }
  17448. if (!window.hasOwnProperty("ks"))
  17449. Laya.Resource.destroyUnusedResources();
  17450. }
  17451. clear(path, force = false) {
  17452. this.clearList([path], force);
  17453. }
  17454. getResInfo() {
  17455. if (this.doneList.length > 0)
  17456. return this.doneList.pop();
  17457. else
  17458. return new ResInfo();
  17459. }
  17460. startLoad() {
  17461. if (this.currentLoad)
  17462. return;
  17463. this.currentLoad = this.resList.pop();
  17464. if (this.currentLoad) {
  17465. this.loader.load(this.currentLoad.resList);
  17466. }
  17467. }
  17468. onComplete() {
  17469. if (!this.currentLoad)
  17470. return;
  17471. for (const k in this.currentLoad.resList) {
  17472. let v = this.currentLoad.resList[k];
  17473. let count = this.resMap[v];
  17474. if (count)
  17475. count++;
  17476. else
  17477. count = 1;
  17478. this.resMap[v] = count;
  17479. }
  17480. if (this.currentLoad.completeHandler)
  17481. this.currentLoad.completeHandler.run();
  17482. this.doneList.push(this.currentLoad);
  17483. this.currentLoad = null;
  17484. this.startLoad();
  17485. }
  17486. onProgress(pro) {
  17487. if (!this.currentLoad)
  17488. return;
  17489. if (this.currentLoad.progressHandler)
  17490. this.currentLoad.progressHandler.runWith(pro);
  17491. }
  17492. showLog(str, ...args) {
  17493. console.log("[ResLoader] " + str);
  17494. }
  17495. }
  17496. ResMgr._instance = null;
  17497. class EventMgr extends Laya.EventDispatcher {
  17498. }
  17499. let eventMgr = new EventMgr();
  17500. /*! *****************************************************************************
  17501. Copyright (c) Microsoft Corporation. All rights reserved.
  17502. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17503. this file except in compliance with the License. You may obtain a copy of the
  17504. License at http://www.apache.org/licenses/LICENSE-2.0
  17505. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17506. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17507. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17508. MERCHANTABLITY OR NON-INFRINGEMENT.
  17509. See the Apache Version 2.0 License for specific language governing permissions
  17510. and limitations under the License.
  17511. ***************************************************************************** */
  17512. /* global Reflect, Promise */
  17513. var extendStatics = function(d, b) {
  17514. extendStatics = Object.setPrototypeOf ||
  17515. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17516. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17517. return extendStatics(d, b);
  17518. };
  17519. function __extends(d, b) {
  17520. extendStatics(d, b);
  17521. function __() { this.constructor = d; }
  17522. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17523. }
  17524. var __assign = function() {
  17525. __assign = Object.assign || function __assign(t) {
  17526. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17527. s = arguments[i];
  17528. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17529. }
  17530. return t;
  17531. };
  17532. return __assign.apply(this, arguments);
  17533. };
  17534. function __rest(s, e) {
  17535. var t = {};
  17536. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17537. t[p] = s[p];
  17538. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17539. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17540. t[p[i]] = s[p[i]];
  17541. return t;
  17542. }
  17543. function __decorate(decorators, target, key, desc) {
  17544. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17545. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17546. 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;
  17547. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17548. }
  17549. function __param(paramIndex, decorator) {
  17550. return function (target, key) { decorator(target, key, paramIndex); }
  17551. }
  17552. function __metadata(metadataKey, metadataValue) {
  17553. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17554. }
  17555. function __awaiter(thisArg, _arguments, P, generator) {
  17556. return new (P || (P = Promise))(function (resolve, reject) {
  17557. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17558. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17559. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17560. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17561. });
  17562. }
  17563. function __generator(thisArg, body) {
  17564. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17565. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17566. function verb(n) { return function (v) { return step([n, v]); }; }
  17567. function step(op) {
  17568. if (f) throw new TypeError("Generator is already executing.");
  17569. while (_) try {
  17570. 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;
  17571. if (y = 0, t) op = [op[0] & 2, t.value];
  17572. switch (op[0]) {
  17573. case 0: case 1: t = op; break;
  17574. case 4: _.label++; return { value: op[1], done: false };
  17575. case 5: _.label++; y = op[1]; op = [0]; continue;
  17576. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17577. default:
  17578. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17579. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17580. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17581. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17582. if (t[2]) _.ops.pop();
  17583. _.trys.pop(); continue;
  17584. }
  17585. op = body.call(thisArg, _);
  17586. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17587. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17588. }
  17589. }
  17590. function __exportStar(m, exports) {
  17591. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17592. }
  17593. function __values(o) {
  17594. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17595. if (m) return m.call(o);
  17596. return {
  17597. next: function () {
  17598. if (o && i >= o.length) o = void 0;
  17599. return { value: o && o[i++], done: !o };
  17600. }
  17601. };
  17602. }
  17603. function __read(o, n) {
  17604. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17605. if (!m) return o;
  17606. var i = m.call(o), r, ar = [], e;
  17607. try {
  17608. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17609. }
  17610. catch (error) { e = { error: error }; }
  17611. finally {
  17612. try {
  17613. if (r && !r.done && (m = i["return"])) m.call(i);
  17614. }
  17615. finally { if (e) throw e.error; }
  17616. }
  17617. return ar;
  17618. }
  17619. function __spread() {
  17620. for (var ar = [], i = 0; i < arguments.length; i++)
  17621. ar = ar.concat(__read(arguments[i]));
  17622. return ar;
  17623. }
  17624. function __await(v) {
  17625. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17626. }
  17627. function __asyncGenerator(thisArg, _arguments, generator) {
  17628. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17629. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17630. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17631. 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); }); }; }
  17632. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17633. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17634. function fulfill(value) { resume("next", value); }
  17635. function reject(value) { resume("throw", value); }
  17636. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17637. }
  17638. function __asyncDelegator(o) {
  17639. var i, p;
  17640. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17641. 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; }
  17642. }
  17643. function __asyncValues(o) {
  17644. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17645. var m = o[Symbol.asyncIterator], i;
  17646. 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);
  17647. 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); }); }; }
  17648. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17649. }
  17650. function __makeTemplateObject(cooked, raw) {
  17651. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17652. return cooked;
  17653. };
  17654. function __importStar(mod) {
  17655. if (mod && mod.__esModule) return mod;
  17656. var result = {};
  17657. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17658. result.default = mod;
  17659. return result;
  17660. }
  17661. function __importDefault(mod) {
  17662. return (mod && mod.__esModule) ? mod : { default: mod };
  17663. }
  17664. class CustomAlert {
  17665. static show(title, content, buttons) {
  17666. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17667. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17668. return;
  17669. }
  17670. const bg = new Laya.Box();
  17671. bg.alpha = 0;
  17672. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17673. Laya.stage.addChild(bg);
  17674. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17675. const panel = new Laya.Box();
  17676. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17677. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17678. bg.addChild(panel);
  17679. const titleText = new Laya.Text();
  17680. titleText.text = title;
  17681. titleText.fontSize = 32;
  17682. titleText.color = "#333333";
  17683. titleText.bold = true;
  17684. titleText.pos(20, 20);
  17685. titleText.width = 360;
  17686. titleText.align = "center";
  17687. panel.addChild(titleText);
  17688. const contentText = new Laya.Text();
  17689. contentText.text = content;
  17690. contentText.fontSize = 21;
  17691. contentText.color = "#555555";
  17692. contentText.pos(20, 70);
  17693. contentText.width = 360;
  17694. contentText.wordWrap = true;
  17695. contentText.align = "center";
  17696. panel.addChild(contentText);
  17697. const buttonContainer = new Laya.Box();
  17698. buttonContainer.pos(20, 160);
  17699. panel.addChild(buttonContainer);
  17700. const btnWidth = 120;
  17701. const spacing = 30;
  17702. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17703. buttons.forEach((btn, index) => {
  17704. const button = new Laya.Button();
  17705. button.label = btn.label;
  17706. button.size(btnWidth, 40);
  17707. button.labelSize = 22;
  17708. button.pos(index * (btnWidth + spacing), 0);
  17709. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17710. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17711. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17712. button.alpha = 0.9;
  17713. });
  17714. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17715. button.alpha = 1;
  17716. });
  17717. button.on(Laya.Event.CLICK, this, () => {
  17718. btn.handler();
  17719. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17720. bg.removeSelf();
  17721. }));
  17722. });
  17723. buttonContainer.addChild(button);
  17724. });
  17725. buttonContainer.x = (panel.width - totalWidth) / 2;
  17726. }
  17727. }
  17728. class ConfigMgr {
  17729. constructor() {
  17730. this.httpReqCount = 4;
  17731. this.httpReqOkCount = 0;
  17732. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17733. try {
  17734. this.httpReqOkCount = 0;
  17735. let reqData = xGame.httpMgr.getReqData();
  17736. console.log('zh:第1个请求getClassicCfg');
  17737. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17738. this.classicCfg = classicCfg;
  17739. this.httpReqOkCount++;
  17740. console.log('zh:第2个请求getLevelCfg');
  17741. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17742. this.levelCfg = levelCfg;
  17743. this.httpReqOkCount++;
  17744. console.log('zh:第3个请求 getPlaceBallCfg');
  17745. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17746. this.placeBallCfg = placeBallCfg;
  17747. this.httpReqOkCount++;
  17748. console.log('zh:第4个请求 npc');
  17749. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17750. this.npcJson = npc.Data;
  17751. this.httpReqOkCount++;
  17752. console.log('zh:所有配置加载完成');
  17753. }
  17754. catch (error) {
  17755. console.error('zh:❌请求失败:', error);
  17756. Laya.timer.once(5000, this, () => {
  17757. let retryCount = 0;
  17758. const maxRetries = 3;
  17759. const tryFetchConfig = () => {
  17760. try {
  17761. xGame.cfgMgr.getConfigFromServer();
  17762. }
  17763. catch (error) {
  17764. if (retryCount < maxRetries) {
  17765. retryCount++;
  17766. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  17767. Laya.timer.once(5000, this, tryFetchConfig);
  17768. }
  17769. else {
  17770. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  17771. }
  17772. }
  17773. };
  17774. tryFetchConfig();
  17775. });
  17776. }
  17777. finally {
  17778. if (this.httpReqCount > this.httpReqOkCount) {
  17779. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  17780. label: "Okay", handler: () => {
  17781. JSBridgeUtils.instance.exitAndCloseGame();
  17782. }
  17783. }]);
  17784. }
  17785. }
  17786. });
  17787. this.sendPostAsync = (action, reqData) => {
  17788. return new Promise((resolve, reject) => {
  17789. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17790. try {
  17791. let code = res.code;
  17792. if (code == 200) {
  17793. const parsedData = JSON.parse(res.msg);
  17794. resolve(parsedData);
  17795. }
  17796. else {
  17797. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17798. reject(new Error(`Request failed with code: ${code}`));
  17799. }
  17800. }
  17801. catch (error) {
  17802. console.error(`ERROR=${error}`);
  17803. alert("Please check your network connection.");
  17804. reject(error);
  17805. }
  17806. finally {
  17807. console.log(`zh:${action}的请求处理完毕`);
  17808. }
  17809. });
  17810. });
  17811. };
  17812. }
  17813. static getInstance() {
  17814. if (!this._instance) {
  17815. this._instance = new ConfigMgr();
  17816. }
  17817. return this._instance;
  17818. }
  17819. init() {
  17820. this.getConfigFromServer();
  17821. }
  17822. test() {
  17823. let reqData = xGame.httpMgr.getReqData();
  17824. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17825. console.log('zh:1s');
  17826. try {
  17827. let code = res.code;
  17828. let data = res.data;
  17829. if (code == 200) {
  17830. const parsedData = JSON.parse(data);
  17831. this.classicCfg = parsedData;
  17832. }
  17833. else {
  17834. console.log('zh:res = ' + JSON.stringify(res));
  17835. }
  17836. }
  17837. catch (error) {
  17838. console.log('error=' + error);
  17839. alert("Please check your network connection.");
  17840. }
  17841. finally {
  17842. console.log('zh:1');
  17843. }
  17844. });
  17845. }
  17846. getUserInfoByIndex(index) {
  17847. return this.npcJson[index];
  17848. }
  17849. getRandomUserInfo() {
  17850. let index = xGame.tools.random(0, this.npcJson.length);
  17851. let rs = this.npcJson[index];
  17852. return rs;
  17853. }
  17854. getMaxBigMoveLength() {
  17855. return Object.keys(this.levelCfg).length;
  17856. }
  17857. getBigMoveLevelByIndex(index) {
  17858. let cfg = this.levelCfg;
  17859. cfg = cfg[index];
  17860. return cfg;
  17861. }
  17862. getRandomClassicLevel() {
  17863. let cfg = this.classicCfg;
  17864. let num = Object.keys(cfg).length;
  17865. let rand = xGame.common.randomNum(1, num);
  17866. return cfg[rand];
  17867. }
  17868. getPlaceBallByLevel(level) {
  17869. return this.placeBallCfg[level];
  17870. }
  17871. getMaxPlaceBall() {
  17872. return Object.keys(this.placeBallCfg).length;
  17873. }
  17874. }
  17875. class PoolD3Mgr {
  17876. constructor() {
  17877. this.pool = {};
  17878. }
  17879. static get ins() {
  17880. return this._ins || (this._ins = new PoolD3Mgr);
  17881. }
  17882. createList(key, prefab, parent) {
  17883. if (!this.pool[key]) {
  17884. this.pool[key] = {};
  17885. this.pool[key].prefab = prefab;
  17886. this.pool[key].list = [];
  17887. this.pool[key].parent = parent;
  17888. }
  17889. }
  17890. getItem(key) {
  17891. if (!this.pool[key]) {
  17892. return;
  17893. }
  17894. let temp;
  17895. if (this.pool[key].list.length > 0) {
  17896. temp = this.pool[key].list.pop();
  17897. }
  17898. else {
  17899. temp = this.pool[key].prefab.clone();
  17900. if (this.pool[key].parent) {
  17901. this.pool[key].parent.addChild(temp);
  17902. }
  17903. }
  17904. temp.active = true;
  17905. return temp;
  17906. }
  17907. putItem(key, obj) {
  17908. if (!this.pool[key]) {
  17909. return;
  17910. }
  17911. obj.active = false;
  17912. this.pool[key].list.push(obj);
  17913. }
  17914. }
  17915. let context$1 = context;
  17916. let uiMgr = UIMgr.inst;
  17917. let soundMgr = SoundMgr.getInstance();
  17918. let resMgr = ResMgr.getInstance();
  17919. let httpMgr = HttpMgr.getInstance();
  17920. let common = Common.getInstance();
  17921. let cfgMgr = ConfigMgr.getInstance();
  17922. let poolD3Mgr = PoolD3Mgr.ins;
  17923. let d3TexUrl = "res/d3Res/";
  17924. let d3ModeUrl = "res/unityRes/";
  17925. function setStageSize(view) {
  17926. if (view.width) {
  17927. view.width = Laya.stage.width;
  17928. view.height = Laya.stage.height;
  17929. }
  17930. }
  17931. function filledBg(view) {
  17932. let wh = Laya.stage.height / Laya.stage.width;
  17933. if (wh > 16 / 9) {
  17934. view.height = Laya.stage.height;
  17935. view.width = Laya.stage.height / 1334 * 750;
  17936. }
  17937. else {
  17938. view.width = Laya.stage.width;
  17939. view.height = Laya.stage.width / 750 * 1334;
  17940. }
  17941. }
  17942. function setNotch(view) {
  17943. if (view.height) {
  17944. view.y += context$1.notchHeight;
  17945. }
  17946. }
  17947. function showTip(str) {
  17948. uiMgr.Show(UIMsg, str);
  17949. }
  17950. function log(...args) {
  17951. console.log(args);
  17952. }
  17953. let xGame = {
  17954. context: context$1,
  17955. eventMgr,
  17956. resMgr,
  17957. uiMgr,
  17958. soundMgr,
  17959. define,
  17960. tools,
  17961. httpMgr,
  17962. d3TexUrl,
  17963. d3ModeUrl,
  17964. common,
  17965. cfgMgr,
  17966. poolD3Mgr,
  17967. setStageSize,
  17968. filledBg,
  17969. setNotch,
  17970. showTip,
  17971. log,
  17972. };
  17973. window["xGame"] = xGame;
  17974. let dataName = 'tBall_';
  17975. class UserData {
  17976. constructor() {
  17977. this.userId = "";
  17978. this.isAgree = false;
  17979. this.coinNum = 0;
  17980. this.gemNum = 0;
  17981. this.sound = true;
  17982. this.vibration = true;
  17983. this.currentDate = 0;
  17984. this.createTime = 0;
  17985. this.awardTime = 0;
  17986. this.roleId = 1;
  17987. this.roleList = [];
  17988. this.roleAds = [];
  17989. this.dressId = 101;
  17990. this.itemId = 201;
  17991. this.bigSkills = [1, 1, 1, 1, 1];
  17992. this.coin = 4000;
  17993. this.diamond = 0;
  17994. this.skillSuccessTimes = 0;
  17995. this.skillGuide = 0;
  17996. this.skillAccTimes = 0;
  17997. this.placeBallData = [];
  17998. this.shareDiamondTimes = 0;
  17999. this.dailyVideoShareTimes = 0;
  18000. this.secretary = [1, 0];
  18001. this.curSecretary = 0;
  18002. this.ballRod = [1, 0, 0, 0, 0, 1];
  18003. this.curBallRod = 5;
  18004. this.signData = 0;
  18005. this.signTime = 0;
  18006. this.drawTimes = 0;
  18007. this.drawAwardTimes = 0;
  18008. this.dailyfreeDrawTimes = 1;
  18009. this.power = 5;
  18010. this.powerTime = 0;
  18011. this.challengeTimes = 0;
  18012. this.extraSign = 0;
  18013. this.classicTimes = 0;
  18014. this.guideHelpLine = 0;
  18015. this.newUser = true;
  18016. this.rootBallFoul = 0;
  18017. this.timeoutFoul = 0;
  18018. this.roleList = [1];
  18019. }
  18020. saveData() {
  18021. let data = {};
  18022. for (let k in this) {
  18023. data[k.toString()] = this[k];
  18024. }
  18025. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18026. }
  18027. getData() {
  18028. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18029. if (ld) {
  18030. let localData = JSON.parse(ld);
  18031. if (localData) {
  18032. for (let k in this) {
  18033. let key = k.toString();
  18034. let data = localData[key];
  18035. if (data != undefined) {
  18036. this[k] = data;
  18037. }
  18038. }
  18039. }
  18040. }
  18041. }
  18042. }
  18043. class ItemData {
  18044. constructor() {
  18045. this.itemList = {};
  18046. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18047. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18048. }
  18049. saveData() {
  18050. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18051. }
  18052. getData() {
  18053. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18054. if (ld) {
  18055. let localData = JSON.parse(ld);
  18056. if (localData) {
  18057. this.itemList = localData;
  18058. }
  18059. }
  18060. }
  18061. }
  18062. class GameData {
  18063. constructor() {
  18064. this.curLevel = 0;
  18065. this.gameType = 1;
  18066. this.signIdx = 0;
  18067. this.signMax = 0;
  18068. this.rotaryTime = 0;
  18069. this.rotaryCount = 0;
  18070. this.rotaryList = [];
  18071. this.diyCount = 3;
  18072. this.awardIdx = 0;
  18073. this.shareNum = 2;
  18074. this.rankWeek = 0;
  18075. this.rankScore = 0;
  18076. this.gameCount = 0;
  18077. this.trySkill = -1;
  18078. this.tryTime = 0;
  18079. }
  18080. saveData() {
  18081. let data = {};
  18082. for (let k in this) {
  18083. data[k.toString()] = this[k];
  18084. }
  18085. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18086. }
  18087. getData() {
  18088. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18089. if (ld) {
  18090. let localData = JSON.parse(ld);
  18091. if (localData) {
  18092. for (let k in this) {
  18093. let key = k.toString();
  18094. let data = localData[key];
  18095. if (data != undefined) {
  18096. this[k] = data;
  18097. }
  18098. }
  18099. }
  18100. }
  18101. }
  18102. }
  18103. class Diy2025GameData {
  18104. constructor() {
  18105. this.challengeMode_overLev = 0;
  18106. this.xszyForClassic = false;
  18107. this.xszyForChallenge = false;
  18108. }
  18109. saveData() {
  18110. let data = {};
  18111. for (let k in this) {
  18112. data[k.toString()] = this[k];
  18113. }
  18114. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18115. }
  18116. getData() {
  18117. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18118. if (ld) {
  18119. let localData = JSON.parse(ld);
  18120. if (localData) {
  18121. for (let k in this) {
  18122. let key = k.toString();
  18123. let data = localData[key];
  18124. if (data != undefined) {
  18125. this[k] = data;
  18126. }
  18127. }
  18128. }
  18129. }
  18130. }
  18131. }
  18132. class UIFuli1 extends UIBase {
  18133. constructor() {
  18134. super();
  18135. this.jiage = 4.99;
  18136. }
  18137. onConstructor() {
  18138. this.ui = ui_UIFuli1.createInstance();
  18139. this.contentPane = this.ui;
  18140. this.isEject = false;
  18141. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18142. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18143. }
  18144. show() {
  18145. super.show();
  18146. this.x = (Laya.stage.width - this.width) / 2;
  18147. this.y = (Laya.stage.height - this.height) / 2;
  18148. this.ui.n2.txt_price.text = "$" + this.jiage;
  18149. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18150. this.setGlobalFont(this.ui);
  18151. }
  18152. closeSelf() {
  18153. DataMgr.loadUserSpOrderForAd();
  18154. this.hide();
  18155. }
  18156. gotoBuy() {
  18157. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18158. if (userInfo != null) {
  18159. let token = userInfo.token;
  18160. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18161. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18162. DataMgr.loadUserSpOrderForAd();
  18163. return;
  18164. }
  18165. else {
  18166. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18167. }
  18168. }
  18169. gotoBuy2() {
  18170. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18171. if (userInfo == null) {
  18172. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18173. return;
  18174. }
  18175. let reqData = xGame.httpMgr.getReqData();
  18176. let pd = JSON.parse(reqData);
  18177. pd.productId = 1;
  18178. reqData = JSON.stringify(pd);
  18179. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18180. try {
  18181. console.log('zh:buySp res = ' + JSON.stringify(res));
  18182. let code = res.code;
  18183. let msg = res.msg;
  18184. if (code == 401) {
  18185. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18186. alert(TIP_MSG_key.loginTimeOut);
  18187. xGame.uiMgr.Show(UIMsg, msg);
  18188. return;
  18189. }
  18190. if (code == 200) {
  18191. xGame.uiMgr.Show(UIMsg, msg);
  18192. DataMgr.loadUserSpOrderForAd();
  18193. DataMgr.getUserZiChanInfo(false);
  18194. this.closeSelf();
  18195. }
  18196. else {
  18197. xGame.uiMgr.Show(UIMsg, msg);
  18198. }
  18199. }
  18200. catch (error) {
  18201. console.log('error=' + error);
  18202. alert(error);
  18203. }
  18204. finally {
  18205. }
  18206. });
  18207. }
  18208. }
  18209. UIFuli1.uiName = "UIFuli1";
  18210. class UIFuli2 extends UIBase {
  18211. constructor() {
  18212. super();
  18213. this.jiage = 14.99;
  18214. }
  18215. onConstructor() {
  18216. this.ui = ui_UIFuli2.createInstance();
  18217. this.contentPane = this.ui;
  18218. this.isEject = false;
  18219. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18220. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18221. }
  18222. show() {
  18223. super.show();
  18224. this.x = (Laya.stage.width - this.width) / 2;
  18225. this.y = (Laya.stage.height - this.height) / 2;
  18226. this.ui.n2.txt_price.text = "$" + this.jiage;
  18227. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18228. this.setGlobalFont(this.ui);
  18229. }
  18230. closeSelf() {
  18231. DataMgr.loadUserSpOrderForAd();
  18232. this.hide();
  18233. }
  18234. gotoBuy() {
  18235. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18236. if (userInfo != null) {
  18237. let token = userInfo.token;
  18238. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18239. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18240. DataMgr.loadUserSpOrderForAd();
  18241. return;
  18242. }
  18243. else {
  18244. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18245. }
  18246. }
  18247. gotoBuy1() {
  18248. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18249. if (userInfo == null) {
  18250. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18251. return;
  18252. }
  18253. let reqData = xGame.httpMgr.getReqData();
  18254. let pd = JSON.parse(reqData);
  18255. pd.productId = 2;
  18256. reqData = JSON.stringify(pd);
  18257. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18258. try {
  18259. console.log('zh:buySp res = ' + JSON.stringify(res));
  18260. let code = res.code;
  18261. let msg = res.msg;
  18262. if (code == 401) {
  18263. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18264. alert(TIP_MSG_key.loginTimeOut);
  18265. xGame.uiMgr.Show(UIMsg, msg);
  18266. return;
  18267. }
  18268. if (code == 200) {
  18269. xGame.uiMgr.Show(UIMsg, msg);
  18270. DataMgr.loadUserSpOrderForAd();
  18271. DataMgr.getUserZiChanInfo(false);
  18272. this.closeSelf();
  18273. }
  18274. else {
  18275. xGame.uiMgr.Show(UIMsg, msg);
  18276. }
  18277. }
  18278. catch (error) {
  18279. console.log('error=' + error);
  18280. alert(error);
  18281. }
  18282. finally {
  18283. }
  18284. });
  18285. }
  18286. }
  18287. UIFuli2.uiName = "UIFuli2";
  18288. class DataMgr {
  18289. static Init() {
  18290. this.userData = new UserData();
  18291. this.gameData = new GameData();
  18292. this.itemData = new ItemData();
  18293. this.diyGameData = new Diy2025GameData();
  18294. this.userData.getData();
  18295. this.gameData.getData();
  18296. this.itemData.getData();
  18297. this.diyGameData.getData();
  18298. this.roleId = this.userData.roleId;
  18299. this.resetUse();
  18300. }
  18301. static isNewDay() {
  18302. Moyu.isNewDay(this, (isnew) => {
  18303. xGame.common.isNewDay = isnew;
  18304. if (!isnew)
  18305. return;
  18306. DataMgr.setShareDiamondTimes(0, false);
  18307. DataMgr.setDailyVideoShareTimes(0, false);
  18308. DataMgr.setDailyfreeDrawTimes(1);
  18309. DataMgr.setExtraSign(0);
  18310. });
  18311. }
  18312. static deletData() {
  18313. Laya.LocalStorage.clear();
  18314. }
  18315. static upRankData() {
  18316. let num = xGame.common.getAllStarNum();
  18317. if (num > 0)
  18318. Moyu.upRankData(xGame.common.curRankID, num);
  18319. }
  18320. static addItem(id, count = 1) {
  18321. let v = this.itemData.itemList[id];
  18322. if (!v)
  18323. v = { id: id, count: count, adnum: 0, active: true };
  18324. else {
  18325. if (v.active) {
  18326. v.count += count;
  18327. }
  18328. else {
  18329. v.count = count;
  18330. v.active = true;
  18331. }
  18332. }
  18333. this.itemData.itemList[id] = v;
  18334. xGame.soundMgr.playGetSound();
  18335. this.saveItemData();
  18336. }
  18337. static hasItem(id) {
  18338. let v = this.itemData.itemList[id];
  18339. if (v && v.active)
  18340. return true;
  18341. return false;
  18342. }
  18343. static getItem(id) {
  18344. let v = this.itemData.itemList[id];
  18345. return v;
  18346. }
  18347. static getItemCount(id) {
  18348. let v = this.itemData.itemList[id];
  18349. if (v && v.active)
  18350. return v.count;
  18351. return 0;
  18352. }
  18353. static getItemAd(id) {
  18354. let v = this.itemData.itemList[id];
  18355. if (v) {
  18356. return v.adnum;
  18357. }
  18358. return 0;
  18359. }
  18360. static onItemAd(id, num = 1) {
  18361. let v = this.itemData.itemList[id];
  18362. if (!v)
  18363. v = { id: id, count: 1, adnum: num, active: false };
  18364. else
  18365. v.adnum += num;
  18366. this.itemData.itemList[id] = v;
  18367. this.saveItemData();
  18368. }
  18369. static costItem(id, count) {
  18370. let v = this.itemData.itemList[id];
  18371. if (v && v.active) {
  18372. if (v.count < count)
  18373. return false;
  18374. else {
  18375. v.count -= count;
  18376. this.itemData.itemList[id] = v;
  18377. return true;
  18378. }
  18379. }
  18380. return false;
  18381. }
  18382. static resetUse() {
  18383. this.dressId = this.userData.dressId;
  18384. this.itemId = this.userData.itemId;
  18385. }
  18386. static passLevel() {
  18387. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18388. this.gameData.curLevel++;
  18389. this.curLevel = this.gameData.curLevel;
  18390. this.saveGameData();
  18391. }
  18392. static useRole(id) {
  18393. this.roleId = id;
  18394. if (this.hasRole(id)) {
  18395. this.userData.roleId = id;
  18396. this.saveUserData();
  18397. }
  18398. }
  18399. static addRole(id) {
  18400. if (this.hasRole(id))
  18401. return;
  18402. this.userData.roleList.push(id);
  18403. this.saveUserData();
  18404. }
  18405. static hasRole(id) {
  18406. return this.userData.roleList.indexOf(id) >= 0;
  18407. }
  18408. static gemEnough(num) {
  18409. return this.userData.gemNum >= num;
  18410. }
  18411. static roleHasAd(id) {
  18412. let count = this.userData.roleAds[id];
  18413. if (count != undefined && count >= 0)
  18414. return true;
  18415. else
  18416. return false;
  18417. }
  18418. static saveUserData(time = 500, event, arg) {
  18419. if (this.userSaving)
  18420. return;
  18421. this.userSaving = true;
  18422. Laya.timer.once(time, this, () => {
  18423. this.userSaving = false;
  18424. this.userData.saveData();
  18425. if (event)
  18426. xGame.eventMgr.event(event, arg);
  18427. });
  18428. }
  18429. static updateUserNickName(loginUserName) {
  18430. let kyeStr = 'moyudata_180';
  18431. console.log('zh:################### kyeStr=' + kyeStr);
  18432. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18433. if (moyudata) {
  18434. const obj = JSON.parse(moyudata);
  18435. obj.nickName = loginUserName;
  18436. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18437. console.log('zh:################### updateUserNickName');
  18438. }
  18439. }
  18440. static saveGameData() {
  18441. if (this.gameSaving)
  18442. return;
  18443. this.gameSaving = true;
  18444. Laya.timer.once(1000, this, () => {
  18445. this.gameSaving = false;
  18446. this.gameData.saveData();
  18447. });
  18448. }
  18449. static saveItemData() {
  18450. let fun = () => {
  18451. this.itemData.saveData();
  18452. };
  18453. Laya.timer.clear(this, fun);
  18454. Laya.timer.once(500, this, fun);
  18455. }
  18456. static saveData() {
  18457. this.saveUserData();
  18458. this.saveGameData();
  18459. }
  18460. static getBigSkillList() {
  18461. return this.userData.bigSkills;
  18462. }
  18463. static getBigSkillByIndex(index) {
  18464. return this.userData.bigSkills[index];
  18465. }
  18466. static setBigSkill(index, val, addUp = true) {
  18467. if (addUp) {
  18468. this.userData.bigSkills[index] += val;
  18469. }
  18470. else {
  18471. this.userData.bigSkills[index] = val;
  18472. }
  18473. this.saveUserData();
  18474. console.log("zh:大技能更新");
  18475. this.updateUserInfo2Server("bigSkills");
  18476. }
  18477. static setBigSkillFormServer(jsonStr) {
  18478. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18479. this.userData.bigSkills = JSON.parse(jsonStr);
  18480. this.saveUserData();
  18481. }
  18482. static coinEnough(need) {
  18483. if (typeof need != "number") {
  18484. console.error("金币格式错误");
  18485. return;
  18486. }
  18487. return this.userData.coin >= need;
  18488. }
  18489. static setCoin(val) {
  18490. if (typeof val != "number") {
  18491. return;
  18492. }
  18493. this.userData.coin += val;
  18494. this.saveUserData();
  18495. xGame.eventMgr.event(COIN_CHANGE);
  18496. this.updateUserInfo2Server("jb");
  18497. }
  18498. static setCoin2(val) {
  18499. if (typeof val != "number") {
  18500. return;
  18501. }
  18502. this.userData.coin = val;
  18503. this.saveUserData();
  18504. xGame.eventMgr.event(COIN_CHANGE);
  18505. }
  18506. static setCoinFormServer(val) {
  18507. if (typeof val != "number") {
  18508. return;
  18509. }
  18510. this.userData.coin = val;
  18511. this.saveUserData();
  18512. console.log('zh:通知更新金币变化' + val);
  18513. xGame.eventMgr.event(COIN_CHANGE);
  18514. }
  18515. static getCoin() {
  18516. return this.userData.coin;
  18517. }
  18518. static diamondEnough(need) {
  18519. if (typeof need != "number") {
  18520. console.error("金币格式错误");
  18521. return;
  18522. }
  18523. return this.userData.diamond >= need;
  18524. }
  18525. static setDiamond(val) {
  18526. if (typeof val != "number") {
  18527. return;
  18528. }
  18529. this.userData.diamond += val;
  18530. this.saveUserData();
  18531. xGame.eventMgr.event(DIAMOND_CHANGE);
  18532. this.updateUserInfo2Server("zs");
  18533. }
  18534. static setDiamond2(val) {
  18535. if (typeof val != "number") {
  18536. return;
  18537. }
  18538. this.userData.diamond = val;
  18539. this.saveUserData();
  18540. xGame.eventMgr.event(DIAMOND_CHANGE);
  18541. }
  18542. static setDiamondFormServer(val) {
  18543. if (typeof val != "number") {
  18544. return;
  18545. }
  18546. this.userData.diamond = val;
  18547. this.saveUserData();
  18548. console.log('zh:通知更新钻石变化' + val);
  18549. xGame.eventMgr.event(DIAMOND_CHANGE);
  18550. }
  18551. static getDiamond() {
  18552. return this.userData.diamond;
  18553. }
  18554. static getSkillSuccessTimes() {
  18555. return this.userData.skillSuccessTimes;
  18556. }
  18557. static setSkillSuccessTimes(val, addUp = true) {
  18558. if (addUp)
  18559. this.userData.skillSuccessTimes += val;
  18560. else
  18561. this.userData.skillSuccessTimes = val;
  18562. this.saveUserData();
  18563. }
  18564. static getSkillAccTimes() {
  18565. return this.userData.skillAccTimes;
  18566. }
  18567. static setSkillAccTimes(val) {
  18568. this.userData.skillAccTimes += val;
  18569. this.saveUserData();
  18570. }
  18571. static getSkillGuide() {
  18572. if (!xGame.common.openGuide) {
  18573. return 1;
  18574. }
  18575. return this.userData.skillGuide;
  18576. }
  18577. static setSkillGuide(val) {
  18578. this.userData.skillGuide = val;
  18579. this.saveUserData();
  18580. }
  18581. static getPlaceBallLevelList() {
  18582. return this.userData.placeBallData;
  18583. }
  18584. static setPlaceBallLevelList(objStr) {
  18585. if (objStr) {
  18586. let obj = JSON.parse(objStr);
  18587. this.userData.placeBallData = obj;
  18588. let cd = obj.length;
  18589. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18590. xGame.common.placeBallCurLevel = cd;
  18591. DataMgr.setChallengeMode_overLev(cd);
  18592. this.saveUserData();
  18593. }
  18594. else {
  18595. this.userData.placeBallData = [];
  18596. this.saveUserData();
  18597. }
  18598. }
  18599. static getPlaceBallLevel(level) {
  18600. let arr = this.userData.placeBallData;
  18601. let index = level - 1;
  18602. let out;
  18603. if (arr[index]) {
  18604. out = arr[index];
  18605. }
  18606. else {
  18607. let max = arr.length;
  18608. if (max == index) {
  18609. out = {
  18610. star: 0,
  18611. play: true,
  18612. isCur: true,
  18613. getAward: false
  18614. };
  18615. }
  18616. else {
  18617. out = {
  18618. star: 0,
  18619. play: false,
  18620. getAward: false
  18621. };
  18622. }
  18623. }
  18624. return out;
  18625. }
  18626. static setPlaceBallLevel(level, star) {
  18627. let arr = this.userData.placeBallData;
  18628. let index = level - 1;
  18629. if (arr[index]) {
  18630. arr[index].star = Math.max(arr[index].star, star);
  18631. }
  18632. else {
  18633. let max = arr.length;
  18634. if (max == index) {
  18635. arr.push({
  18636. star: star,
  18637. play: true,
  18638. getAward: false
  18639. });
  18640. }
  18641. else {
  18642. console.error("关卡存储出错");
  18643. }
  18644. }
  18645. this.saveUserData();
  18646. }
  18647. static setPlaceBallAward(level) {
  18648. let arr = this.userData.placeBallData;
  18649. let index = level - 1;
  18650. if (arr[index]) {
  18651. arr[index].getAward = true;
  18652. }
  18653. this.saveUserData();
  18654. }
  18655. static getShareDiamondTimes() {
  18656. return this.userData.shareDiamondTimes;
  18657. }
  18658. static setShareDiamondTimes(val, addUp = true) {
  18659. if (addUp) {
  18660. this.userData.shareDiamondTimes += val;
  18661. }
  18662. else {
  18663. this.userData.shareDiamondTimes = val;
  18664. }
  18665. this.saveUserData();
  18666. }
  18667. static getDailyVideoShareTimes() {
  18668. return this.userData.dailyVideoShareTimes;
  18669. }
  18670. static setDailyVideoShareTimes(val, addUp = true) {
  18671. if (addUp) {
  18672. this.userData.dailyVideoShareTimes += val;
  18673. }
  18674. else {
  18675. this.userData.dailyVideoShareTimes = val;
  18676. }
  18677. this.saveUserData();
  18678. }
  18679. static getSecretary(index) {
  18680. return this.userData.secretary[index];
  18681. }
  18682. static setSecretary(index, val) {
  18683. this.userData.secretary[index] = val;
  18684. this.saveUserData();
  18685. }
  18686. static getCurSecretary() {
  18687. return this.userData.curSecretary;
  18688. }
  18689. static setCurSecretary(index) {
  18690. this.userData.curSecretary = index;
  18691. this.saveUserData();
  18692. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18693. }
  18694. static getBallRod(index) {
  18695. return this.userData.ballRod[index];
  18696. }
  18697. static setBallRod(index, val) {
  18698. this.userData.ballRod[index] = val;
  18699. this.saveUserData();
  18700. }
  18701. static setBallRodFormServer(haveQiuGanJsonStr) {
  18702. if (!haveQiuGanJsonStr) {
  18703. console.log("setBallRodFormServer数据为空或未定义");
  18704. return;
  18705. }
  18706. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18707. const keys = Object.keys(haveQiuGanJsonObj);
  18708. keys.forEach(key => {
  18709. let v = haveQiuGanJsonObj[key];
  18710. let k = parseInt(key);
  18711. let idx = k - 1;
  18712. this.userData.ballRod[idx] = v;
  18713. });
  18714. }
  18715. static getCurBallRod() {
  18716. return this.userData.curBallRod;
  18717. }
  18718. static setCurBallRod(index) {
  18719. this.userData.curBallRod = index;
  18720. this.saveUserData();
  18721. }
  18722. static setSignData(val) {
  18723. this.userData.signData = val;
  18724. this.saveUserData();
  18725. }
  18726. static getSignData() {
  18727. return this.userData.signData;
  18728. }
  18729. static setSignTime(val) {
  18730. this.userData.signTime = val;
  18731. this.saveUserData();
  18732. }
  18733. static getSignTime() {
  18734. return this.userData.signTime;
  18735. }
  18736. static getDrawTimes() {
  18737. return this.userData.drawTimes;
  18738. }
  18739. static setDrawTimes(val, addUp = true) {
  18740. if (addUp) {
  18741. this.userData.drawTimes += val;
  18742. }
  18743. else {
  18744. this.userData.drawTimes = val;
  18745. }
  18746. this.saveUserData();
  18747. }
  18748. static getDrawAwardTimes() {
  18749. return this.userData.drawAwardTimes;
  18750. }
  18751. static setDrawAwardTimes(val) {
  18752. this.userData.drawAwardTimes = val;
  18753. this.saveUserData();
  18754. }
  18755. static getDailyfreeDrawTimes() {
  18756. return this.userData.dailyfreeDrawTimes;
  18757. }
  18758. static setDailyfreeDrawTimes(val) {
  18759. this.userData.dailyfreeDrawTimes = val;
  18760. this.saveUserData();
  18761. }
  18762. static setPower(val, addUp = true) {
  18763. if (addUp)
  18764. this.userData.power += val;
  18765. else
  18766. this.userData.power = val;
  18767. if (this.userData.power >= xGame.common.maxPower) {
  18768. this.userData.power = xGame.common.maxPower;
  18769. }
  18770. xGame.eventMgr.event(POWER_CHANGE, val);
  18771. this.saveUserData();
  18772. this.updateUserInfo2Server("power");
  18773. }
  18774. static getPower() {
  18775. return this.userData.power;
  18776. }
  18777. static setPowerTime(val) {
  18778. this.userData.powerTime = val;
  18779. this.saveUserData();
  18780. }
  18781. static getPowerTime() {
  18782. return this.userData.powerTime;
  18783. }
  18784. static powerEnough() {
  18785. return this.getPower() > 0;
  18786. }
  18787. static getChallengeTimes() {
  18788. return this.userData.challengeTimes;
  18789. }
  18790. static setChallengeTimes(val) {
  18791. this.userData.challengeTimes += val;
  18792. this.saveUserData();
  18793. }
  18794. static getExtraSign() {
  18795. return this.userData.extraSign;
  18796. }
  18797. static setExtraSign(val) {
  18798. this.userData.extraSign = val;
  18799. this.saveUserData();
  18800. }
  18801. static getClassicTimes() {
  18802. return this.userData.classicTimes;
  18803. }
  18804. static setClassicTimes() {
  18805. this.userData.classicTimes += 1;
  18806. this.saveUserData();
  18807. }
  18808. static getGuideHelpLine() {
  18809. return this.userData.guideHelpLine;
  18810. }
  18811. static setGuideHelpLine() {
  18812. this.userData.guideHelpLine = 1;
  18813. this.saveUserData();
  18814. }
  18815. static getNewUser() {
  18816. return this.userData.newUser;
  18817. }
  18818. static setNewUser() {
  18819. this.userData.newUser = false;
  18820. this.saveUserData();
  18821. }
  18822. static getRootBallFoul() {
  18823. return this.userData.rootBallFoul;
  18824. }
  18825. static setRootBallFoul() {
  18826. this.userData.rootBallFoul = 1;
  18827. this.saveUserData();
  18828. }
  18829. static getTimeoutFoul() {
  18830. return this.userData.timeoutFoul;
  18831. }
  18832. static setTimeoutFoul() {
  18833. this.userData.timeoutFoul = 1;
  18834. this.saveUserData();
  18835. }
  18836. static saveDiyGameData() {
  18837. if (this.diyGameSaving)
  18838. return;
  18839. this.diyGameSaving = true;
  18840. Laya.timer.once(500, this, () => {
  18841. this.diyGameSaving = false;
  18842. this.diyGameData.saveData();
  18843. });
  18844. }
  18845. static getChallengeMode_overLev() {
  18846. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18847. return this.challengeMode_overLev;
  18848. }
  18849. static setChallengeMode_overLev(levNum) {
  18850. this.diyGameData.challengeMode_overLev = levNum;
  18851. this.saveDiyGameData();
  18852. }
  18853. static updateUserInfo2Server(type, count = 0) {
  18854. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18855. if (userInfoData == null) {
  18856. return;
  18857. }
  18858. let reqData = xGame.httpMgr.getReqData();
  18859. let rd = JSON.parse(reqData);
  18860. rd.dataType = type;
  18861. let dataValue = 0;
  18862. if (type == "zs") {
  18863. dataValue = this.getDiamond();
  18864. }
  18865. if (type == "jb") {
  18866. dataValue = this.getCoin();
  18867. }
  18868. if (type == "power") {
  18869. dataValue = this.getPower();
  18870. }
  18871. rd.dataValue = dataValue;
  18872. if (type == "bigSkills") {
  18873. let dataValueStr = this.userData.bigSkills;
  18874. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  18875. rd.dataValueStr = JSON.stringify(dvsJson);
  18876. }
  18877. reqData = JSON.stringify(rd);
  18878. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18879. try {
  18880. let code = res.code;
  18881. let data = res.data;
  18882. if (code == 401) {
  18883. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18884. console.log('zh:保存资产信息失败,请重新登录 ');
  18885. return;
  18886. }
  18887. if (code == 200) {
  18888. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18889. }
  18890. else {
  18891. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18892. }
  18893. }
  18894. catch (error) {
  18895. console.log('error=' + error);
  18896. alert("Please check your network connection.");
  18897. }
  18898. finally {
  18899. }
  18900. });
  18901. }
  18902. static getUserZiChanInfo(winTip = false) {
  18903. console.log('zh:getUserZCI');
  18904. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18905. console.log('zh:userInfoData=' + userInfoData);
  18906. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  18907. if (winTip) {
  18908. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18909. }
  18910. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18911. return;
  18912. }
  18913. let reqData = xGame.httpMgr.getReqData();
  18914. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18915. try {
  18916. console.log('zh:buySp res = ' + JSON.stringify(res));
  18917. let code = res.code;
  18918. let msg = res.msg;
  18919. if (code == 401) {
  18920. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18921. if (winTip) {
  18922. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18923. }
  18924. return;
  18925. }
  18926. if (code == 200) {
  18927. let d = res.data;
  18928. let zuanShi = d.zuanShi;
  18929. let jinBi = d.jinBi;
  18930. let haveQiuGanJson = d.haveQiuGanJson;
  18931. let signData = d.signData;
  18932. let placeBallData = d.placeBallData;
  18933. let bigSkills = d.bigSkills;
  18934. DataMgr.setDiamondFormServer(zuanShi);
  18935. DataMgr.setCoinFormServer(jinBi);
  18936. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18937. DataMgr.setPlaceBallLevelList(placeBallData);
  18938. if (signData && signData > 0) {
  18939. DataMgr.setSignData(signData);
  18940. }
  18941. DataMgr.setBigSkillFormServer(bigSkills);
  18942. }
  18943. else {
  18944. console.log("zh:更新用户资产信息error" + msg);
  18945. if (winTip) {
  18946. xGame.uiMgr.Show(UIMsg, msg);
  18947. }
  18948. }
  18949. }
  18950. catch (error) {
  18951. console.log('error=' + error);
  18952. if (winTip) {
  18953. alert(error);
  18954. }
  18955. }
  18956. finally {
  18957. console.log("zh:更新用户资产信息结束");
  18958. }
  18959. });
  18960. }
  18961. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18962. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18963. console.log('zh:updateLocalUserData=' + userInfo);
  18964. if (userInfo != null) {
  18965. if (!userInfo.buySpids) {
  18966. userInfo.buySpids = { 1: false, 7: false };
  18967. }
  18968. else {
  18969. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18970. }
  18971. userInfo.buySpids[spid] = isBuyOk;
  18972. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18973. }
  18974. else {
  18975. }
  18976. }
  18977. static loadUserSpOrderForAd() {
  18978. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18979. if (userInfo == null) {
  18980. return;
  18981. }
  18982. console.log('zh:重新加载更新广告权利');
  18983. let reqData = xGame.httpMgr.getReqData();
  18984. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18985. try {
  18986. console.log('zh:getOrderListForNoChongFuBuy res = ' + JSON.stringify(res));
  18987. let code = res.code;
  18988. let msg = res.msg;
  18989. if (code == 401) {
  18990. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18991. return;
  18992. }
  18993. if (code == 200) {
  18994. let data = res.data;
  18995. let buy_spid1 = false;
  18996. let buy_spid7 = false;
  18997. for (let index = 0; index < data.length; index++) {
  18998. let element = data[index];
  18999. console.log('zh:list element.spid = ' + element.spid);
  19000. if (element.spid == 1) {
  19001. buy_spid1 = true;
  19002. }
  19003. if (element.spid == 7) {
  19004. buy_spid7 = true;
  19005. }
  19006. }
  19007. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  19008. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  19009. }
  19010. else {
  19011. }
  19012. }
  19013. catch (error) {
  19014. console.log('error=' + error);
  19015. alert(error);
  19016. }
  19017. finally {
  19018. }
  19019. });
  19020. }
  19021. static checkForShowFuLi17AndAlert(alert_spid) {
  19022. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19023. if (userInfo == null) {
  19024. if (alert_spid === 1) {
  19025. xGame.uiMgr.Show(UIFuli1);
  19026. }
  19027. if (alert_spid === 7) {
  19028. xGame.uiMgr.Show(UIFuli2);
  19029. }
  19030. return;
  19031. }
  19032. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  19033. let reqData = xGame.httpMgr.getReqData();
  19034. let pd = JSON.parse(reqData);
  19035. pd.productId = alert_spid;
  19036. reqData = JSON.stringify(pd);
  19037. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  19038. try {
  19039. let code = res.code;
  19040. let msg = res.msg;
  19041. if (code == 401) {
  19042. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19043. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19044. return;
  19045. }
  19046. if (code == 200) {
  19047. let data = res.data;
  19048. let buyOkSpid = [];
  19049. for (let i = 0; i < data.length; i++) {
  19050. let item = data[i];
  19051. let temp_spid = item.spid;
  19052. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19053. buyOkSpid.push(temp_spid);
  19054. }
  19055. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19056. if (isBuyOk7) {
  19057. return;
  19058. }
  19059. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19060. if (isBuyOk && alert_spid === 1) {
  19061. return;
  19062. }
  19063. else {
  19064. if (isBuyOk === false) {
  19065. if (alert_spid === 1) {
  19066. xGame.uiMgr.Show(UIFuli1);
  19067. }
  19068. if (alert_spid === 7) {
  19069. xGame.uiMgr.Show(UIFuli2);
  19070. }
  19071. }
  19072. else {
  19073. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19074. }
  19075. }
  19076. }
  19077. else {
  19078. xGame.uiMgr.Show(UIMsg, msg);
  19079. }
  19080. }
  19081. catch (error) {
  19082. console.log('error=' + error);
  19083. alert(error);
  19084. }
  19085. finally {
  19086. }
  19087. });
  19088. }
  19089. }
  19090. DataMgr.isNewUser = false;
  19091. DataMgr.fristEnter = true;
  19092. DataMgr.levelType = 0;
  19093. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19094. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19095. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19096. DataMgr.challengeMode_overLev = 0;
  19097. DataMgr.xszyForClassic = false;
  19098. DataMgr.xszyForChallenge = false;
  19099. DataMgr.awardId = 0;
  19100. DataMgr.awardCoin = 0;
  19101. DataMgr.sceneId = -1;
  19102. DataMgr.tryId = 0;
  19103. DataMgr.curLevel = 1;
  19104. DataMgr.vipLevel = 0;
  19105. DataMgr.maxLevel = 0;
  19106. DataMgr.awardRatio = 1;
  19107. DataMgr.gameList = [];
  19108. DataMgr.rankList = [];
  19109. DataMgr.recoverTime = 480000;
  19110. DataMgr.minScore = 0;
  19111. DataMgr.rankDis = 0;
  19112. DataMgr.userSaving = false;
  19113. DataMgr.gameSaving = false;
  19114. DataMgr.diyGameSaving = false;
  19115. class D3Tween extends Laya.Script3D {
  19116. constructor() {
  19117. super();
  19118. this.isInited = false;
  19119. }
  19120. ;
  19121. init() {
  19122. if (this.isInited)
  19123. return;
  19124. this.isInited = true;
  19125. this.gameObj = this.owner;
  19126. this.transform = this.gameObj.transform;
  19127. }
  19128. get rotX() {
  19129. return this.transform.localRotationEulerX;
  19130. }
  19131. set rotX(v) {
  19132. this.transform.localRotationEulerX = v;
  19133. }
  19134. get rotY() {
  19135. return this.transform.localRotationEulerY;
  19136. }
  19137. set rotY(v) {
  19138. this.transform.localRotationEulerY = v;
  19139. }
  19140. get rotZ() {
  19141. return this.transform.localRotationEulerZ;
  19142. }
  19143. set rotZ(v) {
  19144. this.transform.localRotationEulerZ = v;
  19145. }
  19146. get posX() {
  19147. return this.transform.localPositionX;
  19148. }
  19149. set posX(v) {
  19150. this.transform.localPositionX = v;
  19151. }
  19152. get posY() {
  19153. return this.transform.localPositionY;
  19154. }
  19155. set posY(v) {
  19156. this.transform.localPositionY = v;
  19157. }
  19158. get posZ() {
  19159. return this.transform.localPositionZ;
  19160. }
  19161. set posZ(v) {
  19162. this.transform.localPositionZ = v;
  19163. }
  19164. get rotation() {
  19165. return this.transform.localRotation;
  19166. }
  19167. set rotation(v) {
  19168. this.transform.localRotation = v;
  19169. }
  19170. }
  19171. class D2Hole extends Laya.Script {
  19172. constructor() { super(); }
  19173. onTriggerEnter(collider) {
  19174. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19175. return;
  19176. }
  19177. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19178. if (collider.owner["mySrc"].isRunSkillAni) {
  19179. return;
  19180. }
  19181. if (collider.owner["mySrc"].number != 0) {
  19182. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19183. }
  19184. xGame.common.ballColliHole(collider);
  19185. xGame.common.recoverCameraView();
  19186. }
  19187. }
  19188. }
  19189. class Table extends Laya.Script3D {
  19190. constructor() {
  19191. super();
  19192. this.isSetBorder = false;
  19193. this.inited = false;
  19194. }
  19195. ;
  19196. onAwake() {
  19197. this.init();
  19198. }
  19199. init() {
  19200. if (this.inited)
  19201. return;
  19202. this.inited = true;
  19203. this.gameObj = this.owner;
  19204. this.border = this.gameObj.getChildByName("border");
  19205. }
  19206. setBorderPos() {
  19207. if (this.isSetBorder)
  19208. return;
  19209. this.isSetBorder = true;
  19210. let ui = xGame.common.gameUI.ui;
  19211. let bar1 = this.border.getChildByName("bar1");
  19212. let bar2 = this.border.getChildByName("bar2");
  19213. let bar3 = this.border.getChildByName("bar3");
  19214. let bar4 = this.border.getChildByName("bar4");
  19215. let bar5 = this.border.getChildByName("bar5");
  19216. let bar6 = this.border.getChildByName("bar6");
  19217. this.setInfo(bar1, ui.border.bar1, "box");
  19218. this.setInfo(bar2, ui.border.bar2, "box");
  19219. this.setInfo(bar3, ui.border.bar3, "box");
  19220. this.setInfo(bar4, ui.border.bar4, "box");
  19221. this.setInfo(bar5, ui.border.bar5, "box");
  19222. this.setInfo(bar6, ui.border.bar6, "box");
  19223. let circle1 = this.border.getChildByName("circle1");
  19224. let circle2 = this.border.getChildByName("circle2");
  19225. let circle3 = this.border.getChildByName("circle3");
  19226. let circle4 = this.border.getChildByName("circle4");
  19227. let circle5 = this.border.getChildByName("circle5");
  19228. let circle6 = this.border.getChildByName("circle6");
  19229. this.setInfo(circle1, ui.border.circle1, "circle");
  19230. this.setInfo(circle2, ui.border.circle2, "circle");
  19231. this.setInfo(circle3, ui.border.circle3, "circle");
  19232. this.setInfo(circle4, ui.border.circle4, "circle");
  19233. this.setInfo(circle5, ui.border.circle5, "circle");
  19234. this.setInfo(circle6, ui.border.circle6, "circle");
  19235. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19236. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19237. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19238. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19239. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19240. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19241. let arr = xGame.common.gameMgr.holePosList;
  19242. xGame.common.gameMgr.posObj = {
  19243. "1": arr[0],
  19244. "3": arr[2],
  19245. "4": arr[3],
  19246. "6": arr[5]
  19247. };
  19248. }
  19249. initHolePos(x, y) {
  19250. if (x < 300)
  19251. x += 25;
  19252. else if (x > 1000)
  19253. x -= 25;
  19254. else if (y > 200)
  19255. y -= 10;
  19256. else
  19257. y += 10;
  19258. if (y < 200)
  19259. y += 30;
  19260. else if (y > 500)
  19261. y -= 30;
  19262. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19263. }
  19264. setInfo(d3Obj, d2Obj, type) {
  19265. let ui = xGame.common.gameUI.ui;
  19266. let sprite = new Laya.Sprite();
  19267. ui.border.displayObject.addChild(sprite);
  19268. let colli = xGame.common.getCollider(type);
  19269. sprite.addComponentIntance(colli);
  19270. let rigy = xGame.common.getRigbody();
  19271. rigy.type = "static";
  19272. sprite.addComponentIntance(rigy);
  19273. let d3Pos = d3Obj.transform.position;
  19274. xGame.common.pos3to2Convert(d3Pos);
  19275. let scaleX = d3Obj.transform.localScaleX;
  19276. let scaleZ = d3Obj.transform.localScaleZ;
  19277. let width = xGame.common.scale3to2Convert(scaleZ);
  19278. let height = xGame.common.scale3to2Convert(scaleX);
  19279. sprite.pivotX = width / 2;
  19280. sprite.pivotY = height / 2;
  19281. sprite.x = d3Pos.x;
  19282. sprite.y = d3Pos.y;
  19283. sprite.width = width;
  19284. sprite.height = height;
  19285. d2Obj.x = d3Pos.x;
  19286. d2Obj.y = d3Pos.y;
  19287. d2Obj.width = width;
  19288. d2Obj.height = height;
  19289. if (type == "box") {
  19290. colli.width = width;
  19291. colli.height = height;
  19292. colli.isSensor = false;
  19293. colli.label = "border";
  19294. }
  19295. else {
  19296. colli.radius = width / 2;
  19297. colli.isSensor = true;
  19298. colli.label = "hole";
  19299. sprite.addComponent(D2Hole);
  19300. }
  19301. }
  19302. }
  19303. class D3World extends Laya.Script3D {
  19304. constructor() {
  19305. super();
  19306. this.loadNum = 0;
  19307. this.setLoadNum = 7;
  19308. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19309. }
  19310. onAwake() {
  19311. }
  19312. loadScene() {
  19313. this.scene = this.owner;
  19314. let url = `res/unityRes/root.lh`;
  19315. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19316. this.scene.addChild(prefab);
  19317. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19318. this.putCameraInfo();
  19319. this.camera.enableHDR = false;
  19320. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19321. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19322. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19323. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19324. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19325. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19326. this.knife.active = false;
  19327. this.loadD3Obj();
  19328. }));
  19329. }
  19330. putCameraInfo() {
  19331. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19332. this.cameraObj = new cameraType();
  19333. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19334. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19335. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19336. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19337. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19338. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19339. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19340. this.visitAngleChild.init();
  19341. this.visitRootObj.posX = this.visitAngleChild.posX;
  19342. this.visitRootObj.posY = this.visitAngleChild.posY;
  19343. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19344. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19345. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19346. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19347. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19348. xGame.common.showOneCamera("mainCamera");
  19349. }
  19350. loadD3Obj() {
  19351. this.loadTable();
  19352. this.loadRoom();
  19353. this.loadInHoleParticial();
  19354. this.loadIceParticial();
  19355. this.loadHitParticial();
  19356. this.loadFireworksParticial();
  19357. this.loadBall();
  19358. }
  19359. loadInHoleParticial() {
  19360. this.loadD3Res("inHoleEft", "", (prefab) => {
  19361. prefab.addComponent(Partical);
  19362. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19363. });
  19364. }
  19365. loadIceParticial() {
  19366. this.loadD3Res("iceEft", "", (prefab) => {
  19367. prefab.addComponent(Partical);
  19368. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19369. });
  19370. }
  19371. loadHitParticial() {
  19372. this.loadD3Res("hitEft", "", (prefab) => {
  19373. prefab.addComponent(Partical);
  19374. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19375. });
  19376. }
  19377. loadFireworksParticial() {
  19378. this.loadD3Res("fireworksEft", "", (prefab) => {
  19379. prefab.addComponent(Partical);
  19380. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19381. });
  19382. }
  19383. loadBall(index = 1) {
  19384. this.loadD3Res("ball", index, (prefab) => {
  19385. this.ballPrefab = prefab;
  19386. this.ballPrefab.addComponent(Ball);
  19387. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19388. });
  19389. }
  19390. loadTable(index = 1) {
  19391. this.loadD3Res("table", index, (prefab) => {
  19392. this.tableSrc = prefab.addComponent(Table);
  19393. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19394. this.d3Hand.init();
  19395. this.tableRoot.addChild(prefab);
  19396. });
  19397. }
  19398. loadRoom(index = 1) {
  19399. this.loadD3Res("room", index, (prefab) => {
  19400. this.roomRoot.addChild(prefab);
  19401. });
  19402. }
  19403. loadD3Res(type, index, callback) {
  19404. let url = `res/unityRes/${type}${index}.lh`;
  19405. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19406. callback && callback(prefab);
  19407. this.checkResLoad();
  19408. }));
  19409. }
  19410. checkResLoad() {
  19411. this.loadNum++;
  19412. if (this.loadNum >= this.setLoadNum) {
  19413. xGame.eventMgr.event(D3RES_LOADED);
  19414. }
  19415. }
  19416. prePlayEft() {
  19417. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19418. eft.transform.localPositionX = 0;
  19419. eft.transform.localPositionY = -5;
  19420. eft.transform.localPositionZ = 0;
  19421. eft.active = true;
  19422. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19423. ice.transform.localPositionX = 0;
  19424. ice.transform.localPositionY = -5;
  19425. ice.transform.localPositionZ = 0;
  19426. ice.active = true;
  19427. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19428. hit.transform.localPositionX = 0;
  19429. hit.transform.localPositionY = -5;
  19430. hit.transform.localPositionZ = 0;
  19431. hit.active = true;
  19432. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19433. fireworks.transform.localPositionX = 0;
  19434. fireworks.transform.localPositionY = -5;
  19435. fireworks.transform.localPositionZ = 0;
  19436. fireworks.active = true;
  19437. }
  19438. }
  19439. class cameraType {
  19440. }
  19441. class MoyuMgr$1 {
  19442. static initMoyu() {
  19443. this.moyuView = new MoyuView$1();
  19444. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19445. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19446. this.moyuView.ui.displayObject.zOrder = 1000;
  19447. this.moyuView.init();
  19448. this.moyuView.showTip(true);
  19449. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19450. window['XApk'] = this;
  19451. }
  19452. static showAge(show) {
  19453. if (this.moyuView)
  19454. this.moyuView.showAge(show);
  19455. }
  19456. static onPlatMsg(idx) {
  19457. if (!MoyuMgr$1.moyuView)
  19458. return;
  19459. if (idx == '0') {
  19460. MoyuMgr$1.moyuView.showTip(false);
  19461. }
  19462. }
  19463. static showAgree(call) {
  19464. if (this.moyuView)
  19465. this.moyuView.showAgree(call);
  19466. else
  19467. call && call();
  19468. }
  19469. static showXy(type = 1) {
  19470. if (this.moyuView)
  19471. this.moyuView.showXy(type);
  19472. }
  19473. }
  19474. MoyuMgr$1.isAdvise = false;
  19475. class MoyuView$1 {
  19476. constructor() {
  19477. this.ysxyNum = 1;
  19478. this.ysJson = null;
  19479. this.ui = ui_UIMoyu.createInstance();
  19480. }
  19481. init() {
  19482. this.ui.mainBg.visible = false;
  19483. this.ui.xyNode.visible = false;
  19484. this.ui.ageNode.visible = false;
  19485. this.ui.tipNode.visible = false;
  19486. this.ui.rnNode.visible = false;
  19487. this.ui.fcmNode.visible = false;
  19488. this.ui.ageTip.visible = false;
  19489. this.ui.msgNode.visible = false;
  19490. this.ui.visible = false;
  19491. this.ui.xyNode.xyList.setVirtual();
  19492. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19493. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19494. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19495. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19496. this.ui.xyNode.btnKnown.visible = false;
  19497. this.ui.xyNode.xy1.visible = false;
  19498. this.ui.xyNode.xy2.visible = false;
  19499. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19500. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19501. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19502. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19503. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19504. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19505. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19506. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19507. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19508. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19509. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19510. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19511. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19512. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19513. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19514. this.ysxyNum = 2;
  19515. }
  19516. }
  19517. onClick(obj) {
  19518. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19519. switch (obj) {
  19520. case this.ui.ageTip:
  19521. if (Moyu.isTTApk) {
  19522. this.ui.ageNode.visible = true;
  19523. this.ui.mainBg.visible = true;
  19524. }
  19525. break;
  19526. case this.ui.tipNode:
  19527. this.showTip(false);
  19528. break;
  19529. case this.ui.ageNode.btnAge:
  19530. this.ui.ageNode.visible = false;
  19531. this.ui.mainBg.visible = false;
  19532. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19533. this.ui.visible = false;
  19534. break;
  19535. case this.ui.xyNode.btnXy3:
  19536. case this.ui.xyNode.btnXy1:
  19537. this.loadXy(1);
  19538. break;
  19539. case this.ui.xyNode.btnXy2:
  19540. this.loadXy(2);
  19541. break;
  19542. case this.ui.xyNode.btnBack:
  19543. this.ui.xyNode.xy1.visible = true;
  19544. this.ui.xyNode.xy2.visible = false;
  19545. break;
  19546. case this.ui.xyNode.btnKnown:
  19547. this.ui.xyNode.visible = false;
  19548. this.ui.mainBg.visible = false;
  19549. this.ui.visible = false;
  19550. break;
  19551. case this.ui.rnNode.btnCheck:
  19552. this.check();
  19553. break;
  19554. case this.ui.rnNode.btnExit:
  19555. case this.ui.xyNode.btnNo:
  19556. this.ysxyNum--;
  19557. if (this.ysxyNum > 0)
  19558. this.showMsg("Refuse to quit the game once again");
  19559. else {
  19560. Moyu.userAgree(false);
  19561. Moyu.exit();
  19562. }
  19563. break;
  19564. case this.ui.xyNode.btnSure:
  19565. case this.ui.xyNode.btnYes:
  19566. DataMgr.userData.isAgree = true;
  19567. DataMgr.saveUserData();
  19568. this.onAgree();
  19569. break;
  19570. case this.ui.rnNode.btnDone:
  19571. this.ui.rnNode.visible = false;
  19572. this.ui.visible = false;
  19573. break;
  19574. case this.ui.fcmNode.btnRn:
  19575. this.showRn();
  19576. break;
  19577. }
  19578. }
  19579. showTip(show) {
  19580. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19581. return;
  19582. if (show) {
  19583. MoyuMgr$1.isAdvise = true;
  19584. this.ui.visible = true;
  19585. this.ui.tipNode.visible = true;
  19586. this.ui.tipNode.alpha = 1;
  19587. Laya.timer.once(1000, this, this.showTip, [false]);
  19588. }
  19589. else {
  19590. this.ui.tipNode.alpha = 1;
  19591. this.ui.tipNode.visible = true;
  19592. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19593. this.ui.tipNode.visible = false;
  19594. MoyuMgr$1.isAdvise = false;
  19595. }), 1000);
  19596. }
  19597. }
  19598. showAge(show, px = 0, py = 0) {
  19599. if (Moyu.platType > 10 && !Moyu.isIos) {
  19600. this.ui.ageTip.x = px;
  19601. this.ui.ageTip.y = py;
  19602. this.ui.ageTip.visible = show;
  19603. if (show)
  19604. this.ui.visible = true;
  19605. }
  19606. }
  19607. showAgree(call) {
  19608. this.agreeCall = call;
  19609. this.onAgree();
  19610. return;
  19611. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19612. this.showXy(0);
  19613. }
  19614. else
  19615. this.onAgree();
  19616. }
  19617. onAgree() {
  19618. if (!this.ui.ageNode.visible)
  19619. this.ui.visible = false;
  19620. this.ui.xyNode.visible = false;
  19621. Moyu.userAgree(true);
  19622. this.showAge(false);
  19623. this.agreeCall && this.agreeCall();
  19624. this.showRn();
  19625. }
  19626. showMsg(txt) {
  19627. this.ui.msgNode.txtMsg.text = txt;
  19628. this.ui.msgNode.visible = true;
  19629. this.ui.msgNode.alpha = 1;
  19630. this.ui.visible = true;
  19631. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19632. this.ui.msgNode.visible = false;
  19633. }), 2500, true);
  19634. }
  19635. showRn() {
  19636. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19637. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19638. this.ui.rnNode.rn1.visible = true;
  19639. this.ui.rnNode.rn2.visible = false;
  19640. this.ui.rnNode.rn3.visible = false;
  19641. this.ui.rnNode.rn4.visible = false;
  19642. this.ui.rnNode.visible = true;
  19643. this.ui.mainBg.visible = true;
  19644. this.ui.rnNode.btnDone.visible = false;
  19645. this.ui.rnNode.btnExit.visible = true;
  19646. this.ui.rnNode.btnCheck.visible = true;
  19647. this.ui.fcmNode.visible = false;
  19648. this.ui.visible = true;
  19649. return;
  19650. }
  19651. }
  19652. this.showFcm();
  19653. }
  19654. showFcm() {
  19655. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19656. Moyu.initFCM(true);
  19657. if (Moyu.gameTime < 1)
  19658. this.fcmLoop();
  19659. else if (Moyu.gameTime < 999)
  19660. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19661. }
  19662. }
  19663. fcmLoop() {
  19664. if (Moyu.gameTime < 1) {
  19665. this.ui.rnNode.visible = false;
  19666. this.ui.fcmNode.visible = true;
  19667. this.ui.mainBg.visible = true;
  19668. this.ui.visible = true;
  19669. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19670. Laya.timer.clear(this.ui, this.fcmLoop);
  19671. }
  19672. }
  19673. check() {
  19674. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19675. this.ui.rnNode.rn1.visible = false;
  19676. this.ui.rnNode.rn2.visible = false;
  19677. this.ui.rnNode.rn4.visible = true;
  19678. }
  19679. else if (this.ui.rnNode.rn4.visible) {
  19680. let name = this.ui.rnNode.inputName.text;
  19681. let code = this.ui.rnNode.inputCode.text;
  19682. if (code && code.length == 18) {
  19683. this.ui.rnNode.rn1.visible = false;
  19684. this.ui.rnNode.rn4.visible = false;
  19685. Moyu.authenticate(name, code, (res) => {
  19686. this.ui.rnNode.rn2.visible = !res;
  19687. this.ui.rnNode.rn3.visible = res;
  19688. this.ui.rnNode.btnDone.visible = res;
  19689. this.ui.rnNode.btnExit.visible = !res;
  19690. this.ui.rnNode.btnCheck.visible = !res;
  19691. if (res)
  19692. this.showFcm();
  19693. });
  19694. }
  19695. else
  19696. this.showMsg("信息填写不完整");
  19697. }
  19698. }
  19699. loadXy(type = 0) {
  19700. this.ui.xyNode.xy1.visible = false;
  19701. this.ui.xyNode.xy2.visible = true;
  19702. this.ui.xyNode.xyList.scrollToView(0);
  19703. if (type == 1) {
  19704. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19705. }
  19706. else if (type == 2) {
  19707. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19708. }
  19709. }
  19710. showXy(type = 0) {
  19711. this.xyBtn();
  19712. if (type == 0) {
  19713. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19714. this.ui.xyNode.btnSure.visible = true;
  19715. }
  19716. else {
  19717. this.ui.xyNode.btnYes.visible = true;
  19718. this.ui.xyNode.btnNo.visible = true;
  19719. }
  19720. }
  19721. else {
  19722. this.ui.xyNode.btnKnown.visible = true;
  19723. this.ui.mainBg.visible = true;
  19724. }
  19725. this.ui.xyNode.xy1.visible = true;
  19726. this.ui.xyNode.xy2.visible = false;
  19727. this.ui.xyNode.visible = true;
  19728. this.ui.visible = true;
  19729. }
  19730. xyBtn() {
  19731. this.ui.xyNode.btnSure.visible = false;
  19732. this.ui.xyNode.btnYes.visible = false;
  19733. this.ui.xyNode.btnNo.visible = false;
  19734. this.ui.xyNode.btnKnown.visible = false;
  19735. {
  19736. this.ui.xyNode.btnXy3.visible = false;
  19737. this.ui.xyNode.btnXy2.visible = true;
  19738. this.ui.xyNode.btnXy1.visible = true;
  19739. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19740. }
  19741. }
  19742. createXY(json) {
  19743. this.ysJson = json.content;
  19744. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19745. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19746. this.ui.xyNode.xy2.visible = true;
  19747. }
  19748. renderListItem(idx, cell) {
  19749. let xy = this.ysJson[idx];
  19750. cell.height = xy.line * 30;
  19751. cell.xyItem.text = xy.text;
  19752. }
  19753. onDestroy() {
  19754. this.agreeCall = null;
  19755. }
  19756. }
  19757. class UILoading extends UIBase {
  19758. constructor() {
  19759. super();
  19760. this.accTime = 0;
  19761. this.curNum = 0;
  19762. this.rate = 1;
  19763. this.loadSubOk = false;
  19764. this.loadResOK = false;
  19765. this.openLoading = true;
  19766. this.beginLoadRes = false;
  19767. this.finishD2 = false;
  19768. this.finishD3 = false;
  19769. }
  19770. onConstructor() {
  19771. this.ui = ui_UILoading.createInstance();
  19772. this.contentPane = this.ui;
  19773. this.isEject = false;
  19774. this._initUI();
  19775. this._addEvent();
  19776. }
  19777. _initUI() {
  19778. MoyuMgr$1.initMoyu();
  19779. }
  19780. _addEvent() {
  19781. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19782. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19783. }
  19784. show() {
  19785. super.show();
  19786. console.log('zh:加载分包资源');
  19787. loadSubRes(this.subResProgress.bind(this));
  19788. this.ui.txtLoad.text = "Loading...";
  19789. this.setGlobalFont(this.ui);
  19790. }
  19791. subResProgress(pro, finish) {
  19792. this.curNum = pro;
  19793. if (finish) {
  19794. this.curNum = 1;
  19795. this.loadSubOk = true;
  19796. }
  19797. }
  19798. laodD3Res() {
  19799. let scene3D = new Laya.Scene3D();
  19800. xGame.common.d3Scene = scene3D;
  19801. xGame.common.d3World = scene3D.addComponent(D3World);
  19802. xGame.common.d3World.loadScene();
  19803. }
  19804. loadD2Res() {
  19805. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19806. this.finishD2 = true;
  19807. this.checkLoadAll();
  19808. this.curNum = 1;
  19809. }), Laya.Handler.create(this, (pro) => {
  19810. this.curNum = pro;
  19811. }, null, false));
  19812. }
  19813. d3ResFinish() {
  19814. this.finishD3 = true;
  19815. this.checkLoadAll();
  19816. }
  19817. checkLoadAll() {
  19818. if (this.finishD2 && this.finishD3) {
  19819. this.loadResOK = true;
  19820. }
  19821. }
  19822. loadRes() {
  19823. this.laodD3Res();
  19824. this.loadD2Res();
  19825. }
  19826. myUpdate(dt) {
  19827. if (!this.openLoading)
  19828. return;
  19829. this.accTime += dt * this.rate;
  19830. if (this.accTime >= this.curNum)
  19831. this.accTime = this.curNum;
  19832. this.ui.loadinfo.value = this.accTime * 100;
  19833. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19834. if (!this.beginLoadRes) {
  19835. this.beginLoadRes = true;
  19836. this.ui.txtLoad.text = "Loading...";
  19837. this.curNum = 0;
  19838. this.accTime = 0;
  19839. this.loadRes();
  19840. }
  19841. if (this.loadResOK) {
  19842. this.openLoading = false;
  19843. Laya.timer.once(300, this, () => {
  19844. xGame.common.d3Scene.active = false;
  19845. MoyuMgr$1.showAgree(enterGame);
  19846. });
  19847. }
  19848. }
  19849. }
  19850. release() {
  19851. }
  19852. hide() {
  19853. super.hide();
  19854. this.release();
  19855. }
  19856. onClose() {
  19857. this.hide();
  19858. }
  19859. }
  19860. UILoading.uiName = "UILoading";
  19861. class UIRepentProp$1 extends UIBase {
  19862. constructor() {
  19863. super();
  19864. this.viewType = 0;
  19865. this.regretType = 0;
  19866. }
  19867. onConstructor() {
  19868. this.ui = ui_UIRepentProp.createInstance();
  19869. this.contentPane = this.ui;
  19870. this.isEject = false;
  19871. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19872. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19873. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19874. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19875. }
  19876. show(viewType, regretType, callback) {
  19877. PlatMgr.showInsert(true);
  19878. this.viewType = viewType;
  19879. this.regretType = regretType;
  19880. this.callback = callback;
  19881. super.show();
  19882. this.ui.t0.play();
  19883. this.ui.c1.selectedIndex = this.viewType;
  19884. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19885. if (this.viewType == 0) {
  19886. let guide = DataMgr.getGuideHelpLine();
  19887. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19888. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19889. }
  19890. xGame.common.gameMgr.gamePause = true;
  19891. this.setGlobalFont(this.ui);
  19892. }
  19893. hideSelf() {
  19894. xGame.common.gameMgr.gamePause = false;
  19895. this.callback && this.callback(false);
  19896. this.hide();
  19897. }
  19898. videoRegret() {
  19899. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19900. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19901. }
  19902. else {
  19903. console.log('zh:AD 失败,直接发放奖励');
  19904. this.qjff_AD_for_UIrepentProp_videoRegret();
  19905. }
  19906. }
  19907. qjff_AD_for_UIrepentProp_videoRegret() {
  19908. this.callback && this.callback(true);
  19909. this.hideSelf();
  19910. }
  19911. videoAddHelpLine() {
  19912. let guide = DataMgr.getGuideHelpLine();
  19913. if (guide == 0) {
  19914. this.callback && this.callback(true);
  19915. this.hideSelf();
  19916. DataMgr.setGuideHelpLine();
  19917. xGame.common.gameUI.ui.guideNode.visible = false;
  19918. }
  19919. else {
  19920. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19921. if (Laya.Browser.onAndroid) {
  19922. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19923. if (!boo) {
  19924. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19925. return;
  19926. }
  19927. }
  19928. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19929. }
  19930. else {
  19931. console.log('zh:AD 失败,直接发放奖励');
  19932. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19933. }
  19934. }
  19935. }
  19936. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19937. this.callback && this.callback(true);
  19938. this.hideSelf();
  19939. }
  19940. }
  19941. UIRepentProp$1.uiName = "UIRepentProp";
  19942. class UIRodMethod$1 extends UIBase {
  19943. constructor() {
  19944. super();
  19945. this.isPressd = false;
  19946. }
  19947. onConstructor() {
  19948. this.ui = ui_UIRodMethod.createInstance();
  19949. this.contentPane = this.ui;
  19950. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19951. this.moveDir = new Laya.Vector2();
  19952. this.moveDest = new Laya.Vector2();
  19953. this.centerPos = new Laya.Vector2();
  19954. xGame.common.uiRodMethod = this;
  19955. }
  19956. show() {
  19957. super.show();
  19958. xGame.common.gameMgr.gamePause = true;
  19959. this.openPressDotEvent();
  19960. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19961. this.centerPos.x = this.ui.white.x;
  19962. this.centerPos.y = this.ui.white.y;
  19963. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19964. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19965. this.setDot();
  19966. this.setGlobalFont(this.ui);
  19967. }
  19968. setDot() {
  19969. this.ui.dot.x = this.moveDest.x;
  19970. this.ui.dot.y = this.moveDest.y;
  19971. }
  19972. closeSelf() {
  19973. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19974. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19975. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19976. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19977. xGame.common.gameMgr.gamePause = false;
  19978. this.hide();
  19979. }
  19980. openPressDotEvent() {
  19981. this.closePressDotEvent();
  19982. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19983. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19984. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19985. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19986. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19987. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19988. }
  19989. closePressDotEvent() {
  19990. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19991. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19992. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19993. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19994. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19995. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19996. }
  19997. onDown(e) {
  19998. if (e.type == Laya.Event.MOUSE_DOWN)
  19999. this.isPressd = true;
  20000. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  20001. this.isPressd = false;
  20002. if (!this.isPressd)
  20003. return;
  20004. this.moveDest.x = e.stageX;
  20005. this.moveDest.y = e.stageY;
  20006. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  20007. if (dis > 6724) {
  20008. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  20009. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  20010. }
  20011. this.setDot();
  20012. }
  20013. resetRod() {
  20014. this.ui.dot.x = this.ui.white.x;
  20015. this.ui.dot.y = this.ui.white.y;
  20016. this.gameRod.dot.x = this.gameRod.bg.x;
  20017. this.gameRod.dot.y = this.gameRod.bg.y;
  20018. xGame.common.rodOffest.x = 0;
  20019. xGame.common.rodOffest.y = 0;
  20020. }
  20021. }
  20022. UIRodMethod$1.uiName = "UIRodMethod";
  20023. class UIMsg$1 extends UIBase {
  20024. constructor() {
  20025. super();
  20026. }
  20027. onConstructor() {
  20028. this.ui = ui_UIMsg.createInstance();
  20029. this.contentPane = this.ui;
  20030. this.isEject = false;
  20031. this.isMuti = true;
  20032. }
  20033. show(msg, callback) {
  20034. super.show();
  20035. this.ui.tipsNode.msgTxt.text = msg;
  20036. this.ui.alpha = 1;
  20037. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  20038. this.hide();
  20039. callback && callback();
  20040. }), 1000);
  20041. this.setGlobalFont(this.ui);
  20042. }
  20043. }
  20044. UIMsg$1.uiName = "UIMsg";
  20045. class UITips$1 extends UIBase {
  20046. constructor() {
  20047. super();
  20048. this.type = 0;
  20049. }
  20050. onConstructor() {
  20051. this.ui = ui_UITips.createInstance();
  20052. this.contentPane = this.ui;
  20053. this.isEject = false;
  20054. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20055. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20056. }
  20057. show(tipsTxt, womanTxt, type) {
  20058. super.show();
  20059. this.ui.t0.play();
  20060. this.ui.myNode.tipsTxt.text = tipsTxt;
  20061. this.ui.myNode.womanTxt.text = womanTxt;
  20062. PlatMgr.showInsert(true);
  20063. this.ui.myNode.c1.selectedIndex = type;
  20064. this.type = type;
  20065. switch (this.type) {
  20066. case TipsType.exitGame:
  20067. xGame.common.gameMgr.gamePause = true;
  20068. break;
  20069. case TipsType.foul:
  20070. Laya.timer.once(200, this, () => {
  20071. if (xGame.common.gameMgr) {
  20072. xGame.common.gameMgr.gamePause = true;
  20073. }
  20074. else {
  20075. console.log("zh:gameMgr is null");
  20076. }
  20077. });
  20078. break;
  20079. default:
  20080. break;
  20081. }
  20082. this.setGlobalFont(this.ui);
  20083. }
  20084. clickLeftBtn() {
  20085. this.hide();
  20086. xGame.common.gameMgr.gamePause = false;
  20087. switch (this.type) {
  20088. case TipsType.exitGame:
  20089. break;
  20090. case TipsType.foul:
  20091. break;
  20092. default:
  20093. break;
  20094. }
  20095. }
  20096. clickRightBtn() {
  20097. this.hide();
  20098. switch (this.type) {
  20099. case TipsType.exitGame:
  20100. xGame.eventMgr.event(RESET_GAME);
  20101. xGame.uiMgr.Show(UIMain$1);
  20102. Moyu.recordEnd(this, null);
  20103. xGame.common.longHelpLine = false;
  20104. break;
  20105. case TipsType.foul:
  20106. if (xGame.common.gameMgr) {
  20107. xGame.common.gameMgr.gamePause = false;
  20108. }
  20109. Laya.timer.clearAll(this);
  20110. break;
  20111. default:
  20112. break;
  20113. }
  20114. }
  20115. }
  20116. UITips$1.uiName = "UITips";
  20117. class UIGame$1 extends UIBase {
  20118. constructor() {
  20119. super();
  20120. this.powerNum = 0;
  20121. this.isD3Inited = false;
  20122. this.isPrePlay = false;
  20123. this.isMoveRod = false;
  20124. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20125. this.rulerDis = 20;
  20126. this.rulerOffset = 0;
  20127. }
  20128. onConstructor() {
  20129. this.ui = ui_UIGame.createInstance();
  20130. this.contentPane = this.ui;
  20131. this.ui.x += xGame.common.sysOffestNum;
  20132. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20133. this.isEject = false;
  20134. xGame.common.gameUI = this;
  20135. this.initSelf();
  20136. }
  20137. isTurnSelf() {
  20138. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20139. return true;
  20140. }
  20141. }
  20142. initSelf() {
  20143. let topUI = this.ui.topNode;
  20144. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20145. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20146. this.barInfo = {};
  20147. this.barInfo.curY = 0;
  20148. this.barInfo.height = this.ui.powerNode.height;
  20149. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20150. this.barInfo.powerStartY = this.ui.powerNode.y;
  20151. xGame.common.aiPlayer = new AIPlayer();
  20152. xGame.common.gameMgr = new GameMgr();
  20153. xGame.common.skillMgr = new SkillMgr();
  20154. xGame.common.wordsMgr = new WordsMgr();
  20155. xGame.common.talkMgr = new TalkMgr();
  20156. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20157. });
  20158. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20159. });
  20160. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20161. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20162. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20163. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20164. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20165. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20166. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20167. }
  20168. getGanZiImg() {
  20169. let index = DataMgr.getCurBallRod();
  20170. let data = cfgTable.ballrodData[index + 1];
  20171. let gan_url = xGame.common.getGameIconUrl(data.img);
  20172. this.ui.powerNode.showImg.url = gan_url;
  20173. }
  20174. returnHome() {
  20175. let tips = "Are you sure to exit the game?";
  20176. let woman = "Boss, why don't you play for a while longer?";
  20177. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20178. }
  20179. addRodMethodClick() {
  20180. if (this.isTurnSelf()) {
  20181. xGame.uiMgr.Show(UIRodMethod$1);
  20182. }
  20183. }
  20184. clickHelpLineBtn(force = false) {
  20185. if (!this.isTurnSelf())
  20186. return;
  20187. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20188. if (success) {
  20189. xGame.common.longHelpLine = true;
  20190. xGame.common.d2World.getHelpLine();
  20191. Moyu.sendDataEvent("guideNum");
  20192. }
  20193. else {
  20194. }
  20195. });
  20196. }
  20197. renderSelfDisplayBalls(index, target) {
  20198. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20199. target.myImg.url = xGame.common.getGameIconUrl(str);
  20200. }
  20201. renderAIDisplayBalls(index, target) {
  20202. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20203. target.myImg.url = xGame.common.getGameIconUrl(str);
  20204. ;
  20205. }
  20206. updateMode() {
  20207. if (xGame.common.gameMode == GameMode.classic) {
  20208. this.ui.topNode.scoreNode.visible = false;
  20209. }
  20210. else if (xGame.common.gameMode == GameMode.bigMove) {
  20211. this.ui.topNode.scoreNode.visible = true;
  20212. }
  20213. }
  20214. show() {
  20215. super.show();
  20216. this.ui.alpha = 0;
  20217. this.updateSelf();
  20218. xGame.common.gameMgr.gamePause = false;
  20219. xGame.common.gameUI.ui.blackAni.visible = false;
  20220. xGame.common.gameUI.ui.whiteAni.visible = false;
  20221. this.ui.powerEft.visible = false;
  20222. this.ui.colorNode.visible = false;
  20223. this.updateHead();
  20224. let curUse = DataMgr.getCurBallRod();
  20225. this.getGanZiImg();
  20226. this.setGlobalFont(this.ui);
  20227. }
  20228. updateSelf() {
  20229. if (xGame.common.gameMode == GameMode.classic) {
  20230. this.ui.c1.selectedIndex = 0;
  20231. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20232. this.ui.topNode.middleNode.visible = true;
  20233. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20234. }
  20235. else if (xGame.common.gameMode == GameMode.bigMove) {
  20236. this.ui.c1.selectedIndex = 0;
  20237. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20238. this.ui.topNode.middleNode.visible = false;
  20239. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20240. let rand = xGame.common.randomNum(1, max);
  20241. let guide = DataMgr.getSkillGuide();
  20242. if (guide == 0)
  20243. rand = 1;
  20244. xGame.common.bigMoveLevelIndex = rand;
  20245. }
  20246. else if (xGame.common.gameMode == GameMode.placeBall) {
  20247. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20248. this.ui.c1.selectedIndex = 1 + data.type;
  20249. this.ui.alpha = 1;
  20250. this.startGame();
  20251. }
  20252. this.updateMode();
  20253. this.initD3world();
  20254. this.initD2world();
  20255. }
  20256. startGame() {
  20257. this.ui.snowNode.visible = Math.random() <= 0.1;
  20258. this.ui.d2Node.visible = false;
  20259. xGame.common.d3World.d3Hand.gameObj.active = false;
  20260. xGame.common.d3World.tableSrc.init();
  20261. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20262. this.cameraViewChange(() => {
  20263. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20264. switch (xGame.common.gameMode) {
  20265. case GameMode.classic:
  20266. xGame.common.d3World.d3Hand.gameObj.active = true;
  20267. this.playPutBallD3Ani();
  20268. break;
  20269. case GameMode.bigMove:
  20270. this.enterGame();
  20271. Laya.timer.once(500, this, () => {
  20272. this.ui.topNode.middleNode.visible = true;
  20273. this.ui.topNode.middleNode.t0.play();
  20274. });
  20275. break;
  20276. case GameMode.placeBall:
  20277. this.enterGame();
  20278. break;
  20279. default:
  20280. break;
  20281. }
  20282. });
  20283. PlatMgr.showBanner(false);
  20284. }
  20285. enterGame() {
  20286. this.ui.d2Node.visible = true;
  20287. xGame.common.d3World.d3Hand.gameObj.active = false;
  20288. xGame.common.showOneCamera("mainCamera");
  20289. Moyu.recordGame(30, true);
  20290. if (!this.isPrePlay) {
  20291. this.isPrePlay = true;
  20292. xGame.common.d3World.prePlayEft();
  20293. }
  20294. xGame.common.gameMgr.gameReady();
  20295. this.openAllEvent();
  20296. this.ui.snowNode.visible = false;
  20297. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20298. this.ui.helpBtn.visible = condition;
  20299. }
  20300. showHelpLineGuide() {
  20301. let longGuide = DataMgr.getGuideHelpLine();
  20302. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20303. this.ui.helpBtn.visible = true;
  20304. this.ui.guideNode.visible = true;
  20305. }
  20306. }
  20307. setTurnAlpha(alpha) {
  20308. this.ui.keduNode.alpha = alpha;
  20309. this.ui.ganNode.alpha = alpha;
  20310. this.ui.rodMethodNode.alpha = alpha;
  20311. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20312. }
  20313. cameraViewChange(callback) {
  20314. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20315. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20316. xGame.common.showOneCamera("visitAngle");
  20317. cameraSrc.localRotationEulerY = 180;
  20318. cameraSrc.localRotationEulerZ = 0;
  20319. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20320. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20321. callback && callback();
  20322. }));
  20323. }));
  20324. }
  20325. playPutBallD3Ani() {
  20326. xGame.common.showOneCamera("mainCamera");
  20327. let handSrc = xGame.common.d3World.d3Hand;
  20328. handSrc.gameObj.active = true;
  20329. handSrc.transform.localPositionZ = 3;
  20330. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20331. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20332. handSrc.gameObj.active = false;
  20333. this.enterGame();
  20334. }), 400);
  20335. }));
  20336. }
  20337. updateHead() {
  20338. let user = Moyu.getUserInfo();
  20339. this.ui.topNode.selfNameTxt.text = user.nickName;
  20340. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20341. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20342. if (DataMgr.getSkillGuide() < 1) {
  20343. this.ui.topNode.aiNameTxt.text = 'billiards';
  20344. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20345. }
  20346. else {
  20347. this.ui.topNode.aiNameTxt.text = aiData.name;
  20348. let randNo = Math.floor(Math.random() * 10) + 1;
  20349. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20350. }
  20351. }
  20352. initD2world() {
  20353. let node = this.ui.d2Root.displayObject;
  20354. let src = node.getComponent(D2World);
  20355. if (!src) {
  20356. xGame.common.d2World = node.addComponent(D2World);
  20357. }
  20358. xGame.common.d2World.initSelf();
  20359. }
  20360. initD3world() {
  20361. if (this.isD3Inited)
  20362. return;
  20363. this.isD3Inited = true;
  20364. let scene3D = xGame.common.d3Scene;
  20365. this.ui.d3Root.displayObject.addChild(scene3D);
  20366. scene3D.active = true;
  20367. xGame.common.d3World.tableSrc.setBorderPos();
  20368. }
  20369. onRootMove(e) {
  20370. let rootBall = xGame.common.d2World.rootBall;
  20371. this.ui.moveNode.x = e.x;
  20372. this.ui.moveNode.y = e.y;
  20373. rootBall.gameObj.x = e.x;
  20374. rootBall.gameObj.y = e.y;
  20375. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20376. }
  20377. aiRootMove(move) {
  20378. if (move)
  20379. this.hideBallUI();
  20380. else {
  20381. this.showBallUI();
  20382. xGame.common.d2World.getHelpLine();
  20383. }
  20384. }
  20385. aiForce(type, force = 0) {
  20386. this.pressTarget = PressType.powerNode;
  20387. if (type == 1)
  20388. this.onEventUp({ force: true });
  20389. else if (type == 2)
  20390. this.onEventMove({ stageY: force, force: true });
  20391. }
  20392. onEventPress(e) {
  20393. if (e.stopPropagation)
  20394. e.stopPropagation();
  20395. if (!this.isTurnSelf())
  20396. return;
  20397. let target = e.target;
  20398. switch (target) {
  20399. case this.ui.myPowerNode.displayObject:
  20400. this.pressTarget = PressType.powerNode;
  20401. this.barInfo.curY = e.stageY;
  20402. this.updateBarInfo();
  20403. break;
  20404. case this.ui.moveNode.displayObject:
  20405. this.pressTarget = PressType.moveNode;
  20406. this.hideBallUI();
  20407. this.eventObj.curX = this.ui.moveNode.x;
  20408. this.eventObj.curY = this.ui.moveNode.y;
  20409. this.ui.moveNode.finger.visible = false;
  20410. this.eventObj.lastX = e.stageX;
  20411. this.eventObj.lastY = e.stageY;
  20412. break;
  20413. case this.ui.rulerClickNode.displayObject:
  20414. this.pressTarget = PressType.rulerNode;
  20415. this.eventObj.lastY = e.stageY;
  20416. break;
  20417. case this.ui.d2Root.displayObject:
  20418. this.pressTarget = PressType.d2Root;
  20419. this.eventObj.lastX = e.stageX;
  20420. this.eventObj.lastY = e.stageY;
  20421. this.eventObj.starX = e.stageX;
  20422. this.eventObj.starY = e.stageY;
  20423. this.eventObj.curX = 0;
  20424. this.eventObj.curY = 0;
  20425. xGame.common.d2World.d2Gan.setGanLastInfo();
  20426. this.rulerOffset = 0;
  20427. break;
  20428. default:
  20429. break;
  20430. }
  20431. }
  20432. onEventMove(e) {
  20433. if (e.stopPropagation)
  20434. e.stopPropagation();
  20435. if (e && e.force) {
  20436. }
  20437. else {
  20438. if (!this.isTurnSelf())
  20439. return;
  20440. }
  20441. switch (this.pressTarget) {
  20442. case PressType.powerNode:
  20443. this.barInfo.curY = e.stageY;
  20444. this.updateBarInfo();
  20445. this.isMoveRod = true;
  20446. break;
  20447. case PressType.moveNode:
  20448. let rootBall = xGame.common.d2World.rootBall;
  20449. let radius = rootBall.gameObj.width / 2;
  20450. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20451. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20452. let border = xGame.common.d2World.borderRect;
  20453. if (curX <= border.x + radius)
  20454. curX = border.x + radius;
  20455. else if (curX >= border.x + border.width - radius)
  20456. curX = border.x + border.width - radius;
  20457. if (curY <= border.y + radius)
  20458. curY = border.y + radius;
  20459. else if (curY >= border.y + border.height - radius)
  20460. curY = border.y + border.height - radius;
  20461. if (xGame.common.gameMgr.isOpenBall) {
  20462. if (curX >= border.x + border.openBallW - radius)
  20463. curX = border.x + border.openBallW - radius;
  20464. }
  20465. this.ui.moveNode.x = curX;
  20466. this.ui.moveNode.y = curY;
  20467. rootBall.gameObj.x = curX;
  20468. rootBall.gameObj.y = curY;
  20469. rootBall.d3BallSrc.setTransPos(curX, curY);
  20470. this.isMoveRod = true;
  20471. break;
  20472. case PressType.rulerNode:
  20473. let yy = e.stageY - this.eventObj.lastY;
  20474. this.eventObj.lastY = e.stageY;
  20475. let ruler1 = this.ui.rulerNode.img1;
  20476. let ruler2 = this.ui.rulerNode.img2;
  20477. ruler1.y += yy;
  20478. ruler2.y += yy;
  20479. this.rulerOffset += yy;
  20480. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20481. this.rulerOffset = 0;
  20482. xGame.soundMgr.playSound("inch", 1, 10);
  20483. }
  20484. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20485. let h = ruler1.height;
  20486. this.checkGuide();
  20487. this.isMoveRod = true;
  20488. if (ruler1.y >= h) {
  20489. ruler1.y = -h;
  20490. ruler2.y = 0;
  20491. return;
  20492. }
  20493. else if (ruler1.y <= -h) {
  20494. ruler1.y = h;
  20495. ruler2.y = 0;
  20496. return;
  20497. }
  20498. if (ruler2.y >= h) {
  20499. ruler2.y = -h;
  20500. ruler1.y = 0;
  20501. return;
  20502. }
  20503. else if (ruler2.y <= -h) {
  20504. ruler2.y = h;
  20505. ruler1.y = 0;
  20506. return;
  20507. }
  20508. break;
  20509. case PressType.d2Root:
  20510. this.eventObj.curX = e.stageX;
  20511. this.eventObj.curY = e.stageY;
  20512. let offset = this.checkRodMoveDir();
  20513. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20514. this.eventObj.lastX = e.stageX;
  20515. this.eventObj.lastY = e.stageY;
  20516. break;
  20517. default:
  20518. break;
  20519. }
  20520. }
  20521. onEventUp(e) {
  20522. if (e.stopPropagation)
  20523. e.stopPropagation();
  20524. if (e && e.force) {
  20525. }
  20526. else {
  20527. if (!this.isTurnSelf())
  20528. return;
  20529. }
  20530. switch (this.pressTarget) {
  20531. case PressType.powerNode:
  20532. this.ui.powerNode.value = 0;
  20533. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20534. this.ui.powerTxt.text = "";
  20535. if (this.powerNum > 0) {
  20536. xGame.eventMgr.event(BALL_SHOOT);
  20537. xGame.common.d2World.shoot(this.powerNum);
  20538. xGame.common.d2World.d2Gan.shoot();
  20539. xGame.common.d2World.d2HelpLine.shoot();
  20540. this.finishGuide();
  20541. this.ui.powerEft.visible = false;
  20542. this.ui.colorNode.visible = false;
  20543. let ganStr = "";
  20544. if (this.powerNum <= 30) {
  20545. ganStr = "gan_30";
  20546. }
  20547. else if (this.powerNum <= 60) {
  20548. ganStr = "gan_50";
  20549. }
  20550. else {
  20551. ganStr = "gan_80";
  20552. }
  20553. xGame.soundMgr.playSound(ganStr);
  20554. }
  20555. break;
  20556. case PressType.moveNode:
  20557. let rootBall = xGame.common.d2World.rootBall;
  20558. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20559. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20560. let isIntersect = this.judgeBallIntersect();
  20561. if (isIntersect) {
  20562. this.ui.moveNode.x = lastX;
  20563. this.ui.moveNode.y = lastY;
  20564. rootBall.gameObj.x = lastX;
  20565. rootBall.gameObj.y = lastY;
  20566. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20567. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20568. }
  20569. else {
  20570. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20571. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20572. }
  20573. this.showBallUI();
  20574. this.ui.moveNode.finger.visible = true;
  20575. xGame.common.d2World.getHelpLine();
  20576. break;
  20577. case PressType.rulerNode:
  20578. break;
  20579. case PressType.d2Root:
  20580. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20581. if (dis <= 25) {
  20582. this.moveToClickDot(e);
  20583. }
  20584. break;
  20585. default:
  20586. break;
  20587. }
  20588. this.pressTarget = -1;
  20589. }
  20590. checkGuide() {
  20591. let guide = DataMgr.getSkillGuide();
  20592. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20593. xGame.common.guideStep++;
  20594. xGame.common.gameUI.ui.guide2.visible = false;
  20595. xGame.common.gameUI.ui.guide3.visible = true;
  20596. }
  20597. }
  20598. finishGuide() {
  20599. let guide = DataMgr.getSkillGuide();
  20600. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20601. xGame.common.guideStep = 10;
  20602. this.closeAllGuide();
  20603. console.log('zh: 新手引导完毕');
  20604. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20605. }
  20606. }
  20607. closeAllGuide() {
  20608. xGame.common.gameUI.ui.guide1.visible = false;
  20609. xGame.common.gameUI.ui.guide2.visible = false;
  20610. xGame.common.gameUI.ui.guide3.visible = false;
  20611. }
  20612. updateBarInfo() {
  20613. let star = this.ui.powerNode.y;
  20614. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20615. if (rate >= 1)
  20616. rate = 1;
  20617. if (rate <= 0)
  20618. rate = 0;
  20619. this.powerNum = Math.ceil(rate * 100);
  20620. this.ui.powerNode.value = this.powerNum;
  20621. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20622. this.ui.colorNode.value = this.powerNum;
  20623. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20624. this.ui.powerEft.visible = this.powerNum != 0;
  20625. this.ui.colorNode.visible = this.powerNum != 0;
  20626. this.ui.powerTxt.text = this.powerNum + "";
  20627. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20628. }
  20629. forceCancel() {
  20630. this.ui.powerNode.value = 0;
  20631. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20632. this.ui.powerTxt.text = "";
  20633. }
  20634. checkRodMoveDir() {
  20635. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20636. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20637. if (tempX >= 0 && tempY <= 0) {
  20638. return this.checkDir();
  20639. }
  20640. else if (tempX < 0 && tempY < 0) {
  20641. return this.checkDir(1, -1);
  20642. }
  20643. else if (tempX < 0 && tempY > 0) {
  20644. return this.checkDir(-1, -1);
  20645. }
  20646. else {
  20647. return this.checkDir(-1, 1);
  20648. }
  20649. }
  20650. checkDir(flagX = 1, flagY = 1) {
  20651. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20652. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20653. if (offsetY == 0) {
  20654. return offsetX * flagX;
  20655. }
  20656. if (offsetX == 0) {
  20657. return offsetY * flagY;
  20658. }
  20659. let angle = offsetY / offsetX;
  20660. if (Math.abs(angle) >= 1) {
  20661. return offsetY * flagY;
  20662. }
  20663. else {
  20664. return offsetX * flagX;
  20665. }
  20666. }
  20667. judgeBallIntersect() {
  20668. let rootBall = xGame.common.d2World.rootBall;
  20669. let ballArr = xGame.common.d2World.ballArr;
  20670. let radius = rootBall.gameObj.width / 2;
  20671. let temp;
  20672. let isIntersect = false;
  20673. for (let index = 0; index < ballArr.length; index++) {
  20674. temp = ballArr[index];
  20675. if (temp.number == rootBall.number)
  20676. continue;
  20677. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20678. if (isIntersect) {
  20679. break;
  20680. }
  20681. }
  20682. return isIntersect;
  20683. }
  20684. hideBallUI() {
  20685. let d2Gan = xGame.common.d2World.d2Gan;
  20686. if (!d2Gan.ui.isDisposed)
  20687. d2Gan.ui.visible = false;
  20688. let d2Help = xGame.common.d2World.d2HelpLine;
  20689. if (!d2Help.ui.isDisposed)
  20690. d2Help.ui.visible = false;
  20691. let rootBall = xGame.common.d2World.rootBall;
  20692. if (!rootBall.destroyed) {
  20693. rootBall.gameObj.active = false;
  20694. }
  20695. }
  20696. showBallUI() {
  20697. let d2Gan = xGame.common.d2World.d2Gan;
  20698. if (!d2Gan.ui.isDisposed)
  20699. d2Gan.ui.visible = true;
  20700. let d2Help = xGame.common.d2World.d2HelpLine;
  20701. if (!d2Help.ui.isDisposed)
  20702. d2Help.ui.visible = true;
  20703. let rootBall = xGame.common.d2World.rootBall;
  20704. if (!rootBall.destroyed) {
  20705. rootBall.gameObj.active = true;
  20706. }
  20707. }
  20708. moveToClickDot(e) {
  20709. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20710. let root = xGame.common.d2World.rootBall.gameObj;
  20711. let xx = e.stageX - xGame.common.sysOffestNum;
  20712. let yy = e.stageY;
  20713. let x = xx - root.x;
  20714. let y = yy - root.y;
  20715. let angle = xGame.common.getfguiRotation(x, y);
  20716. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20717. xGame.common.d2World.getHelpLine();
  20718. }
  20719. this.isMoveRod = false;
  20720. xGame.common.clickedBall = false;
  20721. }
  20722. openAllEvent() {
  20723. this.closeAllEvent();
  20724. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20725. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20726. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20727. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20728. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20729. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20730. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20731. }
  20732. closeAllEvent() {
  20733. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20734. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20735. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20736. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20737. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20738. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20739. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20740. }
  20741. resetGame() {
  20742. this.closeAllEvent();
  20743. this.hideBallUI();
  20744. xGame.common.gameMgr.gamePause = true;
  20745. }
  20746. }
  20747. UIGame$1.uiName = "UIGame";
  20748. class UIAddCoin$1 extends UIBase {
  20749. constructor() {
  20750. super();
  20751. this.coinNum = 2000;
  20752. }
  20753. onConstructor() {
  20754. this.ui = ui_UIAddCoin.createInstance();
  20755. this.contentPane = this.ui;
  20756. this.isEject = false;
  20757. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20758. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20759. }
  20760. show() {
  20761. super.show();
  20762. this.ui.t0.play();
  20763. this.setGlobalFont(this.ui);
  20764. }
  20765. videoAddCoin() {
  20766. console.log('zh:qjff_AD_for_UIAddCoin');
  20767. if (Laya.Browser.onAndroid) {
  20768. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20769. if (!boo) {
  20770. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20771. return;
  20772. }
  20773. }
  20774. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20775. }
  20776. else {
  20777. console.log('zh:AD 失败,直接发放奖励');
  20778. this.qjff_AD_for_UIAddCoin();
  20779. }
  20780. }
  20781. qjff_AD_for_UIAddCoin() {
  20782. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20783. this.hide();
  20784. }
  20785. }
  20786. UIAddCoin$1.uiName = "UIAddCoin";
  20787. class UIInvitation$1 extends UIBase {
  20788. constructor() {
  20789. super();
  20790. }
  20791. onConstructor() {
  20792. this.ui = ui_UIInvitation.createInstance();
  20793. this.contentPane = this.ui;
  20794. this.isEject = false;
  20795. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20796. }
  20797. show() {
  20798. super.show();
  20799. this.setGlobalFont(this.ui);
  20800. }
  20801. enterGame() {
  20802. xGame.common.gameMode = GameMode.classic;
  20803. DataMgr.setChallengeTimes(1);
  20804. xGame.common.passAwardCoin = 2000;
  20805. let need = xGame.common.classicNiceNeddCoin;
  20806. if (DataMgr.coinEnough(need)) {
  20807. DataMgr.setCoin(-need);
  20808. xGame.eventMgr.event(RESTART_GAME, true);
  20809. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20810. }
  20811. else {
  20812. xGame.eventMgr.event(RESTART_GAME, true);
  20813. }
  20814. this.hide();
  20815. }
  20816. hide() {
  20817. super.hide();
  20818. }
  20819. }
  20820. UIInvitation$1.uiName = "UIInvitation";
  20821. class UIPower$1 extends UIBase {
  20822. constructor() {
  20823. super();
  20824. }
  20825. onConstructor() {
  20826. this.ui = ui_UIPower.createInstance();
  20827. this.contentPane = this.ui;
  20828. this.isEject = false;
  20829. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20830. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20831. }
  20832. show() {
  20833. super.show();
  20834. this.ui.t0.play();
  20835. this.setGlobalFont(this.ui);
  20836. }
  20837. videoGetPower() {
  20838. console.log('zh:qjff_AD_for_uipower');
  20839. if (Laya.Browser.onAndroid) {
  20840. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20841. if (!boo) {
  20842. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20843. return;
  20844. }
  20845. }
  20846. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20847. }
  20848. else {
  20849. console.log('zh:AD 失败,直接发放奖励');
  20850. this.qjff_AD_for_uipower();
  20851. }
  20852. }
  20853. qjff_AD_for_uipower() {
  20854. DataMgr.setPower(xGame.common.videoPower, true);
  20855. xGame.eventMgr.event(POWER_TIME);
  20856. this.hide();
  20857. }
  20858. }
  20859. UIPower$1.uiName = "UIPower";
  20860. class UIGameEnd$1 extends UIBase {
  20861. constructor() {
  20862. super();
  20863. this.success = false;
  20864. this.awardCoinNum = 1000;
  20865. this.awardDiamondNum = 10;
  20866. }
  20867. onConstructor() {
  20868. this.ui = ui_UIGameEnd.createInstance();
  20869. this.contentPane = this.ui;
  20870. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20871. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20872. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20873. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20874. this.ui.talkNode.visible = false;
  20875. if (Moyu.isKs)
  20876. this.ui.closeNode.closeBtn.x += 100;
  20877. }
  20878. updateType() {
  20879. switch (xGame.common.gameMode) {
  20880. case GameMode.classic:
  20881. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20882. this.ui.coinNode.visible = this.success;
  20883. if (!this.success) {
  20884. Laya.timer.once(500, this, () => {
  20885. xGame.uiMgr.Show(UIAddCoin$1);
  20886. });
  20887. }
  20888. else {
  20889. this.logEventForClassic_win();
  20890. }
  20891. this.logEventForClassic_complete();
  20892. this.ui.isGetAward.visible = false;
  20893. this.ui.leftBtn.c1.selectedIndex = 3;
  20894. this.ui.rightBtn.c1.selectedIndex = 0;
  20895. this.moneyNode.ui.c1.selectedIndex = 1;
  20896. break;
  20897. case GameMode.bigMove:
  20898. console.log('zh:招法模式 aaaaaa bigMove');
  20899. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20900. this.ui.coinNode.visible = this.success;
  20901. if (xGame.common.gameMode == GameMode.bigMove) {
  20902. if (this.success) {
  20903. DataMgr.setSkillSuccessTimes(1, true);
  20904. DataMgr.setSkillAccTimes(1);
  20905. }
  20906. else {
  20907. DataMgr.setSkillSuccessTimes(0, false);
  20908. }
  20909. }
  20910. this.logEventForRod_complete_N();
  20911. if (!this.success) {
  20912. Laya.timer.once(500, this, () => {
  20913. xGame.uiMgr.Show(UIAddCoin$1);
  20914. });
  20915. }
  20916. else {
  20917. this.logEventForRod_win();
  20918. }
  20919. this.ui.isGetAward.visible = false;
  20920. this.ui.leftBtn.c1.selectedIndex = 3;
  20921. this.ui.rightBtn.c1.selectedIndex = 0;
  20922. this.moneyNode.ui.c1.selectedIndex = 1;
  20923. break;
  20924. case GameMode.placeBall:
  20925. this.ui.coinNode.visible = false;
  20926. if (this.success) {
  20927. if (xGame.common.placeBallStarNum == 3) {
  20928. this.ui.c1.selectedIndex = 2;
  20929. }
  20930. else {
  20931. this.ui.c1.selectedIndex = 3;
  20932. }
  20933. let level = xGame.common.placeBallCurLevel;
  20934. if (level > 59) {
  20935. this.logEventForChallenge_level_complete(level);
  20936. }
  20937. else {
  20938. this.logEventForChallenge_level_N(level);
  20939. }
  20940. }
  20941. else {
  20942. this.ui.c1.selectedIndex = 4;
  20943. }
  20944. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20945. if (cfg.type == PlaceBallType.challenge) {
  20946. this.ui.c1.selectedIndex = 2;
  20947. }
  20948. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20949. this.updatePlaceBallBtn();
  20950. this.updatePlaceBallStarNum();
  20951. this.updatePlaceBallAwardState();
  20952. this.moneyNode.ui.c1.selectedIndex = 2;
  20953. this.moneyNode.checkPowerTime();
  20954. this.moneyNode.powerChange();
  20955. DataMgr.upRankData();
  20956. break;
  20957. default:
  20958. break;
  20959. }
  20960. }
  20961. logEventForRod_complete_N() {
  20962. let gfmsIdx = xGame.common.curPlayerSkillType;
  20963. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20964. let gfmc = 'Skyfall Shot';
  20965. if (gfmsIdx == 0) {
  20966. gfmc = 'Skyfall Shot';
  20967. }
  20968. if (gfmsIdx == 1) {
  20969. gfmc = 'Surging break';
  20970. }
  20971. if (gfmsIdx == 2) {
  20972. gfmc = 'Frost Lock';
  20973. }
  20974. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20975. console.log('zh:logEventForRod_complete_N level = ' + level);
  20976. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20977. let jsonStr = {
  20978. "count": 0,
  20979. "name": gfmc
  20980. };
  20981. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20982. const d = LocalStorageManager.getItem(keyStr);
  20983. jsonStr.count = d.count + 1;
  20984. LocalStorageManager.setItem(keyStr, jsonStr);
  20985. }
  20986. else {
  20987. LocalStorageManager.setItem(keyStr, jsonStr);
  20988. }
  20989. const d2 = LocalStorageManager.getItem(keyStr);
  20990. let count = d2.count;
  20991. console.log('zh:logEventForRod_complete_N count = ' + count);
  20992. if (count % 5 == 0) {
  20993. const reqStr = JSON.stringify(jsonStr);
  20994. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20995. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20996. }
  20997. }
  20998. logEventForRod_win() {
  20999. console.log('zh:logEventForRod_win,胜利');
  21000. let gfmsIdx = xGame.common.curPlayerSkillType;
  21001. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  21002. let gfmc = 'Skyfall Shot';
  21003. if (gfmsIdx == 0) {
  21004. gfmc = 'Skyfall Shot';
  21005. }
  21006. if (gfmsIdx == 1) {
  21007. gfmc = 'Surging break';
  21008. }
  21009. if (gfmsIdx == 2) {
  21010. gfmc = 'Frost Lock';
  21011. }
  21012. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21013. console.log('zh:logEventForRod_win level = ' + level);
  21014. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  21015. let jsonStr = {
  21016. "count": 1,
  21017. "name": gfmc + ' Lev' + level
  21018. };
  21019. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21020. const d = LocalStorageManager.getItem(keyStr);
  21021. jsonStr.count = d.count + 1;
  21022. LocalStorageManager.setItem(keyStr, jsonStr);
  21023. }
  21024. else {
  21025. LocalStorageManager.setItem(keyStr, jsonStr);
  21026. }
  21027. const reqStr = JSON.stringify(jsonStr);
  21028. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  21029. }
  21030. logEventForClassic_win() {
  21031. console.log('zh:logEventForClassic_win,胜利');
  21032. let rtype = xGame.common.classicRoomType;
  21033. let msmc = '';
  21034. if (rtype == 1) {
  21035. msmc = 'beginner';
  21036. }
  21037. if (rtype == 2) {
  21038. msmc = 'expert';
  21039. }
  21040. if (rtype == 3) {
  21041. msmc = 'master';
  21042. }
  21043. let keyStr = 'sjmd_classic_win_' + rtype;
  21044. let jsonStr = {
  21045. "difficulty": msmc,
  21046. "classic_count": 1,
  21047. "difficulty_count": 1
  21048. };
  21049. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21050. const d = LocalStorageManager.getItem(keyStr);
  21051. jsonStr.classic_count = d.classic_count + 1;
  21052. jsonStr.difficulty_count = d.difficulty_count + 1;
  21053. LocalStorageManager.setItem(keyStr, jsonStr);
  21054. }
  21055. else {
  21056. LocalStorageManager.setItem(keyStr, jsonStr);
  21057. }
  21058. const reqStr = JSON.stringify(jsonStr);
  21059. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21060. }
  21061. logEventForClassic_complete() {
  21062. console.log('zh:logEventForClassic_complete,胜利');
  21063. let rtype = xGame.common.classicRoomType;
  21064. let msmc = '';
  21065. if (rtype == 1) {
  21066. msmc = 'beginner';
  21067. }
  21068. if (rtype == 2) {
  21069. msmc = 'expert';
  21070. }
  21071. if (rtype == 3) {
  21072. msmc = 'master';
  21073. }
  21074. let keyStr = 'sjmd_classic_complete_' + rtype;
  21075. let jsonStr = {
  21076. "msmc": msmc,
  21077. "count": 0
  21078. };
  21079. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21080. const d = LocalStorageManager.getItem(keyStr);
  21081. jsonStr.count = d.count + 1;
  21082. LocalStorageManager.setItem(keyStr, jsonStr);
  21083. }
  21084. else {
  21085. LocalStorageManager.setItem(keyStr, jsonStr);
  21086. }
  21087. if (jsonStr.count % 5 == 0) {
  21088. const reqStr = JSON.stringify(jsonStr);
  21089. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21090. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21091. }
  21092. }
  21093. updatePlaceBallBtn() {
  21094. this.ui.leftBtn.c1.selectedIndex = 5;
  21095. if (this.success) {
  21096. this.ui.rightBtn.c1.selectedIndex = 14;
  21097. }
  21098. else {
  21099. if (xGame.common.placeBallStarNum == 3) {
  21100. this.ui.rightBtn.c1.selectedIndex = 14;
  21101. }
  21102. else {
  21103. this.ui.rightBtn.c1.selectedIndex = 1;
  21104. }
  21105. }
  21106. }
  21107. updatePlaceBallStarNum() {
  21108. let starNum = xGame.common.placeBallStarNum;
  21109. if (starNum == 0)
  21110. this.ui.starNumNode.c1.selectedIndex = 3;
  21111. else {
  21112. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21113. }
  21114. }
  21115. updatePlaceBallAwardState() {
  21116. let level = xGame.common.placeBallCurLevel;
  21117. let starNum = xGame.common.placeBallStarNum;
  21118. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21119. let data = cfgTable.placeballData[level].award;
  21120. let cfg = cfgTable.placeballData[level];
  21121. this.awardDiamondNum = data[1];
  21122. this.awardCoinNum = data[0];
  21123. if (cfg.type == PlaceBallType.challenge) {
  21124. this.awardDiamondNum = 0;
  21125. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21126. }
  21127. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21128. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21129. if (cfg.type == PlaceBallType.challenge) {
  21130. this.ui.awardNode.coinNode.visible = true;
  21131. }
  21132. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21133. this.ui.awardNode.diamondNode.x = 265;
  21134. this.ui.awardNode.coinNode.x = 354;
  21135. }
  21136. else {
  21137. this.ui.awardNode.diamondNode.x = 291;
  21138. this.ui.awardNode.coinNode.x = 291;
  21139. }
  21140. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21141. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21142. if (this.awardCoinNum == 0) {
  21143. this.ui.awardNode.coinNode.numTxt.text = "";
  21144. }
  21145. if (getAward) {
  21146. this.ui.isGetAward.visible = true;
  21147. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21148. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21149. }
  21150. else {
  21151. this.ui.isGetAward.visible = false;
  21152. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21153. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21154. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21155. }
  21156. else {
  21157. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21158. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21159. }
  21160. }
  21161. }
  21162. show(success) {
  21163. super.show();
  21164. xGame.eventMgr.event(RESET_GAME);
  21165. this.success = success;
  21166. Laya.timer.clearAll(this);
  21167. this.playSecretaryAni();
  21168. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21169. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21170. offsetTime = Math.floor(offsetTime / 1000);
  21171. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21172. this.updateType();
  21173. Laya.timer.once(200, this, () => {
  21174. this.addAward(() => {
  21175. this.updateType();
  21176. Laya.timer.once(500, this, () => {
  21177. this.showChallengeLevel();
  21178. });
  21179. });
  21180. });
  21181. if (this.success) {
  21182. JSBridgeUtils.instance.showInternAd('gameend_success');
  21183. console.log('zh:game end 成功');
  21184. xGame.soundMgr.playSound('slots_roll01');
  21185. xGame.soundMgr.playSound("s_win");
  21186. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21187. this.diyGameDataUtilForGameWin();
  21188. this.updateGamePlaceBallData2Server();
  21189. }
  21190. else {
  21191. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21192. console.log('zh:game end失败');
  21193. xGame.soundMgr.playSound('matchwin01');
  21194. xGame.soundMgr.playSound("s_lose");
  21195. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21196. }
  21197. console.log('zh:开始弹出福利框2个');
  21198. Laya.timer.once(1000, this, () => {
  21199. console.log('zh: 1秒后 showFuLiSp1');
  21200. DataMgr.checkForShowFuLi17AndAlert(1);
  21201. });
  21202. let challengeNum = DataMgr.getChallengeTimes();
  21203. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21204. DataMgr.setChallengeTimes(1);
  21205. }
  21206. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21207. DataMgr.setClassicTimes();
  21208. }
  21209. this.setGlobalFont(this.ui);
  21210. }
  21211. diyGameDataUtilForGameWin() {
  21212. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21213. switch (xGame.common.gameMode) {
  21214. case GameMode.classic:
  21215. console.log('zh:DiyGameDataUtilForGameWin 111');
  21216. case GameMode.bigMove:
  21217. console.log('zh:DiyGameDataUtilForGameWin 222');
  21218. this.restartGame();
  21219. break;
  21220. case GameMode.placeBall:
  21221. console.log('zh:DiyGameDataUtilForGameWin 333');
  21222. var level = xGame.common.placeBallCurLevel;
  21223. console.log('zh:练习模式 联系了多少LEV=' + level);
  21224. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21225. if (level > db_over_lev) {
  21226. DataMgr.setChallengeMode_overLev(level);
  21227. }
  21228. break;
  21229. default:
  21230. console.log('zh:DiyGameDataUtilForGameWin 444');
  21231. break;
  21232. }
  21233. }
  21234. updateGamePlaceBallData2Server() {
  21235. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21236. if (userInfo == null) {
  21237. return;
  21238. }
  21239. let pbdObj = DataMgr.getPlaceBallLevelList();
  21240. let reqData = xGame.httpMgr.getReqData();
  21241. let pd = JSON.parse(reqData);
  21242. pd.placeBallData = JSON.stringify(pbdObj);
  21243. reqData = JSON.stringify(pd);
  21244. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21245. try {
  21246. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21247. let code = res.code;
  21248. let msg = res.msg;
  21249. if (code == 401) {
  21250. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21251. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21252. return;
  21253. }
  21254. if (code == 200) {
  21255. let data = res.data;
  21256. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21257. }
  21258. else {
  21259. xGame.uiMgr.Show(UIMsg$1, msg);
  21260. }
  21261. }
  21262. catch (error) {
  21263. console.log('error=' + error);
  21264. alert(error);
  21265. }
  21266. finally {
  21267. }
  21268. });
  21269. }
  21270. showChallengeLevel() {
  21271. if (DataMgr.getChallengeTimes() != 0)
  21272. return;
  21273. let skill = DataMgr.getSkillAccTimes();
  21274. let put = DataMgr.getPlaceBallLevelList().length;
  21275. if (skill >= 3 || put >= 5) {
  21276. xGame.uiMgr.Show(UIInvitation$1);
  21277. this.hide();
  21278. }
  21279. }
  21280. addAward(callback) {
  21281. if (!this.success) {
  21282. callback && callback();
  21283. return;
  21284. }
  21285. switch (xGame.common.gameMode) {
  21286. case GameMode.classic:
  21287. this.awardCoinNum = xGame.common.passAwardCoin;
  21288. this.awardDiamondNum = 0;
  21289. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21290. break;
  21291. case GameMode.bigMove:
  21292. this.awardCoinNum = xGame.common.passAwardCoin;
  21293. this.awardDiamondNum = 0;
  21294. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21295. callback && callback();
  21296. break;
  21297. case GameMode.placeBall:
  21298. let level = xGame.common.placeBallCurLevel;
  21299. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21300. if (xGame.common.placeBallStarNum != 3) {
  21301. callback && callback();
  21302. return;
  21303. }
  21304. else {
  21305. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21306. if (getAward) {
  21307. callback && callback();
  21308. return;
  21309. }
  21310. }
  21311. let cfg = cfgTable.placeballData[level];
  21312. let data = cfgTable.placeballData[level].award;
  21313. this.awardCoinNum = data[0];
  21314. this.awardDiamondNum = data[1];
  21315. if (cfg.type == PlaceBallType.challenge) {
  21316. this.awardDiamondNum = 0;
  21317. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21318. }
  21319. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21320. let diamondAward;
  21321. if (this.awardDiamondNum > 0) {
  21322. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21323. xGame.common.getAward([diamondAward, coinAward], callback);
  21324. }
  21325. else {
  21326. xGame.common.getAward([coinAward], callback);
  21327. }
  21328. if (cfg.type == PlaceBallType.normal) {
  21329. DataMgr.setPlaceBallAward(level);
  21330. }
  21331. break;
  21332. default:
  21333. break;
  21334. }
  21335. }
  21336. playSecretaryAni_old() {
  21337. let parent = this.ui.secretary.displayObject;
  21338. parent.destroyChildren();
  21339. let xx = this.ui.secretary.width / 2;
  21340. let yy = this.ui.secretary.height;
  21341. let scale = xGame.common.getSecretaryScale();
  21342. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21343. if (this.success) {
  21344. let rand = Math.random() <= 0.5 ? 2 : 3;
  21345. xGame.common.secretary.play(data, rand, false, parent, () => {
  21346. xGame.common.secretary.play(data, 1, true, parent);
  21347. });
  21348. }
  21349. else {
  21350. xGame.common.secretary.play(data, 0, true, parent);
  21351. }
  21352. }
  21353. playSecretaryAni() {
  21354. let parent = this.ui.secretary.displayObject;
  21355. parent.destroyChildren();
  21356. let xx = this.ui.secretary.width / 2;
  21357. let yy = this.ui.secretary.height;
  21358. let scale = xGame.common.getSecretaryScale();
  21359. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21360. if (this.success) {
  21361. let rand = 0;
  21362. xGame.common.secretary.play(data, 0, true, parent);
  21363. }
  21364. else {
  21365. xGame.common.secretary.play(data, 0, true, parent);
  21366. }
  21367. }
  21368. restartGame() {
  21369. switch (xGame.common.gameMode) {
  21370. case GameMode.classic:
  21371. xGame.eventMgr.event(RESTART_GAME);
  21372. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21373. break;
  21374. case GameMode.bigMove:
  21375. this.hide();
  21376. xGame.eventMgr.event(RESTART_GAME);
  21377. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21378. break;
  21379. default:
  21380. break;
  21381. }
  21382. }
  21383. hide() {
  21384. super.hide();
  21385. xGame.common.stopGirlPop(this.ui.talkNode);
  21386. PlatMgr.showBanner(false);
  21387. }
  21388. returnHome() {
  21389. this.hide();
  21390. let showFailWords = !this.success;
  21391. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21392. }
  21393. clickLeftBtn() {
  21394. switch (xGame.common.gameMode) {
  21395. case GameMode.classic:
  21396. case GameMode.bigMove:
  21397. this.returnHome();
  21398. break;
  21399. case GameMode.placeBall:
  21400. let level = xGame.common.placeBallCurLevel;
  21401. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21402. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21403. break;
  21404. default:
  21405. break;
  21406. }
  21407. }
  21408. powerStartPlaceBallLevel(level, btn) {
  21409. if (DataMgr.powerEnough()) {
  21410. btn.touchable = false;
  21411. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21412. btn.touchable = true;
  21413. DataMgr.setPower(-1);
  21414. xGame.eventMgr.event(POWER_TIME);
  21415. this.startPlaceBallLevel(level);
  21416. this.logEventForChallenge_level_start(level);
  21417. }));
  21418. }
  21419. else {
  21420. xGame.uiMgr.Show(UIPower$1, 0);
  21421. }
  21422. }
  21423. clickRightBtn() {
  21424. switch (xGame.common.gameMode) {
  21425. case GameMode.classic:
  21426. console.log('zh:clickRightBtn 111');
  21427. case GameMode.bigMove:
  21428. console.log('zh:clickRightBtn 222');
  21429. this.restartGame();
  21430. break;
  21431. case GameMode.placeBall:
  21432. console.log('zh:clickRightBtn 333');
  21433. let level = xGame.common.placeBallCurLevel;
  21434. let data = DataMgr.getPlaceBallLevel(level);
  21435. let curPss = data.play && !data.isCur;
  21436. if (curPss) {
  21437. console.log('zh:clickRightBtn 333-111');
  21438. console.log('zh:当前LV=' + level);
  21439. if (level == 60) {
  21440. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21441. Laya.timer.once(3000, this, () => {
  21442. this.returnHome();
  21443. });
  21444. }
  21445. else {
  21446. let lev = level + 1;
  21447. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21448. }
  21449. }
  21450. else {
  21451. console.log('zh:clickRightBtn 333-000');
  21452. Moyu.sendDataEvent("placeBallNextLevel");
  21453. console.log('zh:qjff_AD_for_uiGameEnd');
  21454. if (Laya.Browser.onAndroid) {
  21455. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21456. if (!boo) {
  21457. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21458. return;
  21459. }
  21460. }
  21461. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21462. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21463. }
  21464. else {
  21465. console.log('zh:AD 失败,直接发放奖励');
  21466. this.qjff_AD_for_uiGameEnd(level);
  21467. }
  21468. }
  21469. break;
  21470. default:
  21471. console.log('zh:clickRightBtn 444');
  21472. break;
  21473. }
  21474. }
  21475. logEventForChallenge_level_start(level) {
  21476. let keyStr = 'sjmd_challenge_level_start';
  21477. let jsonStr = {
  21478. "count": 0,
  21479. "gold_balance ": DataMgr.getCoin(),
  21480. "level": level,
  21481. "diamond_balance ": DataMgr.getDiamond()
  21482. };
  21483. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21484. const d = LocalStorageManager.getItem(keyStr);
  21485. if (level > d.level) {
  21486. jsonStr.count = d.count + 1;
  21487. LocalStorageManager.setItem(keyStr, jsonStr);
  21488. }
  21489. else {
  21490. }
  21491. }
  21492. else {
  21493. LocalStorageManager.setItem(keyStr, jsonStr);
  21494. }
  21495. const reqStr = JSON.stringify(jsonStr);
  21496. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21497. }
  21498. qjff_AD_for_uiGameEnd(level) {
  21499. DataMgr.setPlaceBallLevel(level, 1);
  21500. this.startPlaceBallLevel(level + 1);
  21501. }
  21502. startPlaceBallLevel(level) {
  21503. xGame.common.gameMode = GameMode.placeBall;
  21504. xGame.common.placeBallCurLevel = level;
  21505. xGame.uiMgr.Show(UIGame$1);
  21506. this.hide();
  21507. }
  21508. logEventForChallenge_level_complete(level) {
  21509. let keyStr = 'sjmd_challenge_level_complete';
  21510. let jsonStr = {
  21511. "count": 1,
  21512. "gold_balance ": DataMgr.getCoin(),
  21513. "level": level,
  21514. "diamond_balance ": DataMgr.getDiamond()
  21515. };
  21516. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21517. const d = LocalStorageManager.getItem(keyStr);
  21518. jsonStr.count = d.count + 1;
  21519. LocalStorageManager.setItem(keyStr, jsonStr);
  21520. }
  21521. else {
  21522. LocalStorageManager.setItem(keyStr, jsonStr);
  21523. }
  21524. const reqStr = JSON.stringify(jsonStr);
  21525. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21526. }
  21527. logEventForChallenge_level_N(level) {
  21528. console.log('zh:logEventForChallenge_level_N ' + level);
  21529. let keyStr = 'sjmd_challenge_level_N';
  21530. if (LocalStorageManager.hasKey(keyStr)) {
  21531. let lev = LocalStorageManager.getItem(keyStr);
  21532. if (level > lev) {
  21533. LocalStorageManager.setItem(keyStr, level);
  21534. }
  21535. if ((level) % 5 == 0) {
  21536. console.log('zh:每5关上报1次');
  21537. let sjmc = 'challenge_level_' + level;
  21538. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21539. let sjmcForFirebase = 'challenge_level_' + level;
  21540. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21541. }
  21542. else {
  21543. console.log('zh:5 no 上报');
  21544. }
  21545. }
  21546. else {
  21547. LocalStorageManager.setItem(keyStr, level);
  21548. }
  21549. }
  21550. }
  21551. UIGameEnd$1.uiName = "UIGameEnd";
  21552. class ShowItem$1 {
  21553. constructor() {
  21554. this.ui = ui_ShowItem.createInstance();
  21555. }
  21556. destroySelf() {
  21557. if (!this.ui.isDisposed) {
  21558. this.ui.removeFromParent();
  21559. this.ui.dispose();
  21560. }
  21561. }
  21562. setParent(parent) {
  21563. parent.addChild(this.ui);
  21564. }
  21565. setPos(x, y) {
  21566. this.ui.x = x;
  21567. this.ui.y = y;
  21568. }
  21569. setUrl(index) {
  21570. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21571. }
  21572. }
  21573. class UILevelProp$1 extends UIBase {
  21574. constructor() {
  21575. super();
  21576. this.firstPos = 385;
  21577. this.secondPos = 467;
  21578. this.showItemArr = [];
  21579. }
  21580. onConstructor() {
  21581. this.ui = ui_UILevelProp.createInstance();
  21582. this.contentPane = this.ui;
  21583. this.isEject = false;
  21584. this.addUIClick(this.ui.closeBtn, this.hideWin);
  21585. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21586. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21587. }
  21588. show(level) {
  21589. console.log('zh:show.');
  21590. super.show();
  21591. this.ui.t1.play();
  21592. this.level = level;
  21593. this.data = cfgTable.placeballData[this.level];
  21594. this.updateSelf();
  21595. this.showPreView();
  21596. this.moneyNode.ui.c1.selectedIndex = 2;
  21597. this.moneyNode.checkPowerTime();
  21598. this.moneyNode.powerChange();
  21599. this.setGlobalFont(this.ui);
  21600. }
  21601. showPreView() {
  21602. let item;
  21603. let data;
  21604. for (let index = 0; index < this.showItemArr.length; index++) {
  21605. item = this.showItemArr[index];
  21606. item.destroySelf();
  21607. }
  21608. this.showItemArr = [];
  21609. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21610. for (const key in cfgData) {
  21611. data = cfgData[key];
  21612. item = new ShowItem$1();
  21613. item.setParent(this.ui.myNode.displayRoot);
  21614. item.setPos(data.x, data.y);
  21615. item.setUrl(data.value);
  21616. this.showItemArr.push(item);
  21617. }
  21618. }
  21619. updateSelf() {
  21620. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21621. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21622. if (this.data.ball == -1) {
  21623. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21624. }
  21625. else {
  21626. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21627. }
  21628. let localData = DataMgr.getPlaceBallLevel(this.level);
  21629. let getAward = localData.getAward;
  21630. let cfg = cfgTable.placeballData[this.level];
  21631. let coin = this.data.award[0];
  21632. let diamond = this.data.award[1];
  21633. if (cfg.type == PlaceBallType.challenge) {
  21634. diamond = 0;
  21635. coin = 100;
  21636. }
  21637. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21638. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21639. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21640. if (cfg.type == PlaceBallType.challenge) {
  21641. this.ui.myNode.coinNode.numTxt.text = "";
  21642. }
  21643. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21644. if (coin > 0 && diamond > 0) {
  21645. this.ui.myNode.diamondNode.x = 385;
  21646. this.ui.myNode.coinNode.x = 467;
  21647. }
  21648. else {
  21649. this.ui.myNode.diamondNode.x = 385;
  21650. this.ui.myNode.coinNode.x = 385;
  21651. }
  21652. if (!getAward) {
  21653. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21654. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21655. }
  21656. else {
  21657. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21658. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21659. }
  21660. }
  21661. startGame() {
  21662. console.log("zh:startGame");
  21663. if (DataMgr.powerEnough()) {
  21664. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21665. this.ui.myNode.startBtn.touchable = false;
  21666. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21667. console.log('zh:startGame dh ');
  21668. this.ui.myNode.startBtn.touchable = true;
  21669. DataMgr.setPower(-1);
  21670. xGame.eventMgr.event(POWER_TIME);
  21671. xGame.common.gameMode = GameMode.placeBall;
  21672. xGame.common.placeBallCurLevel = this.level;
  21673. xGame.uiMgr.Show(UIGame$1);
  21674. xGame.uiMgr.Hide(UILevelDisplay$1);
  21675. xGame.uiMgr.Hide(UIMain$1);
  21676. this.logEventForChallenge_level_start(this.level);
  21677. this.hideWin();
  21678. }));
  21679. console.log('zh:eeeee');
  21680. }
  21681. else {
  21682. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21683. xGame.uiMgr.Show(UIPower$1);
  21684. }
  21685. }
  21686. logEventForChallenge_level_start(level) {
  21687. let keyStr = 'sjmd_challenge_level_start';
  21688. let jsonStr = {
  21689. "count": 1,
  21690. "gold_balance ": DataMgr.getCoin(),
  21691. "level": level,
  21692. "diamond_balance ": DataMgr.getDiamond()
  21693. };
  21694. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21695. const d = LocalStorageManager.getItem(keyStr);
  21696. if (level > d.level) {
  21697. jsonStr.count = d.count + 1;
  21698. LocalStorageManager.setItem(keyStr, jsonStr);
  21699. }
  21700. else {
  21701. }
  21702. }
  21703. else {
  21704. LocalStorageManager.setItem(keyStr, jsonStr);
  21705. }
  21706. const reqStr = JSON.stringify(jsonStr);
  21707. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21708. }
  21709. hideWin() {
  21710. super.hide();
  21711. if (this.ui.myNode.startBtn) {
  21712. this.ui.myNode.startBtn.touchable = true;
  21713. if (this.ui.myNode.startBtn.powerEft.t0) {
  21714. this.ui.myNode.startBtn.powerEft.t0.stop();
  21715. }
  21716. }
  21717. }
  21718. }
  21719. UILevelProp$1.uiName = "UILevelProp";
  21720. class PutBallLevelDisplay$1 {
  21721. constructor(ui, index) {
  21722. this.index = 0;
  21723. this.ui = ui;
  21724. this.index = index;
  21725. this.ui.onClick(this, this.clickSelf);
  21726. this.updateSelf();
  21727. this.ui.levelTxt.text = (this.index + 1) + "";
  21728. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21729. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21730. }
  21731. updateSelf() {
  21732. let level = this.index + 1;
  21733. this.data = DataMgr.getPlaceBallLevel(level);
  21734. this.ui.starNode.c1.selectedIndex = this.data.star;
  21735. let isChallenge = cfgTable.placeballData[level].type;
  21736. if (this.data.isCur) {
  21737. if (isChallenge) {
  21738. this.ui.c1.selectedIndex = 5;
  21739. }
  21740. else {
  21741. this.ui.c1.selectedIndex = 2;
  21742. }
  21743. }
  21744. else {
  21745. if (this.data.play) {
  21746. if (this.data.star == 3) {
  21747. this.ui.c1.selectedIndex = 0;
  21748. }
  21749. else {
  21750. this.ui.c1.selectedIndex = 1;
  21751. }
  21752. }
  21753. else {
  21754. if (isChallenge) {
  21755. this.ui.c1.selectedIndex = 4;
  21756. }
  21757. else {
  21758. this.ui.c1.selectedIndex = 3;
  21759. }
  21760. }
  21761. }
  21762. }
  21763. clickSelf() {
  21764. if (!this.data.play)
  21765. return;
  21766. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21767. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21768. }
  21769. }
  21770. class UILevelDisplay$1 extends UIBase {
  21771. constructor() {
  21772. super();
  21773. }
  21774. onConstructor() {
  21775. this.ui = ui_UILevelDisplay.createInstance();
  21776. this.contentPane = this.ui;
  21777. this.isEject = false;
  21778. this.myList = this.ui.myNode.myList;
  21779. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21780. this.levelItemArr = [];
  21781. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21782. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21783. this.myList.numItems = levelNum;
  21784. }
  21785. levelItemRender(index, target) {
  21786. let item = new PutBallLevelDisplay$1(target, index);
  21787. this.levelItemArr.push(item);
  21788. }
  21789. show() {
  21790. super.show();
  21791. this.updateLevel();
  21792. this.scrollToPlace();
  21793. this.setGlobalFont(this.ui);
  21794. }
  21795. updateLevel() {
  21796. let temp;
  21797. for (let index = 0; index < this.levelItemArr.length; index++) {
  21798. temp = this.levelItemArr[index];
  21799. temp.updateSelf();
  21800. }
  21801. }
  21802. scrollToPlace() {
  21803. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21804. let passArr = DataMgr.getPlaceBallLevelList();
  21805. let offest = passArr.length;
  21806. if (offest >= maxNum - 1)
  21807. offest = maxNum - 1;
  21808. this.myList.scrollToView(offest, true, true);
  21809. }
  21810. hide() {
  21811. super.hide();
  21812. }
  21813. }
  21814. UILevelDisplay$1.uiName = "UILevelDisplay";
  21815. class UIMatching$1 extends UIBase {
  21816. constructor() {
  21817. super();
  21818. }
  21819. onConstructor() {
  21820. this.ui = ui_UIMatching.createInstance();
  21821. this.contentPane = this.ui;
  21822. this.isEject = false;
  21823. }
  21824. show(callback) {
  21825. super.show();
  21826. PlatMgr.showBanner(true);
  21827. this.callback = callback;
  21828. let user = Moyu.getUserInfo();
  21829. if (!this.selfPot) {
  21830. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21831. }
  21832. if (!this.aiPot) {
  21833. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21834. }
  21835. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21836. this.ui.selfHead.nameTxt.text = user.nickName;
  21837. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21838. this.ui.aiHead.nameTxt.text = "???";
  21839. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21840. this.ui.selfHead.c1.selectedIndex = 0;
  21841. this.ui.aiHead.c1.selectedIndex = 0;
  21842. this.ui.selfHead.x = this.selfPot.x;
  21843. this.ui.selfHead.y = this.selfPot.y;
  21844. this.ui.aiHead.x = this.aiPot.x;
  21845. this.ui.aiHead.y = this.aiPot.y;
  21846. switch (xGame.common.gameMode) {
  21847. case GameMode.classic:
  21848. break;
  21849. case GameMode.bigMove:
  21850. this.initSkillData();
  21851. break;
  21852. default:
  21853. break;
  21854. }
  21855. this.ui.t1.play(Laya.Handler.create(this, () => {
  21856. this.ui.t2.play(Laya.Handler.create(this, () => {
  21857. switch (xGame.common.gameMode) {
  21858. case GameMode.classic:
  21859. this.waitingPeople();
  21860. break;
  21861. case GameMode.bigMove:
  21862. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21863. break;
  21864. default:
  21865. break;
  21866. }
  21867. }));
  21868. }));
  21869. this.setGlobalFont(this.ui);
  21870. }
  21871. initSkillData() {
  21872. this.skillSelectData = [];
  21873. let skillUrl = xGame.common.skillIconList;
  21874. let skillName = xGame.common.skillNameList;
  21875. let skillLevel = DataMgr.getBigSkillList();
  21876. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21877. for (let index = 0; index < 5; index++) {
  21878. let obj = {};
  21879. obj.skillImg = skillUrl[index];
  21880. obj.skillName = skillName[index];
  21881. obj.skillType = skillType[index];
  21882. obj.skillLevel = skillLevel[index];
  21883. this.skillSelectData.push(obj);
  21884. }
  21885. }
  21886. getAISkillLevel(myLevel) {
  21887. let video = xGame.common.upSkillLevel;
  21888. let aiLevel;
  21889. let temp;
  21890. if (video) {
  21891. temp = xGame.common.randomNum(-2, -1);
  21892. }
  21893. else {
  21894. if (myLevel <= 5) {
  21895. temp = xGame.common.randomNum(1, 3);
  21896. }
  21897. else if (myLevel <= 9) {
  21898. temp = xGame.common.randomNum(-2, 1);
  21899. }
  21900. else {
  21901. temp = xGame.common.randomNum(-4, 0);
  21902. }
  21903. }
  21904. aiLevel = temp + myLevel;
  21905. if (aiLevel <= 1)
  21906. aiLevel = 1;
  21907. if (aiLevel >= 10)
  21908. aiLevel = 10;
  21909. return aiLevel;
  21910. }
  21911. getAISkillType() {
  21912. return xGame.common.randomNum(1, 4);
  21913. let successTimes = DataMgr.getSkillSuccessTimes();
  21914. let info = cfgTable.aiskillData[successTimes];
  21915. if (!info) {
  21916. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21917. info = cfgTable.aiskillData[max];
  21918. }
  21919. let dataArr = info.skillselect;
  21920. let myCfg = {};
  21921. for (let index = 0; index < dataArr.length; index++) {
  21922. let temp = dataArr[index].split('-');
  21923. myCfg[temp[0]] = {};
  21924. myCfg[temp[0]].id = parseInt(temp[0]);
  21925. myCfg[temp[0]].weight = parseInt(temp[1]);
  21926. }
  21927. let aiCfg = xGame.common.initWeight(myCfg);
  21928. let curData = xGame.common.getRandomWeightData(aiCfg);
  21929. return parseInt(curData.id);
  21930. }
  21931. getAISkillData(index) {
  21932. let myLevel = this.skillSelectData[index].skillLevel;
  21933. let aiLevel = this.getAISkillLevel(myLevel);
  21934. let aiType = this.getAISkillType() - 1;
  21935. return { aiLevel, aiType } = { aiLevel, aiType };
  21936. }
  21937. skillSelectFinish(index) {
  21938. let aiInfo = this.getAISkillData(index);
  21939. xGame.common.gameMgr.selfCurSkill = index;
  21940. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21941. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21942. this.ui.selfHead.c1.selectedIndex = 1;
  21943. this.ui.aiHead.c1.selectedIndex = 1;
  21944. let myData = this.skillSelectData[index];
  21945. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21946. let guide = DataMgr.getSkillGuide();
  21947. if (guide == 0) {
  21948. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21949. }
  21950. else {
  21951. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21952. }
  21953. let aiData = this.skillSelectData[aiInfo.aiType];
  21954. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21955. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21956. this.waitingPeople();
  21957. }
  21958. waitingPeople() {
  21959. let time = xGame.common.randomNum(1000, 3000);
  21960. time += 1000;
  21961. Laya.timer.once(time, this, () => {
  21962. this.matchingSuccess();
  21963. });
  21964. }
  21965. matchingSuccess() {
  21966. let gameUI = xGame.common.gameUI;
  21967. let name = gameUI.ui.topNode.aiNameTxt.text;
  21968. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21969. this.ui.aiHead.nameTxt.text = name;
  21970. this.ui.aiHead.headImg.url = url;
  21971. name = gameUI.ui.topNode.selfNameTxt.text;
  21972. url = gameUI.ui.topNode.selfHeadLoader.url;
  21973. this.ui.selfHead.nameTxt.text = name;
  21974. this.ui.selfHead.headImg.url = url;
  21975. this.ui.t3.play(Laya.Handler.create(this, () => {
  21976. this.callback && this.callback();
  21977. this.ui.t4.play(Laya.Handler.create(this, () => {
  21978. this.destroySelf();
  21979. }));
  21980. }));
  21981. }
  21982. destroySelf() {
  21983. this.callback = null;
  21984. this.skillSelectData = null;
  21985. this.selfPot = null;
  21986. this.aiPot = null;
  21987. if (!this.ui.isDisposed) {
  21988. this.ui.removeFromParent();
  21989. this.ui.dispose();
  21990. }
  21991. xGame.uiMgr.destroyUI(this);
  21992. }
  21993. }
  21994. UIMatching$1.uiName = "UIMatching";
  21995. class SkillDisplay$1 {
  21996. constructor(ui, data, uiIndex) {
  21997. this.starX = 0;
  21998. this.starY = 0;
  21999. this.index = 0;
  22000. this.ui = ui;
  22001. this.data = data;
  22002. this.index = uiIndex;
  22003. this.initSelf();
  22004. console.log('zh:SkillDisplay constructor this.skillData=', data);
  22005. }
  22006. initSelf() {
  22007. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  22008. this.ui.nameTxt.text = this.data.name;
  22009. this.ui.describeTxt.text = this.data.describe;
  22010. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  22011. this.ui.startBtn.onClick(this, this.startGame);
  22012. this.updateSelf();
  22013. }
  22014. updateSelf() {
  22015. this.checkTry();
  22016. let level = DataMgr.getBigSkillByIndex(this.index);
  22017. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  22018. }
  22019. checkTry() {
  22020. let index = this.index;
  22021. let level = DataMgr.getBigSkillByIndex(index);
  22022. if (level == null) {
  22023. DataMgr.setBigSkill(index, 1, false);
  22024. level = 1;
  22025. }
  22026. this.ui.levelTxt.text = "LV." + level;
  22027. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  22028. this.ui.tryNode.visible = true;
  22029. else
  22030. this.ui.tryNode.visible = false;
  22031. }
  22032. clickAddLevel() {
  22033. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22034. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  22035. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  22036. if (Laya.Browser.onAndroid) {
  22037. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  22038. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22039. }
  22040. else {
  22041. console.log('zh:AD 失败,直接发放奖励');
  22042. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22043. }
  22044. }
  22045. else {
  22046. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22047. }
  22048. }
  22049. qjff_AD_for_skilldisplay_clickAddLevel() {
  22050. DataMgr.setBigSkill(this.data.index, 1);
  22051. this.updateSelf();
  22052. xGame.common.upSkillLevel = true;
  22053. }
  22054. startGame() {
  22055. console.log('zh:rod skill startgame');
  22056. if (this.data.index == 3) {
  22057. alert('Coming soon!');
  22058. return;
  22059. }
  22060. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22061. let needCoin = xGame.common.bigMoveNeedCoin;
  22062. xGame.common.passAwardCoin = 2000;
  22063. let guide = DataMgr.getSkillGuide();
  22064. console.log('zh:startGame guide=' + guide);
  22065. xGame.common.temSelfLevel = 0;
  22066. if (guide == 0) {
  22067. needCoin = 0;
  22068. xGame.common.temSelfLevel = 100;
  22069. }
  22070. if (DataMgr.coinEnough(needCoin)) {
  22071. DataMgr.setCoin(-needCoin);
  22072. xGame.common.curPlayerSkillType = this.index;
  22073. if (guide == 0)
  22074. xGame.common.curPlayerSkillType = 0;
  22075. console.log('zh: skilldisplay 1');
  22076. xGame.uiMgr.Show(UIGame$1);
  22077. xGame.uiMgr.Hide(UIMain$1);
  22078. xGame.uiMgr.Show(UIMatching$1, () => {
  22079. xGame.common.gameUI.ui.alpha = 1;
  22080. xGame.common.gameUI.startGame();
  22081. xGame.uiMgr.Hide(UISkill$1);
  22082. });
  22083. this.logEventForRod_start();
  22084. }
  22085. else {
  22086. console.log('zh: skilldisplay 2');
  22087. xGame.uiMgr.Show(UIAddProp$1, 0);
  22088. Moyu.sendDataEvent("AddCoinVideo");
  22089. }
  22090. }
  22091. logEventForRod_start() {
  22092. let gfmsIdx = xGame.common.curPlayerSkillType;
  22093. console.log('zh:选择的技能=' + gfmsIdx);
  22094. let gfmc = 'Skyfall Shot';
  22095. if (gfmsIdx == 0) {
  22096. gfmc = 'Skyfall Shot';
  22097. }
  22098. if (gfmsIdx == 1) {
  22099. gfmc = 'Surging break';
  22100. }
  22101. if (gfmsIdx == 2) {
  22102. gfmc = 'Frost Lock';
  22103. }
  22104. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22105. let jsonStr = {
  22106. "count": 0,
  22107. "name": gfmc
  22108. };
  22109. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22110. const d = LocalStorageManager.getItem(keyStr);
  22111. jsonStr.count = d.count + 1;
  22112. LocalStorageManager.setItem(keyStr, jsonStr);
  22113. }
  22114. else {
  22115. LocalStorageManager.setItem(keyStr, jsonStr);
  22116. }
  22117. const reqStr = JSON.stringify(jsonStr);
  22118. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22119. }
  22120. }
  22121. class UISkill$1 extends UIBase {
  22122. constructor() {
  22123. super();
  22124. this.skillData = [];
  22125. }
  22126. onConstructor() {
  22127. this.ui = ui_UISkill.createInstance();
  22128. this.contentPane = this.ui;
  22129. this.isEject = false;
  22130. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22131. this.initSkillData();
  22132. console.log('zh:aaaaaa1111111111');
  22133. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22134. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22135. console.log('zh:aaaaaa22222222');
  22136. this.displayList = [];
  22137. this.ui.skillNode.skillList.numItems = 3;
  22138. this.addUIClick(this.ui, this.interuptSecretary);
  22139. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22140. this.ui.talkNode.visible = false;
  22141. if (Moyu.isKs)
  22142. this.ui.closeNode.closeBtn.x += 100;
  22143. }
  22144. show() {
  22145. super.show();
  22146. this.playSecretaryIdle();
  22147. this.moneyNode.ui.c1.selectedIndex = 1;
  22148. Laya.timer.clearAll(this);
  22149. xGame.soundMgr.playSound("s_start");
  22150. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22151. let guide = DataMgr.getSkillGuide();
  22152. this.ui.guideNode.visible = guide == 0;
  22153. let item = this.getSkillItemByUIIndex(0);
  22154. if (guide == 0) {
  22155. item.ui.c1.selectedIndex = 1;
  22156. }
  22157. else {
  22158. item.ui.c1.selectedIndex = 0;
  22159. }
  22160. this.ui.guideNode.guideBtn.visible = guide == 0;
  22161. for (let index = 0; index < this.displayList.length; index++) {
  22162. this.displayList[index].checkTry();
  22163. }
  22164. this.setGlobalFont(this.ui);
  22165. }
  22166. getSkillItemByUIIndex(cur) {
  22167. for (let index = 0; index < this.displayList.length; index++) {
  22168. if (this.displayList[index].index == cur) {
  22169. return this.displayList[index];
  22170. }
  22171. }
  22172. }
  22173. enterGuideLevel() {
  22174. let item = this.getSkillItemByUIIndex(0);
  22175. item.startGame();
  22176. if (DataMgr.getNewUser())
  22177. Moyu.sendDataEvent("gameStart1");
  22178. }
  22179. initSkillData() {
  22180. this.skillData = [];
  22181. let nameList = xGame.common.skillNameList;
  22182. let iconList = xGame.common.skillIconList;
  22183. let describeList = [
  22184. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22185. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22186. "The power of frost descends—freezing the flow and taking full control of the game!"
  22187. ];
  22188. console.log('zh:initSkillData 111111111');
  22189. let data;
  22190. for (let index = 0; index < nameList.length; index++) {
  22191. data = {};
  22192. data.name = nameList[index];
  22193. data.icon = iconList[index];
  22194. data.describe = describeList[index];
  22195. data.index = index;
  22196. this.skillData.push(data);
  22197. }
  22198. }
  22199. updateSkillItem(index, target) {
  22200. if (this.displayList[index] == null) {
  22201. let uiIndex;
  22202. switch (index) {
  22203. case 0:
  22204. uiIndex = 1;
  22205. break;
  22206. case 1:
  22207. uiIndex = 0;
  22208. break;
  22209. case 2:
  22210. uiIndex = 2;
  22211. break;
  22212. case 3:
  22213. uiIndex = 3;
  22214. break;
  22215. default:
  22216. break;
  22217. }
  22218. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22219. this.displayList.push(temp);
  22220. }
  22221. }
  22222. playSecretaryIdle() {
  22223. let parent = this.ui.secretary.displayObject;
  22224. parent.destroyChildren();
  22225. let xx = this.ui.secretary.width / 2;
  22226. let yy = this.ui.secretary.height;
  22227. let scale = xGame.common.getSecretaryScale();
  22228. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22229. xGame.common.secretary.play(data, 0, true, parent);
  22230. }
  22231. returnUIMain() {
  22232. this.hide();
  22233. xGame.common.stopGirlPop(this.ui.talkNode);
  22234. xGame.uiMgr.Show(UIMain$1);
  22235. }
  22236. interuptSecretary() {
  22237. Laya.timer.clearAll(this);
  22238. this.playSecretaryRandomSound();
  22239. }
  22240. playSecretaryRandomSound() {
  22241. if (this.isHide)
  22242. return;
  22243. let time = xGame.common.randomNum(45000, 60000);
  22244. Laya.timer.once(time, this, () => {
  22245. if (this.isHide)
  22246. return;
  22247. let index = xGame.common.randomNum(4, 7);
  22248. xGame.soundMgr.playSound("s_main0" + index);
  22249. let words = 1;
  22250. switch (index) {
  22251. case 4:
  22252. words = 5;
  22253. break;
  22254. case 5:
  22255. words = 3;
  22256. break;
  22257. case 6:
  22258. words = 6;
  22259. break;
  22260. case 7:
  22261. words = 7;
  22262. break;
  22263. default:
  22264. break;
  22265. }
  22266. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22267. this.playSecretaryRandomSound();
  22268. });
  22269. }
  22270. }
  22271. UISkill$1.uiName = "UISkill";
  22272. class UIAddProp$1 extends UIBase {
  22273. constructor() {
  22274. super();
  22275. this.curType = "";
  22276. }
  22277. onConstructor() {
  22278. this.ui = ui_UIAddProp.createInstance();
  22279. this.contentPane = this.ui;
  22280. this.isEject = false;
  22281. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22282. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22283. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22284. this.updateUI();
  22285. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22286. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22287. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22288. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22289. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22290. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22291. }
  22292. show(type) {
  22293. super.show();
  22294. this.curType = type == 0 ? "coin" : "diamond";
  22295. this.switchBtn("");
  22296. this.ui.t0.play();
  22297. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22298. PlatMgr.showInsert(true);
  22299. this.setGlobalFont(this.ui);
  22300. }
  22301. closeSelf() {
  22302. this.hide();
  22303. }
  22304. updateUI() {
  22305. let data = cfgTable.moneyData;
  22306. let temp;
  22307. let obj;
  22308. for (const key in data) {
  22309. temp = data[key];
  22310. obj = this.ui.myNode["node" + key];
  22311. if (parseInt(key) <= 2) {
  22312. obj.diamondTxt.text = "+" + temp.num;
  22313. }
  22314. else {
  22315. obj.coinTxt.text = temp.num;
  22316. obj.diamondTxt.text = temp.get.split('_')[1];
  22317. }
  22318. }
  22319. this.updateDiamondShare();
  22320. }
  22321. updateDiamondShare() {
  22322. let data = DataMgr.getShareDiamondTimes();
  22323. if (data >= xGame.common.maxShareDiamondTimes) {
  22324. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22325. this.ui.myNode.node1.touchable = false;
  22326. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22327. }
  22328. else {
  22329. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22330. this.ui.myNode.node1.touchable = true;
  22331. }
  22332. }
  22333. switchBtn(type) {
  22334. if (type == "")
  22335. type = this.curType;
  22336. else {
  22337. if (this.curType == type) {
  22338. return;
  22339. }
  22340. else {
  22341. this.curType = type;
  22342. }
  22343. }
  22344. if (type == "coin") {
  22345. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22346. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22347. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22348. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22349. this.ui.myNode.c1.selectedIndex = 0;
  22350. }
  22351. else {
  22352. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22353. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22354. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22355. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22356. this.ui.myNode.c1.selectedIndex = 1;
  22357. }
  22358. }
  22359. convertCoin(index) {
  22360. let data = cfgTable.moneyData[index];
  22361. let coinNum = data.num;
  22362. let str = data.get.split('_')[1];
  22363. let needDiamond = parseInt(str);
  22364. if (DataMgr.diamondEnough(needDiamond)) {
  22365. DataMgr.setDiamond(-needDiamond);
  22366. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22367. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22368. }
  22369. else {
  22370. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22371. this.switchBtn("diamond");
  22372. }
  22373. }
  22374. videoGetDiamond() {
  22375. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22376. if (Laya.Browser.onAndroid) {
  22377. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22378. if (!boo) {
  22379. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22380. return;
  22381. }
  22382. }
  22383. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22384. }
  22385. else {
  22386. console.log('zh:AD 失败,直接发放奖励');
  22387. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22388. }
  22389. }
  22390. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22391. let num = cfgTable.moneyData[2].num;
  22392. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22393. this.closeSelf();
  22394. }
  22395. videoGetCoin() {
  22396. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22397. if (Laya.Browser.onAndroid) {
  22398. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22399. if (!boo) {
  22400. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22401. return;
  22402. }
  22403. }
  22404. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22405. }
  22406. else {
  22407. console.log('zh:AD 失败,直接发放奖励');
  22408. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22409. }
  22410. }
  22411. qjff_AD_for_uiAddProp_videoGetCoin() {
  22412. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22413. this.closeSelf();
  22414. }
  22415. shareGetDiamond() {
  22416. let times = DataMgr.getShareDiamondTimes();
  22417. if (times >= xGame.common.maxShareDiamondTimes) {
  22418. console.log('zh: 233333333333 maxShareDiamondTimes');
  22419. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22420. }
  22421. else {
  22422. console.log('zh:33333333333333ad');
  22423. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22424. if (Laya.Browser.onAndroid) {
  22425. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22426. if (!boo) {
  22427. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22428. return;
  22429. }
  22430. }
  22431. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22432. }
  22433. else {
  22434. console.log('zh:AD 失败,直接发放奖励');
  22435. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22436. }
  22437. }
  22438. }
  22439. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22440. let diamond = xGame.common.randomNum(50, 100);
  22441. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22442. DataMgr.setShareDiamondTimes(1);
  22443. this.updateDiamondShare();
  22444. }
  22445. openPutBallView() {
  22446. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22447. let skill = xGame.uiMgr.getUI(UISkill$1);
  22448. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22449. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22450. if (end && !end.isHide) {
  22451. xGame.uiMgr.Hide(UIGameEnd$1);
  22452. xGame.uiMgr.Show(UIMain$1);
  22453. }
  22454. if (skill && !skill.isHide)
  22455. xGame.uiMgr.Hide(UISkill$1);
  22456. if (uigame && !uigame.isHide)
  22457. xGame.uiMgr.Hide(UIGame$1);
  22458. if (level && !level.isHide) {
  22459. }
  22460. else {
  22461. xGame.uiMgr.Show(UILevelDisplay$1);
  22462. }
  22463. this.closeSelf();
  22464. }
  22465. }
  22466. UIAddProp$1.uiName = "UIAddProp";
  22467. class MoneyNode$1 {
  22468. constructor(ui) {
  22469. this.leftTime = 0;
  22470. this.ui = ui;
  22471. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22472. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22473. this.ui.addPowerBtn.onClick(this, this.addPower);
  22474. this.ui.c1.selectedIndex = 1;
  22475. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22476. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22477. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22478. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22479. this.coinChange();
  22480. this.diamondChange();
  22481. this.powerChange();
  22482. }
  22483. addPower() {
  22484. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22485. xGame.uiMgr.Show(UIPower$1);
  22486. }
  22487. powerChange() {
  22488. let powerNum = DataMgr.getPower();
  22489. this.ui.powerTxt.text = powerNum + "";
  22490. }
  22491. checkPowerTime() {
  22492. let cur = new Date().getTime();
  22493. let last = DataMgr.getPowerTime();
  22494. if (last == 0) {
  22495. last = cur;
  22496. DataMgr.setPowerTime(cur);
  22497. }
  22498. let power = DataMgr.getPower();
  22499. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22500. Laya.timer.clearAll(this);
  22501. if (power >= xGame.common.natureMaxPower) {
  22502. this.ui.powerTimeTxt.text = "";
  22503. DataMgr.setPowerTime(cur);
  22504. return;
  22505. }
  22506. if (power + offset >= xGame.common.natureMaxPower) {
  22507. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22508. this.ui.powerTimeTxt.text = "";
  22509. DataMgr.setPowerTime(cur);
  22510. }
  22511. else {
  22512. if (offset > 0) {
  22513. DataMgr.setPower(offset);
  22514. DataMgr.setPowerTime(cur);
  22515. }
  22516. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22517. this.leftTime = xGame.common.powerRecoverNum - time;
  22518. if (this.leftTime <= 0)
  22519. this.leftTime = 0;
  22520. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22521. Laya.timer.loop(1000, this, this.updatePowerTime);
  22522. }
  22523. }
  22524. updatePowerTime() {
  22525. this.leftTime -= 1;
  22526. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22527. if (this.leftTime <= 0) {
  22528. this.checkPowerTime();
  22529. }
  22530. }
  22531. coinChange() {
  22532. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22533. }
  22534. diamondChange() {
  22535. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22536. }
  22537. addCoin() {
  22538. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22539. Moyu.sendDataEvent("AddCoinBtn");
  22540. xGame.uiMgr.Show(UIAddProp$1, 0);
  22541. }
  22542. addDiamond() {
  22543. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22544. Moyu.sendDataEvent("AddDiamondBtn");
  22545. xGame.uiMgr.Show(UIAddProp$1, 1);
  22546. }
  22547. }
  22548. class SettingNode$1 {
  22549. constructor(ui) {
  22550. this.showSetting = false;
  22551. this.openSound = true;
  22552. this.openShake = true;
  22553. this.ui = ui;
  22554. this.ui.soundBtn.onClick(this, this.switchSound);
  22555. this.ui.shakeBtn.onClick(this, this.switchShake);
  22556. this.ui.xyBtn.onClick(this, this.onXy);
  22557. this.ui.clickNode.onClick(this, this.changeSetting);
  22558. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22559. this.ui.xyBtn.visible = false;
  22560. this.ui.shakeBtn.visible = false;
  22561. }
  22562. changeSetting() {
  22563. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22564. this.showSetting = !this.showSetting;
  22565. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22566. }
  22567. switchSound() {
  22568. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22569. this.openSound = !this.openSound;
  22570. Moyu.onSetting(this.openSound, this.openShake);
  22571. xGame.soundMgr.onSetting(this.openSound);
  22572. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22573. }
  22574. switchShake() {
  22575. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22576. this.openShake = !this.openShake;
  22577. Moyu.onSetting(this.openSound, this.openShake);
  22578. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22579. }
  22580. onXy() {
  22581. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22582. MoyuMgr$1.showXy(1);
  22583. }
  22584. }
  22585. class UIDraw$1 extends UIBase {
  22586. constructor() {
  22587. super();
  22588. this.curKey = 0;
  22589. }
  22590. onConstructor() {
  22591. this.ui = ui_UIDraw.createInstance();
  22592. this.contentPane = this.ui;
  22593. this.isEject = false;
  22594. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22595. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22596. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22597. this.initDraw();
  22598. this.initUI();
  22599. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22600. }
  22601. show() {
  22602. super.show();
  22603. this.ui.t0.play();
  22604. this.playSecretaryIdle();
  22605. this.updateDraw();
  22606. this.checkFree();
  22607. if (PlatMgr.bannerDelay > 0) {
  22608. this.ui.closeNode.closeBtn.visible = false;
  22609. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22610. this.ui.closeNode.closeBtn.visible = true;
  22611. });
  22612. }
  22613. PlatMgr.showRateBanner();
  22614. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22615. this.setGlobalFont(this.ui);
  22616. }
  22617. hide() {
  22618. Laya.timer.clearAll(this);
  22619. super.hide();
  22620. }
  22621. checkFree() {
  22622. let isFree = DataMgr.getDailyfreeDrawTimes();
  22623. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22624. }
  22625. initDraw() {
  22626. this.drawObj = [];
  22627. let data = cfgTable.drawData;
  22628. let temp;
  22629. let weight = 0;
  22630. for (const key in data) {
  22631. temp = data[key];
  22632. weight += temp.weight;
  22633. this.drawObj.push(weight);
  22634. }
  22635. this.allWeight = weight;
  22636. }
  22637. initUI() {
  22638. let data = cfgTable.drawData;
  22639. let temp;
  22640. let img;
  22641. let txt;
  22642. for (const key in data) {
  22643. temp = data[key];
  22644. img = this.ui.myNode.rotNode["img" + key];
  22645. txt = this.ui.myNode.rotNode["txt" + key];
  22646. img.url = xGame.common.getGameIconUrl(temp.icon);
  22647. txt.visible = true;
  22648. if (temp.award > 2) {
  22649. img.rotation = 0;
  22650. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22651. }
  22652. else {
  22653. img.rotation = temp.rotation;
  22654. txt.text = temp.num;
  22655. }
  22656. }
  22657. }
  22658. getCurkey() {
  22659. let rand = Math.random() * this.allWeight;
  22660. let temp;
  22661. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22662. temp = this.drawObj[index];
  22663. if (index == 0) {
  22664. if (rand < temp) {
  22665. return index + 1;
  22666. }
  22667. }
  22668. else {
  22669. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22670. return index + 1;
  22671. }
  22672. }
  22673. }
  22674. return 2;
  22675. }
  22676. startDraw() {
  22677. console.log('zh:开始抽奖');
  22678. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22679. if (freeTimes > 0) {
  22680. console.log('zh:freeTimes=' + freeTimes);
  22681. this.beginDraw();
  22682. DataMgr.setDailyfreeDrawTimes(0);
  22683. this.checkFree();
  22684. }
  22685. else {
  22686. if (Laya.Browser.onAndroid) {
  22687. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22688. if (!boo) {
  22689. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22690. return;
  22691. }
  22692. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22693. }
  22694. else {
  22695. console.log('zh:AD 失败,直接发放奖励');
  22696. this.qjff_chouJiang();
  22697. }
  22698. }
  22699. else {
  22700. this.qjff_chouJiang();
  22701. }
  22702. }
  22703. }
  22704. qjff_chouJiang() {
  22705. this.beginDraw();
  22706. }
  22707. beginDraw() {
  22708. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22709. this.ui.drawBtn.touchable = false;
  22710. this.curKey = this.getCurkey();
  22711. console.log("zh:当前key", this.curKey);
  22712. let cell = 60;
  22713. let lap = 3;
  22714. let angle = cell * (this.curKey - 1) + lap * 360;
  22715. let target = this.ui.myNode.rotNode;
  22716. target.rotation = 0;
  22717. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22718. console.log("zh:旋转完成");
  22719. this.ui.drawBtn.touchable = true;
  22720. this.getAward();
  22721. }));
  22722. }
  22723. getAward() {
  22724. let data = cfgTable.drawData[this.curKey];
  22725. let temp = new AwardType();
  22726. temp.type = data.award;
  22727. temp.num = data.num;
  22728. xGame.common.getAward([temp], () => {
  22729. DataMgr.setDrawTimes(1);
  22730. this.updateDraw();
  22731. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22732. });
  22733. }
  22734. updateDraw() {
  22735. let drawTimes = DataMgr.getDrawTimes();
  22736. let awardTimes = DataMgr.getDrawAwardTimes();
  22737. if (Math.floor(drawTimes / 3) > awardTimes) {
  22738. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22739. this.ui.extraNode.boxBtn.touchable = true;
  22740. this.ui.extraNode.tipsTxt.text = "3/3";
  22741. this.ui.extraNode.barNode.width = 265;
  22742. this.getExtraAward();
  22743. }
  22744. else {
  22745. this.ui.extraNode.boxBtn.t0.stop();
  22746. this.ui.extraNode.boxBtn.touchable = false;
  22747. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22748. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22749. }
  22750. let data = cfgTable.drawData[1];
  22751. if (awardTimes == 0) {
  22752. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22753. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22754. this.ui.myNode.rotNode.img1.rotation = 0;
  22755. }
  22756. else {
  22757. let award = data.nextid;
  22758. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22759. this.ui.myNode.rotNode.txt1.text = award[1];
  22760. this.ui.myNode.rotNode.img1.rotation = 0;
  22761. }
  22762. }
  22763. getExtraAward() {
  22764. let drawTimes = DataMgr.getDrawTimes();
  22765. let awardTimes = DataMgr.getDrawAwardTimes();
  22766. let data = cfgTable.drawData[1];
  22767. let award = new AwardType();
  22768. if (awardTimes == 0) {
  22769. award.num = data.num;
  22770. award.type = data.award;
  22771. xGame.common.getAward([award], () => {
  22772. let all = Math.floor(drawTimes / 3);
  22773. DataMgr.setDrawAwardTimes(all);
  22774. this.updateDraw();
  22775. });
  22776. }
  22777. else {
  22778. award.num = parseInt(data.nextid[1]);
  22779. award.type = parseInt(data.nextid[0]);
  22780. xGame.common.getAward([award], () => {
  22781. let all = Math.floor(drawTimes / 3);
  22782. DataMgr.setDrawAwardTimes(all);
  22783. this.updateDraw();
  22784. });
  22785. }
  22786. }
  22787. closeSelf() {
  22788. this.hide();
  22789. }
  22790. playSecretaryIdle() {
  22791. let parent = this.ui.secretary.displayObject;
  22792. parent.destroyChildren();
  22793. let xx = this.ui.secretary.width / 2;
  22794. let yy = this.ui.secretary.height;
  22795. let scale = xGame.common.getSecretaryScale();
  22796. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22797. xGame.common.secretary.play(data, 0, true, parent);
  22798. }
  22799. }
  22800. UIDraw$1.uiName = "UIDraw";
  22801. class UIRanking$1 extends UIBase {
  22802. constructor() {
  22803. super();
  22804. this.showSelf = true;
  22805. this.rankType = 1;
  22806. this.rankList = [];
  22807. this.topX = 10;
  22808. this.myIndex = this.topX + 1;
  22809. this.myStar = 0;
  22810. }
  22811. onConstructor() {
  22812. this.ui = ui_UIRanking.createInstance();
  22813. this.contentPane = this.ui;
  22814. this.isEject = false;
  22815. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22816. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22817. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22818. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22819. this.ui.myNode.myList.setVirtual();
  22820. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22821. }
  22822. show() {
  22823. super.show();
  22824. this.getPaiHangBangDataFormJosnFile();
  22825. this.updateSelf();
  22826. let self = Moyu.getUserInfo();
  22827. if (!self.isAuth) {
  22828. Moyu.initUser(this, () => {
  22829. DataMgr.upRankData();
  22830. });
  22831. }
  22832. this.setGlobalFont(this.ui);
  22833. }
  22834. getPaiHangBangDataFormJosnFile() {
  22835. const rankingList = cfgTable.paiHangBangData.list;
  22836. this.updateItemData(rankingList);
  22837. }
  22838. updateSelfItem() {
  22839. console.log('zh:Moyu.platType =' + Moyu.platType);
  22840. let self = Moyu.getUserInfo();
  22841. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22842. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22843. if (this.myIndex > this.topX) {
  22844. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22845. }
  22846. else {
  22847. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22848. }
  22849. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22850. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22851. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22852. }
  22853. updateItemData(data) {
  22854. this.myStar = xGame.common.getAllStarNum();
  22855. if (this.rankList.length < 2) {
  22856. this.rankList = data;
  22857. let self = Moyu.getUserInfo();
  22858. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22859. self.headIcon = self.headIcon;
  22860. for (let i = 0; i < data.length; i++) {
  22861. let data = this.rankList[i];
  22862. if (data.userId == self.userId) {
  22863. this.rankList.splice(i, 1);
  22864. break;
  22865. }
  22866. }
  22867. for (let i = 0; i < data.length; i++) {
  22868. let data = this.rankList[i];
  22869. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22870. this.myIndex = i + 1;
  22871. let user = { headIcon: self.headIcon, nickName: "myself" };
  22872. let ud = { user: user, data: {} };
  22873. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22874. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22875. if (Moyu.platType < 11) {
  22876. user.headIcon = self.headIcon;
  22877. user.nickName = self.nickName;
  22878. }
  22879. this.rankList.splice(i, 0, md);
  22880. break;
  22881. }
  22882. }
  22883. }
  22884. this.updateSelfItem();
  22885. this.ui.myNode.myList.numItems = this.rankList.length;
  22886. }
  22887. updateItemUI(index, obj) {
  22888. let data = this.rankList[index];
  22889. let userData = JSON.parse(data.userData).user;
  22890. obj.nameTxt.text = userData.nickName.toString();
  22891. obj.valueTxt.text = data.rankScore;
  22892. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22893. obj.rankTxt.text = index + 1;
  22894. switch (index) {
  22895. case 0:
  22896. this.setImg(obj, 1, 0, 0);
  22897. obj.rankTxt.color = "#FFC047";
  22898. break;
  22899. case 1:
  22900. this.setImg(obj, 0, 1, 0);
  22901. obj.rankTxt.color = "#ACACAC";
  22902. break;
  22903. case 2:
  22904. this.setImg(obj, 0, 0, 1);
  22905. obj.rankTxt.color = "#D09672";
  22906. break;
  22907. default:
  22908. this.setImg(obj, 0, 0, 0);
  22909. obj.rankTxt.color = "#496FAB";
  22910. break;
  22911. }
  22912. }
  22913. setImg(obj, a, b, c) {
  22914. obj.img1.visible = a ? true : false;
  22915. obj.img2.visible = b ? true : false;
  22916. obj.img3.visible = c ? true : false;
  22917. }
  22918. changeList(type) {
  22919. this.rankType = type;
  22920. this.updateSelf();
  22921. }
  22922. changeSelfNode() {
  22923. this.showSelf = !this.showSelf;
  22924. this.updateSelf();
  22925. }
  22926. updateSelf() {
  22927. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22928. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22929. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22930. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22931. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22932. }
  22933. }
  22934. UIRanking$1.uiName = "UIRanking";
  22935. class UISecretary$1 extends UIBase {
  22936. constructor() {
  22937. super();
  22938. this.curIndex = 1;
  22939. }
  22940. onConstructor() {
  22941. this.ui = ui_UISecretary.createInstance();
  22942. this.contentPane = this.ui;
  22943. this.isEject = false;
  22944. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22945. this.nodeObj = { left: null, right: null, cur: null };
  22946. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22947. }
  22948. show() {
  22949. super.show();
  22950. this.ui.t0.play();
  22951. this.updateData();
  22952. this.setGlobalFont(this.ui);
  22953. }
  22954. addSecretarySpine(node, spineName) {
  22955. if (spineName == "mishu") {
  22956. if (this.secretarySpine1) {
  22957. node.displayObject.destroyChildren();
  22958. this.playWoman(this.secretarySpine1, node.displayObject);
  22959. }
  22960. else {
  22961. let spine1 = new SpineMgr("mishu", () => {
  22962. this.secretarySpine1 = spine1;
  22963. this.playWoman(this.secretarySpine1, node.displayObject);
  22964. });
  22965. }
  22966. }
  22967. else {
  22968. if (this.secretarySpine2) {
  22969. node.displayObject.destroyChildren();
  22970. this.playWoman(this.secretarySpine2, node.displayObject);
  22971. }
  22972. else {
  22973. let spine2 = new SpineMgr("xiaomishu2", () => {
  22974. this.secretarySpine2 = spine2;
  22975. this.playWoman(this.secretarySpine2, node.displayObject);
  22976. });
  22977. }
  22978. }
  22979. }
  22980. playWoman(node, parent) {
  22981. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22982. let yy = this.ui.myNode.gameNode3.secretary.height;
  22983. let scale = 1.5;
  22984. if (node == this.secretarySpine2) {
  22985. scale = 1.2;
  22986. }
  22987. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22988. node.play(data, 0, true, parent);
  22989. }
  22990. turnLeft() {
  22991. this.curIndex--;
  22992. if (this.curIndex < 1) {
  22993. this.curIndex = 2;
  22994. }
  22995. let left = this.nodeObj.left;
  22996. let right = this.nodeObj.right;
  22997. let cur = this.nodeObj.cur;
  22998. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22999. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23000. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23001. this.updateData();
  23002. }));
  23003. this.ui.myNode.setChildIndex(right, 2);
  23004. this.nodeObj.left = cur;
  23005. this.nodeObj.right = left;
  23006. this.nodeObj.cur = right;
  23007. }
  23008. turnRight() {
  23009. this.curIndex++;
  23010. if (this.curIndex > 2) {
  23011. this.curIndex = 1;
  23012. }
  23013. let left = this.nodeObj.left;
  23014. let right = this.nodeObj.right;
  23015. let cur = this.nodeObj.cur;
  23016. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23017. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23018. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23019. this.updateData();
  23020. }));
  23021. this.ui.myNode.setChildIndex(left, 2);
  23022. this.nodeObj.left = right;
  23023. this.nodeObj.right = cur;
  23024. this.nodeObj.cur = left;
  23025. }
  23026. updateData() {
  23027. console.log('zh: updateData FFFFFFFFFF');
  23028. let data = cfgTable.secretaryshopData;
  23029. let children = this.ui.myNode._children;
  23030. let temp;
  23031. let curData;
  23032. for (let index = 0; index < children.length; index++) {
  23033. temp = children[index];
  23034. curData = data[1];
  23035. temp.heightTxt.text = curData.height;
  23036. temp.foodTxt.text = curData.food;
  23037. temp.historyTxt.text = curData.history;
  23038. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  23039. this.addSecretarySpine(temp.secretary, curData.spine);
  23040. let womanIndex = curData.id - 1;
  23041. let getWoman = DataMgr.getSecretary(womanIndex);
  23042. let curUse = DataMgr.getCurSecretary();
  23043. if (getWoman) {
  23044. if (curUse == womanIndex) {
  23045. temp.purchaseBtn.c1.selectedIndex = 1;
  23046. }
  23047. else {
  23048. temp.purchaseBtn.c1.selectedIndex = 2;
  23049. }
  23050. }
  23051. else {
  23052. temp.purchaseBtn.c1.selectedIndex = 0;
  23053. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23054. }
  23055. temp.purchaseBtn.visible = false;
  23056. }
  23057. }
  23058. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23059. console.log('zh: 点击了clickSecretary ');
  23060. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23061. if (getWoman) {
  23062. if (curUse != womanIndex) {
  23063. console.log();
  23064. DataMgr.setCurSecretary(womanIndex);
  23065. this.updateData();
  23066. }
  23067. }
  23068. else {
  23069. console.log('zh:点击购买了');
  23070. let need = needDiamond;
  23071. if (DataMgr.diamondEnough(need)) {
  23072. DataMgr.setDiamond(-need);
  23073. DataMgr.setSecretary(womanIndex, 1);
  23074. DataMgr.setCurSecretary(womanIndex);
  23075. this.updateData();
  23076. }
  23077. else {
  23078. xGame.uiMgr.Show(UIAddProp$1, 1);
  23079. }
  23080. }
  23081. }
  23082. closeSelf() {
  23083. this.hide();
  23084. }
  23085. }
  23086. UISecretary$1.uiName = "UISecretary";
  23087. class BallRodDisplay$1 {
  23088. constructor(ui, index) {
  23089. this.index = 0;
  23090. this.uiIndex = 0;
  23091. this.ui = ui;
  23092. this.index = index;
  23093. this.initData();
  23094. }
  23095. initData() {
  23096. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23097. let data = cfgTable.ballrodData[this.index + 1];
  23098. this.ui.nameTxt.text = data.name;
  23099. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23100. this.ui.levelNode.c1.selectedIndex = data.quality;
  23101. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23102. if (data.spine) {
  23103. this.mySpine = new SpineMgr(data.spine, () => {
  23104. let xx = 150;
  23105. let yy = 70;
  23106. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23107. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23108. });
  23109. }
  23110. }
  23111. updateSelf() {
  23112. let get = DataMgr.getBallRod(this.index);
  23113. if (get == null)
  23114. get = 1;
  23115. let curUse = DataMgr.getCurBallRod();
  23116. if (get) {
  23117. if (curUse == this.index) {
  23118. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23119. }
  23120. else {
  23121. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23122. }
  23123. }
  23124. else {
  23125. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23126. }
  23127. }
  23128. buyBallRod() {
  23129. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23130. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23131. switch (selectedIndex) {
  23132. case 0:
  23133. break;
  23134. case 1:
  23135. console.log('zh:点击了 USE THIS');
  23136. DataMgr.setCurBallRod(this.index);
  23137. let curUse = DataMgr.getCurBallRod();
  23138. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23139. let ui = xGame.uiMgr.getUI(UIShop$1);
  23140. ui.updateBallRod();
  23141. break;
  23142. case 2:
  23143. let data = cfgTable.ballrodData[this.index + 1];
  23144. let need = data.price;
  23145. if (DataMgr.diamondEnough(need)) {
  23146. this.buyQiuGan(data);
  23147. DataMgr.setDiamond(-need);
  23148. DataMgr.setBallRod(this.index, 1);
  23149. DataMgr.setCurBallRod(this.index);
  23150. let ui = xGame.uiMgr.getUI(UIShop$1);
  23151. ui.updateBallRod();
  23152. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23153. }
  23154. else {
  23155. xGame.uiMgr.Show(UIAddProp$1, 1);
  23156. }
  23157. break;
  23158. default:
  23159. break;
  23160. }
  23161. }
  23162. buyQiuGan(qgItem) {
  23163. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23164. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23165. if (userInfo == null) {
  23166. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23167. return;
  23168. }
  23169. let reqData = xGame.httpMgr.getReqData();
  23170. let pd = JSON.parse(reqData);
  23171. pd.qiuGanData = qgItem;
  23172. reqData = JSON.stringify(pd);
  23173. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23174. try {
  23175. console.log('zh:buySp res = ' + JSON.stringify(res));
  23176. let code = res.code;
  23177. let msg = res.msg;
  23178. if (code == 401) {
  23179. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23180. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23181. return;
  23182. }
  23183. if (code == 200) {
  23184. xGame.uiMgr.Show(UIMsg$1, msg);
  23185. DataMgr.getUserZiChanInfo(false);
  23186. }
  23187. else {
  23188. xGame.uiMgr.Show(UIMsg$1, msg);
  23189. }
  23190. }
  23191. catch (error) {
  23192. console.log('error=' + error);
  23193. alert(error);
  23194. }
  23195. finally {
  23196. }
  23197. });
  23198. }
  23199. logEventForGouMaiGan(qiuGanName) {
  23200. const ev = {
  23201. value: qiuGanName
  23202. };
  23203. const jsonStr = JSON.stringify(ev);
  23204. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23205. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23206. }
  23207. }
  23208. class DaoJuDisplay$1 {
  23209. constructor(ui, index) {
  23210. this.index = 0;
  23211. this.uiIndex = 0;
  23212. this.ggSpid = "";
  23213. this.spid = 0;
  23214. this.ui = ui;
  23215. this.index = index;
  23216. this.initData();
  23217. }
  23218. initData() {
  23219. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23220. let data = cfgTable.daoJuData[this.index + 1];
  23221. this.ui.nameTxt.text = data.spbt;
  23222. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23223. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23224. this.ggSpid = data.ggSpid;
  23225. this.spid = data.spid;
  23226. let baseUrl = "asset/sound/ogg/";
  23227. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23228. }
  23229. gotoBuy() {
  23230. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23231. if (userInfo != null) {
  23232. let token = userInfo.token;
  23233. let ggSpid = this.ggSpid;
  23234. let spid = this.spid;
  23235. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23236. console.log('zh:gotoBuy1 spid =' + spid);
  23237. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23238. return;
  23239. }
  23240. else {
  23241. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23242. }
  23243. }
  23244. gotoBuy1() {
  23245. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23246. let djItem = cfgTable.daoJuData[this.index + 1];
  23247. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23248. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23249. if (userInfo == null) {
  23250. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23251. return;
  23252. }
  23253. let reqData = xGame.httpMgr.getReqData();
  23254. let pd = JSON.parse(reqData);
  23255. pd.spItem = djItem;
  23256. reqData = JSON.stringify(pd);
  23257. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23258. try {
  23259. console.log('zh:buySp res = ' + JSON.stringify(res));
  23260. let code = res.code;
  23261. let msg = res.msg;
  23262. if (code == 401) {
  23263. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23264. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23265. return;
  23266. }
  23267. if (code == 200) {
  23268. xGame.uiMgr.Show(UIMsg$1, msg);
  23269. DataMgr.getUserZiChanInfo(false);
  23270. }
  23271. else {
  23272. xGame.uiMgr.Show(UIMsg$1, msg);
  23273. }
  23274. }
  23275. catch (error) {
  23276. console.log('error=' + error);
  23277. alert(error);
  23278. }
  23279. finally {
  23280. }
  23281. });
  23282. }
  23283. }
  23284. class UIShop$1 extends UIBase {
  23285. constructor() {
  23286. super();
  23287. this.itemNums = 0;
  23288. this.itemNumsForDj = 0;
  23289. this.curType = "";
  23290. }
  23291. onConstructor() {
  23292. this.ui = ui_UIShop.createInstance();
  23293. this.contentPane = this.ui;
  23294. this.isEject = false;
  23295. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23296. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23297. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23298. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23299. this.addUIClick(this.ui, this.interuptSecretary);
  23300. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23301. this.ballRodArr = [];
  23302. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23303. this.ui.myNode.myList.numItems = this.itemNums;
  23304. this.loadDjdata_old();
  23305. }
  23306. loadDjdata_old() {
  23307. let fff = cfgTable.daoJuData;
  23308. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23309. this.daoJuArr = [];
  23310. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23311. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23312. }
  23313. getProductList() {
  23314. let reqData = xGame.httpMgr.getReqData();
  23315. let pd = JSON.parse(reqData);
  23316. pd.splx = "Consumable";
  23317. reqData = JSON.stringify(pd);
  23318. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23319. try {
  23320. let code = res.code;
  23321. let msg = res.msg;
  23322. if (code == 401) {
  23323. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23324. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23325. return;
  23326. }
  23327. if (code == 200) {
  23328. let data = res.data;
  23329. for (let index = 0; index < data.length; index++) {
  23330. let element = data[index];
  23331. cfgTable.daoJuData[element.spid] = element;
  23332. }
  23333. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23334. }
  23335. else {
  23336. xGame.uiMgr.Show(UIMsg, msg);
  23337. }
  23338. }
  23339. catch (error) {
  23340. console.log('error=' + error);
  23341. alert(error);
  23342. }
  23343. finally {
  23344. }
  23345. });
  23346. }
  23347. show(type) {
  23348. super.show();
  23349. this.curType = type == 0 ? "qiugan" : "daoju";
  23350. this.switchBtn("");
  23351. this.playSecretaryIdle();
  23352. this.updateBallRod();
  23353. this.setGlobalFont(this.ui);
  23354. }
  23355. test123() {
  23356. console.log('zh:test123 ');
  23357. }
  23358. switchBtn(type) {
  23359. console.log('zh:1111切換 sel type=' + type);
  23360. if (type == "") {
  23361. type = this.curType;
  23362. }
  23363. else {
  23364. if (this.curType == type) {
  23365. return;
  23366. }
  23367. else {
  23368. this.curType = type;
  23369. }
  23370. }
  23371. if (type == "qiugan") {
  23372. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23373. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23374. this.ui.myNode.c1.selectedIndex = 0;
  23375. this.ui.myNode.myList.visible = true;
  23376. this.ui.myNode.djList.visible = false;
  23377. }
  23378. else {
  23379. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23380. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23381. this.ui.myNode.c1.selectedIndex = 1;
  23382. this.ui.myNode.myList.visible = false;
  23383. this.ui.myNode.djList.visible = true;
  23384. }
  23385. }
  23386. updateBallRod() {
  23387. for (let index = 0; index < this.ballRodArr.length; index++) {
  23388. this.ballRodArr[index].updateSelf();
  23389. }
  23390. }
  23391. renderBallRod(sort, obj) {
  23392. let index = this.getIndexBySort(sort + 1) - 1;
  23393. let ballRod = new BallRodDisplay$1(obj, index);
  23394. this.ballRodArr.push(ballRod);
  23395. }
  23396. renderDaoJu(idx, obj) {
  23397. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23398. let b = new DaoJuDisplay$1(obj, index);
  23399. this.daoJuArr.push(b);
  23400. }
  23401. getIndexBySort(sort) {
  23402. let object = cfgTable.ballrodData;
  23403. for (const key in object) {
  23404. if (object[key].sort == sort) {
  23405. return parseInt(key);
  23406. }
  23407. }
  23408. }
  23409. getIndexBySortForDj(idx) {
  23410. let object = cfgTable.daoJuData;
  23411. for (const key in object) {
  23412. if (object[key].idx == idx) {
  23413. return parseInt(key);
  23414. }
  23415. }
  23416. }
  23417. playSecretaryIdle() {
  23418. let parent = this.ui.secretary.displayObject;
  23419. parent.destroyChildren();
  23420. let xx = this.ui.secretary.width / 2;
  23421. let yy = this.ui.secretary.height;
  23422. let scale = xGame.common.getSecretaryScale();
  23423. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23424. xGame.common.secretary.play(data, 0, true, parent);
  23425. }
  23426. interuptSecretary() {
  23427. Laya.timer.clearAll(this);
  23428. this.playSecretaryRandomSound();
  23429. }
  23430. playSecretaryRandomSound() {
  23431. if (this.isHide)
  23432. return;
  23433. let time = xGame.common.randomNum(45000, 60000);
  23434. Laya.timer.once(time, this, () => {
  23435. if (this.isHide)
  23436. return;
  23437. let index = xGame.common.randomNum(4, 7);
  23438. xGame.soundMgr.playSound("s_main0" + index);
  23439. let words = 1;
  23440. switch (index) {
  23441. case 4:
  23442. words = 5;
  23443. break;
  23444. case 5:
  23445. words = 3;
  23446. break;
  23447. case 6:
  23448. words = 6;
  23449. break;
  23450. case 7:
  23451. words = 7;
  23452. break;
  23453. default:
  23454. break;
  23455. }
  23456. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23457. this.playSecretaryRandomSound();
  23458. });
  23459. }
  23460. closeSelf() {
  23461. this.hide();
  23462. }
  23463. }
  23464. UIShop$1.uiName = "UIShop";
  23465. class SignMax$1 {
  23466. constructor(ui) {
  23467. this.ui = ui;
  23468. }
  23469. updateSelf(index, sameDay, curDayIndex) {
  23470. let data = cfgTable.signData[index + 1];
  23471. this.ui.titleTxt.text = data.title;
  23472. let arr1 = data.award[0].split('-');
  23473. let arr2 = data.award[1].split('-');
  23474. let num1 = parseInt(arr1[1]);
  23475. let num2 = parseInt(arr2[1]);
  23476. this.ui.numTxt1.text = num1 + "";
  23477. this.ui.numTxt2.text = num2 + "";
  23478. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23479. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23480. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23481. this.ui.numTxt1.visible = false;
  23482. }
  23483. else {
  23484. this.ui.numTxt1.visible = true;
  23485. }
  23486. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23487. this.ui.numTxt2.visible = false;
  23488. }
  23489. else {
  23490. this.ui.numTxt2.visible = true;
  23491. }
  23492. if (index < curDayIndex) {
  23493. this.ui.c1.selectedIndex = 1;
  23494. }
  23495. else if (index == curDayIndex) {
  23496. if (sameDay) {
  23497. this.ui.c1.selectedIndex = 2;
  23498. }
  23499. else {
  23500. this.ui.c1.selectedIndex = 2;
  23501. }
  23502. }
  23503. else {
  23504. this.ui.c1.selectedIndex = 0;
  23505. }
  23506. }
  23507. }
  23508. class SignNormal$1 {
  23509. constructor(ui) {
  23510. this.ui = ui;
  23511. }
  23512. updateSelf(index, sameDay, curDayIndex) {
  23513. let data = cfgTable.signData[index + 1];
  23514. this.ui.titleTxt.text = data.title;
  23515. let arr = data.award[0].split('-');
  23516. let type = parseInt(arr[0]);
  23517. let num = parseInt(arr[1]);
  23518. this.ui.numTxt.text = num + "";
  23519. if (type > 2) {
  23520. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23521. this.ui.myIcon.rotation = 0;
  23522. }
  23523. else {
  23524. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23525. this.ui.myIcon.rotation = 0;
  23526. }
  23527. if (xGame.common.signAwardContainsRod(data.award)) {
  23528. this.ui.numTxt.visible = false;
  23529. }
  23530. else {
  23531. this.ui.numTxt.visible = true;
  23532. }
  23533. if (index < curDayIndex) {
  23534. this.ui.c1.selectedIndex = 1;
  23535. }
  23536. else if (index == curDayIndex) {
  23537. if (sameDay) {
  23538. this.ui.c1.selectedIndex = 2;
  23539. }
  23540. else {
  23541. this.ui.c1.selectedIndex = 2;
  23542. }
  23543. }
  23544. else {
  23545. this.ui.c1.selectedIndex = 0;
  23546. }
  23547. }
  23548. }
  23549. class UISign$1 extends UIBase {
  23550. constructor() {
  23551. super();
  23552. this.curDayIndex = 0;
  23553. this.starX = 0;
  23554. }
  23555. onConstructor() {
  23556. this.ui = ui_UISign.createInstance();
  23557. this.contentPane = this.ui;
  23558. this.isEject = false;
  23559. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23560. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23561. this.initSignItem();
  23562. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23563. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23564. }
  23565. show() {
  23566. super.show();
  23567. this.ui.t0.play();
  23568. this.playSecretaryIdle();
  23569. this.updateSign();
  23570. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23571. this.setGlobalFont(this.ui);
  23572. }
  23573. initSignItem() {
  23574. this.signArr = [];
  23575. for (let index = 0; index < 6; index++) {
  23576. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23577. this.signArr.push(temp);
  23578. }
  23579. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23580. if (Moyu.isKs)
  23581. this.ui.closeNode.closeBtn.x += 100;
  23582. }
  23583. updateSign() {
  23584. let sameDay = xGame.common.judgeSameDay();
  23585. let max = 7;
  23586. this.curDayIndex = DataMgr.getSignData();
  23587. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23588. this.curDayIndex = 0;
  23589. if (!sameDay) {
  23590. this.ui.normalBtn.visible = true;
  23591. this.ui.tipsNode.visible = false;
  23592. this.ui.againBtn.visible = false;
  23593. }
  23594. else {
  23595. this.ui.normalBtn.visible = false;
  23596. let again = DataMgr.getExtraSign();
  23597. let isCurrency = false;
  23598. let index = this.curDayIndex;
  23599. if (index == 0)
  23600. index = 7;
  23601. let award = cfgTable.signData[index].award;
  23602. let num = award[0].split("-")[0];
  23603. if (num == "1" || num == "2")
  23604. isCurrency = true;
  23605. let showAgain = again == 0 && isCurrency;
  23606. this.ui.againBtn.visible = showAgain;
  23607. this.ui.tipsNode.visible = !showAgain;
  23608. }
  23609. for (let index = 0; index < this.signArr.length; index++) {
  23610. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23611. }
  23612. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23613. }
  23614. playSecretaryIdle() {
  23615. let parent = this.ui.secretary.displayObject;
  23616. parent.destroyChildren();
  23617. let xx = this.ui.secretary.width / 2;
  23618. let yy = this.ui.secretary.height;
  23619. let scale = xGame.common.getSecretaryScale();
  23620. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23621. xGame.common.secretary.play(data, 0, true, parent);
  23622. }
  23623. closeSelf() {
  23624. this.hide();
  23625. }
  23626. normalGetAward() {
  23627. let sameDay = xGame.common.judgeSameDay();
  23628. if (!sameDay) {
  23629. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23630. let temp;
  23631. let type;
  23632. let num;
  23633. let arr = [];
  23634. for (let index = 0; index < award.length; index++) {
  23635. temp = award[index].split("-");
  23636. type = parseInt(temp[0]);
  23637. num = parseInt(temp[1]);
  23638. let awardType = new AwardType();
  23639. awardType.num = num;
  23640. awardType.type = type;
  23641. arr.push(awardType);
  23642. }
  23643. xGame.common.getAward(arr, (watchVideo) => {
  23644. this.curDayIndex++;
  23645. if (this.curDayIndex > 7)
  23646. this.curDayIndex = 0;
  23647. DataMgr.setSignData(this.curDayIndex);
  23648. this.updateSignData2Server(this.curDayIndex);
  23649. DataMgr.setSignTime(new Date().getTime());
  23650. if (watchVideo) {
  23651. DataMgr.setExtraSign(1);
  23652. Moyu.sendDataEvent("signIn1");
  23653. }
  23654. this.updateSign();
  23655. });
  23656. }
  23657. }
  23658. againGetAward() {
  23659. Moyu.sendDataEvent("signIn2");
  23660. console.log('zh:qjff_AD_for_uisign');
  23661. if (Laya.Browser.onAndroid) {
  23662. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23663. if (!boo) {
  23664. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23665. return;
  23666. }
  23667. }
  23668. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23669. }
  23670. else {
  23671. console.log('zh:AD 失败,直接发放奖励');
  23672. this.qjff_AD_for_uisign();
  23673. }
  23674. }
  23675. qjff_AD_for_uisign() {
  23676. let index = this.curDayIndex;
  23677. if (index == 0)
  23678. index = 7;
  23679. let award = cfgTable.signData[index].award;
  23680. let temp;
  23681. let type;
  23682. let num;
  23683. for (let index = 0; index < award.length; index++) {
  23684. temp = award[index].split("-");
  23685. type = parseInt(temp[0]);
  23686. num = parseInt(temp[1]) * 3;
  23687. xGame.common.playObjFlyAnim(num, type);
  23688. }
  23689. DataMgr.setExtraSign(1);
  23690. this.updateSign();
  23691. }
  23692. updateSignData2Server(day) {
  23693. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23694. if (userInfo == null) {
  23695. return;
  23696. }
  23697. let reqData = xGame.httpMgr.getReqData();
  23698. let pd = JSON.parse(reqData);
  23699. pd.signData = day;
  23700. reqData = JSON.stringify(pd);
  23701. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23702. try {
  23703. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23704. let code = res.code;
  23705. let msg = res.msg;
  23706. if (code == 401) {
  23707. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23708. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23709. return;
  23710. }
  23711. if (code == 200) {
  23712. let data = res.data;
  23713. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23714. }
  23715. else {
  23716. xGame.uiMgr.Show(UIMsg$1, msg);
  23717. }
  23718. }
  23719. catch (error) {
  23720. console.log('error=' + error);
  23721. alert(error);
  23722. }
  23723. finally {
  23724. }
  23725. });
  23726. }
  23727. }
  23728. UISign$1.uiName = "UISign";
  23729. class UIModeSelection$1 extends UIBase {
  23730. constructor() {
  23731. super();
  23732. }
  23733. onConstructor() {
  23734. this.ui = ui_UIModeSelection.createInstance();
  23735. this.contentPane = this.ui;
  23736. this.isEject = false;
  23737. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23738. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23739. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23740. this.addUIClick(this.ui.closeBtn, this.hide);
  23741. this.peopleArr = [65, 990, 580];
  23742. this.peopleOffest = [5, 10, 10];
  23743. }
  23744. show(callback) {
  23745. this.updateSelf();
  23746. super.show();
  23747. this.ui.t0.play();
  23748. this.callback = callback;
  23749. this.setGlobalFont(this.ui);
  23750. }
  23751. updateSelf() {
  23752. let cfg = cfgTable.modeselectData;
  23753. for (let index = 1; index <= 3; index++) {
  23754. let node = this.ui.myNode["type" + index];
  23755. node.need.text = cfg[index].need;
  23756. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23757. node.peopleTxt.text = this.getRandPeople(index - 1);
  23758. }
  23759. }
  23760. enterGame(type) {
  23761. console.log('zh: 进入经典模式 type: ' + type);
  23762. xGame.common.classicRoomType = type;
  23763. let cfg = cfgTable.modeselectData[type];
  23764. let need = cfg.need;
  23765. xGame.common.passAwardCoin = cfg.award;
  23766. if (DataMgr.coinEnough(need)) {
  23767. DataMgr.setCoin(-need);
  23768. this.ui.myNode["type" + type].t0.play();
  23769. Laya.timer.once(200, this, () => {
  23770. this.callback && this.callback();
  23771. });
  23772. this.logEventForClassic_start();
  23773. }
  23774. else {
  23775. Moyu.sendDataEvent("AddCoinVideo");
  23776. xGame.uiMgr.Show(UIAddProp$1, 0);
  23777. }
  23778. }
  23779. getRandPeople(index) {
  23780. let rand = this.peopleOffest[index];
  23781. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23782. }
  23783. logEventForClassic_start() {
  23784. let rtype = xGame.common.classicRoomType;
  23785. let msmc = '';
  23786. if (rtype == 1) {
  23787. msmc = 'beginner';
  23788. }
  23789. if (rtype == 2) {
  23790. msmc = 'expert';
  23791. }
  23792. if (rtype == 3) {
  23793. msmc = 'master';
  23794. }
  23795. let keyStr = 'sjmd_classic_start_' + rtype;
  23796. let jsonStr = {
  23797. "difficulty": msmc,
  23798. "classic_count": 1,
  23799. "difficulty_count": 1
  23800. };
  23801. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23802. const d = LocalStorageManager.getItem(keyStr);
  23803. jsonStr.classic_count = d.classic_count + 1;
  23804. jsonStr.difficulty_count = d.difficulty_count + 1;
  23805. LocalStorageManager.setItem(keyStr, jsonStr);
  23806. }
  23807. else {
  23808. LocalStorageManager.setItem(keyStr, jsonStr);
  23809. }
  23810. const reqStr = JSON.stringify(jsonStr);
  23811. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23812. }
  23813. }
  23814. UIModeSelection$1.uiName = "UIModeSelection";
  23815. class UILogin$1 extends UIBase {
  23816. constructor() {
  23817. super();
  23818. this.fontStr = 'big-john-woff2-2';
  23819. try {
  23820. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23821. console.log("zh: constructor加载arial字体成功");
  23822. }
  23823. catch (error) {
  23824. console.log("zh: constructor加载arial字体失败");
  23825. }
  23826. }
  23827. onFontLoaded() {
  23828. try {
  23829. Laya.Text.defaultFont = this.fontStr;
  23830. this.ui.txt_ua.font = this.fontStr;
  23831. this.ui.txt_up.font = this.fontStr;
  23832. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23833. }
  23834. catch (error) {
  23835. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23836. }
  23837. }
  23838. onConstructor() {
  23839. this.ui = ui_UILogin.createInstance();
  23840. this.contentPane = this.ui;
  23841. this.isEject = false;
  23842. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23843. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23844. this.addUIClick(this.ui.btn_login, this.userLogin);
  23845. }
  23846. show() {
  23847. super.show();
  23848. this.x = (Laya.stage.width - this.width) / 2;
  23849. this.y = (Laya.stage.height - this.height) / 2;
  23850. this.onFontLoaded();
  23851. }
  23852. closeSelf() {
  23853. this.hide();
  23854. }
  23855. userLogin() {
  23856. let ua = this.ui.txt_ua.text;
  23857. let up = this.ui.txt_up.text;
  23858. console.log('zh:ua font' + this.ui.txt_ua.font);
  23859. if (ua && up) {
  23860. let reqData = JSON.stringify({
  23861. username: ua.trim(),
  23862. password: up.trim(),
  23863. fromMark: 'app_game'
  23864. });
  23865. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23866. try {
  23867. console.log('zh:res = ' + JSON.stringify(res));
  23868. let code = res.code;
  23869. let msg = res.msg;
  23870. if (code == 200) {
  23871. let keyStr = keyForLoginInfo;
  23872. let jsonStr = {
  23873. "username": res.username,
  23874. "token": res.token,
  23875. "buySpids": { 1: false, 7: false }
  23876. };
  23877. LocalStorageManager.setItem(keyStr, jsonStr);
  23878. let myu = Moyu.getUserInfo();
  23879. console.log('zh:myu = ' + JSON.stringify(myu));
  23880. DataMgr.updateUserNickName(res.username);
  23881. Moyu.updateUserInfo(res.username);
  23882. xGame.uiMgr.Show(UIMsg$1, msg);
  23883. DataMgr.loadUserSpOrderForAd();
  23884. DataMgr.getUserZiChanInfo(false);
  23885. xGame.eventMgr.event(LOGIN_IN);
  23886. this.closeSelf();
  23887. }
  23888. else {
  23889. xGame.uiMgr.Show(UIMsg$1, msg);
  23890. }
  23891. }
  23892. catch (error) {
  23893. console.log('error=' + error);
  23894. alert(error);
  23895. }
  23896. finally {
  23897. }
  23898. });
  23899. }
  23900. else {
  23901. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23902. }
  23903. }
  23904. gotoRegPage() {
  23905. this.closeSelf();
  23906. xGame.uiMgr.Show(UIReg$1);
  23907. }
  23908. }
  23909. UILogin$1.uiName = "UILogin";
  23910. class UIReg$1 extends UIBase {
  23911. constructor() {
  23912. super();
  23913. this.fontStr = 'big-john-woff2-2';
  23914. try {
  23915. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23916. console.log("zh: constructor加载arial字体成功");
  23917. }
  23918. catch (error) {
  23919. console.log("zh: constructor加载arial字体失败");
  23920. }
  23921. }
  23922. onFontLoaded() {
  23923. try {
  23924. Laya.Text.defaultFont = this.fontStr;
  23925. this.ui.txt_ua.font = this.fontStr;
  23926. this.ui.txt_up1.font = this.fontStr;
  23927. this.ui.txt_up2.font = this.fontStr;
  23928. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23929. }
  23930. catch (error) {
  23931. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23932. }
  23933. }
  23934. onConstructor() {
  23935. this.ui = ui_UIReg.createInstance();
  23936. this.contentPane = this.ui;
  23937. this.isEject = false;
  23938. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23939. this.addUIClick(this.ui.btn_reg, this.regUser);
  23940. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23941. }
  23942. show() {
  23943. super.show();
  23944. this.x = (Laya.stage.width - this.width) / 2;
  23945. this.y = (Laya.stage.height - this.height) / 2;
  23946. this.onFontLoaded();
  23947. }
  23948. closeSelf() {
  23949. this.hide();
  23950. }
  23951. regUser() {
  23952. this.ui.lab_tip.visible = false;
  23953. let ua = this.ui.txt_ua.text;
  23954. let up1 = this.ui.txt_up1.text;
  23955. let up2 = this.ui.txt_up2.text;
  23956. if (ua && up1 && up2 && up1 == up2) {
  23957. let reqData = JSON.stringify({
  23958. username: ua.trim(),
  23959. password: up1.trim(),
  23960. fromMark: 'app_game'
  23961. });
  23962. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23963. try {
  23964. console.log('zh:res = ' + JSON.stringify(res));
  23965. let code = res.code;
  23966. let msg = res.msg;
  23967. xGame.uiMgr.Show(UIMsg$1, msg);
  23968. if (code == 200) {
  23969. this.ui.lab_tip.color = "#FFFFFF";
  23970. xGame.uiMgr.Show(UIMsg$1, msg);
  23971. this.closeSelf();
  23972. }
  23973. else {
  23974. this.ui.lab_tip.color = "#FF0000";
  23975. xGame.uiMgr.Show(UIMsg$1, msg);
  23976. }
  23977. }
  23978. catch (error) {
  23979. console.log('error=' + error);
  23980. alert(error);
  23981. }
  23982. finally {
  23983. }
  23984. });
  23985. }
  23986. else {
  23987. if (up1 != up2) {
  23988. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23989. }
  23990. else {
  23991. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23992. }
  23993. }
  23994. }
  23995. gotoLogin() {
  23996. this.closeSelf();
  23997. xGame.uiMgr.Show(UILogin$1);
  23998. }
  23999. }
  24000. UIReg$1.uiName = "UIReg";
  24001. class UITry$1 extends UIBase {
  24002. constructor() {
  24003. super();
  24004. this.closeTime = 0;
  24005. this.closeNum = 0;
  24006. this.skillUrl = xGame.common.skillIconList;
  24007. }
  24008. onConstructor() {
  24009. this.ui = ui_UITry.createInstance();
  24010. this.contentPane = this.ui;
  24011. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24012. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24013. }
  24014. show() {
  24015. super.show();
  24016. this.closeNum = 0;
  24017. this.closeTime = 15;
  24018. this.ui.t0.play();
  24019. PlatMgr.showRateBanner();
  24020. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24021. Laya.timer.loop(1000, this, this.updateTime);
  24022. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24023. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24024. xGame.common.gameMgr.gamePause = true;
  24025. this.setGlobalFont(this.ui);
  24026. }
  24027. updateTime() {
  24028. if (this.closeTime > 1) {
  24029. this.closeTime--;
  24030. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24031. }
  24032. else
  24033. this.hide();
  24034. }
  24035. hide() {
  24036. Laya.timer.clearAll(this);
  24037. Moyu.showBannerAd(false);
  24038. super.hide();
  24039. xGame.common.gameMgr.gamePause = false;
  24040. }
  24041. onTry() {
  24042. console.log('zh:qjff_AD_for_uitry');
  24043. if (Laya.Browser.onAndroid) {
  24044. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24045. if (!boo) {
  24046. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24047. return;
  24048. }
  24049. }
  24050. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24051. }
  24052. else {
  24053. console.log('zh:AD 失败,直接发放奖励');
  24054. this.qjff_AD_for_uitry();
  24055. }
  24056. }
  24057. qjff_AD_for_uitry() {
  24058. let select = xGame.common.curPlayerSkillType;
  24059. DataMgr.gameData.trySkill = select;
  24060. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24061. DataMgr.saveGameData();
  24062. DataMgr.setBigSkill(select, 1);
  24063. xGame.showTip("Trial Successful");
  24064. this.hide();
  24065. }
  24066. onCancel() {
  24067. if (this.closeNum > 0) {
  24068. this.closeNum--;
  24069. if (this.closeNum < 2)
  24070. this.hide();
  24071. return;
  24072. }
  24073. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24074. this.onTry();
  24075. }
  24076. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24077. this.closeNum = 3;
  24078. }
  24079. else
  24080. this.hide();
  24081. }
  24082. }
  24083. UITry$1.uiName = "UITry";
  24084. class UIGetAward$1 extends UIBase {
  24085. constructor() {
  24086. super();
  24087. this.showTriple = true;
  24088. }
  24089. onConstructor() {
  24090. this.ui = ui_UIGetAward.createInstance();
  24091. this.contentPane = this.ui;
  24092. this.isEject = false;
  24093. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24094. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24095. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24096. }
  24097. show(arr, showTriple, callback) {
  24098. super.show();
  24099. this.ui.t0.play();
  24100. this.ui.eftNode.visible = true;
  24101. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24102. this.ui.eftNode.visible = false;
  24103. }), 1, 0, 0, 0.9);
  24104. this.awardArr = arr;
  24105. this.showTriple = showTriple;
  24106. this.callback = callback;
  24107. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24108. this.ui.myList.numItems = arr.length;
  24109. xGame.soundMgr.playSound("getaward");
  24110. this.setGlobalFont(this.ui);
  24111. }
  24112. updateSelf(index, obj) {
  24113. let temp = this.awardArr[index];
  24114. let icon = this.getIcon(temp.type);
  24115. let str = icon;
  24116. if (temp.type > 2) {
  24117. str = "s" + icon;
  24118. }
  24119. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24120. obj.myIcon.rotation = 0;
  24121. obj.numTxt.text = temp.num + "";
  24122. obj.numTxt.visible = temp.type > 2 ? false : true;
  24123. obj.nameTxt.text = this.getNameStr(temp.type);
  24124. }
  24125. renderItem(index, obj) {
  24126. this.updateSelf(index, obj);
  24127. }
  24128. tripleGetAward() {
  24129. console.log('zh:qjff_AD_for_uigetAward');
  24130. if (Laya.Browser.onAndroid) {
  24131. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24132. if (!boo) {
  24133. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24134. return;
  24135. }
  24136. }
  24137. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24138. }
  24139. else {
  24140. console.log('zh:AD 失败,直接发放奖励');
  24141. this.qjff_AD_for_uigetAward();
  24142. }
  24143. }
  24144. qjff_AD_for_uigetAward() {
  24145. this.getAward(3);
  24146. }
  24147. normalGetAward() {
  24148. if (PlatMgr.isMisVideo())
  24149. this.tripleGetAward();
  24150. else
  24151. this.getAward();
  24152. }
  24153. getAward(times = 1) {
  24154. this.hide();
  24155. for (let index = 0; index < this.awardArr.length; index++) {
  24156. this.awardArr[index].num *= times;
  24157. }
  24158. this.callback && this.callback(times != 1);
  24159. }
  24160. getIcon(type) {
  24161. switch (type) {
  24162. case Prop.diamond:
  24163. return "ty_zs";
  24164. case Prop.coin:
  24165. return "ty_jb";
  24166. case Prop.gan1:
  24167. return "qg1";
  24168. case Prop.gan2:
  24169. return "qg2";
  24170. case Prop.gan3:
  24171. return "qg3";
  24172. case Prop.gan4:
  24173. return "qg4";
  24174. default:
  24175. break;
  24176. }
  24177. }
  24178. getNameStr(type) {
  24179. switch (type) {
  24180. case Prop.diamond:
  24181. return "Diamond";
  24182. case Prop.coin:
  24183. return "Coins";
  24184. case Prop.gan1:
  24185. case Prop.gan2:
  24186. case Prop.gan3:
  24187. case Prop.gan4:
  24188. return cfgTable.ballrodData[type - 1].name;
  24189. default:
  24190. break;
  24191. }
  24192. }
  24193. }
  24194. UIGetAward$1.uiName = "UIGetAward";
  24195. class UIBox$1 extends UIBase {
  24196. constructor() {
  24197. super();
  24198. this.boxNum = 0;
  24199. this.boxMax = 10;
  24200. this.inAd = false;
  24201. this.isClose = false;
  24202. }
  24203. onConstructor() {
  24204. this.ui = ui_UIBox.createInstance();
  24205. this.contentPane = this.ui;
  24206. this.isEject = false;
  24207. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24208. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24209. Laya.timer.loop(1000, this, this.update);
  24210. }
  24211. update() {
  24212. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24213. this.boxNum -= 1;
  24214. this.upBar();
  24215. }
  24216. }
  24217. upBar() {
  24218. if (this.boxNum > this.boxMax)
  24219. this.boxNum = this.boxMax;
  24220. this.ui.bar.value = this.boxNum * 10;
  24221. }
  24222. show() {
  24223. super.show();
  24224. this.isClose = false;
  24225. this.boxNum = 0;
  24226. this.inAd = false;
  24227. this.upBar();
  24228. this.ui.t0.play();
  24229. this.ui.closeBtn.visible = false;
  24230. Laya.timer.once(3000, this, () => {
  24231. this.ui.closeBtn.visible = true;
  24232. this.ui.bar.alpha = 1;
  24233. });
  24234. Laya.timer.once(500, this, () => {
  24235. this.ui.t1.play();
  24236. });
  24237. this.setGlobalFont(this.ui);
  24238. }
  24239. hide() {
  24240. Laya.timer.clearAll(this);
  24241. Moyu.showBannerAd(false);
  24242. super.hide();
  24243. }
  24244. onOpenBox() {
  24245. this.boxNum++;
  24246. if (this.boxNum < this.boxMax) {
  24247. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24248. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24249. }
  24250. }
  24251. else if (this.boxNum == this.boxMax) {
  24252. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24253. this.ui.openBtn.c1.selectedIndex = 13;
  24254. this.inAd = true;
  24255. }
  24256. else
  24257. this.getAward();
  24258. }
  24259. else if (this.inAd) {
  24260. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24261. if (Laya.Browser.onAndroid) {
  24262. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24263. if (!boo) {
  24264. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24265. return;
  24266. }
  24267. }
  24268. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24269. }
  24270. else {
  24271. console.log('zh:AD 失败,直接发放奖励');
  24272. this.qjff_AD_for_UIBOX_onOpenBox();
  24273. }
  24274. }
  24275. this.upBar();
  24276. }
  24277. qjff_AD_for_UIBOX_onOpenBox() {
  24278. this.getAward();
  24279. }
  24280. onCloseBox() {
  24281. if (this.isClose)
  24282. this.hide();
  24283. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24284. this.isClose = true;
  24285. PlatMgr.showBanner(true, 0, 3000);
  24286. }
  24287. else
  24288. this.hide();
  24289. }
  24290. getAward() {
  24291. let str = "";
  24292. if (Math.random() < 0.5) {
  24293. let max = Moyu.isLegal ? 500 : 2500;
  24294. let num = xGame.tools.random(max, 500 + max);
  24295. DataMgr.setCoin(num);
  24296. str = "金币x" + num;
  24297. }
  24298. else {
  24299. let max = Moyu.isLegal ? 10 : 30;
  24300. let num = xGame.tools.random(max, 30 + max);
  24301. DataMgr.setDiamond(num);
  24302. str = "钻石x" + num;
  24303. }
  24304. xGame.showTip("恭喜获得-" + str);
  24305. this.hide();
  24306. }
  24307. }
  24308. UIBox$1.uiName = "UIBox";
  24309. class UIMain$1 extends UIBase {
  24310. constructor() {
  24311. super();
  24312. this.firstEnter = true;
  24313. this.moni_click_count = 0;
  24314. }
  24315. nativeCallJs(msg) {
  24316. let t = msg;
  24317. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24318. switch (t) {
  24319. case 'qjff_chouJiang':
  24320. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24321. dui.qjff_chouJiang();
  24322. break;
  24323. case 'qjff_AD_for_uisign':
  24324. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24325. dui2.qjff_AD_for_uisign();
  24326. break;
  24327. case 'qjff_AD_for_uitry':
  24328. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24329. dui3.qjff_AD_for_uitry();
  24330. break;
  24331. case 'qjff_AD_for_uipower':
  24332. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24333. dui4.qjff_AD_for_uipower();
  24334. break;
  24335. case 'qjff_AD_for_uigetAward':
  24336. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24337. dui5.qjff_AD_for_uigetAward();
  24338. break;
  24339. case 'qjff_AD_for_uiGameEnd':
  24340. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24341. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24342. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24343. break;
  24344. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24345. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24346. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24347. break;
  24348. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24349. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24350. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24351. break;
  24352. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24353. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24354. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24355. break;
  24356. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24357. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24358. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24359. break;
  24360. case 'qjff_AD_for_UIBOX_onOpenBox':
  24361. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24362. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24363. break;
  24364. case 'qjff_AD_for_UIAddCoin':
  24365. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24366. dui12.qjff_AD_for_UIAddCoin();
  24367. break;
  24368. case 'app_sign_for_buyProduct_onSuccess':
  24369. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24370. DataMgr.getUserZiChanInfo(false);
  24371. break;
  24372. case '222axxxxxx':
  24373. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24374. dui15.qjff_AD_for_uisign();
  24375. break;
  24376. case '333axsxxxxxx':
  24377. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24378. dui16.qjff_AD_for_uisign();
  24379. break;
  24380. default:
  24381. console.log('zh:未知的方法名字' + t);
  24382. break;
  24383. }
  24384. }
  24385. onConstructor() {
  24386. console.log('zh: UIMain onConstructor');
  24387. this.ui = ui_UIMain.createInstance();
  24388. this.contentPane = this.ui;
  24389. this.isEject = false;
  24390. this.addEvent();
  24391. this.addClickSpine();
  24392. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24393. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24394. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24395. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24396. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24397. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24398. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24399. let curUse = DataMgr.getCurSecretary();
  24400. this.changeSecretary(curUse);
  24401. this.ui.talkNode.visible = false;
  24402. let guide = DataMgr.getSkillGuide();
  24403. if (xGame.common.isNewDay && guide == 1) {
  24404. xGame.common.isNewDay = false;
  24405. xGame.soundMgr.playSound("s_main01");
  24406. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24407. console.log("zh:播放小秘书每天语音");
  24408. }
  24409. this.onGetUserInfo();
  24410. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24411. DataMgr.getUserZiChanInfo(false);
  24412. }
  24413. this.ui.n83.visible = false;
  24414. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24415. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24416. let ua = d.username;
  24417. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24418. }
  24419. this.c_btn_for_user();
  24420. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24421. }
  24422. Logout() {
  24423. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24424. LocalStorageManager.removeItem(keyForLoginInfo);
  24425. this.freshUser();
  24426. }
  24427. JSBridgeUtils.instance.loginOutForApp();
  24428. this.setUserDefaultNickname();
  24429. DataMgr.setCoin2(4000);
  24430. DataMgr.setDiamond2(0);
  24431. this.setDefaultQiuGanInfo();
  24432. DataMgr.setPlaceBallLevelList("");
  24433. DataMgr.setChallengeMode_overLev(1);
  24434. this.setDefaultSignData();
  24435. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24436. }
  24437. setDefaultSignData() {
  24438. DataMgr.setSignData(1);
  24439. DataMgr.setSignTime(new Date().getTime());
  24440. }
  24441. setDefaultQiuGanInfo() {
  24442. DataMgr.setBallRod(0, 1);
  24443. DataMgr.setBallRod(1, 0);
  24444. DataMgr.setBallRod(2, 0);
  24445. DataMgr.setBallRod(3, 0);
  24446. DataMgr.setBallRod(4, 0);
  24447. DataMgr.setBallRod(5, 1);
  24448. }
  24449. setUserDefaultNickname() {
  24450. let defUsername = "player";
  24451. this.ui.headNode.nameTxt.text = defUsername;
  24452. DataMgr.updateUserNickName(defUsername);
  24453. Moyu.updateUserInfo(defUsername);
  24454. }
  24455. gotoLogin() {
  24456. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24457. xGame.uiMgr.Show(UILogin$1);
  24458. }
  24459. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24460. this.Logout();
  24461. }
  24462. }
  24463. gotoRegUser() {
  24464. xGame.uiMgr.Show(UIReg$1);
  24465. }
  24466. showFuLiSp1() {
  24467. console.log('zh:福利1');
  24468. DataMgr.checkForShowFuLi17AndAlert(1);
  24469. }
  24470. showFuLiSp7() {
  24471. console.log('zh:福利7');
  24472. DataMgr.checkForShowFuLi17AndAlert(7);
  24473. }
  24474. c_btn_for_user() {
  24475. this.ui.n_dengLu.c1.selectedIndex = 0;
  24476. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24477. this.ui.n_dengLu.c1.selectedIndex = 1;
  24478. }
  24479. else {
  24480. this.ui.n_dengLu.c1.selectedIndex = 0;
  24481. }
  24482. }
  24483. changeSecretary(curUse) {
  24484. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24485. xGame.common.secretary && xGame.common.secretary.dispose();
  24486. this.addSecretarySpine(name);
  24487. }
  24488. addSecretarySpine(name) {
  24489. let spine = new SpineMgr(name, () => {
  24490. this.playSecretaryIdle();
  24491. });
  24492. xGame.common.secretary = spine;
  24493. }
  24494. addClickSpine() {
  24495. let clickSpine = new SpineMgr("dianji", () => {
  24496. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24497. let parent = Laya.stage;
  24498. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24499. clickSpine.play(data, 0, false, parent, (spine) => {
  24500. spine.destroy(true);
  24501. });
  24502. });
  24503. });
  24504. }
  24505. addEvent() {
  24506. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24507. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24508. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24509. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24510. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24511. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24512. this.addUIClick(this.ui, this.interuptSecretary);
  24513. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24514. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24515. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24516. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24517. this.addUIClick(this.ui.signBtn, this.openSignView);
  24518. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24519. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24520. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  24521. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  24522. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24523. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24524. }
  24525. show(showFailWords) {
  24526. super.show();
  24527. DataMgr.loadUserSpOrderForAd();
  24528. this.moneyNode.ui.c1.selectedIndex = 1;
  24529. this.playSecretaryIdle();
  24530. xGame.soundMgr.playMusic("caromhall01", 0);
  24531. Laya.timer.clearAll(this);
  24532. this.playSecretaryRandomSound();
  24533. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24534. if (showFailWords) {
  24535. console.log('zh:uimain.ts ');
  24536. setTimeout(() => {
  24537. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24538. let words = -1;
  24539. if (str == "s_main02") {
  24540. words = 2;
  24541. }
  24542. else {
  24543. words = 3;
  24544. }
  24545. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24546. xGame.soundMgr.playSound(str);
  24547. }, 300);
  24548. }
  24549. this.showGuide();
  24550. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24551. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24552. let guide = DataMgr.getSkillGuide();
  24553. if (guide == 1) {
  24554. let randTime = xGame.common.randomNum(300, 800);
  24555. if (this.firstEnter) {
  24556. console.log("zh: firstEnter");
  24557. this.firstEnter = false;
  24558. randTime += 900;
  24559. }
  24560. else {
  24561. console.log("zh: no firstEnter");
  24562. }
  24563. Laya.timer.once(randTime, this, () => {
  24564. });
  24565. Laya.timer.once(1000, this, () => {
  24566. console.log('zh: 1秒后 showFuLiSp7');
  24567. this.showFuLiSp7();
  24568. });
  24569. this.showTipForGuest();
  24570. }
  24571. this.setGlobalFont(this.ui);
  24572. }
  24573. yinDaoForLianxi() {
  24574. let x = this.ui.placeBallBtn.x;
  24575. let y = this.ui.placeBallBtn.y;
  24576. this.ui.n_yd_challenge_1.visible = true;
  24577. this.ui.n_yd_challenge_1_hand.x = x + 150;
  24578. this.ui.n_yd_challenge_1_hand.y = y;
  24579. this.ui.n_yd_challenge_1_btn.x = x;
  24580. this.ui.n_yd_challenge_1_btn.y = y;
  24581. console.log('zh:yinDaoForLianxi set ok');
  24582. }
  24583. showTipForGuest() {
  24584. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24585. if (userInfo == null) {
  24586. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  24587. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  24588. let woman = "this is an important notice.";
  24589. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  24590. return;
  24591. }
  24592. }
  24593. checkActive(show) {
  24594. }
  24595. showGuide() {
  24596. let guide = DataMgr.getSkillGuide();
  24597. this.ui.guideBtn.visible = guide == 0;
  24598. this.ui.enterGuide.visible = false;
  24599. this.ui.secretaryGuide.visible = guide == 0;
  24600. if (guide == 0) {
  24601. console.log("zh:显示引导");
  24602. xGame.soundMgr.playSound("s_guide");
  24603. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24604. }
  24605. else {
  24606. console.log("zh:不需要显示引导");
  24607. }
  24608. }
  24609. ensureSecretary() {
  24610. console.log('zh: ensureSecretary ');
  24611. this.ui.secretaryGuide.visible = false;
  24612. this.ui.enterGuide.visible = true;
  24613. this.ui.wordsNode.t0.play();
  24614. if (DataMgr.getNewUser())
  24615. Moyu.sendDataEvent("gameReady");
  24616. }
  24617. playSecretaryIdle() {
  24618. let parent = this.ui.secretary.displayObject;
  24619. parent.destroyChildren();
  24620. let xx = this.ui.secretary.width / 2;
  24621. let yy = this.ui.secretary.height;
  24622. let scale = xGame.common.getSecretaryScale();
  24623. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24624. xGame.common.secretary.play(data, 0, true, parent);
  24625. }
  24626. startGame(type) {
  24627. if (!this.isReadyForLoadNetSource()) {
  24628. return;
  24629. }
  24630. xGame.common.gameMode = type;
  24631. Moyu.sendDataEvent("PlayGame", { type: type });
  24632. let gm = xGame.common.gameMode;
  24633. console.log('zh:进入游戏gameMode =' + gm);
  24634. switch (gm) {
  24635. case GameMode.classic:
  24636. console.log('zh:进入经典模式111111111');
  24637. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24638. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24639. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24640. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24641. console.log('zh:判断是否可以玩该模式classic =NO');
  24642. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24643. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24644. return;
  24645. }
  24646. else {
  24647. console.log('zh:可以玩该模式classic');
  24648. this.beginGame();
  24649. }
  24650. }
  24651. else {
  24652. console.log('zh:不需要判断是否可以玩该classic');
  24653. let challengeTimes = DataMgr.getChallengeTimes();
  24654. if (challengeTimes == 0) {
  24655. xGame.uiMgr.Show(UIInvitation$1);
  24656. }
  24657. else {
  24658. this.beginGame();
  24659. }
  24660. }
  24661. break;
  24662. case GameMode.bigMove:
  24663. console.info('zh:bigMove check 大招');
  24664. let guide = DataMgr.getSkillGuide();
  24665. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24666. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24667. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24668. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24669. console.log('zh:提示不可以玩');
  24670. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24671. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24672. return;
  24673. }
  24674. else {
  24675. console.log('zh:可以玩该模式 bigMove');
  24676. this.beginGame();
  24677. if (DataMgr.getNewUser())
  24678. Moyu.sendDataEvent("gameStart0");
  24679. }
  24680. }
  24681. else {
  24682. this.beginGame();
  24683. if (DataMgr.getNewUser())
  24684. Moyu.sendDataEvent("gameStart0");
  24685. }
  24686. break;
  24687. default:
  24688. console.error('zh:未知错误!!!!');
  24689. break;
  24690. }
  24691. }
  24692. beginGame(isNice = false) {
  24693. console.log('zh:beginGame ');
  24694. let guide = DataMgr.getSkillGuide();
  24695. if (guide == 1) {
  24696. console.log('zh:非新手引导,showInternAd ');
  24697. JSBridgeUtils.instance.showInternAd('beginGame');
  24698. }
  24699. else {
  24700. console.log('zh:新手引导,不显示AD ');
  24701. }
  24702. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24703. console.log('zh:beginGame 1');
  24704. if (xGame.common.gameMode == GameMode.classic) {
  24705. console.log('zh:beginGame 2');
  24706. if (isNice) {
  24707. console.log('zh:进入巅峰赛');
  24708. this.enterClassic();
  24709. }
  24710. else {
  24711. console.log('zh:beginGame 3-1');
  24712. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24713. console.log('zh:beginGame 3-2');
  24714. this.enterClassic();
  24715. });
  24716. }
  24717. }
  24718. else if (xGame.common.gameMode == GameMode.bigMove) {
  24719. console.log('zh:beginGame 5');
  24720. this.ui.enterGuide.visible = false;
  24721. xGame.uiMgr.Show(UISkill$1);
  24722. }
  24723. }
  24724. enterClassic() {
  24725. console.log('zh:beginGame 7');
  24726. xGame.uiMgr.Show(UIGame$1);
  24727. xGame.uiMgr.Show(UIMatching$1, () => {
  24728. if (!this.isHide)
  24729. this.hide();
  24730. xGame.common.gameUI.ui.alpha = 1;
  24731. console.log('zh:beginGame 8');
  24732. xGame.common.gameUI.startGame();
  24733. xGame.uiMgr.Hide(UIGameEnd$1);
  24734. });
  24735. }
  24736. start_debug_for_moni_payOk() {
  24737. let ccc = this.moni_click_count + 1;
  24738. this.moni_click_count = ccc;
  24739. if (ccc % 5 == 0) {
  24740. console.log('zh:start_debug_for_moni_payOk');
  24741. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24742. if (userInfo != null) {
  24743. let token = userInfo.token;
  24744. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24745. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24746. alert('模拟支付OK');
  24747. return;
  24748. }
  24749. else {
  24750. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24751. }
  24752. }
  24753. }
  24754. startGlobal() {
  24755. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24756. }
  24757. startWeekly() {
  24758. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24759. }
  24760. zhouSaiMonth() {
  24761. console.log('zh: zhouSaiMonth 被调用');
  24762. }
  24763. isReadyForLoadNetSource() {
  24764. let reqCount = xGame.cfgMgr.httpReqCount;
  24765. let ok = xGame.cfgMgr.httpReqOkCount;
  24766. if (reqCount > ok) {
  24767. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24768. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24769. Laya.timer.once(5000, this, () => {
  24770. let retryCount = 0;
  24771. const maxRetries = 3;
  24772. const tryFetchConfig = () => {
  24773. try {
  24774. xGame.cfgMgr.getConfigFromServer();
  24775. }
  24776. catch (error) {
  24777. if (retryCount < maxRetries) {
  24778. retryCount++;
  24779. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24780. Laya.timer.once(5000, this, tryFetchConfig);
  24781. }
  24782. else {
  24783. console.error("❌ 达到最大重试次数,配置获取失败");
  24784. }
  24785. }
  24786. };
  24787. tryFetchConfig();
  24788. });
  24789. return false;
  24790. }
  24791. return true;
  24792. }
  24793. startPlaceBall() {
  24794. if (!this.isReadyForLoadNetSource()) {
  24795. return;
  24796. }
  24797. xGame.uiMgr.Show(UILevelDisplay$1);
  24798. }
  24799. hide() {
  24800. console.log('zh:uimain hide ...');
  24801. super.hide();
  24802. xGame.common.stopGirlPop(this.ui.talkNode);
  24803. }
  24804. onGetUserInfo(force = false) {
  24805. if (Moyu.isWx) {
  24806. let info = Moyu.getSystemInfo();
  24807. if (info)
  24808. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24809. }
  24810. else {
  24811. Moyu.initUser(this, this.freshUser, force);
  24812. }
  24813. this.freshUser();
  24814. console.log('zh:5秒后更新用户信息');
  24815. setTimeout(() => {
  24816. DataMgr.getUserZiChanInfo(true);
  24817. }, 5000);
  24818. }
  24819. event_login_in() {
  24820. console.log("zh:event_login_in被触发");
  24821. this.freshUser();
  24822. }
  24823. freshUser() {
  24824. let user = Moyu.getUserInfo();
  24825. if (!user.isAuth) {
  24826. user.headIcon = 'res/ty_touxiang.png';
  24827. }
  24828. else {
  24829. DataMgr.upRankData();
  24830. }
  24831. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24832. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24833. let keyStr = keyForLoginInfo;
  24834. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24835. const d = LocalStorageManager.getItem(keyStr);
  24836. let ua = d.username;
  24837. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24838. }
  24839. else {
  24840. }
  24841. this.c_btn_for_user();
  24842. }
  24843. interuptSecretary() {
  24844. Laya.timer.clearAll(this);
  24845. this.playSecretaryRandomSound();
  24846. }
  24847. playSecretaryRandomSound() {
  24848. if (this.isHide)
  24849. return;
  24850. let time = xGame.common.randomNum(45000, 60000);
  24851. Laya.timer.once(time, this, () => {
  24852. if (this.isHide)
  24853. return;
  24854. let index = xGame.common.randomNum(4, 7);
  24855. xGame.soundMgr.playSound("s_main0" + index);
  24856. let words = 1;
  24857. switch (index) {
  24858. case 4:
  24859. words = 5;
  24860. break;
  24861. case 5:
  24862. words = 3;
  24863. break;
  24864. case 6:
  24865. words = 6;
  24866. break;
  24867. case 7:
  24868. words = 7;
  24869. break;
  24870. default:
  24871. break;
  24872. }
  24873. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24874. this.playSecretaryRandomSound();
  24875. });
  24876. }
  24877. openSecretaryView() {
  24878. xGame.uiMgr.Show(UISecretary$1);
  24879. Moyu.sendDataEvent("secretary");
  24880. }
  24881. openShopView() {
  24882. xGame.uiMgr.Show(UIShop$1, 1);
  24883. }
  24884. openShopView0() {
  24885. xGame.uiMgr.Show(UIShop$1, 0);
  24886. }
  24887. openSignView() {
  24888. xGame.uiMgr.Show(UISign$1);
  24889. }
  24890. openDrawView() {
  24891. xGame.uiMgr.Show(UIDraw$1);
  24892. }
  24893. openRanking() {
  24894. console.log('zh:phb openRanking');
  24895. xGame.uiMgr.Show(UIRanking$1);
  24896. Moyu.sendDataEvent("rankingList");
  24897. }
  24898. }
  24899. UIMain$1.uiName = "UIMain";
  24900. function InitShader() {
  24901. }
  24902. function appInit() {
  24903. xGame.context.init(getLoadingResList(), initCallback);
  24904. }
  24905. function getLoadingResList() {
  24906. return [
  24907. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24908. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24909. ];
  24910. }
  24911. function getGameResList() {
  24912. return [
  24913. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24914. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24915. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24916. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24917. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24918. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24919. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24920. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24921. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24922. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24923. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24924. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24925. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24926. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24927. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24928. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24929. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24930. ];
  24931. }
  24932. function initCallback() {
  24933. window["DataMgr"] = DataMgr;
  24934. DataMgr.Init();
  24935. Moyu.init(getPlat(), this, () => {
  24936. DataMgr.isNewDay();
  24937. PlatMgr.initConfig();
  24938. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24939. }, true);
  24940. console.log('zh:开始sm init1 start');
  24941. xGame.soundMgr.init();
  24942. console.log('zh:开始sm init1 end');
  24943. xGame.uiMgr.init();
  24944. xGame.uiMgr.clearTempData();
  24945. xGame.uiMgr.bindFUI(fguiRes.loading);
  24946. xGame.uiMgr.Show(UILoading);
  24947. }
  24948. function onFontLoaded() {
  24949. try {
  24950. Laya.Text.defaultFont = "arial";
  24951. console.log("zh: onFontLoaded 设置arial字体成功");
  24952. }
  24953. catch (error) {
  24954. console.log("zh: constructor onFontLoaded加载arial字体失败");
  24955. }
  24956. }
  24957. function loadSubRes(callback) {
  24958. var tab = ["asset", "res", "spine"];
  24959. let subDone = 0;
  24960. for (var i = 0; i < tab.length; i++) {
  24961. let sub = tab[i];
  24962. Moyu.loadSubRes(sub, (pro) => {
  24963. callback && callback(pro, false);
  24964. }).then(() => {
  24965. subDone++;
  24966. if (subDone >= tab.length)
  24967. callback && callback(1, true);
  24968. });
  24969. }
  24970. }
  24971. function enterGame() {
  24972. xGame.cfgMgr.init();
  24973. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24974. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24975. xGame.uiMgr.Hide(UILoading);
  24976. fgui.UIPackage.removePackage(fguiRes.loading);
  24977. xGame.uiMgr.bindFUI(fguiRes.game);
  24978. xGame.uiMgr.Show(UIMain$1);
  24979. if (DataMgr.getNewUser())
  24980. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24981. }
  24982. function getPlat() {
  24983. let cfg = new MoyuCfg();
  24984. cfg.plat = MoyuPlat.web;
  24985. cfg.myId = 180;
  24986. cfg.myKey = '8848a885774230a4';
  24987. cfg.version = 0;
  24988. if (window.hasOwnProperty("gamebox")) {
  24989. cfg.plat = MoyuPlat.f399;
  24990. cfg.version = 0;
  24991. }
  24992. else if (window.hasOwnProperty("ks")) {
  24993. cfg.plat = MoyuPlat.ks;
  24994. cfg.version = 0;
  24995. cfg.ads.ksVideoId = '2300002254_01';
  24996. cfg.ads.ksInsertId = '2300002254_02';
  24997. }
  24998. else if (Laya.Browser.onTTMiniGame) {
  24999. cfg.plat = MoyuPlat.tt;
  25000. cfg.version = 0;
  25001. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25002. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25003. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25004. }
  25005. else if (Laya.Browser.onMiniGame) {
  25006. cfg.plat = MoyuPlat.wx;
  25007. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25008. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25009. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25010. }
  25011. else if (Laya.Browser.onQQMiniGame) {
  25012. cfg.plat = MoyuPlat.qq;
  25013. }
  25014. else if (Laya.Browser.onQGMiniGame) {
  25015. cfg.plat = MoyuPlat.op;
  25016. cfg.ads.opVideoId = '455502';
  25017. cfg.ads.opBannerId = '455507';
  25018. }
  25019. else if (Laya.Browser.onVVMiniGame) {
  25020. cfg.plat = MoyuPlat.vv;
  25021. cfg.version = 0;
  25022. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25023. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25024. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25025. }
  25026. else if (Laya.Browser.onHWMiniGame) {
  25027. cfg.plat = MoyuPlat.hw;
  25028. }
  25029. else if (window["mz"]) {
  25030. cfg.plat = MoyuPlat.mz;
  25031. }
  25032. else {
  25033. let cfg = window['conchConfig'];
  25034. if (cfg) {
  25035. var os = cfg.getOS();
  25036. if (os == "Conch-ios") {
  25037. cfg.plat = MoyuPlat.ios;
  25038. }
  25039. else if (os == "Conch-android") {
  25040. }
  25041. }
  25042. }
  25043. return cfg;
  25044. }
  25045. class Main {
  25046. constructor() {
  25047. if (window["Laya3D"])
  25048. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25049. else {
  25050. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25051. this.initMain();
  25052. }
  25053. }
  25054. initMain() {
  25055. Laya["Physics"] && Laya["Physics"].enable();
  25056. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25057. Laya.stage.scaleMode = GameConfig.scaleMode;
  25058. Laya.stage.screenMode = GameConfig.screenMode;
  25059. Laya.stage.alignV = GameConfig.alignV;
  25060. Laya.stage.alignH = GameConfig.alignH;
  25061. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25062. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25063. Laya.enableDebugPanel();
  25064. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25065. Laya["PhysicsDebugDraw"].enable();
  25066. if (GameConfig.stat)
  25067. Laya.Stat.show();
  25068. Laya.alertGlobalError(true);
  25069. this.loadFont();
  25070. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25071. }
  25072. loadFont() {
  25073. try {
  25074. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25075. console.log("zh: constructor加载arial字体成功1");
  25076. }
  25077. catch (error) {
  25078. console.log("zh: constructor加载arial字体失败1");
  25079. }
  25080. }
  25081. onFontLoaded() {
  25082. try {
  25083. Laya.Text.defaultFont = "Arial";
  25084. console.log("zh: onFontLoaded 设置arial字体成功1");
  25085. }
  25086. catch (error) {
  25087. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25088. }
  25089. }
  25090. onVersionLoaded() {
  25091. appInit();
  25092. }
  25093. }
  25094. new Main();
  25095. }());
  25096. //# sourceMappingURL=bundle.js.map