bundle.js 967 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200
  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. }
  893. let url = urlMid + reqUrl;
  894. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  895. if (isDev) {
  896. url = urlTop + reqUrl;
  897. }
  898. else {
  899. url = urlTop + "prod-api/" + reqUrl;
  900. }
  901. }
  902. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  903. if (reqUrl.indexOf("/api/game/") >= 0) {
  904. }
  905. const keyForLoginInfo = "userInfo";
  906. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  907. if (userInfoData != null) {
  908. try {
  909. let bb = JSON.parse(userInfoData);
  910. if (bb) {
  911. let token = bb.token;
  912. headers.push("Authorization");
  913. headers.push(`Bearer ${token}`);
  914. }
  915. }
  916. catch (e) {
  917. }
  918. }
  919. let httpObj = new Laya.HttpRequest();
  920. httpObj.http.timeout = 5000;
  921. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  922. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  923. httpObj.send(url, data, 'post', 'text', headers);
  924. console.log('zh: http url = ' + url);
  925. function errorHandler(error) {
  926. if (call) {
  927. call("{'msg':'Network exception','code':500}");
  928. }
  929. else {
  930. alert("Tip:Please check your network connection.");
  931. }
  932. }
  933. function completeHandler(data) {
  934. if (data && data.length > 0) {
  935. let jsonData = JSON.parse(data);
  936. if (call)
  937. call(jsonData);
  938. }
  939. }
  940. }
  941. sendGet(url, call) {
  942. let httpObj = new Laya.HttpRequest();
  943. httpObj.http.timeout = 5000;
  944. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  945. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  946. httpObj.send(url, '', 'get');
  947. function errorHandler(error) {
  948. console.log("errorHandler:" + error);
  949. }
  950. function completeHandler(data) {
  951. if (data && data.length > 0) {
  952. if (call)
  953. call(data);
  954. }
  955. }
  956. }
  957. }
  958. HttpMgr._instance = null;
  959. class LightShader extends Laya.Sprite {
  960. constructor() {
  961. super();
  962. this._time = 0;
  963. this._sin = 0;
  964. this.initShader();
  965. }
  966. initShader() {
  967. var vs = `
  968. #define FSHIGHPRECISION
  969. attribute vec4 posuv;
  970. uniform vec2 size;
  971. varying vec4 v_texcoord;
  972. void main() {
  973. vec4 pos = vec4(posuv.xy,0.,1.);
  974. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  975. gl_Position=pos1;
  976. v_texcoord.xy = posuv.xy;
  977. }
  978. `;
  979. var ps = `
  980. #define FSHIGHPRECISION
  981. precision highp float;
  982. varying vec4 v_texcoord;
  983. uniform vec2 size;
  984. uniform sampler2D texture;
  985. uniform float u_Time;
  986. void main() {
  987. vec4 color= texture2D(texture, v_texcoord.xy);
  988. float width = 0.2;
  989. float start = u_Time;
  990. float offset = 1.0;
  991. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  992. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  993. {
  994. color.r=1.1;
  995. color.g=1.1;
  996. color.b=1.1;
  997. gl_FragColor = color;
  998. } else {
  999. gl_FragColor = color;
  1000. }
  1001. }
  1002. `;
  1003. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1004. this.customRenderEnable = true;
  1005. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1006. }
  1007. customRender(context, x, y) {
  1008. this.onUpdate();
  1009. if (!this.texture)
  1010. return;
  1011. let xx = x - this.pivotX;
  1012. let yy = y - this.pivotY;
  1013. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1014. }
  1015. onUpdate() {
  1016. this._time += 2 * Laya.timer.delta * 0.001;
  1017. this._sin = Math.sin(this._time);
  1018. if (this._sin > 0.99) {
  1019. this._sin = 0;
  1020. this._time = 0;
  1021. }
  1022. this.shaderValue['u_Time'] = this._sin;
  1023. }
  1024. }
  1025. LightShader.DissolveSurfaceSaveName = 9997;
  1026. class UIBase extends fairygui.Window {
  1027. constructor() {
  1028. super();
  1029. this.isEject = true;
  1030. this.isHide = true;
  1031. this.showbanner = true;
  1032. this.className = "";
  1033. this.isMuti = false;
  1034. this.showbanner = false;
  1035. this.onConstructor();
  1036. }
  1037. checkActive(show) {
  1038. }
  1039. getUIName() {
  1040. return UIBase.uiName;
  1041. }
  1042. onConstructor() {
  1043. }
  1044. onInit() {
  1045. if (!!this.contentPane) {
  1046. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1047. }
  1048. this.setPivot(0.5, 0.5, false);
  1049. }
  1050. doShowAnimation() {
  1051. if (!this.isEject)
  1052. return;
  1053. super.doShowAnimation();
  1054. Laya.Tween.clearTween(this);
  1055. this.scaleX = this.scaleY = 0.8;
  1056. let tweenFunc1 = (func) => {
  1057. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1058. };
  1059. let tweenFunc2 = (func) => {
  1060. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1061. };
  1062. tweenFunc1(tweenFunc2);
  1063. }
  1064. show(...args) {
  1065. super.show();
  1066. this._openParam = args;
  1067. this.isHide = false;
  1068. xGame.uiMgr.checkUIState();
  1069. }
  1070. moveBannerButton() {
  1071. }
  1072. showBannerButton() {
  1073. this.bannerButton.visible = true;
  1074. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1075. this.bannerButton.touchable = true;
  1076. }));
  1077. }
  1078. hide() {
  1079. super.hide();
  1080. this.isHide = true;
  1081. xGame.uiMgr.checkUIState();
  1082. }
  1083. Dispose() {
  1084. super.dispose();
  1085. }
  1086. myUpdate(delay) {
  1087. }
  1088. refresh() { }
  1089. addUIClick(obj, func, arr = null) {
  1090. obj.onClick(this, func, arr);
  1091. obj.onClick(this, this.playBtnSound);
  1092. }
  1093. offUIClick(obj, func) {
  1094. obj.offClick(this, func);
  1095. }
  1096. playBtnSound() {
  1097. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1098. }
  1099. }
  1100. UIBase.lastShowBanner = 0;
  1101. UIBase.showBannerNum = 0;
  1102. UIBase.uiName = "";
  1103. class ui_UIDraw extends fgui.GComponent {
  1104. static createInstance() {
  1105. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1106. }
  1107. onConstruct() {
  1108. this.n1 = (this.getChild("n1"));
  1109. this.extraNode = (this.getChild("extraNode"));
  1110. this.myNode = (this.getChild("myNode"));
  1111. this.closeNode = (this.getChild("closeNode"));
  1112. this.moneyNode = (this.getChild("moneyNode"));
  1113. this.n38 = (this.getChild("n38"));
  1114. this.secretary = (this.getChild("secretary"));
  1115. this.drawBtn = (this.getChild("drawBtn"));
  1116. this.talkNode = (this.getChild("talkNode"));
  1117. this.t0 = this.getTransition("t0");
  1118. }
  1119. }
  1120. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1121. class ui_UIBox extends fgui.GComponent {
  1122. static createInstance() {
  1123. return (fgui.UIPackage.createObject("game", "UIBox"));
  1124. }
  1125. onConstruct() {
  1126. this.n0 = (this.getChild("n0"));
  1127. this.n12 = (this.getChild("n12"));
  1128. this.n1 = (this.getChild("n1"));
  1129. this.n2 = (this.getChild("n2"));
  1130. this.bar = (this.getChild("bar"));
  1131. this.closeBtn = (this.getChild("closeBtn"));
  1132. this.openBtn = (this.getChild("openBtn"));
  1133. this.t0 = this.getTransition("t0");
  1134. this.t1 = this.getTransition("t1");
  1135. }
  1136. }
  1137. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1138. class LocalStorageManager {
  1139. test1() {
  1140. LocalStorageManager.setItem("playerName", "Tom");
  1141. LocalStorageManager.setItem("playerLevel", 5);
  1142. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1143. const name = LocalStorageManager.getItem("playerName");
  1144. const level = LocalStorageManager.getItem("playerLevel");
  1145. const data = LocalStorageManager.getItem("playerData");
  1146. console.log(name);
  1147. console.log(level);
  1148. console.log(data);
  1149. LocalStorageManager.removeItem("playerLevel");
  1150. }
  1151. static setItem(key, value) {
  1152. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1153. }
  1154. static getItem(key) {
  1155. const data = Laya.LocalStorage.getItem(key);
  1156. if (data === null)
  1157. return null;
  1158. try {
  1159. return JSON.parse(data);
  1160. }
  1161. catch (e) {
  1162. return data;
  1163. }
  1164. }
  1165. static removeItem(key) {
  1166. Laya.LocalStorage.removeItem(key);
  1167. }
  1168. static clear() {
  1169. Laya.LocalStorage.clear();
  1170. }
  1171. static hasJosnKey(key) {
  1172. var value = Laya.LocalStorage.getJSON(key);
  1173. if (value != null) {
  1174. return true;
  1175. }
  1176. else {
  1177. return false;
  1178. }
  1179. }
  1180. static hasKey(key) {
  1181. return Laya.LocalStorage.getItem(key) !== null;
  1182. }
  1183. }
  1184. class GlobalManager {
  1185. constructor() {
  1186. }
  1187. registerMethod(name, method) {
  1188. console.log('zh: 注册全局方法', name);
  1189. this[name] = method;
  1190. }
  1191. callMethod(name, ...args) {
  1192. console.log('zh: 调用全局方法', name);
  1193. if (this[name]) {
  1194. return this[name](...args);
  1195. }
  1196. else {
  1197. console.error(`zh: 全局方法 Method ${name} not found`);
  1198. }
  1199. }
  1200. }
  1201. GlobalManager.instance = new GlobalManager();
  1202. class JSBridgeUtils {
  1203. constructor() { }
  1204. static get instance() {
  1205. if (!this._instance) {
  1206. this._instance = new JSBridgeUtils();
  1207. }
  1208. return this._instance;
  1209. }
  1210. initBridge() {
  1211. if (!Laya.Browser.onAndroid) {
  1212. console.log('zh:非android dev');
  1213. return;
  1214. }
  1215. let cfg = window['conchConfig'];
  1216. if (cfg) {
  1217. var os = cfg.getOS();
  1218. if (os == "Conch-android") {
  1219. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1220. if (this.bridge) {
  1221. return true;
  1222. }
  1223. else {
  1224. return false;
  1225. }
  1226. }
  1227. else {
  1228. return false;
  1229. }
  1230. }
  1231. else {
  1232. return false;
  1233. }
  1234. }
  1235. testAd1() {
  1236. if (!Laya.Browser.onAndroid) {
  1237. console.log('zh:非android dev');
  1238. return;
  1239. }
  1240. if (!this.initBridge()) {
  1241. return;
  1242. }
  1243. let rs = this.bridge.call("testString", "hello");
  1244. console.log('zh:testString rs=' + rs);
  1245. }
  1246. testAdCallBack() {
  1247. if (!this.initBridge()) {
  1248. return;
  1249. }
  1250. console.log("zh:testAdCallBack start");
  1251. const defaultObj = { code: 200, msg: "req update Ui" };
  1252. const reqObj = { code: 300, msg: "hello java ui" };
  1253. this.bridge.callWithBack((rsStr) => {
  1254. const rsObj = JSON.parse(rsStr);
  1255. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1256. }, "testAsyncCallback", JSON.stringify(reqObj));
  1257. }
  1258. showInternAd(mark) {
  1259. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1260. if (boo1) {
  1261. console.log('zh: VIP SPID = 1,免除插页AD');
  1262. return false;
  1263. }
  1264. console.log('zh:showInternAd start');
  1265. if (!Laya.Browser.onAndroid) {
  1266. console.log('zh:showInternAd 非android dev');
  1267. return false;
  1268. }
  1269. if (!this.initBridge()) {
  1270. return false;
  1271. }
  1272. let rs = this.bridge.call("showInternAd", mark);
  1273. try {
  1274. const result = JSON.parse(rs);
  1275. if (result.code === 200) {
  1276. console.log("zh:showInternAd OK");
  1277. return true;
  1278. }
  1279. else {
  1280. console.warn("zh:showInternAd FAILL:", result.msg);
  1281. return false;
  1282. }
  1283. }
  1284. catch (e) {
  1285. console.error("zh:解析桥接返回值失败:", e);
  1286. return false;
  1287. }
  1288. }
  1289. exitAndCloseGame() {
  1290. if (!Laya.Browser.onAndroid) {
  1291. return;
  1292. }
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log('zh:开始关闭游戏-');
  1297. this.bridge.call("exitAndCloseGame");
  1298. }
  1299. checkAdForUserOrderForSpid17(spid) {
  1300. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1301. if (userInfo != null) {
  1302. if (!userInfo.buySpids) {
  1303. userInfo.buySpids = { 1: false, 7: false };
  1304. }
  1305. else {
  1306. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1307. }
  1308. let boo = userInfo.buySpids[spid];
  1309. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1310. return boo;
  1311. }
  1312. return false;
  1313. }
  1314. showRewardAd(mark) {
  1315. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1316. if (boo7) {
  1317. console.log('zh: VIP SPID = 7,无任何AD');
  1318. return false;
  1319. }
  1320. if (!Laya.Browser.onAndroid) {
  1321. return false;
  1322. }
  1323. if (!this.initBridge()) {
  1324. return false;
  1325. }
  1326. let rs = this.bridge.call("showRewardAd", mark);
  1327. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1328. try {
  1329. const result = JSON.parse(rs);
  1330. if (result.code === 200) {
  1331. console.log("zh:广告显示成功");
  1332. return true;
  1333. }
  1334. else {
  1335. console.warn("zh:广告显示失败:", result.msg);
  1336. return false;
  1337. }
  1338. }
  1339. catch (e) {
  1340. console.error("zh:解析桥接返回值失败:", e);
  1341. return false;
  1342. }
  1343. }
  1344. logEventForAdNoParams(eventName) {
  1345. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1346. if (!Laya.Browser.onAndroid) {
  1347. return;
  1348. }
  1349. if (!this.initBridge()) {
  1350. return;
  1351. }
  1352. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1353. this.bridge.call("logEventForAdNoParams", eventName);
  1354. }
  1355. logEventForAdHaveParams(eventName, jsonStr) {
  1356. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1357. if (!Laya.Browser.onAndroid) {
  1358. return;
  1359. }
  1360. if (!this.initBridge()) {
  1361. return;
  1362. }
  1363. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1364. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1365. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1366. }
  1367. logEventForFirebase(eventName, jsonStr) {
  1368. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1369. if (!Laya.Browser.onAndroid) {
  1370. return;
  1371. }
  1372. if (!this.initBridge()) {
  1373. return;
  1374. }
  1375. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1376. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1377. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1378. }
  1379. testNetTip() {
  1380. if (Laya.Browser.onAndroid) {
  1381. let boo = this.getNetworkAvailable();
  1382. this.showToast2("Network error, reward unavailable");
  1383. return;
  1384. }
  1385. }
  1386. getNetworkAvailable() {
  1387. if (!Laya.Browser.onAndroid) {
  1388. return;
  1389. }
  1390. if (!this.initBridge()) {
  1391. return;
  1392. }
  1393. let boo = this.bridge.call("getNetworkAvailable");
  1394. console.log("zh:getNetworkAvailable boo=" + boo);
  1395. return boo;
  1396. }
  1397. showToast2(msg) {
  1398. if (!Laya.Browser.onAndroid) {
  1399. return;
  1400. }
  1401. if (!this.initBridge()) {
  1402. return;
  1403. }
  1404. this.bridge.call("showToast2", msg);
  1405. }
  1406. loginOutForApp() {
  1407. if (!Laya.Browser.onAndroid) {
  1408. return;
  1409. }
  1410. if (!this.initBridge()) {
  1411. return;
  1412. }
  1413. this.bridge.call("loginOutForApp");
  1414. }
  1415. startGgPay(token, ggSpid, spid) {
  1416. if (!Laya.Browser.onAndroid) {
  1417. return;
  1418. }
  1419. if (!this.initBridge()) {
  1420. return;
  1421. }
  1422. let jsonObj = {
  1423. token: token,
  1424. ggSpid: ggSpid,
  1425. spid: spid,
  1426. spsl: 1
  1427. };
  1428. let reqData = JSON.stringify(jsonObj);
  1429. console.log("zh:startGgPay ts reqData=" + reqData);
  1430. this.bridge.call("startGgPay", reqData);
  1431. }
  1432. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1433. if (!Laya.Browser.onAndroid) {
  1434. return;
  1435. }
  1436. if (!this.initBridge()) {
  1437. return;
  1438. }
  1439. let jsonObj = {
  1440. token: token,
  1441. ggSpid: ggSpid,
  1442. spid: spid,
  1443. spsl: 1
  1444. };
  1445. let reqData = JSON.stringify(jsonObj);
  1446. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1447. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1448. }
  1449. nativeCallJs(msg) {
  1450. console.log("zh:nativeCallJs received data: 1111", msg);
  1451. if (msg === 'Ad1') {
  1452. GlobalManager.instance.callMethod('Ad1');
  1453. console.log("zh: Ad1 奖励发送成功");
  1454. }
  1455. else if (msg === 'Ad2') {
  1456. GlobalManager.instance.callMethod('Ad2');
  1457. console.log("zh: Ad2 奖励发送成功");
  1458. }
  1459. else if (msg === 'Ad3') {
  1460. GlobalManager.instance.callMethod('Ad3');
  1461. console.log("zh: Ad3 奖励发送成功");
  1462. }
  1463. else if (msg === 'Ad4') {
  1464. GlobalManager.instance.callMethod('Ad4');
  1465. console.log("zh: Ad4 奖励发送成功");
  1466. }
  1467. else if (msg === 'Ad5') {
  1468. console.log("zh: Ad5 奖励发送成功");
  1469. GlobalManager.instance.callMethod('Ad5');
  1470. }
  1471. }
  1472. }
  1473. class UIBox extends UIBase {
  1474. constructor() {
  1475. super();
  1476. this.boxNum = 0;
  1477. this.boxMax = 10;
  1478. this.inAd = false;
  1479. this.isClose = false;
  1480. }
  1481. onConstructor() {
  1482. this.ui = ui_UIBox.createInstance();
  1483. this.contentPane = this.ui;
  1484. this.isEject = false;
  1485. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1486. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1487. Laya.timer.loop(1000, this, this.update);
  1488. }
  1489. update() {
  1490. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1491. this.boxNum -= 1;
  1492. this.upBar();
  1493. }
  1494. }
  1495. upBar() {
  1496. if (this.boxNum > this.boxMax)
  1497. this.boxNum = this.boxMax;
  1498. this.ui.bar.value = this.boxNum * 10;
  1499. }
  1500. show() {
  1501. super.show();
  1502. this.isClose = false;
  1503. this.boxNum = 0;
  1504. this.inAd = false;
  1505. this.upBar();
  1506. this.ui.t0.play();
  1507. this.ui.closeBtn.visible = false;
  1508. Laya.timer.once(3000, this, () => {
  1509. this.ui.closeBtn.visible = true;
  1510. this.ui.bar.alpha = 1;
  1511. });
  1512. Laya.timer.once(500, this, () => {
  1513. this.ui.t1.play();
  1514. });
  1515. }
  1516. hide() {
  1517. Laya.timer.clearAll(this);
  1518. Moyu.showBannerAd(false);
  1519. super.hide();
  1520. }
  1521. onOpenBox() {
  1522. this.boxNum++;
  1523. if (this.boxNum < this.boxMax) {
  1524. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1525. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1526. }
  1527. }
  1528. else if (this.boxNum == this.boxMax) {
  1529. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1530. this.ui.openBtn.c1.selectedIndex = 13;
  1531. this.inAd = true;
  1532. }
  1533. else
  1534. this.getAward();
  1535. }
  1536. else if (this.inAd) {
  1537. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1538. if (Laya.Browser.onAndroid) {
  1539. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1540. if (!boo) {
  1541. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1542. return;
  1543. }
  1544. }
  1545. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1546. }
  1547. else {
  1548. console.log('zh:AD 失败,直接发放奖励');
  1549. this.qjff_AD_for_UIBOX_onOpenBox();
  1550. }
  1551. }
  1552. this.upBar();
  1553. }
  1554. qjff_AD_for_UIBOX_onOpenBox() {
  1555. this.getAward();
  1556. }
  1557. onCloseBox() {
  1558. if (this.isClose)
  1559. this.hide();
  1560. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1561. this.isClose = true;
  1562. PlatMgr.showBanner(true, 0, 3000);
  1563. }
  1564. else
  1565. this.hide();
  1566. }
  1567. getAward() {
  1568. let str = "";
  1569. if (Math.random() < 0.5) {
  1570. let max = Moyu.isLegal ? 500 : 2500;
  1571. let num = xGame.tools.random(max, 500 + max);
  1572. DataMgr.setCoin(num);
  1573. str = "金币x" + num;
  1574. }
  1575. else {
  1576. let max = Moyu.isLegal ? 10 : 30;
  1577. let num = xGame.tools.random(max, 30 + max);
  1578. DataMgr.setDiamond(num);
  1579. str = "钻石x" + num;
  1580. }
  1581. xGame.showTip("恭喜获得-" + str);
  1582. this.hide();
  1583. }
  1584. }
  1585. UIBox.uiName = "UIBox";
  1586. class ui_UITry extends fgui.GComponent {
  1587. static createInstance() {
  1588. return (fgui.UIPackage.createObject("game", "UITry"));
  1589. }
  1590. onConstruct() {
  1591. this.n11 = (this.getChild("n11"));
  1592. this.myNode = (this.getChild("myNode"));
  1593. this.t0 = this.getTransition("t0");
  1594. }
  1595. }
  1596. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1597. class UITry extends UIBase {
  1598. constructor() {
  1599. super();
  1600. this.closeTime = 0;
  1601. this.closeNum = 0;
  1602. this.skillUrl = xGame.common.skillIconList;
  1603. }
  1604. onConstructor() {
  1605. this.ui = ui_UITry.createInstance();
  1606. this.contentPane = this.ui;
  1607. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1608. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1609. }
  1610. show() {
  1611. super.show();
  1612. this.closeNum = 0;
  1613. this.closeTime = 15;
  1614. this.ui.t0.play();
  1615. PlatMgr.showRateBanner();
  1616. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1617. Laya.timer.loop(1000, this, this.updateTime);
  1618. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1619. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1620. xGame.common.gameMgr.gamePause = true;
  1621. }
  1622. updateTime() {
  1623. if (this.closeTime > 1) {
  1624. this.closeTime--;
  1625. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1626. }
  1627. else
  1628. this.hide();
  1629. }
  1630. hide() {
  1631. Laya.timer.clearAll(this);
  1632. Moyu.showBannerAd(false);
  1633. super.hide();
  1634. xGame.common.gameMgr.gamePause = false;
  1635. }
  1636. onTry() {
  1637. console.log('zh:qjff_AD_for_uitry');
  1638. if (Laya.Browser.onAndroid) {
  1639. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1640. if (!boo) {
  1641. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1642. return;
  1643. }
  1644. }
  1645. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1646. }
  1647. else {
  1648. console.log('zh:AD 失败,直接发放奖励');
  1649. this.qjff_AD_for_uitry();
  1650. }
  1651. }
  1652. qjff_AD_for_uitry() {
  1653. let select = xGame.common.curPlayerSkillType;
  1654. DataMgr.gameData.trySkill = select;
  1655. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1656. DataMgr.saveGameData();
  1657. DataMgr.setBigSkill(select, 1);
  1658. xGame.showTip("Trial Successful");
  1659. this.hide();
  1660. }
  1661. onCancel() {
  1662. if (this.closeNum > 0) {
  1663. this.closeNum--;
  1664. if (this.closeNum < 2)
  1665. this.hide();
  1666. return;
  1667. }
  1668. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1669. this.onTry();
  1670. }
  1671. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1672. this.closeNum = 3;
  1673. }
  1674. else
  1675. this.hide();
  1676. }
  1677. }
  1678. UITry.uiName = "UITry";
  1679. class PlatMgr {
  1680. static initConfig() {
  1681. this.lastVt = 0;
  1682. if (!Moyu.platConfig)
  1683. return;
  1684. for (let k in Moyu.platConfig) {
  1685. let pd = this[k];
  1686. let pc = Moyu.platConfig[k];
  1687. if (pd != undefined && pc != undefined)
  1688. this[k] = pc;
  1689. }
  1690. Moyu.setBannerPos(0.5, 1);
  1691. }
  1692. static rand100(num) {
  1693. return xGame.tools.random(0, 100) < num;
  1694. }
  1695. static isMisVideo() {
  1696. let dt = Laya.timer.currTimer - this.lastVt;
  1697. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1698. this.lastVt = Laya.timer.currTimer;
  1699. return true;
  1700. }
  1701. else {
  1702. if (this.rand100(this.fullVideoRate)) {
  1703. console.log('zh:插屏 ad start');
  1704. JSBridgeUtils.instance.showInternAd('platMgr');
  1705. }
  1706. return false;
  1707. }
  1708. }
  1709. static showVideo(call, type) {
  1710. Moyu.showVideoAd(() => {
  1711. this.lastVt = Laya.timer.currTimer;
  1712. call && call();
  1713. }, type);
  1714. }
  1715. static showInsert(delay = false) {
  1716. if (this.getRand() < this.insertRate) {
  1717. let dt = delay ? this.insertDelay : 0;
  1718. console.log('zh:插屏 ad start');
  1719. JSBridgeUtils.instance.showInternAd('gameInsert');
  1720. }
  1721. }
  1722. static gameInsert() {
  1723. let t = this.getRand();
  1724. let r = this.gameInsertRate;
  1725. if (t < r) {
  1726. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1727. }
  1728. }
  1729. static showRateBanner() {
  1730. if (this.getRand() < this.bannerRate)
  1731. this.showBanner(true, this.bannerDelay, 3000);
  1732. }
  1733. static showBanner(show, delay = 0, hide = 0) {
  1734. if (2 > 1) {
  1735. console.log('zh:显示showBanner广告 直接返回');
  1736. return;
  1737. }
  1738. if (!show)
  1739. Moyu.showBannerAd(false);
  1740. else {
  1741. Laya.timer.clear(this, this.bannerShow);
  1742. if (delay > 0)
  1743. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1744. else
  1745. this.bannerShow(true);
  1746. if (hide > 0)
  1747. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1748. }
  1749. }
  1750. static bannerShow(show) {
  1751. if (2 > 1) {
  1752. console.log('zh:显示showBanner广告 直接返回');
  1753. return;
  1754. }
  1755. Moyu.showBannerAd(show);
  1756. console.log("showBanner" + show);
  1757. }
  1758. static getRand() {
  1759. return xGame.tools.random(0, 100);
  1760. }
  1761. static openBox() {
  1762. if (this.getRand() < this.boxRate)
  1763. xGame.uiMgr.Show(UIBox);
  1764. }
  1765. static openTry() {
  1766. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1767. return;
  1768. if (this.getRand() < this.tryRate)
  1769. xGame.uiMgr.Show(UITry);
  1770. else if (DataMgr.gameData.gameCount == 1)
  1771. xGame.uiMgr.Show(UITry);
  1772. }
  1773. }
  1774. PlatMgr.forceShare = 0;
  1775. PlatMgr.signAdRate = 0;
  1776. PlatMgr.forceVideoRate = 0;
  1777. PlatMgr.forceVideoGap = 0;
  1778. PlatMgr.fullVideoRate = 0;
  1779. PlatMgr.gameInsertRate = 0;
  1780. PlatMgr.insertGap = 0;
  1781. PlatMgr.insertDelay = 0;
  1782. PlatMgr.insertRate = 0;
  1783. PlatMgr.boxRate = 0;
  1784. PlatMgr.boxVideoRate = 0;
  1785. PlatMgr.boxInsertRate = 0;
  1786. PlatMgr.boxBannerRate = 0;
  1787. PlatMgr.tryRate = 0;
  1788. PlatMgr.tryClose3Rate = 0;
  1789. PlatMgr.tryVideoRate = 0;
  1790. PlatMgr.bannerRate = 0;
  1791. PlatMgr.lastVt = 0;
  1792. class ui_UIAddProp extends fgui.GComponent {
  1793. static createInstance() {
  1794. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1795. }
  1796. onConstruct() {
  1797. this.n11 = (this.getChild("n11"));
  1798. this.myNode = (this.getChild("myNode"));
  1799. this.closeBtn = (this.getChild("closeBtn"));
  1800. this.t0 = this.getTransition("t0");
  1801. }
  1802. }
  1803. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1804. class SpineMgr {
  1805. constructor(name, loadCb = null) {
  1806. this.loaded = false;
  1807. this.spineName = '';
  1808. this.loadedCallback = loadCb;
  1809. this.templet = new Laya.Templet();
  1810. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1811. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1812. if (name === 'mishu') {
  1813. this.templet.loadAni('spine/nvmishu.sk');
  1814. }
  1815. else {
  1816. this.templet.loadAni(`spine/${name}.sk`);
  1817. }
  1818. this.templet.lock = true;
  1819. this.spineName = name;
  1820. }
  1821. onError() {
  1822. console.log("zh:spine加载出错");
  1823. }
  1824. parseComplete() {
  1825. this.loaded = true;
  1826. this.loadedCallback && this.loadedCallback();
  1827. }
  1828. dispose() {
  1829. if (this.templet && !this.templet.destroyed) {
  1830. this.templet.destroy();
  1831. }
  1832. this.templet = null;
  1833. }
  1834. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1835. if (!this.loaded) {
  1836. return;
  1837. }
  1838. let spine;
  1839. if (mySpine) {
  1840. spine = mySpine;
  1841. }
  1842. else {
  1843. spine = this.createSpine(data, parent);
  1844. }
  1845. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1846. if (!isLoop) {
  1847. spine.on(Laya.Event.STOPPED, this, () => {
  1848. spine.offAll(Laya.Event.STOPPED);
  1849. callback && callback(spine);
  1850. });
  1851. }
  1852. return spine;
  1853. }
  1854. createSpine(data, parent, type = 1) {
  1855. let spine;
  1856. spine = this.templet.buildArmature(type);
  1857. spine.showSkinByIndex(0);
  1858. parent.addChild(spine);
  1859. spine.pos(data.x, data.y);
  1860. spine.scale(data.scaleX, data.scaleY, true);
  1861. return spine;
  1862. }
  1863. }
  1864. var AIState;
  1865. (function (AIState) {
  1866. AIState[AIState["none"] = 0] = "none";
  1867. AIState[AIState["idle"] = 1] = "idle";
  1868. AIState[AIState["reset"] = 2] = "reset";
  1869. AIState[AIState["move"] = 3] = "move";
  1870. AIState[AIState["wait"] = 4] = "wait";
  1871. AIState[AIState["select"] = 5] = "select";
  1872. AIState[AIState["turn"] = 6] = "turn";
  1873. AIState[AIState["shoot"] = 7] = "shoot";
  1874. AIState[AIState["leave"] = 8] = "leave";
  1875. })(AIState || (AIState = {}));
  1876. class AIPlayer {
  1877. constructor() {
  1878. this.dtime = 30;
  1879. this.awayTime = 0;
  1880. this.awayNum = 0;
  1881. this.hideTime = 0;
  1882. this.rootMoveTime = 0;
  1883. this.isGuide = false;
  1884. this.state = AIState.none;
  1885. this.waitTime = 0;
  1886. this.forceNum = 0;
  1887. this.forceMax = 0;
  1888. this.ballSize = 33;
  1889. this.selectNum = 0;
  1890. this.destRot = 0;
  1891. this.aiLv = 10;
  1892. this.kickBall = [];
  1893. this.lineBall = [];
  1894. this.scoreBall = [];
  1895. this.holeBall = [];
  1896. this.turnNum = 0;
  1897. this.setNum = 0;
  1898. this.setMax = 0;
  1899. this.setRate = 0;
  1900. this.rectL = 0;
  1901. this.rectR = 0;
  1902. this.rectT = 0;
  1903. this.rectB = 0;
  1904. this.rootPos = { x: 0, y: 0 };
  1905. this.bestForce = 0;
  1906. this.bestAngle = 180;
  1907. this.bestPos = { x: 0, y: 0 };
  1908. this.bestKick = { x: 0, y: 0 };
  1909. this.posList = [];
  1910. this.posIdx = 0;
  1911. this.chatTime = 3000;
  1912. this.tempDir1 = new Laya.Vector2();
  1913. this.tempDir2 = new Laya.Vector2();
  1914. this.tempDir3 = new Laya.Vector2();
  1915. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1916. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1917. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1918. this.gameSrc = xGame.common.gameUI;
  1919. this.hideTime = Laya.timer.currTimer;
  1920. Moyu.setOnTipCall((id) => {
  1921. if (id == 20012)
  1922. this.hideTime = Laya.timer.currTimer;
  1923. else
  1924. (id == 20011);
  1925. {
  1926. let dt = Laya.timer.currTimer - this.hideTime;
  1927. console.log("onshow" + dt);
  1928. if (dt > 30000 && this.state > AIState.none)
  1929. xGame.common.gameMgr.aiGameEnd(false);
  1930. }
  1931. }, this);
  1932. }
  1933. init() {
  1934. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1935. this.awayTime = xGame.tools.random(5000, 10000);
  1936. this.awayNum = 0;
  1937. this.hideTime = Laya.timer.currTimer;
  1938. let rect = xGame.common.d2World.borderRect;
  1939. this.rectL = Math.ceil(rect.x) + 17;
  1940. this.rectT = Math.ceil(rect.y) + 17;
  1941. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1942. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1943. this.wBall = xGame.common.d2World.rootBall;
  1944. this.ballSize = this.wBall.gameObj.width - 1;
  1945. if (this.posList.length < 1) {
  1946. let dp = 40;
  1947. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1948. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1949. let dx = i < this.rectR ? i : this.rectR;
  1950. let dy = j < this.rectB ? j : this.rectB;
  1951. let order = xGame.tools.random(0, 1000);
  1952. this.posList.push({ x: dx, y: dy, order: order });
  1953. }
  1954. }
  1955. this.posList.sort(function (a, b) {
  1956. return a.order - b.order;
  1957. });
  1958. this.setMax = this.posList.length;
  1959. }
  1960. this.state = AIState.idle;
  1961. }
  1962. setAiLevel(num) {
  1963. this.aiLv = num;
  1964. }
  1965. initBall() {
  1966. this.rootPos.x = this.wBall.gameObj.x;
  1967. this.rootPos.y = this.wBall.gameObj.y;
  1968. this.initHoleBall();
  1969. }
  1970. initHoleBall() {
  1971. this.kickBall = [];
  1972. this.lineBall = [];
  1973. this.scoreBall = [];
  1974. this.holeBall = [];
  1975. this.selectNum = 0;
  1976. this.forceNum = 0;
  1977. this.forceMax = 0;
  1978. this.turnNum = 0;
  1979. let list = xGame.common.d2World.ballArr;
  1980. if (list.length < 20 && !this.isGuide) {
  1981. let holes = xGame.common.gameMgr.holePosList;
  1982. for (let i = 0; i < list.length; i++) {
  1983. let obj = list[i];
  1984. if (!obj)
  1985. continue;
  1986. obj.kickPos.x = 0;
  1987. obj.kickPos.y = 0;
  1988. obj.poleAngle = 0;
  1989. obj.hard = 0;
  1990. obj.borderDis = 0;
  1991. obj.kickAngle = 180;
  1992. if (obj.number == 0)
  1993. continue;
  1994. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1995. continue;
  1996. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1997. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1998. continue;
  1999. }
  2000. let b = obj.gameObj;
  2001. let wbp = this.rootPos;
  2002. let bx = wbp.x - b.x;
  2003. let by = wbp.y - b.y;
  2004. obj.borderDis = xGame.tools.random(0, 100);
  2005. this.kickBall.push(obj);
  2006. if (!this.isLine(wbp, obj))
  2007. continue;
  2008. obj.kickAngle = xGame.tools.random(90, 180);
  2009. obj.kickPos.x = b.x;
  2010. obj.kickPos.y = b.y;
  2011. this.lineBall.push(obj);
  2012. let minDis = 999999;
  2013. let hole = false;
  2014. for (let j = 0; j < holes.length; j++) {
  2015. let hp = holes[j];
  2016. if (bx >= 0 && hp.x > b.x + 100)
  2017. continue;
  2018. if (bx <= 0 && hp.x < b.x - 100)
  2019. continue;
  2020. if (by < -10 && hp.y < wbp.y)
  2021. continue;
  2022. if (by > 10 && hp.y > wbp.y)
  2023. continue;
  2024. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2025. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2026. if (dis < minDis) {
  2027. let dx = b.x - this.tempDir1.x * this.ballSize;
  2028. let dy = b.y - this.tempDir1.y * this.ballSize;
  2029. this.tempDir3.x = this.tempDir1.x;
  2030. this.tempDir3.y = this.tempDir1.y;
  2031. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2032. obj.kickPos.x = dx;
  2033. obj.kickPos.y = dy;
  2034. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2035. if (num > 1)
  2036. num = 1;
  2037. obj.kickAngle = Math.acos(num) * 57.3;
  2038. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2039. dis = dis * 2;
  2040. if (Math.abs(hp.x - 600) < 100)
  2041. dis += 50;
  2042. obj.hard = dis + obj.kickAngle * 3;
  2043. hole = true;
  2044. }
  2045. }
  2046. }
  2047. }
  2048. if (hole) {
  2049. this.scoreBall.push(obj);
  2050. this.holeBall.push(obj);
  2051. }
  2052. }
  2053. this.scoreBall.sort(function (a, b) {
  2054. return a.hard - b.hard;
  2055. });
  2056. this.holeBall.sort(function (a, b) {
  2057. return a.kickAngle - b.kickAngle;
  2058. });
  2059. this.kickBall.sort(function (a, b) {
  2060. return a.borderDis - b.borderDis;
  2061. });
  2062. }
  2063. else {
  2064. let max = list.length - 1;
  2065. let i = xGame.tools.random(0, max);
  2066. for (i; i <= max; i++) {
  2067. let idx = i >= max ? i -= max : i;
  2068. let obj = list[idx];
  2069. if (obj && obj.number != 0) {
  2070. obj.kickAngle = xGame.tools.random(90, 180);
  2071. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2072. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2073. this.lineBall.push(obj);
  2074. break;
  2075. }
  2076. }
  2077. }
  2078. }
  2079. selectBall() {
  2080. let ball = null;
  2081. this.destRot = 0;
  2082. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2083. let ai = 110 - this.aiLv * 10;
  2084. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2085. let score = false;
  2086. if (this.scoreBall.length < 1) {
  2087. if (this.lineBall.length < 1) {
  2088. for (let i = 0; i < this.kickBall.length; i++) {
  2089. let list = [];
  2090. let bo = this.kickBall[i];
  2091. let bobj = bo.gameObj;
  2092. let rect = xGame.common.d2World.borderRect;
  2093. let mobj = this.wBall.gameObj;
  2094. let minb = bobj.y - rect.y - 20;
  2095. let minw = mobj.y - rect.y - 50;
  2096. if (minb > 0 && minw > 0) {
  2097. let dlenx = 0;
  2098. let dleny = mobj.y - rect.y;
  2099. let spx = mobj.x;
  2100. let spy = rect.y - dleny;
  2101. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2102. }
  2103. minb = rect.y + rect.height - bobj.y - 20;
  2104. minw = rect.y + rect.height - mobj.y - 50;
  2105. if (minb > 0 && minw > 0) {
  2106. let dlenx = 0;
  2107. let dleny = rect.y + rect.height - mobj.y;
  2108. let spx = mobj.x;
  2109. let spy = rect.y + rect.height + dleny;
  2110. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2111. }
  2112. minb = bobj.x - rect.x - 20;
  2113. minw = mobj.x - rect.x - 50;
  2114. if (minb > 0 && minw > 0) {
  2115. let dlenx = mobj.x - rect.x;
  2116. let dleny = 0;
  2117. let spx = rect.x - dlenx;
  2118. let spy = mobj.y;
  2119. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2120. }
  2121. minb = rect.x + rect.width - bobj.x - 20;
  2122. minw = rect.x + rect.width - mobj.x - 50;
  2123. if (minb > 0 && minw > 0) {
  2124. let dlenx = rect.x + rect.width - mobj.x;
  2125. let dleny = 0;
  2126. let spx = rect.x + rect.width + dlenx;
  2127. let spy = mobj.y;
  2128. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2129. }
  2130. list.sort(function (a, b) {
  2131. return a.order - b.order;
  2132. });
  2133. for (let i = 0; i < list.length; i++) {
  2134. let data = list[i];
  2135. let mx = mobj.x - bobj.x;
  2136. let my = mobj.y - bobj.y;
  2137. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2138. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2139. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2140. if (num > 1)
  2141. num = 1;
  2142. let cos = Math.acos(num);
  2143. if (cos > 1.57)
  2144. cos = 1.57;
  2145. else if (cos < 0.01)
  2146. cos = 0.01;
  2147. let tan = Math.tan(cos);
  2148. let dx = tan * data.dleny;
  2149. let dy = tan * data.dlenx;
  2150. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2151. if (Math.abs(bx - 667) < 40)
  2152. continue;
  2153. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2154. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2155. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2156. this.forceMax = dis * 0.08;
  2157. this.destRot += mis * 0.1;
  2158. this.setKick(bx, by);
  2159. return true;
  2160. }
  2161. }
  2162. }
  2163. }
  2164. else {
  2165. ball = xGame.common.getRandArrEle(this.lineBall);
  2166. }
  2167. }
  2168. else {
  2169. for (let i = 0; i < this.scoreBall.length; i++) {
  2170. if (i < this.scoreBall.length - 1) {
  2171. let rand = 70 + this.aiLv * 10 + i * 10;
  2172. if (xGame.tools.random(0, 100) < rand) {
  2173. ball = this.scoreBall[i];
  2174. break;
  2175. }
  2176. }
  2177. else {
  2178. ball = this.scoreBall[i];
  2179. break;
  2180. }
  2181. }
  2182. score = true;
  2183. this.selectNum++;
  2184. }
  2185. if (!ball)
  2186. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2187. if (this.selectNum >= max) {
  2188. let dx = ball.gameObj.x;
  2189. let dy = ball.gameObj.y;
  2190. let kickAngle = 0;
  2191. if (score) {
  2192. dx = ball.kickPos.x;
  2193. dy = ball.kickPos.y;
  2194. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2195. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2196. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2197. if (adot > 1)
  2198. adot = 1;
  2199. kickAngle = Math.acos(adot) * 57.3;
  2200. if (kickAngle > 45) {
  2201. let kdx = ball.kickPos.x - ball.gameObj.x;
  2202. let kdy = ball.kickPos.y - ball.gameObj.y;
  2203. dx = ball.kickPos.x - kdx * mis * 0.3;
  2204. dy = ball.kickPos.y - kdy * mis * 0.3;
  2205. }
  2206. else
  2207. this.destRot += mis;
  2208. }
  2209. else if (ball.poleAngle != 0) {
  2210. this.destRot += ball.poleAngle;
  2211. }
  2212. if (xGame.common.gameMode == 0) {
  2213. let af = kickAngle * 0.08;
  2214. this.forceMax = ball.hard * 0.1 + af * af;
  2215. }
  2216. this.setKick(dx, dy);
  2217. }
  2218. else {
  2219. let rand = this.aiLv * 5 + 40;
  2220. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2221. ball = xGame.common.getRandArrEle(this.scoreBall);
  2222. else
  2223. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2224. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2225. if (xGame.tools.random(0, 100) > rand) {
  2226. this.selectNum = max;
  2227. }
  2228. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2229. this.selectNum++;
  2230. }
  2231. ball.onClick(0, true);
  2232. }
  2233. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2234. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2235. let balls = xGame.common.d2World.ballArr;
  2236. let max = xGame.tools.getDis(hx, hy, bx, by);
  2237. for (let index = 0; index < balls.length; index++) {
  2238. let obj = balls[index];
  2239. if (obj.number == 0)
  2240. continue;
  2241. if (obj.number == bn || obj.number == dn)
  2242. continue;
  2243. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2244. if (dis * dis > max)
  2245. continue;
  2246. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2247. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2248. if (num > 1)
  2249. num = 1;
  2250. if (num < 0)
  2251. continue;
  2252. let gap = Math.sin(Math.acos(num)) * dis;
  2253. if (gap < this.ballSize)
  2254. return true;
  2255. }
  2256. return false;
  2257. }
  2258. isLine(xy, ball) {
  2259. let bx = xy.x;
  2260. let by = xy.y;
  2261. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2262. let dis = ball.getDestDis(xy);
  2263. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2264. let sin = Math.sin(angle);
  2265. let cos = Math.cos(angle);
  2266. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2267. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2268. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2269. let dx = bx + this.tempDir2.x * dis;
  2270. let dy = by + this.tempDir2.y * dis;
  2271. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2272. sin = Math.sin(-angle);
  2273. cos = Math.cos(-angle);
  2274. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2275. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2276. dx = bx + this.tempDir2.x * dis;
  2277. dy = by + this.tempDir2.y * dis;
  2278. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2279. if (isr && isl)
  2280. return false;
  2281. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2282. }
  2283. return true;
  2284. }
  2285. turnPole() {
  2286. this.turnNum++;
  2287. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2288. let dr = rot - this.destRot;
  2289. let abs = Math.abs(dr) % 360;
  2290. if (abs > 180) {
  2291. if (rot > 180)
  2292. rot -= 360;
  2293. if (this.destRot > 180)
  2294. this.destRot -= 360;
  2295. }
  2296. let max = this.turnNum * 5 + this.aiLv * 5;
  2297. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2298. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2299. let at = xGame.tools.random(1000, 2000);
  2300. if (!this.onAway(3))
  2301. at += xGame.tools.random(10000, 15000);
  2302. this.setState(AIState.shoot, at);
  2303. }
  2304. else {
  2305. let mr = 0;
  2306. if (abs > 3)
  2307. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2308. else if (Math.random() > 0.6)
  2309. mr = xGame.tools.random(1, 10) * 0.1;
  2310. mr = dr > 0 ? -mr : mr;
  2311. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2312. }
  2313. }
  2314. setKick(dx, dy) {
  2315. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2316. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2317. this.tempDir1.x = 0;
  2318. this.tempDir1.y = 1;
  2319. this.tempDir2.y = -this.tempDir2.y;
  2320. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2321. if (num > 1)
  2322. num = 1;
  2323. let rot = Math.acos(num) * 57.3;
  2324. if (this.tempDir2.x < 0)
  2325. rot = 360 - rot;
  2326. this.destRot += rot;
  2327. if (!xGame.common.gameMgr.finishOneShoot) {
  2328. this.forceMax += xGame.tools.random(10, 50);
  2329. this.forceMax -= this.aiLv * 2;
  2330. if (this.forceMax < 20)
  2331. this.forceMax = 20;
  2332. }
  2333. if (this.forceMax > 100)
  2334. this.forceMax = 101;
  2335. else if (this.forceMax < 10)
  2336. this.forceMax += xGame.tools.random(0, 10);
  2337. if (xGame.common.gameMode == 1)
  2338. this.forceMax = xGame.tools.random(80, 100);
  2339. else
  2340. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2341. let max = 2000 - this.aiLv * 100;
  2342. if (Math.random() > 0.8)
  2343. max += xGame.tools.random(100, 2000);
  2344. this.setState(AIState.turn, xGame.tools.random(500, max));
  2345. }
  2346. shoot() {
  2347. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2348. if (Math.random() > 0.8) {
  2349. this.gameSrc.aiForce(1);
  2350. this.setState(AIState.wait);
  2351. }
  2352. }
  2353. else {
  2354. let df = xGame.tools.random(3, 8);
  2355. if (this.forceNum < this.forceMax)
  2356. this.forceNum += df;
  2357. else
  2358. this.forceNum -= df;
  2359. let startY = this.gameSrc.ui.powerNode.y;
  2360. let height = this.gameSrc.ui.powerNode.height;
  2361. let force = startY + height * this.forceNum * 0.01;
  2362. this.gameSrc.aiForce(2, force);
  2363. }
  2364. }
  2365. reset() {
  2366. for (let i = 0; i < 4; i++) {
  2367. this.setRate--;
  2368. this.setNum++;
  2369. let pos = this.posList[this.posIdx];
  2370. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2371. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2372. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2373. this.rootPos.x = 387;
  2374. if (this.rootPos.x < this.rectL)
  2375. this.rootPos.x = this.rectL;
  2376. else if (this.rootPos.x > this.rectR)
  2377. this.rootPos.x = this.rectR;
  2378. if (this.rootPos.y < this.rectT)
  2379. this.rootPos.y = this.rectT;
  2380. else if (this.rootPos.y > this.rectB)
  2381. this.rootPos.y = this.rectB;
  2382. this.posIdx++;
  2383. let max = this.posList.length;
  2384. if (this.posIdx >= max)
  2385. this.posIdx -= max;
  2386. this.initHoleBall();
  2387. let ball = null;
  2388. if (this.scoreBall.length > 0)
  2389. ball = this.scoreBall[0];
  2390. else if (this.lineBall.length > 0)
  2391. ball = xGame.common.getRandArrEle(this.lineBall);
  2392. if (ball && ball.kickAngle < this.bestAngle) {
  2393. this.bestAngle = ball.kickAngle;
  2394. this.bestKick.x = ball.kickPos.x;
  2395. this.bestKick.y = ball.kickPos.y;
  2396. this.bestPos.x = this.rootPos.x;
  2397. this.bestPos.y = this.rootPos.y;
  2398. this.bestForce = ball.hard * 0.08;
  2399. }
  2400. }
  2401. if (this.setNum >= this.setMax)
  2402. this.setMax = 0;
  2403. if (this.setRate < 1) {
  2404. this.setState(AIState.move, 0);
  2405. this.rootMoveTime = Laya.timer.currTimer;
  2406. this.gameSrc.aiRootMove(true);
  2407. }
  2408. }
  2409. delayLine() {
  2410. this.gameSrc.aiRootMove(false);
  2411. }
  2412. move() {
  2413. if (this.bestPos.x < 1)
  2414. this.bestPos = this.rootPos;
  2415. let wObj = this.wBall.gameObj;
  2416. let destx = wObj.x;
  2417. let desty = wObj.y;
  2418. let dx = Math.abs(destx - this.bestPos.x);
  2419. let dy = Math.abs(desty - this.bestPos.y);
  2420. let mx = 3 + dx * 0.03;
  2421. let my = 3 + dy * 0.03;
  2422. if (dx < 4 && dy < 4) {
  2423. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2424. dt = dt < 1000 ? 1000 - dt : 0;
  2425. if (this.setMax > 0) {
  2426. let min = this.setMax * 0.3 + this.aiLv * 5;
  2427. this.setRate = xGame.tools.random(min, this.setMax);
  2428. this.setState(AIState.reset, 0);
  2429. }
  2430. else {
  2431. this.destRot = 0;
  2432. this.forceMax = this.bestForce;
  2433. this.setKick(this.bestKick.x, this.bestKick.y);
  2434. }
  2435. if (dt > 100) {
  2436. Laya.timer.clear(this, this.delayLine);
  2437. Laya.timer.once(dt, this, this.delayLine);
  2438. }
  2439. else
  2440. this.gameSrc.aiRootMove(false);
  2441. }
  2442. else {
  2443. if (dx > 4)
  2444. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2445. if (dy > 4)
  2446. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2447. this.gameSrc.onRootMove({ x: destx, y: desty });
  2448. }
  2449. }
  2450. resetRoot() {
  2451. this.bestAngle = 180;
  2452. this.bestForce = 0;
  2453. this.setMax = this.posList.length;
  2454. this.posIdx = xGame.tools.random(0, this.setMax);
  2455. let min = this.setMax * 0.3 + this.aiLv * 5;
  2456. this.setRate = xGame.tools.random(min, this.setMax);
  2457. let max = 2000 - this.aiLv * 100;
  2458. if (Math.random() > 0.8)
  2459. max += xGame.tools.random(100, 1000);
  2460. if (this.isGuide)
  2461. this.setState(AIState.select, 500);
  2462. else if (this.onAway(2))
  2463. this.setState(AIState.reset, xGame.tools.random(400, max));
  2464. else
  2465. this.setState(AIState.none);
  2466. if (xGame.common.gameMgr.finishOneShoot)
  2467. this.chat();
  2468. }
  2469. runAI() {
  2470. if (this.state > AIState.idle)
  2471. return;
  2472. this.initBall();
  2473. this.onGame(2500);
  2474. if (Math.random() > 0.6)
  2475. this.chat();
  2476. }
  2477. stopRun() {
  2478. this.setState(AIState.idle);
  2479. }
  2480. onGame(base) {
  2481. let max = base - this.aiLv * 100;
  2482. if (Math.random() > 0.8)
  2483. max += xGame.tools.random(100, 1000);
  2484. if (this.onAway(2))
  2485. this.setState(AIState.select, xGame.tools.random(500, max));
  2486. else
  2487. this.setState(AIState.none);
  2488. }
  2489. setState(sta, wt = 0) {
  2490. if (this.state == AIState.none)
  2491. return;
  2492. this.state = sta;
  2493. this.waitTime = wt;
  2494. }
  2495. onUpdate() {
  2496. if (this.state == AIState.none)
  2497. return;
  2498. this.awayTime -= this.dtime;
  2499. if (this.awayTime < 1) {
  2500. this.awayTime = xGame.tools.random(6000, 10000);
  2501. this.awayNum += (11 - this.aiLv);
  2502. this.onAway(1);
  2503. }
  2504. if (this.waitTime >= 0) {
  2505. this.waitTime -= this.dtime;
  2506. return;
  2507. }
  2508. switch (this.state) {
  2509. case AIState.idle:
  2510. this.chat();
  2511. break;
  2512. case AIState.reset:
  2513. this.reset();
  2514. break;
  2515. case AIState.move:
  2516. this.move();
  2517. break;
  2518. case AIState.leave:
  2519. this.state = AIState.none;
  2520. xGame.common.gameMgr.aiGameEnd(true);
  2521. break;
  2522. case AIState.select:
  2523. this.selectBall();
  2524. break;
  2525. case AIState.turn:
  2526. this.turnPole();
  2527. break;
  2528. case AIState.shoot:
  2529. this.shoot();
  2530. break;
  2531. }
  2532. }
  2533. onAway(type) {
  2534. if (type == 1) {
  2535. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2536. let num = this.awayNum + db * 20;
  2537. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2538. xGame.common.gameMgr.aiLeave();
  2539. this.setState(AIState.leave, 6666);
  2540. }
  2541. }
  2542. else if (type == 2) {
  2543. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2544. let num = this.awayNum + db * 30;
  2545. if (xGame.tools.random(0, 10000) < num)
  2546. return false;
  2547. }
  2548. else if (type == 3) {
  2549. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2550. let num = this.awayNum + db * 10;
  2551. if (xGame.tools.random(0, 4000) < num)
  2552. return false;
  2553. }
  2554. return true;
  2555. }
  2556. chat() {
  2557. if (this.chatTime > 0) {
  2558. this.chatTime -= this.dtime;
  2559. return;
  2560. }
  2561. this.chatTime = xGame.tools.random(2000, 10000);
  2562. let rand = xGame.tools.random(0, 100);
  2563. if (rand < 15)
  2564. this.talk();
  2565. else if (rand < 35)
  2566. this.emotion();
  2567. }
  2568. talk() {
  2569. xGame.common.talkMgr.showAITalk(0);
  2570. }
  2571. emotion() {
  2572. xGame.common.talkMgr.showAIEmotion(0);
  2573. }
  2574. resetAI() {
  2575. this.stopRun();
  2576. this.state = AIState.none;
  2577. }
  2578. }
  2579. class Partical extends Laya.Script3D {
  2580. constructor() {
  2581. super();
  2582. this.duration = 2000;
  2583. }
  2584. ;
  2585. onAwake() {
  2586. this.gameObj = this.owner;
  2587. }
  2588. onEnable() {
  2589. this.openTimer();
  2590. }
  2591. openTimer() {
  2592. Laya.timer.once(this.duration, this, this.disappear);
  2593. }
  2594. setCallback(obj, callback) {
  2595. this.obj = obj;
  2596. this.callback = callback;
  2597. Laya.timer.clearAll(this);
  2598. Laya.timer.once(this.duration, this, this.disappear);
  2599. }
  2600. disappear() {
  2601. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2602. this.callback && this.callback(this.obj);
  2603. }
  2604. }
  2605. class Ball extends Laya.Script3D {
  2606. constructor() {
  2607. super();
  2608. this.posV3 = new Laya.Vector3();
  2609. this.rotRate = 2.1;
  2610. this.rotSpeed = new Laya.Vector3();
  2611. this.myIndex = 0;
  2612. }
  2613. onAwake() {
  2614. this.gameObj = this.owner;
  2615. this.transform = this.gameObj.transform;
  2616. this.ballNode = this.gameObj.getChildByName("Ball");
  2617. this.shadowNode = this.gameObj.getChildByName("shadow");
  2618. }
  2619. initSelf(index, x, y, owner) {
  2620. this.d2BallSrc = owner;
  2621. this.myIndex = index;
  2622. this.setAlbedoTexture();
  2623. this.setTransPos(x, y);
  2624. this.setScale();
  2625. this.ballNode.transform.localRotationEulerX = 90;
  2626. if (index == 0) {
  2627. }
  2628. }
  2629. setAlbedoTexture(isIce = false) {
  2630. let url;
  2631. if (isIce) {
  2632. url = `res/d3Res/ballTexture/ice.jpg`;
  2633. }
  2634. else {
  2635. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2636. }
  2637. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2638. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2639. }));
  2640. }
  2641. runFireworks(obj, delay, callback) {
  2642. Laya.timer.clearAll(this);
  2643. Laya.timer.once(delay + 1, this, () => {
  2644. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2645. fire.transform.localPositionX = this.transform.localPositionX;
  2646. fire.transform.localPositionY = this.transform.localPositionY;
  2647. fire.transform.localPositionZ = this.transform.localPositionZ;
  2648. let src = fire.getComponent(Partical);
  2649. src.duration = 1000;
  2650. src.setCallback(obj, callback);
  2651. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2652. eft.transform.localPositionX = this.transform.localPositionX;
  2653. eft.transform.localPositionY = this.transform.localPositionY;
  2654. eft.transform.localPositionZ = this.transform.localPositionZ;
  2655. });
  2656. }
  2657. setTransPos(x, y) {
  2658. this.setRotation();
  2659. xGame.common.pos2to3Convert(x, y, this.posV3);
  2660. this.transform.localPositionX = this.posV3.x;
  2661. this.transform.localPositionY = 0;
  2662. this.transform.localPositionZ = this.posV3.z;
  2663. this.transform.localRotationEulerX = 0;
  2664. this.transform.localRotationEulerY = 0;
  2665. this.transform.localRotationEulerZ = 0;
  2666. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2667. this.shadowNode.transform.localPositionY = 0.1;
  2668. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2669. }
  2670. setRotation() {
  2671. if (this.d2BallSrc.canRot) {
  2672. let speed = this.d2BallSrc.rigy.linearVelocity;
  2673. this.rotSpeed.x = speed.x * this.rotRate;
  2674. this.rotSpeed.z = speed.y * this.rotRate;
  2675. this.rotSpeed.y = this.d2BallSrc.rotY;
  2676. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2677. }
  2678. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2679. this.rotSpeed.x = this.rotSpeed.y = 0;
  2680. this.rotSpeed.y = this.d2BallSrc.rotY;
  2681. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2682. }
  2683. }
  2684. setScale() {
  2685. let radius = xGame.common.d2World.rootBall.ui.width;
  2686. let scale = xGame.common.scale2to3Convert(radius);
  2687. this.transform.localScaleX = scale;
  2688. this.transform.localScaleY = scale;
  2689. this.transform.localScaleZ = scale;
  2690. }
  2691. playInHoleEft() {
  2692. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2693. eft.transform.position = this.transform.position;
  2694. }
  2695. playIceEft() {
  2696. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2697. eft.transform.position = this.transform.position;
  2698. }
  2699. get scaleXYZ() {
  2700. return this.transform.localScaleX;
  2701. }
  2702. set scaleXYZ(val) {
  2703. this.transform.localScaleX = val;
  2704. this.transform.localScaleY = val;
  2705. this.transform.localScaleZ = val;
  2706. }
  2707. get posX() {
  2708. return this.transform.localPositionX;
  2709. }
  2710. set posX(val) {
  2711. this.transform.localPositionX = val;
  2712. }
  2713. get posY() {
  2714. return this.transform.localPositionY;
  2715. }
  2716. set posY(val) {
  2717. this.transform.localPositionY = val;
  2718. }
  2719. get posZ() {
  2720. return this.transform.localPositionZ;
  2721. }
  2722. set posZ(val) {
  2723. this.transform.localPositionZ = val;
  2724. }
  2725. destroySelf() {
  2726. this.posV3 = null;
  2727. this.rotSpeed = null;
  2728. this.d2BallSrc = null;
  2729. this.ballNode = null;
  2730. this.gameObj.destroy(true);
  2731. this.transform = null;
  2732. this.destroy();
  2733. }
  2734. }
  2735. class ui_D2Ball extends fgui.GComponent {
  2736. static createInstance() {
  2737. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2738. }
  2739. onConstruct() {
  2740. this.myIcon = (this.getChild("myIcon"));
  2741. this.inner = (this.getChild("inner"));
  2742. this.n8 = (this.getChild("n8"));
  2743. this.n4 = (this.getChild("n4"));
  2744. this.wrongTips = (this.getChild("wrongTips"));
  2745. this.rightTips = (this.getChild("rightTips"));
  2746. this.breathAni = this.getTransition("breathAni");
  2747. }
  2748. }
  2749. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2750. class D2BallSrc extends Laya.Script {
  2751. constructor() {
  2752. super();
  2753. this.number = 0;
  2754. this.startX = 0;
  2755. this.startY = 0;
  2756. this.angleV2 = new Laya.Vector2();
  2757. this.isRootBall = false;
  2758. this.isBlackBall = false;
  2759. this.ballType = "";
  2760. this.canRot = true;
  2761. this.rotY = 0;
  2762. this.poleAngle = 0;
  2763. this.kickPos = { x: 0, y: 0 };
  2764. this.hard = 0;
  2765. this.kickAngle = 0;
  2766. this.borderDis = 0;
  2767. this.speedP10 = 5.6;
  2768. this.lastSpeed = { x: 0, y: 0 };
  2769. this.stillSpeed = 0.12;
  2770. this.ballFunc = "normal";
  2771. this.isRunSkillAni = false;
  2772. this.isInHole = false;
  2773. this.iceOwner = "";
  2774. this.forceRun = false;
  2775. this.myUNID = "";
  2776. this.rectL = 0;
  2777. this.rectR = 0;
  2778. this.rectT = 0;
  2779. this.rectB = 0;
  2780. this.forceVec = new Laya.Vector2();
  2781. this.lastDis = 0;
  2782. this.helpOut = { type: "", x: 0, y: 0 };
  2783. }
  2784. initSelf(number, x, y, d3Ball) {
  2785. if (!this.gameObj)
  2786. this.gameObj = this.owner;
  2787. this.number = number;
  2788. this.startX = x;
  2789. this.startY = y;
  2790. this.d3Ball = d3Ball;
  2791. this.isRootBall = false;
  2792. this.isBlackBall = false;
  2793. this.ballType = "";
  2794. if (number == 0) {
  2795. this.isRootBall = true;
  2796. }
  2797. else if (number == 8) {
  2798. this.isBlackBall = true;
  2799. }
  2800. else {
  2801. if (number <= 7) {
  2802. this.ballType = ballCamp.full;
  2803. }
  2804. else {
  2805. this.ballType = ballCamp.flower;
  2806. }
  2807. }
  2808. this.setInfo();
  2809. this.setD3Ball();
  2810. this.owner["mySrc"] = this;
  2811. this.rigy.linearDamping = 1;
  2812. D2BallSrc._unid++;
  2813. this.myUNID = "d2ball" + D2BallSrc._unid;
  2814. let rect = xGame.common.d2World.borderRect;
  2815. this.rectL = Math.ceil(rect.x) + 20;
  2816. this.rectT = Math.ceil(rect.y) + 20;
  2817. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2818. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2819. }
  2820. setInfo() {
  2821. this.gameObj.x = this.startX;
  2822. this.gameObj.y = this.startY;
  2823. let radius = this.ui.width / 2;
  2824. this.gameObj.width = radius * 2;
  2825. this.gameObj.height = radius * 2;
  2826. if (xGame.common.showDebug) {
  2827. this.ui.myIcon.alpha = 1;
  2828. this.ui.inner.alpha = 1;
  2829. }
  2830. else {
  2831. this.ui.myIcon.alpha = 0;
  2832. this.ui.inner.alpha = 0;
  2833. }
  2834. }
  2835. setD3Ball() {
  2836. this.d3Ball = this.d3Ball;
  2837. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2838. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2839. }
  2840. onUpdate() {
  2841. if (xGame.common.gameMgr.gamePause)
  2842. return;
  2843. if (this.isInHole)
  2844. return;
  2845. if (!xGame.common.d2World.openCheckStill)
  2846. return;
  2847. this.runBall();
  2848. }
  2849. runBall() {
  2850. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2851. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2852. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2853. this.judgeBorder();
  2854. }
  2855. getDestDis(dest) {
  2856. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2857. }
  2858. setmyXY(x, y) {
  2859. this.d3BallSrc.setTransPos(x, y);
  2860. }
  2861. getSpeed() {
  2862. let speed = this.rigy.linearVelocity;
  2863. return speed.x * speed.x + speed.y * speed.y;
  2864. }
  2865. onTriggerEnter(collider) {
  2866. if (!collider || !collider.owner)
  2867. return;
  2868. let coll = "collide";
  2869. let speed = this.getSpeed();
  2870. let sv2 = this.speedP10 * this.speedP10;
  2871. if (collider.label == "ball") {
  2872. if (speed < 9 && this.number != 0)
  2873. coll = "";
  2874. else if (speed < sv2)
  2875. coll = "collide_4";
  2876. else if (speed < sv2 * 6.2)
  2877. coll = "collide_3";
  2878. else if (speed < sv2 * 25)
  2879. coll = "collide_2";
  2880. else if (speed < sv2 * 56)
  2881. coll = "collide_1";
  2882. xGame.soundMgr.playSound(coll);
  2883. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2884. if (collider.owner) {
  2885. let rig = collider.owner.getComponent(D2BallSrc);
  2886. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2887. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2888. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2889. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2890. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2891. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2892. let rx = 0;
  2893. let ry = 0;
  2894. if (this.gameObj.x < this.rectL)
  2895. rx = vx;
  2896. else if (this.gameObj.x > this.rectR)
  2897. rx = -vx;
  2898. else if (this.gameObj.y < this.rectT)
  2899. ry = vy;
  2900. else if (this.gameObj.y > this.rectB)
  2901. ry = -vy;
  2902. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2903. }
  2904. }
  2905. if (this.number != 0) {
  2906. return;
  2907. }
  2908. else {
  2909. if (this.forceRun) {
  2910. console.log("randon force");
  2911. this.applyForce(collider);
  2912. }
  2913. }
  2914. if (xGame.common.d2World.isOnSameLine) {
  2915. xGame.common.d2World.isOnSameLine = false;
  2916. this.rigy.linearVelocity = { x: 0, y: 0 };
  2917. }
  2918. if (xGame.common.gameMgr.firstColliObj == null) {
  2919. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2920. xGame.common.gameMgr.isTouchedBall = true;
  2921. }
  2922. }
  2923. else {
  2924. xGame.common.recoverCameraView();
  2925. let wallStr = "";
  2926. if (speed < 9) { }
  2927. else if (speed < sv2) { }
  2928. else if (speed < sv2 * 6.2)
  2929. wallStr = "wall_30";
  2930. else if (speed < sv2 * 25)
  2931. wallStr = "wall_50";
  2932. else if (speed < sv2 * 56)
  2933. wallStr = "wall_80";
  2934. xGame.soundMgr.playSound(wallStr);
  2935. }
  2936. }
  2937. applyForce(collider) {
  2938. let src = collider.owner.mySrc;
  2939. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2940. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2941. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2942. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2943. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2944. }
  2945. checkWrongBall(playEft = true) {
  2946. if (this.isInHole)
  2947. return;
  2948. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2949. if (this.number != 0 && playEft)
  2950. this.d3BallSrc.playInHoleEft();
  2951. let coll = "inpocket_1";
  2952. let speed = this.getSpeed();
  2953. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2954. if (speed < 9 && this.number != 0)
  2955. coll = "";
  2956. else if (speed < sv2 * 6.2)
  2957. coll = "inpocket_4";
  2958. else if (speed < sv2 * 25)
  2959. coll = "collide_3";
  2960. else if (speed < sv2 * 56)
  2961. coll = "collide_2";
  2962. xGame.soundMgr.playSound(coll);
  2963. this.isInHole = true;
  2964. if (this.number == 0) {
  2965. console.log("白球进了。。");
  2966. this.reset();
  2967. this.rigy.linearVelocity = { x: 0, y: 0 };
  2968. this.hideSelf();
  2969. xGame.common.gameUI.ui.whiteAni.visible = true;
  2970. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2971. xGame.common.gameUI.ui.whiteAni.visible = false;
  2972. }));
  2973. }
  2974. else {
  2975. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2976. xGame.common.d2World.removeOneBall(this);
  2977. this.destroySelf();
  2978. xGame.common.playHappySound(this.number);
  2979. this.runFlyEft();
  2980. }
  2981. }
  2982. runFlyEft() {
  2983. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2984. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2985. }
  2986. }
  2987. hideSelf() {
  2988. if (this.d3Ball)
  2989. this.d3Ball.active = false;
  2990. }
  2991. showSelf() {
  2992. this.isInHole = false;
  2993. if (this.d3Ball && !this.d3Ball.active)
  2994. this.d3Ball.active = true;
  2995. }
  2996. isStill() {
  2997. let speed = this.rigy.linearVelocity;
  2998. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2999. this.rigy.linearVelocity = { x: 0, y: 0 };
  3000. return true;
  3001. }
  3002. return false;
  3003. }
  3004. reset() {
  3005. }
  3006. destroySelf() {
  3007. this.d3BallSrc.destroySelf();
  3008. if (!this.ui.isDisposed) {
  3009. this.ui.removeFromParent();
  3010. this.ui.dispose();
  3011. this.ui = null;
  3012. }
  3013. this.outColli = null;
  3014. this.innerColli = null;
  3015. this.rigy = null;
  3016. this.d3Ball = null;
  3017. this.d3BallSrc = null;
  3018. this.angleV2 = null;
  3019. this.gameObj.destroy(true);
  3020. this.destroy();
  3021. }
  3022. judgeBorder() {
  3023. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3024. return;
  3025. }
  3026. if (this.destroyed)
  3027. return;
  3028. if (xGame.common.gameMode == GameMode.classic)
  3029. return;
  3030. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3031. if (isOver) {
  3032. this.checkWrongBall();
  3033. }
  3034. }
  3035. onClick(e, force = false) {
  3036. if (this.number == 0)
  3037. return;
  3038. if (force) {
  3039. }
  3040. else {
  3041. if (xGame.common.d2World.openCheckStill)
  3042. return;
  3043. if (!xGame.common.gameMgr.selfTurn) {
  3044. return;
  3045. }
  3046. }
  3047. if (!xGame.common.gameMgr.finishOneShoot)
  3048. return;
  3049. let root = xGame.common.d2World.rootBall.gameObj;
  3050. let x = this.gameObj.x - root.x;
  3051. let y = this.gameObj.y - root.y;
  3052. let angle = xGame.common.getfguiRotation(x, y);
  3053. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3054. xGame.common.d2World.getHelpLine();
  3055. xGame.common.clickedBall = true;
  3056. this.checkGuide();
  3057. }
  3058. checkGuide() {
  3059. let guide = DataMgr.getSkillGuide();
  3060. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3061. xGame.common.guideStep++;
  3062. xGame.common.gameUI.ui.guide1.visible = false;
  3063. xGame.common.gameUI.ui.guide2.visible = true;
  3064. }
  3065. }
  3066. checkDistance(disX, disY, angle) {
  3067. let diameter = this.gameObj.width - 1;
  3068. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3069. if (!this.lastDis)
  3070. this.lastDis = dis;
  3071. else {
  3072. if (dis > this.lastDis) {
  3073. this.helpOut.type = "remove";
  3074. return this.helpOut;
  3075. }
  3076. }
  3077. if (dis <= Math.pow(diameter, 2)) {
  3078. let del = 0.01;
  3079. let offest = 0;
  3080. let realX = disX - this.gameObj.x;
  3081. let realY = disY - this.gameObj.y;
  3082. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3083. offest += del;
  3084. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3085. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3086. }
  3087. this.helpOut.type = "ok";
  3088. this.helpOut.x = realX + this.gameObj.x;
  3089. this.helpOut.y = realY + this.gameObj.y;
  3090. return this.helpOut;
  3091. }
  3092. else {
  3093. this.helpOut.type = "no";
  3094. return this.helpOut;
  3095. }
  3096. }
  3097. clearBallEft() {
  3098. this.clearBallRightEft();
  3099. this.clearBallWrongEft();
  3100. }
  3101. clearBallRightEft() {
  3102. this.ui.breathAni.stop();
  3103. this.ui.rightTips.visible = false;
  3104. }
  3105. clearBallWrongEft() {
  3106. this.ui.wrongTips.visible = false;
  3107. }
  3108. showWrongEft() {
  3109. if (!xGame.common.gameMgr.selfTurn)
  3110. return;
  3111. this.ui.wrongTips.visible = true;
  3112. }
  3113. showRightEft() {
  3114. if (!xGame.common.gameMgr.selfTurn)
  3115. return;
  3116. this.ui.rightTips.visible = true;
  3117. this.ui.rightTips.scaleX = 1;
  3118. this.ui.rightTips.scaleY = 1;
  3119. this.ui.breathAni.play();
  3120. }
  3121. setBallFunc(type, owner) {
  3122. if (type == "ice") {
  3123. this.ballFunc = type;
  3124. this.d3BallSrc.setAlbedoTexture(true);
  3125. this.rigy.type = "static";
  3126. this.iceOwner = owner;
  3127. }
  3128. else {
  3129. if (owner == this.iceOwner) {
  3130. this.ballFunc = type;
  3131. this.d3BallSrc.setAlbedoTexture(false);
  3132. this.rigy.type = "dynamic";
  3133. }
  3134. }
  3135. }
  3136. }
  3137. D2BallSrc._unid = 0;
  3138. class D2RootBallSrc extends D2BallSrc {
  3139. constructor() {
  3140. super();
  3141. this.maxSpeed = 0;
  3142. this.classicMaxSpeed = 2.2;
  3143. this.bigSkillMaxSpeed = 4;
  3144. this.angle = 0;
  3145. this.allPercent = 0;
  3146. this.linearPercent = 0;
  3147. this.anglePercent = 0;
  3148. this.maxAngleRate = 0.6;
  3149. this.baseRot = 7;
  3150. this.angleMax = 0;
  3151. this.speed = new Laya.Vector2();
  3152. this.rotSpeed = new Laya.Vector2();
  3153. }
  3154. isStill() {
  3155. let speed = this.rigy.linearVelocity;
  3156. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3157. if (this.anglePercent <= 0.1) {
  3158. this.rigy.linearVelocity = { x: 0, y: 0 };
  3159. return true;
  3160. }
  3161. }
  3162. return false;
  3163. }
  3164. reset() {
  3165. this.linearPercent = 0;
  3166. this.anglePercent = 0;
  3167. }
  3168. setSpeed(percent, angle) {
  3169. this.allPercent = percent;
  3170. this.angle = angle;
  3171. this.setAngleSpeed();
  3172. this.setLinearSpeed();
  3173. let hit = "hit";
  3174. if (percent < 25)
  3175. hit = "hit03";
  3176. else if (percent < 50)
  3177. hit = "hit02";
  3178. else if (percent < 75)
  3179. hit = "hit01";
  3180. xGame.soundMgr.playSound(hit);
  3181. }
  3182. setAngleSpeed() {
  3183. let offest = xGame.common.rodOffest;
  3184. let radius = 82;
  3185. let rate = Math.abs(offest.y / radius) * 0.5;
  3186. if (offest.y > 0)
  3187. this.angleMax = -this.baseRot * 2;
  3188. else
  3189. this.angleMax = this.baseRot;
  3190. this.rotY = -offest.x / radius * 100;
  3191. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3192. this.linearPercent = this.allPercent - this.anglePercent;
  3193. }
  3194. setLinearSpeed() {
  3195. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3196. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3197. if (!xGame.common.longHelpLine) {
  3198. let offset = -150 + xGame.common.randomNum(0, 300);
  3199. offset /= 100;
  3200. this.angle += offset;
  3201. }
  3202. }
  3203. }
  3204. let sin = Math.sin(this.angle * Math.PI / 180);
  3205. let cos = Math.cos(this.angle * Math.PI / 180);
  3206. switch (xGame.common.gameMode) {
  3207. case GameMode.classic:
  3208. this.maxSpeed = this.classicMaxSpeed;
  3209. break;
  3210. case GameMode.bigMove:
  3211. this.maxSpeed = this.bigSkillMaxSpeed;
  3212. break;
  3213. case GameMode.placeBall:
  3214. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3215. if (data.type == 1) {
  3216. this.maxSpeed = this.bigSkillMaxSpeed;
  3217. }
  3218. else {
  3219. this.maxSpeed = this.classicMaxSpeed;
  3220. }
  3221. break;
  3222. default:
  3223. break;
  3224. }
  3225. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3226. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3227. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3228. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3229. this.rigy.applyLinearImpulseToCenter(this.speed);
  3230. }
  3231. onUpdate() {
  3232. if (this.anglePercent > 0.1) {
  3233. this.anglePercent *= 0.97;
  3234. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3235. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3236. this.rigy.applyForceToCenter(this.rotSpeed);
  3237. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3238. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3239. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3240. if (num > 0.9)
  3241. this.canRot = true;
  3242. }
  3243. else
  3244. this.canRot = true;
  3245. if (Math.abs(this.rotY) > 0.1)
  3246. this.rotY *= 0.98;
  3247. super.onUpdate();
  3248. }
  3249. destroySelf() {
  3250. super.destroySelf();
  3251. this.speed = null;
  3252. }
  3253. }
  3254. class D2Ball extends Laya.Sprite {
  3255. constructor(isRootBall = false) {
  3256. super();
  3257. this.ui = ui_D2Ball.createInstance();
  3258. this.pivotX = this.ui.width / 2;
  3259. this.pivotY = this.ui.width / 2;
  3260. this.x = 0;
  3261. this.y = 0;
  3262. this.addChild(this.ui.displayObject);
  3263. this.ui.displayObject.x += this.ui.width / 2;
  3264. this.ui.displayObject.y += this.ui.width / 2;
  3265. if (isRootBall) {
  3266. this.d2Src = this.addComponent(D2RootBallSrc);
  3267. }
  3268. else {
  3269. this.d2Src = this.addComponent(D2BallSrc);
  3270. }
  3271. this.d2Src.ui = this.ui;
  3272. this.addCircleCollider();
  3273. this.addInnerCircleCollider();
  3274. this.addRigyBody();
  3275. }
  3276. addCircleCollider() {
  3277. let colli = xGame.common.getCollider("circle");
  3278. colli.radius = this.ui.width / 2;
  3279. this.addComponentIntance(colli);
  3280. this.d2Src.outColli = colli;
  3281. colli.label = "ball";
  3282. }
  3283. addInnerCircleCollider() {
  3284. let colli = xGame.common.getCollider("circle");
  3285. colli.radius = this.ui.inner.width / 2;
  3286. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3287. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3288. this.addComponentIntance(colli);
  3289. this.d2Src.innerColli = colli;
  3290. colli.label = "inner";
  3291. }
  3292. addRigyBody() {
  3293. let rigy = xGame.common.getRigbody();
  3294. rigy.type = "dynamic";
  3295. this.addComponentIntance(rigy);
  3296. this.d2Src.rigy = rigy;
  3297. }
  3298. disposeSelf() {
  3299. if (!this.ui.isDisposed) {
  3300. this.ui.dispose();
  3301. this.ui.removeFromParent();
  3302. this.ui = null;
  3303. }
  3304. }
  3305. }
  3306. class ui_D2Gan extends fgui.GComponent {
  3307. static createInstance() {
  3308. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3309. }
  3310. onConstruct() {
  3311. this.myIcon = (this.getChild("myIcon"));
  3312. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3313. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3314. this.self = (this.getChild("self"));
  3315. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3316. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3317. this.ai = (this.getChild("ai"));
  3318. }
  3319. }
  3320. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3321. class D2Gan {
  3322. constructor() {
  3323. this.offset = 0.15;
  3324. this.cell = 1.5;
  3325. this.onBallCell = 0.4;
  3326. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3327. this.moveNum = 70;
  3328. this.rulerRate = 0.1;
  3329. this.ui = ui_D2Gan.createInstance();
  3330. this.changeSelfRod();
  3331. this.changeAIRod();
  3332. }
  3333. changeSelfRod() {
  3334. let index = DataMgr.getCurBallRod();
  3335. let data = cfgTable.ballrodData[index + 1];
  3336. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3337. this.selfMySpine && this.selfMySpine.dispose();
  3338. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3339. if (data.spine) {
  3340. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3341. this.selfMySpine = new SpineMgr(data.spine, () => {
  3342. let xx = this.ui.selfEftRoot.width / 2;
  3343. let yy = this.ui.selfEftRoot.height / 2;
  3344. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3345. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3346. outSpine.rotation = -90;
  3347. });
  3348. }
  3349. }
  3350. changeAIRod() {
  3351. let length = Object.keys(cfgTable.ballrodData).length;
  3352. let rand = Math.floor(length * Math.random()) + 1;
  3353. let data = cfgTable.ballrodData[rand];
  3354. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3355. this.aiMySpine && this.aiMySpine.dispose();
  3356. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3357. if (data.spine) {
  3358. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3359. this.aiMySpine = new SpineMgr(data.spine, () => {
  3360. let xx = this.ui.aiEftRoot.width / 2;
  3361. let yy = this.ui.aiEftRoot.height / 2;
  3362. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3363. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3364. outSpine.rotation = -90;
  3365. });
  3366. }
  3367. }
  3368. setGanLastInfo() {
  3369. this.lastInfo.rotation = this.ui.rotation;
  3370. this.lastInfo.x = this.ui.x;
  3371. this.lastInfo.y = this.ui.y;
  3372. }
  3373. rotateSelf(flag, isRuler = false) {
  3374. let angle;
  3375. flag = flag * this.offset;
  3376. if (xGame.common.d2World.isHelpLineOnBall) {
  3377. angle = flag * this.onBallCell;
  3378. }
  3379. else {
  3380. angle = flag * this.cell;
  3381. }
  3382. if (isRuler) {
  3383. angle *= this.rulerRate;
  3384. }
  3385. this.ui.rotation += angle;
  3386. xGame.common.d2World.getHelpLine();
  3387. }
  3388. checkDistance() {
  3389. let target = xGame.common.d2World.targetBall;
  3390. let root = xGame.common.d2World.rootBall;
  3391. if (target == null) {
  3392. return 1;
  3393. }
  3394. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3395. if (dis <= 2500) {
  3396. return 5;
  3397. }
  3398. return 1;
  3399. }
  3400. rotDest(rot) {
  3401. this.ui.rotation = rot;
  3402. xGame.common.d2World.getHelpLine();
  3403. }
  3404. storagePower(powerNum) {
  3405. let pos = (powerNum / 100) * this.moveNum;
  3406. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3407. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3408. this.ui.x = this.lastInfo.x + xx;
  3409. this.ui.y = this.lastInfo.y + yy;
  3410. }
  3411. shoot() {
  3412. this.storagePower(0);
  3413. this.ui.visible = false;
  3414. }
  3415. destroySelf() {
  3416. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3417. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3418. this.selfMySpine && this.selfMySpine.dispose();
  3419. this.aiMySpine && this.aiMySpine.dispose();
  3420. this.lastInfo = null;
  3421. if (!this.ui.isDisposed) {
  3422. this.ui.removeFromParent();
  3423. this.ui.dispose();
  3424. }
  3425. }
  3426. }
  3427. class ui_HelpLine extends fgui.GComponent {
  3428. static createInstance() {
  3429. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3430. }
  3431. onConstruct() {
  3432. this.n10 = (this.getChild("n10"));
  3433. this.rect = (this.getChild("rect"));
  3434. this.dir11 = (this.getChild("dir11"));
  3435. this.dir = (this.getChild("dir"));
  3436. this.rootDir = (this.getChild("rootDir"));
  3437. this.dirDot = (this.getChild("dirDot"));
  3438. }
  3439. }
  3440. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3441. class D2HelpLine {
  3442. constructor() {
  3443. this.starX = 0;
  3444. this.starY = 0;
  3445. this.ui = ui_HelpLine.createInstance();
  3446. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3447. this.starX = this.ui.rect.x;
  3448. this.starY = this.ui.rect.y;
  3449. }
  3450. shoot() {
  3451. this.ui.visible = false;
  3452. }
  3453. destroySelf() {
  3454. if (this.ui.isDisposed) {
  3455. this.ui.removeFromParent();
  3456. this.ui.dispose();
  3457. }
  3458. }
  3459. }
  3460. class D2World extends Laya.Script {
  3461. constructor() {
  3462. super();
  3463. this.ballArr = [];
  3464. this.openCheckStill = false;
  3465. this.checkArr = [];
  3466. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3467. this.isHelpLineOnBall = false;
  3468. this.isOnSameLine = false;
  3469. this.reflectAngle = 0;
  3470. this.powerPercent = 0;
  3471. this.inHolesSpeed = [];
  3472. this.outDir = new Laya.Vector2();
  3473. this.rootDir = new Laya.Vector2();
  3474. this.aiLv = 0;
  3475. this.rootPos = new Laya.Vector2();
  3476. this.tempDir1 = new Laya.Vector2();
  3477. this.tempDir2 = new Laya.Vector2();
  3478. this.tempDir3 = new Laya.Vector2();
  3479. this.ballSize = 33;
  3480. this.destRot = 0;
  3481. }
  3482. initSelf() {
  3483. this.createBalls();
  3484. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3485. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3486. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3487. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3488. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3489. }
  3490. setBorderRect() {
  3491. let ui = xGame.common.gameUI.ui;
  3492. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3493. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3494. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3495. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3496. this.borderRect.x = starX;
  3497. this.borderRect.y = starY;
  3498. this.borderRect.width = width;
  3499. this.borderRect.height = height;
  3500. }
  3501. resetGame() {
  3502. this.openCheckStill = false;
  3503. let temp;
  3504. for (let index = 0; index < this.ballArr.length; index++) {
  3505. temp = this.ballArr[index];
  3506. temp.destroySelf();
  3507. }
  3508. xGame.common.d3World.ballRoot.destroyChildren();
  3509. xGame.common.gameUI.ui.ballNode.removeChildren();
  3510. console.log("进入摧毁逻辑");
  3511. this.d2Gan.destroySelf();
  3512. this.d2HelpLine.destroySelf();
  3513. this.ballArr = [];
  3514. }
  3515. setD2Gan() {
  3516. let ballNode = this.rootBall.ui;
  3517. let d2Gan = new D2Gan();
  3518. this.d2Gan = d2Gan;
  3519. let ganNode = d2Gan.ui;
  3520. ballNode.addChild(ganNode);
  3521. ganNode.pivotX = ganNode.pivotX;
  3522. ganNode.pivotY = ganNode.pivotY;
  3523. ganNode.x = ganNode.myIcon.width / 2;
  3524. ganNode.y = this.rootBall.gameObj.width;
  3525. d2Gan.setGanLastInfo();
  3526. }
  3527. setHelpLine() {
  3528. let d2Help = new D2HelpLine();
  3529. this.d2HelpLine = d2Help;
  3530. }
  3531. createBalls() {
  3532. let cfg;
  3533. switch (xGame.common.gameMode) {
  3534. case GameMode.classic:
  3535. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3536. break;
  3537. case GameMode.bigMove:
  3538. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3539. break;
  3540. case GameMode.placeBall:
  3541. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3542. break;
  3543. default:
  3544. break;
  3545. }
  3546. cfg = JSON.parse(JSON.stringify(cfg));
  3547. for (const key in cfg) {
  3548. if (cfg[key].value == 0) {
  3549. this.createRootBall(cfg[key]);
  3550. delete cfg[key];
  3551. break;
  3552. }
  3553. }
  3554. this.createOtherBalls(cfg);
  3555. }
  3556. createRootBall(data) {
  3557. let root = new D2Ball(true);
  3558. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3559. this.rootBall = root.d2Src;
  3560. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3561. let d3BallSrc = d3Ball.getComponent(Ball);
  3562. xGame.common.d3World.rootBall = d3Ball;
  3563. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3564. let xx = data.x;
  3565. let yy = data.y;
  3566. let numer = data.value;
  3567. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3568. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3569. this.ballArr.push(this.rootBall);
  3570. this.setD2Gan();
  3571. this.setHelpLine();
  3572. }
  3573. createOtherBalls(cfg) {
  3574. let temp;
  3575. let src;
  3576. let data;
  3577. for (const key in cfg) {
  3578. data = cfg[key];
  3579. temp = new D2Ball();
  3580. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3581. src = temp.d2Src;
  3582. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3583. src.initSelf(data.value, data.x, data.y, d3Ball);
  3584. this.ballArr.push(src);
  3585. }
  3586. }
  3587. shoot(percent) {
  3588. this.powerPercent = percent;
  3589. this.openCheckStill = true;
  3590. let d2Angle = this.d2Gan.ui.rotation;
  3591. this.rootBall.setSpeed(percent, d2Angle);
  3592. this.clearBallAllEft();
  3593. this.changePlayerView();
  3594. }
  3595. onUpdate() {
  3596. if (!this.openCheckStill)
  3597. return;
  3598. this.checkStill();
  3599. }
  3600. checkStill() {
  3601. for (let index = 0; index < this.ballArr.length; index++) {
  3602. if (!this.ballArr[index].isStill()) {
  3603. return;
  3604. }
  3605. }
  3606. xGame.eventMgr.event(ALL_BALL_STOP);
  3607. }
  3608. allBallStop() {
  3609. this.openCheckStill = false;
  3610. xGame.common.recoverCameraView();
  3611. }
  3612. waitShoot() {
  3613. if (!this.d2Gan.ui.isDisposed) {
  3614. this.d2Gan.ui.visible = true;
  3615. }
  3616. if (!this.d2HelpLine.ui.isDisposed) {
  3617. this.d2HelpLine.ui.visible = true;
  3618. }
  3619. this.clearBallAllEft();
  3620. this.showBallRightEft();
  3621. this.getHelpLine();
  3622. this.inHolesSpeed = [];
  3623. this.selectOneBall();
  3624. }
  3625. _getAllBallArr() {
  3626. let arr = this.ballArr;
  3627. let outArr = [];
  3628. for (let index = 0; index < arr.length; index++) {
  3629. if (arr[index] instanceof D2RootBallSrc)
  3630. continue;
  3631. if (arr[index].ballFunc == "ice")
  3632. continue;
  3633. if (arr[index].destroyed)
  3634. continue;
  3635. outArr.push(arr[index]);
  3636. }
  3637. return outArr;
  3638. }
  3639. _getBlackObj() {
  3640. let arr = this.ballArr;
  3641. for (let index = 0; index < arr.length; index++) {
  3642. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3643. return arr[index];
  3644. }
  3645. }
  3646. }
  3647. selectOneBall() {
  3648. let all = this._getAllBallArr();
  3649. let target;
  3650. switch (xGame.common.gameMode) {
  3651. case GameMode.classic:
  3652. if (xGame.common.gameMgr.selfTurn) {
  3653. let self = xGame.common.gameMgr.selfBallArr;
  3654. let black = this._getBlackObj();
  3655. if (xGame.common.gameMgr.ensureBallType) {
  3656. if (self.length > 0) {
  3657. let out = [];
  3658. for (let j = 0; j < all.length; j++) {
  3659. if (self.indexOf(all[j].number) > -1) {
  3660. out.push(all[j]);
  3661. }
  3662. }
  3663. target = this.selectBestEnterOne(out);
  3664. }
  3665. else {
  3666. target = this.selectBestEnterOne([black]);
  3667. }
  3668. }
  3669. else {
  3670. target = this.selectBestEnterOne(all);
  3671. }
  3672. }
  3673. else {
  3674. target = this.selectBestEnterOne(all);
  3675. }
  3676. break;
  3677. case GameMode.bigMove:
  3678. target = this.selectBestEnterOne(all);
  3679. break;
  3680. case GameMode.placeBall:
  3681. if (all.length > 0) {
  3682. target = this.selectBestEnterOne(all);
  3683. }
  3684. break;
  3685. default:
  3686. break;
  3687. }
  3688. if (target && !target.destroyed && target.onClick) {
  3689. target.onClick(0, true);
  3690. let num = -200 + xGame.common.randomNum(0, 400);
  3691. num /= 150;
  3692. if (xGame.common.longHelpLine) {
  3693. num = 0;
  3694. }
  3695. this.destRot += num;
  3696. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3697. }
  3698. }
  3699. removeOneBall(ball) {
  3700. for (let index = 0; index < this.ballArr.length; index++) {
  3701. if (this.ballArr[index].id == ball.id) {
  3702. this.ballArr.splice(index, 1);
  3703. break;
  3704. }
  3705. }
  3706. }
  3707. getHelpLine() {
  3708. this.d2HelpLine.ui.dirDot.visible = false;
  3709. this.isOnSameLine = false;
  3710. let startX = this.rootBall.gameObj.x;
  3711. let startY = this.rootBall.gameObj.y;
  3712. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3713. if (dis == null) {
  3714. this.d2HelpLine.ui.visible = false;
  3715. console.error("辅助线异常");
  3716. return;
  3717. }
  3718. this.d2HelpLine.ui.visible = true;
  3719. let angle = this.d2Gan.ui.rotation;
  3720. let radius = 16.5;
  3721. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3722. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3723. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3724. if (colliObj == null) {
  3725. this.getColliPos(disX, disY, radius, angle);
  3726. xGame.common.d2World.isHelpLineOnBall = false;
  3727. this.targetBall = null;
  3728. this.reflectAngle = 0;
  3729. this.showBallWrongEft();
  3730. }
  3731. else {
  3732. let target = colliObj.src;
  3733. let radius = 16.5;
  3734. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3735. dis1 = Math.sqrt(dis1);
  3736. let realDis = colliObj.disHon - dis1;
  3737. let dir = colliObj.dir;
  3738. let xx = startX + dir.x * realDis;
  3739. let yy = startY + dir.y * realDis;
  3740. this.getColliPos(xx, yy, radius, angle);
  3741. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3742. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3743. let offset = xGame.common.rodOffest;
  3744. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3745. this.isOnSameLine = true;
  3746. }
  3747. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3748. xGame.common.d2World.isHelpLineOnBall = true;
  3749. this.targetBall = target;
  3750. this.reflectAngle = reflectAngle;
  3751. this.showBallWrongEft();
  3752. if (xGame.common.longHelpLine) {
  3753. this.delayReflectLine(target, reflectAngle);
  3754. }
  3755. }
  3756. }
  3757. getBorderDot(startX, startY, angle) {
  3758. let radius = 17;
  3759. let distance;
  3760. let isDone;
  3761. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3762. isDone = this.judgeUpDown(distance, angle, startX);
  3763. if (isDone != null) {
  3764. return isDone;
  3765. }
  3766. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3767. isDone = this.judgeUpDown(distance, angle, startX);
  3768. if (isDone != null) {
  3769. return isDone;
  3770. }
  3771. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3772. isDone = this.judgeLeftRight(distance, angle, startY);
  3773. if (isDone != null) {
  3774. return isDone;
  3775. }
  3776. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3777. isDone = this.judgeLeftRight(distance, angle, startY);
  3778. if (isDone != null) {
  3779. return isDone;
  3780. }
  3781. }
  3782. judgeUpDown(distance, angle, startX) {
  3783. let flag = Math.sin(angle * Math.PI / 180);
  3784. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3785. if (distance >= 0) {
  3786. if (flag > 0) {
  3787. if (temp < this.borderRect.x + this.borderRect.width) {
  3788. return distance;
  3789. }
  3790. }
  3791. else {
  3792. if (temp > this.borderRect.x) {
  3793. return distance;
  3794. }
  3795. }
  3796. }
  3797. }
  3798. judgeLeftRight(distance, angle, starY) {
  3799. let flag = -Math.cos(angle * Math.PI / 180);
  3800. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3801. if (distance >= 0) {
  3802. if (flag > 0) {
  3803. if (temp < this.borderRect.y + this.borderRect.height) {
  3804. return distance;
  3805. }
  3806. }
  3807. else {
  3808. if (temp > this.borderRect.y) {
  3809. return distance;
  3810. }
  3811. }
  3812. }
  3813. }
  3814. clearBallAllEft() {
  3815. let temp;
  3816. for (let index = 0; index < this.ballArr.length; index++) {
  3817. temp = this.ballArr[index];
  3818. temp.clearBallEft();
  3819. }
  3820. }
  3821. showBallRightEft() {
  3822. let gameMgr = xGame.common.gameMgr;
  3823. let temp;
  3824. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3825. if (targetArr.length <= 0)
  3826. return;
  3827. for (let index = 0; index < this.ballArr.length; index++) {
  3828. temp = this.ballArr[index];
  3829. if (targetArr.indexOf(temp.number) > -1) {
  3830. temp.showRightEft();
  3831. }
  3832. }
  3833. }
  3834. showBallWrongEft() {
  3835. let gameMgr = xGame.common.gameMgr;
  3836. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3837. if (targetArr.length <= 0)
  3838. return;
  3839. let temp;
  3840. for (let index = 0; index < this.ballArr.length; index++) {
  3841. temp = this.ballArr[index];
  3842. if (this.targetBall && this.targetBall.number == temp.number) {
  3843. if (targetArr.indexOf(temp.number) <= -1) {
  3844. temp.showWrongEft();
  3845. }
  3846. else {
  3847. temp.clearBallWrongEft();
  3848. }
  3849. }
  3850. else {
  3851. temp.clearBallWrongEft();
  3852. }
  3853. }
  3854. }
  3855. getColliPos(x, y, radius, angle) {
  3856. this.d2HelpLine.ui.x = x;
  3857. this.d2HelpLine.ui.y = y;
  3858. let dirX = x - this.rootBall.gameObj.x;
  3859. let dirY = y - this.rootBall.gameObj.y;
  3860. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3861. if (rectH <= 0)
  3862. rectH = 0;
  3863. this.d2HelpLine.ui.rect.height = 0;
  3864. this.d2HelpLine.ui.rect.height = rectH;
  3865. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3866. if (rectH < this.rootBall.gameObj.width) {
  3867. this.d2HelpLine.ui.rect.visible = false;
  3868. }
  3869. else {
  3870. this.d2HelpLine.ui.rect.visible = true;
  3871. }
  3872. this.d2HelpLine.ui.dir.visible = false;
  3873. this.d2HelpLine.ui.rootDir.visible = false;
  3874. }
  3875. getReflectLine(x, y, radius, target) {
  3876. this.d2HelpLine.ui.dir.visible = true;
  3877. let dirX = target.x - x;
  3878. let dirY = target.y - y;
  3879. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3880. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3881. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3882. this.d2HelpLine.ui.dir.height = 48;
  3883. this.d2HelpLine.ui.dir.rotation = angle;
  3884. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3885. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3886. return angle;
  3887. }
  3888. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3889. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3890. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3891. let targetX = target.gameObj.x;
  3892. let targetY = target.gameObj.y;
  3893. this.outDir.setValue(targetX - xx, targetY - yy);
  3894. this.rootDir.setValue(rtX - xx, rtY - yy);
  3895. let ver = Math.PI / 2;
  3896. let sin = Math.sin(ver);
  3897. let cos = Math.cos(ver);
  3898. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3899. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3900. this.outDir.setValue(outX, outY);
  3901. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3902. Laya.Vector2.normalize(this.outDir, this.outDir);
  3903. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3904. if (Math.abs(result) <= 0.08) {
  3905. this.d2HelpLine.ui.rootDir.visible = false;
  3906. return;
  3907. }
  3908. if (result > 0) {
  3909. angle += 90;
  3910. }
  3911. else if (result < 0) {
  3912. angle -= 90;
  3913. }
  3914. this.d2HelpLine.ui.rootDir.visible = true;
  3915. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3916. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3917. this.d2HelpLine.ui.rootDir.rotation = angle;
  3918. }
  3919. delayReflectLine(obj, angle) {
  3920. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3921. return;
  3922. }
  3923. this.isOnSameLine = false;
  3924. let startX = obj.gameObj.x;
  3925. let startY = obj.gameObj.y;
  3926. let dis = this.getBorderDot(startX, startY, angle);
  3927. if (dis == null) {
  3928. this.d2HelpLine.ui.dirDot.visible = false;
  3929. return;
  3930. }
  3931. this.d2HelpLine.ui.visible = true;
  3932. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3933. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3934. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3935. if (colliObj == null) {
  3936. this.setDelayLine(disX, disY, obj, angle);
  3937. }
  3938. else {
  3939. let radius = 16;
  3940. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3941. dis1 = Math.sqrt(dis1);
  3942. let realDis = colliObj.disHon - dis1;
  3943. let dir = colliObj.dir;
  3944. let xx = startX + dir.x * realDis;
  3945. let yy = startY + dir.y * realDis;
  3946. this.setDelayLine(xx, yy, obj, angle);
  3947. }
  3948. }
  3949. setDelayLine(x, y, obj, angle) {
  3950. let dirX = x - obj.gameObj.x;
  3951. let dirY = y - obj.gameObj.y;
  3952. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3953. if (rectH <= 0)
  3954. rectH = 0;
  3955. this.d2HelpLine.ui.dir.height = rectH;
  3956. this.d2HelpLine.ui.dirDot.visible = true;
  3957. this.d2HelpLine.ui.dirDot.x = 17;
  3958. this.d2HelpLine.ui.dirDot.y = 17;
  3959. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3960. ;
  3961. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3962. }
  3963. changePlayerView() {
  3964. if (Math.random() >= 0.7)
  3965. return;
  3966. if (!this.targetBall) {
  3967. return;
  3968. }
  3969. if (!xGame.common.gameMgr.selfTurn)
  3970. return;
  3971. switch (xGame.common.gameMode) {
  3972. case GameMode.classic:
  3973. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3974. if (this.targetBall.number != 8) {
  3975. return;
  3976. }
  3977. }
  3978. break;
  3979. case GameMode.bigMove:
  3980. return;
  3981. case GameMode.placeBall:
  3982. break;
  3983. default:
  3984. break;
  3985. }
  3986. let startX = this.targetBall.gameObj.x;
  3987. let startY = this.targetBall.gameObj.y;
  3988. let angle = this.reflectAngle;
  3989. let dis = this.getBorderDot(startX, startY, angle);
  3990. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3991. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3992. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3993. if (colliObj) {
  3994. return;
  3995. }
  3996. let offset = 40;
  3997. let posObj = xGame.common.gameMgr.posObj;
  3998. let temp;
  3999. let radius;
  4000. let tarX, tarY;
  4001. for (const key in posObj) {
  4002. temp = posObj[key];
  4003. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4004. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4005. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4006. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4007. xGame.common.showOneCamera("angle" + key);
  4008. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4009. Laya.physicsTimer.scale = 0.7;
  4010. break;
  4011. }
  4012. }
  4013. }
  4014. selectBestEnterOne(arr) {
  4015. this.aiLv = xGame.tools.random(1, 11);
  4016. this.aiLv = 10;
  4017. this.wBall = xGame.common.d2World.rootBall;
  4018. this.rootPos.x = this.wBall.gameObj.x;
  4019. this.rootPos.y = this.wBall.gameObj.y;
  4020. this.initHoleBall(arr);
  4021. return this.selectBall();
  4022. }
  4023. selectBall() {
  4024. let ball = null;
  4025. this.destRot = 0;
  4026. let ai = 110 - this.aiLv * 10;
  4027. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4028. let score = false;
  4029. if (this.scoreBall.length < 1) {
  4030. if (this.lineBall.length < 1) {
  4031. for (let i = 0; i < this.kickBall.length; i++) {
  4032. let list = [];
  4033. let bo = this.kickBall[i];
  4034. let bobj = bo.gameObj;
  4035. let rect = xGame.common.d2World.borderRect;
  4036. let mobj = this.wBall.gameObj;
  4037. let minb = bobj.y - rect.y - 20;
  4038. let minw = mobj.y - rect.y - 50;
  4039. if (minb > 0 && minw > 0) {
  4040. let dlenx = 0;
  4041. let dleny = mobj.y - rect.y;
  4042. let spx = mobj.x;
  4043. let spy = rect.y - dleny;
  4044. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4045. }
  4046. minb = rect.y + rect.height - bobj.y - 20;
  4047. minw = rect.y + rect.height - mobj.y - 50;
  4048. if (minb > 0 && minw > 0) {
  4049. let dlenx = 0;
  4050. let dleny = rect.y + rect.height - mobj.y;
  4051. let spx = mobj.x;
  4052. let spy = rect.y + rect.height + dleny;
  4053. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4054. }
  4055. minb = bobj.x - rect.x - 20;
  4056. minw = mobj.x - rect.x - 50;
  4057. if (minb > 0 && minw > 0) {
  4058. let dlenx = mobj.x - rect.x;
  4059. let dleny = 0;
  4060. let spx = rect.x - dlenx;
  4061. let spy = mobj.y;
  4062. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4063. }
  4064. minb = rect.x + rect.width - bobj.x - 20;
  4065. minw = rect.x + rect.width - mobj.x - 50;
  4066. if (minb > 0 && minw > 0) {
  4067. let dlenx = rect.x + rect.width - mobj.x;
  4068. let dleny = 0;
  4069. let spx = rect.x + rect.width + dlenx;
  4070. let spy = mobj.y;
  4071. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4072. }
  4073. list.sort(function (a, b) {
  4074. return a.order - b.order;
  4075. });
  4076. for (let i = 0; i < list.length; i++) {
  4077. let data = list[i];
  4078. let mx = mobj.x - bobj.x;
  4079. let my = mobj.y - bobj.y;
  4080. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4081. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4082. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4083. if (num > 1)
  4084. num = 1;
  4085. let cos = Math.acos(num);
  4086. if (cos > 1.57)
  4087. cos = 1.57;
  4088. else if (cos < 0.01)
  4089. cos = 0.01;
  4090. let tan = Math.tan(cos);
  4091. let dx = tan * data.dleny;
  4092. let dy = tan * data.dlenx;
  4093. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4094. if (Math.abs(bx - 667) < 40)
  4095. continue;
  4096. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4097. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4098. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4099. this.forceMax = dis * 0.08;
  4100. this.destRot += mis * 0.1;
  4101. this.setKick(bx, by);
  4102. return true;
  4103. }
  4104. }
  4105. }
  4106. }
  4107. else {
  4108. ball = xGame.common.getRandArrEle(this.lineBall);
  4109. }
  4110. }
  4111. else {
  4112. for (let i = 0; i < this.scoreBall.length; i++) {
  4113. if (i < this.scoreBall.length - 1) {
  4114. let rand = 70 + this.aiLv * 10 + i * 10;
  4115. if (xGame.tools.random(0, 100) < rand) {
  4116. ball = this.scoreBall[i];
  4117. break;
  4118. }
  4119. }
  4120. else {
  4121. ball = this.scoreBall[i];
  4122. break;
  4123. }
  4124. }
  4125. score = true;
  4126. this.selectNum++;
  4127. }
  4128. if (!ball)
  4129. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4130. let dx = ball.gameObj.x;
  4131. let dy = ball.gameObj.y;
  4132. let kickAngle = 0;
  4133. if (score) {
  4134. dx = ball.kickPos.x;
  4135. dy = ball.kickPos.y;
  4136. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4137. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4138. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4139. if (adot > 1)
  4140. adot = 1;
  4141. kickAngle = Math.acos(adot) * 57.3;
  4142. if (kickAngle > 45) {
  4143. let kdx = ball.kickPos.x - ball.gameObj.x;
  4144. let kdy = ball.kickPos.y - ball.gameObj.y;
  4145. dx = ball.kickPos.x - kdx * mis * 0.3;
  4146. dy = ball.kickPos.y - kdy * mis * 0.3;
  4147. }
  4148. else
  4149. this.destRot += mis;
  4150. }
  4151. else if (ball.poleAngle != 0) {
  4152. this.destRot += ball.poleAngle;
  4153. }
  4154. if (xGame.common.gameMode == 0) {
  4155. let af = kickAngle * 0.08;
  4156. this.forceMax = ball.hard * 0.1 + af * af;
  4157. }
  4158. this.setKick(dx, dy);
  4159. return ball;
  4160. }
  4161. initHoleBall(arr) {
  4162. this.kickBall = [];
  4163. this.lineBall = [];
  4164. this.scoreBall = [];
  4165. this.holeBall = [];
  4166. this.selectNum = 0;
  4167. this.forceNum = 0;
  4168. this.forceMax = 0;
  4169. this.turnNum = 0;
  4170. let list = arr;
  4171. let holes = xGame.common.gameMgr.holePosList;
  4172. let self = xGame.common.aiPlayer;
  4173. for (let i = 0; i < list.length; i++) {
  4174. let obj = list[i];
  4175. if (!obj)
  4176. continue;
  4177. obj.kickPos.x = 0;
  4178. obj.kickPos.y = 0;
  4179. obj.poleAngle = 0;
  4180. obj.hard = 0;
  4181. obj.borderDis = 0;
  4182. obj.kickAngle = 180;
  4183. let b = obj.gameObj;
  4184. let wbp = this.rootPos;
  4185. let bx = wbp.x - b.x;
  4186. let by = wbp.y - b.y;
  4187. obj.borderDis = xGame.tools.random(0, 100);
  4188. this.kickBall.push(obj);
  4189. if (!this.isLine(wbp, obj))
  4190. continue;
  4191. obj.kickAngle = xGame.tools.random(90, 180);
  4192. obj.kickPos.x = b.x;
  4193. obj.kickPos.y = b.y;
  4194. this.lineBall.push(obj);
  4195. let minDis = 999999;
  4196. let hole = false;
  4197. for (let j = 0; j < holes.length; j++) {
  4198. let hp = holes[j];
  4199. if (bx >= 0 && hp.x > b.x + 100)
  4200. continue;
  4201. if (bx <= 0 && hp.x < b.x - 100)
  4202. continue;
  4203. if (by < -10 && hp.y < wbp.y)
  4204. continue;
  4205. if (by > 10 && hp.y > wbp.y)
  4206. continue;
  4207. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4208. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4209. if (dis < minDis) {
  4210. let dx = b.x - this.tempDir1.x * this.ballSize;
  4211. let dy = b.y - this.tempDir1.y * this.ballSize;
  4212. this.tempDir3.x = this.tempDir1.x;
  4213. this.tempDir3.y = this.tempDir1.y;
  4214. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4215. obj.kickPos.x = dx;
  4216. obj.kickPos.y = dy;
  4217. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4218. if (num > 1)
  4219. num = 1;
  4220. obj.kickAngle = Math.acos(num) * 57.3;
  4221. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4222. dis = dis * 2;
  4223. if (Math.abs(hp.x - 600) < 100)
  4224. dis += 50;
  4225. obj.hard = dis + obj.kickAngle * 3;
  4226. hole = true;
  4227. }
  4228. }
  4229. }
  4230. }
  4231. if (hole) {
  4232. this.scoreBall.push(obj);
  4233. this.holeBall.push(obj);
  4234. }
  4235. }
  4236. this.scoreBall.sort(function (a, b) {
  4237. return a.hard - b.hard;
  4238. });
  4239. this.holeBall.sort(function (a, b) {
  4240. return a.kickAngle - b.kickAngle;
  4241. });
  4242. this.kickBall.sort(function (a, b) {
  4243. return a.borderDis - b.borderDis;
  4244. });
  4245. }
  4246. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4247. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4248. let balls = xGame.common.d2World.ballArr;
  4249. let max = xGame.tools.getDis(hx, hy, bx, by);
  4250. for (let index = 0; index < balls.length; index++) {
  4251. let obj = balls[index];
  4252. if (obj.number == 0)
  4253. continue;
  4254. if (obj.number == bn || obj.number == dn)
  4255. continue;
  4256. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4257. if (dis * dis > max)
  4258. continue;
  4259. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4260. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4261. if (num > 1)
  4262. num = 1;
  4263. if (num < 0)
  4264. continue;
  4265. let gap = Math.sin(Math.acos(num)) * dis;
  4266. if (gap < this.ballSize)
  4267. return true;
  4268. }
  4269. return false;
  4270. }
  4271. isLine(xy, ball) {
  4272. let bx = xy.x;
  4273. let by = xy.y;
  4274. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4275. let dis = ball.getDestDis(xy);
  4276. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4277. let sin = Math.sin(angle);
  4278. let cos = Math.cos(angle);
  4279. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4280. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4281. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4282. let dx = bx + this.tempDir2.x * dis;
  4283. let dy = by + this.tempDir2.y * dis;
  4284. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4285. sin = Math.sin(-angle);
  4286. cos = Math.cos(-angle);
  4287. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4288. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4289. dx = bx + this.tempDir2.x * dis;
  4290. dy = by + this.tempDir2.y * dis;
  4291. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4292. if (isr && isl)
  4293. return false;
  4294. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4295. }
  4296. return true;
  4297. }
  4298. setKick(dx, dy) {
  4299. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4300. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4301. this.tempDir1.x = 0;
  4302. this.tempDir1.y = 1;
  4303. this.tempDir2.y = -this.tempDir2.y;
  4304. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4305. if (num > 1)
  4306. num = 1;
  4307. let rot = Math.acos(num) * 57.3;
  4308. if (this.tempDir2.x < 0)
  4309. rot = 360 - rot;
  4310. this.destRot += rot;
  4311. }
  4312. }
  4313. class ui_UIGame extends fgui.GComponent {
  4314. static createInstance() {
  4315. return (fgui.UIPackage.createObject("game", "UIGame"));
  4316. }
  4317. onConstruct() {
  4318. this.c1 = this.getController("c1");
  4319. this.d3Root = (this.getChild("d3Root"));
  4320. this.clickNode = (this.getChild("clickNode"));
  4321. this.d2Root = (this.getChild("d2Root"));
  4322. this.topNode = (this.getChild("topNode"));
  4323. this.n72 = (this.getChild("n72"));
  4324. this.n40 = (this.getChild("n40"));
  4325. this.rulerNode = (this.getChild("rulerNode"));
  4326. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4327. this.n50 = (this.getChild("n50"));
  4328. this.keduNode = (this.getChild("keduNode"));
  4329. this.powerTxt = (this.getChild("powerTxt"));
  4330. this.powerNode = (this.getChild("powerNode"));
  4331. this.colorNode = (this.getChild("colorNode"));
  4332. this.powerEft = (this.getChild("powerEft"));
  4333. this.myPowerNode = (this.getChild("myPowerNode"));
  4334. this.ganNode = (this.getChild("ganNode"));
  4335. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4336. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4337. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4338. this.skillRod = (this.getChild("skillRod"));
  4339. this.border = (this.getChild("border"));
  4340. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4341. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4342. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4343. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4344. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4345. this.guanyuNode = (this.getChild("guanyuNode"));
  4346. this.helpBtn = (this.getChild("helpBtn"));
  4347. this.wordsBtn = (this.getChild("wordsBtn"));
  4348. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4349. this.returnBtn = (this.getChild("returnBtn"));
  4350. this.ballNode = (this.getChild("ballNode"));
  4351. this.whiteAni = (this.getChild("whiteAni"));
  4352. this.blackAni = (this.getChild("blackAni"));
  4353. this.selfTurn = (this.getChild("selfTurn"));
  4354. this.aiTurn = (this.getChild("aiTurn"));
  4355. this.deskNode = (this.getChild("deskNode"));
  4356. this.moveNode = (this.getChild("moveNode"));
  4357. this.selfTalk = (this.getChild("selfTalk"));
  4358. this.aiTalk = (this.getChild("aiTalk"));
  4359. this.d2Node = (this.getChild("d2Node"));
  4360. this.snowNode = (this.getChild("snowNode"));
  4361. this.guide2 = (this.getChild("guide2"));
  4362. this.guide1 = (this.getChild("guide1"));
  4363. this.guide3 = (this.getChild("guide3"));
  4364. this.guideNode = (this.getChild("guideNode"));
  4365. }
  4366. }
  4367. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4368. class ui_UIGameEnd extends fgui.GComponent {
  4369. static createInstance() {
  4370. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4371. }
  4372. onConstruct() {
  4373. this.c1 = this.getController("c1");
  4374. this.n22 = (this.getChild("n22"));
  4375. this.n2 = (this.getChild("n2"));
  4376. this.n52 = (this.getChild("n52"));
  4377. this.n53 = (this.getChild("n53"));
  4378. this.coinNode = (this.getChild("coinNode"));
  4379. this.closeNode = (this.getChild("closeNode"));
  4380. this.moneyNode = (this.getChild("moneyNode"));
  4381. this.secretary = (this.getChild("secretary"));
  4382. this.n27 = (this.getChild("n27"));
  4383. this.n29 = (this.getChild("n29"));
  4384. this.talkNode = (this.getChild("talkNode"));
  4385. this.n38 = (this.getChild("n38"));
  4386. this.n39 = (this.getChild("n39"));
  4387. this.n40 = (this.getChild("n40"));
  4388. this.awardNode = (this.getChild("awardNode"));
  4389. this.starNumNode = (this.getChild("starNumNode"));
  4390. this.n47 = (this.getChild("n47"));
  4391. this.conditionNode = (this.getChild("conditionNode"));
  4392. this.isGetAward = (this.getChild("isGetAward"));
  4393. this.leftBtn = (this.getChild("leftBtn"));
  4394. this.rightBtn = (this.getChild("rightBtn"));
  4395. this.btnNode = (this.getChild("btnNode"));
  4396. }
  4397. }
  4398. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4399. class ui_UIAddCoin extends fgui.GComponent {
  4400. static createInstance() {
  4401. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4402. }
  4403. onConstruct() {
  4404. this.n11 = (this.getChild("n11"));
  4405. this.myNode = (this.getChild("myNode"));
  4406. this.t0 = this.getTransition("t0");
  4407. }
  4408. }
  4409. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4410. class UIAddCoin extends UIBase {
  4411. constructor() {
  4412. super();
  4413. this.coinNum = 2000;
  4414. }
  4415. onConstructor() {
  4416. this.ui = ui_UIAddCoin.createInstance();
  4417. this.contentPane = this.ui;
  4418. this.isEject = false;
  4419. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4420. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4421. }
  4422. show() {
  4423. super.show();
  4424. this.ui.t0.play();
  4425. }
  4426. videoAddCoin() {
  4427. console.log('zh:qjff_AD_for_UIAddCoin');
  4428. if (Laya.Browser.onAndroid) {
  4429. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4430. if (!boo) {
  4431. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4432. return;
  4433. }
  4434. }
  4435. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4436. }
  4437. else {
  4438. console.log('zh:AD 失败,直接发放奖励');
  4439. this.qjff_AD_for_UIAddCoin();
  4440. }
  4441. }
  4442. qjff_AD_for_UIAddCoin() {
  4443. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4444. this.hide();
  4445. }
  4446. }
  4447. UIAddCoin.uiName = "UIAddCoin";
  4448. class ui_UIInvitation extends fgui.GComponent {
  4449. static createInstance() {
  4450. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4451. }
  4452. onConstruct() {
  4453. this.n14 = (this.getChild("n14"));
  4454. this.myNode = (this.getChild("myNode"));
  4455. this.t0 = this.getTransition("t0");
  4456. }
  4457. }
  4458. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4459. class UIInvitation extends UIBase {
  4460. constructor() {
  4461. super();
  4462. }
  4463. onConstructor() {
  4464. this.ui = ui_UIInvitation.createInstance();
  4465. this.contentPane = this.ui;
  4466. this.isEject = false;
  4467. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4468. }
  4469. show() {
  4470. super.show();
  4471. }
  4472. enterGame() {
  4473. xGame.common.gameMode = GameMode.classic;
  4474. DataMgr.setChallengeTimes(1);
  4475. xGame.common.passAwardCoin = 2000;
  4476. let need = xGame.common.classicNiceNeddCoin;
  4477. if (DataMgr.coinEnough(need)) {
  4478. DataMgr.setCoin(-need);
  4479. xGame.eventMgr.event(RESTART_GAME, true);
  4480. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4481. }
  4482. else {
  4483. xGame.eventMgr.event(RESTART_GAME, true);
  4484. }
  4485. this.hide();
  4486. }
  4487. hide() {
  4488. super.hide();
  4489. }
  4490. }
  4491. UIInvitation.uiName = "UIInvitation";
  4492. class ui_UIMain extends fgui.GComponent {
  4493. static createInstance() {
  4494. return (fgui.UIPackage.createObject("game", "UIMain"));
  4495. }
  4496. onConstruct() {
  4497. this.n47 = (this.getChild("n47"));
  4498. this.n10 = (this.getChild("n10"));
  4499. this.secretary = (this.getChild("secretary"));
  4500. this.shopBtn = (this.getChild("shopBtn"));
  4501. this.moneyNode = (this.getChild("moneyNode"));
  4502. this.headNode = (this.getChild("headNode"));
  4503. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4504. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4505. this.classicBtn = (this.getChild("classicBtn"));
  4506. this.globalBtn = (this.getChild("globalBtn"));
  4507. this.n44 = (this.getChild("n44"));
  4508. this.signBtn = (this.getChild("signBtn"));
  4509. this.drawBtn = (this.getChild("drawBtn"));
  4510. this.settingNode = (this.getChild("settingNode"));
  4511. this.n_fuli = (this.getChild("n_fuli"));
  4512. this.n45 = (this.getChild("n45"));
  4513. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4514. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4515. this.rankBtn = (this.getChild("rankBtn"));
  4516. this.n46 = (this.getChild("n46"));
  4517. this.liucheng1 = (this.getChild("liucheng1"));
  4518. this.rightBtn = (this.getChild("rightBtn"));
  4519. this.n75 = (this.getChild("n75"));
  4520. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4521. this.liucheng2 = (this.getChild("liucheng2"));
  4522. this.guideBtn = (this.getChild("guideBtn"));
  4523. this.n73 = (this.getChild("n73"));
  4524. this.wordsNode = (this.getChild("wordsNode"));
  4525. this.enterGuide = (this.getChild("enterGuide"));
  4526. this.talkNode = (this.getChild("talkNode"));
  4527. this.n83 = (this.getChild("n83"));
  4528. this.n84 = (this.getChild("n84"));
  4529. this.n_Logout = (this.getChild("n_Logout"));
  4530. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4531. this.n_dengLu = (this.getChild("n_dengLu"));
  4532. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4533. }
  4534. }
  4535. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4536. class ui_UIMoyu extends fgui.GComponent {
  4537. static createInstance() {
  4538. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4539. }
  4540. onConstruct() {
  4541. this.ageTip = (this.getChild("ageTip"));
  4542. this.mainBg = (this.getChild("mainBg"));
  4543. this.xyNode = (this.getChild("xyNode"));
  4544. this.rnNode = (this.getChild("rnNode"));
  4545. this.fcmNode = (this.getChild("fcmNode"));
  4546. this.ageNode = (this.getChild("ageNode"));
  4547. this.tipNode = (this.getChild("tipNode"));
  4548. this.msgNode = (this.getChild("msgNode"));
  4549. }
  4550. }
  4551. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4552. class MoyuMgr {
  4553. static initMoyu() {
  4554. this.moyuView = new MoyuView();
  4555. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4556. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4557. this.moyuView.ui.displayObject.zOrder = 1000;
  4558. this.moyuView.init();
  4559. this.moyuView.showTip(true);
  4560. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4561. window['XApk'] = this;
  4562. }
  4563. static showAge(show) {
  4564. if (this.moyuView)
  4565. this.moyuView.showAge(show);
  4566. }
  4567. static onPlatMsg(idx) {
  4568. if (!MoyuMgr.moyuView)
  4569. return;
  4570. if (idx == '0') {
  4571. MoyuMgr.moyuView.showTip(false);
  4572. }
  4573. }
  4574. static showAgree(call) {
  4575. if (this.moyuView)
  4576. this.moyuView.showAgree(call);
  4577. else
  4578. call && call();
  4579. }
  4580. static showXy(type = 1) {
  4581. if (this.moyuView)
  4582. this.moyuView.showXy(type);
  4583. }
  4584. }
  4585. MoyuMgr.isAdvise = false;
  4586. class MoyuView {
  4587. constructor() {
  4588. this.ysxyNum = 1;
  4589. this.ysJson = null;
  4590. this.ui = ui_UIMoyu.createInstance();
  4591. }
  4592. init() {
  4593. this.ui.mainBg.visible = false;
  4594. this.ui.xyNode.visible = false;
  4595. this.ui.ageNode.visible = false;
  4596. this.ui.tipNode.visible = false;
  4597. this.ui.rnNode.visible = false;
  4598. this.ui.fcmNode.visible = false;
  4599. this.ui.ageTip.visible = false;
  4600. this.ui.msgNode.visible = false;
  4601. this.ui.visible = false;
  4602. this.ui.xyNode.xyList.setVirtual();
  4603. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4604. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4605. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4606. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4607. this.ui.xyNode.btnKnown.visible = false;
  4608. this.ui.xyNode.xy1.visible = false;
  4609. this.ui.xyNode.xy2.visible = false;
  4610. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4611. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4612. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4613. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4614. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4615. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4616. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4617. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4618. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4619. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4620. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4621. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4622. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4623. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4624. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4625. this.ysxyNum = 2;
  4626. }
  4627. }
  4628. onClick(obj) {
  4629. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4630. switch (obj) {
  4631. case this.ui.ageTip:
  4632. if (Moyu.isTTApk) {
  4633. this.ui.ageNode.visible = true;
  4634. this.ui.mainBg.visible = true;
  4635. }
  4636. break;
  4637. case this.ui.tipNode:
  4638. this.showTip(false);
  4639. break;
  4640. case this.ui.ageNode.btnAge:
  4641. this.ui.ageNode.visible = false;
  4642. this.ui.mainBg.visible = false;
  4643. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4644. this.ui.visible = false;
  4645. break;
  4646. case this.ui.xyNode.btnXy3:
  4647. case this.ui.xyNode.btnXy1:
  4648. this.loadXy(1);
  4649. break;
  4650. case this.ui.xyNode.btnXy2:
  4651. this.loadXy(2);
  4652. break;
  4653. case this.ui.xyNode.btnBack:
  4654. this.ui.xyNode.xy1.visible = true;
  4655. this.ui.xyNode.xy2.visible = false;
  4656. break;
  4657. case this.ui.xyNode.btnKnown:
  4658. this.ui.xyNode.visible = false;
  4659. this.ui.mainBg.visible = false;
  4660. this.ui.visible = false;
  4661. break;
  4662. case this.ui.rnNode.btnCheck:
  4663. this.check();
  4664. break;
  4665. case this.ui.rnNode.btnExit:
  4666. case this.ui.xyNode.btnNo:
  4667. this.ysxyNum--;
  4668. if (this.ysxyNum > 0)
  4669. this.showMsg("Refuse to quit the game once again");
  4670. else {
  4671. Moyu.userAgree(false);
  4672. Moyu.exit();
  4673. }
  4674. break;
  4675. case this.ui.xyNode.btnSure:
  4676. case this.ui.xyNode.btnYes:
  4677. DataMgr.userData.isAgree = true;
  4678. DataMgr.saveUserData();
  4679. this.onAgree();
  4680. break;
  4681. case this.ui.rnNode.btnDone:
  4682. this.ui.rnNode.visible = false;
  4683. this.ui.visible = false;
  4684. break;
  4685. case this.ui.fcmNode.btnRn:
  4686. this.showRn();
  4687. break;
  4688. }
  4689. }
  4690. showTip(show) {
  4691. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4692. return;
  4693. if (show) {
  4694. MoyuMgr.isAdvise = true;
  4695. this.ui.visible = true;
  4696. this.ui.tipNode.visible = true;
  4697. this.ui.tipNode.alpha = 1;
  4698. Laya.timer.once(1000, this, this.showTip, [false]);
  4699. }
  4700. else {
  4701. this.ui.tipNode.alpha = 1;
  4702. this.ui.tipNode.visible = true;
  4703. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4704. this.ui.tipNode.visible = false;
  4705. MoyuMgr.isAdvise = false;
  4706. }), 1000);
  4707. }
  4708. }
  4709. showAge(show, px = 0, py = 0) {
  4710. if (Moyu.platType > 10 && !Moyu.isIos) {
  4711. this.ui.ageTip.x = px;
  4712. this.ui.ageTip.y = py;
  4713. this.ui.ageTip.visible = show;
  4714. if (show)
  4715. this.ui.visible = true;
  4716. }
  4717. }
  4718. showAgree(call) {
  4719. this.agreeCall = call;
  4720. this.onAgree();
  4721. return;
  4722. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4723. this.showXy(0);
  4724. }
  4725. else
  4726. this.onAgree();
  4727. }
  4728. onAgree() {
  4729. if (!this.ui.ageNode.visible)
  4730. this.ui.visible = false;
  4731. this.ui.xyNode.visible = false;
  4732. Moyu.userAgree(true);
  4733. this.showAge(false);
  4734. this.agreeCall && this.agreeCall();
  4735. this.showRn();
  4736. }
  4737. showMsg(txt) {
  4738. this.ui.msgNode.txtMsg.text = txt;
  4739. this.ui.msgNode.visible = true;
  4740. this.ui.msgNode.alpha = 1;
  4741. this.ui.visible = true;
  4742. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4743. this.ui.msgNode.visible = false;
  4744. }), 2500, true);
  4745. }
  4746. showRn() {
  4747. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4748. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4749. this.ui.rnNode.rn1.visible = true;
  4750. this.ui.rnNode.rn2.visible = false;
  4751. this.ui.rnNode.rn3.visible = false;
  4752. this.ui.rnNode.rn4.visible = false;
  4753. this.ui.rnNode.visible = true;
  4754. this.ui.mainBg.visible = true;
  4755. this.ui.rnNode.btnDone.visible = false;
  4756. this.ui.rnNode.btnExit.visible = true;
  4757. this.ui.rnNode.btnCheck.visible = true;
  4758. this.ui.fcmNode.visible = false;
  4759. this.ui.visible = true;
  4760. return;
  4761. }
  4762. }
  4763. this.showFcm();
  4764. }
  4765. showFcm() {
  4766. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4767. Moyu.initFCM(true);
  4768. if (Moyu.gameTime < 1)
  4769. this.fcmLoop();
  4770. else if (Moyu.gameTime < 999)
  4771. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4772. }
  4773. }
  4774. fcmLoop() {
  4775. if (Moyu.gameTime < 1) {
  4776. this.ui.rnNode.visible = false;
  4777. this.ui.fcmNode.visible = true;
  4778. this.ui.mainBg.visible = true;
  4779. this.ui.visible = true;
  4780. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4781. Laya.timer.clear(this.ui, this.fcmLoop);
  4782. }
  4783. }
  4784. check() {
  4785. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4786. this.ui.rnNode.rn1.visible = false;
  4787. this.ui.rnNode.rn2.visible = false;
  4788. this.ui.rnNode.rn4.visible = true;
  4789. }
  4790. else if (this.ui.rnNode.rn4.visible) {
  4791. let name = this.ui.rnNode.inputName.text;
  4792. let code = this.ui.rnNode.inputCode.text;
  4793. if (code && code.length == 18) {
  4794. this.ui.rnNode.rn1.visible = false;
  4795. this.ui.rnNode.rn4.visible = false;
  4796. Moyu.authenticate(name, code, (res) => {
  4797. this.ui.rnNode.rn2.visible = !res;
  4798. this.ui.rnNode.rn3.visible = res;
  4799. this.ui.rnNode.btnDone.visible = res;
  4800. this.ui.rnNode.btnExit.visible = !res;
  4801. this.ui.rnNode.btnCheck.visible = !res;
  4802. if (res)
  4803. this.showFcm();
  4804. });
  4805. }
  4806. else
  4807. this.showMsg("信息填写不完整");
  4808. }
  4809. }
  4810. loadXy(type = 0) {
  4811. this.ui.xyNode.xy1.visible = false;
  4812. this.ui.xyNode.xy2.visible = true;
  4813. this.ui.xyNode.xyList.scrollToView(0);
  4814. if (type == 1) {
  4815. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4816. }
  4817. else if (type == 2) {
  4818. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4819. }
  4820. }
  4821. showXy(type = 0) {
  4822. this.xyBtn();
  4823. if (type == 0) {
  4824. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4825. this.ui.xyNode.btnSure.visible = true;
  4826. }
  4827. else {
  4828. this.ui.xyNode.btnYes.visible = true;
  4829. this.ui.xyNode.btnNo.visible = true;
  4830. }
  4831. }
  4832. else {
  4833. this.ui.xyNode.btnKnown.visible = true;
  4834. this.ui.mainBg.visible = true;
  4835. }
  4836. this.ui.xyNode.xy1.visible = true;
  4837. this.ui.xyNode.xy2.visible = false;
  4838. this.ui.xyNode.visible = true;
  4839. this.ui.visible = true;
  4840. }
  4841. xyBtn() {
  4842. this.ui.xyNode.btnSure.visible = false;
  4843. this.ui.xyNode.btnYes.visible = false;
  4844. this.ui.xyNode.btnNo.visible = false;
  4845. this.ui.xyNode.btnKnown.visible = false;
  4846. {
  4847. this.ui.xyNode.btnXy3.visible = false;
  4848. this.ui.xyNode.btnXy2.visible = true;
  4849. this.ui.xyNode.btnXy1.visible = true;
  4850. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4851. }
  4852. }
  4853. createXY(json) {
  4854. this.ysJson = json.content;
  4855. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4856. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4857. this.ui.xyNode.xy2.visible = true;
  4858. }
  4859. renderListItem(idx, cell) {
  4860. let xy = this.ysJson[idx];
  4861. cell.height = xy.line * 30;
  4862. cell.xyItem.text = xy.text;
  4863. }
  4864. onDestroy() {
  4865. this.agreeCall = null;
  4866. }
  4867. }
  4868. class SettingNode {
  4869. constructor(ui) {
  4870. this.showSetting = false;
  4871. this.openSound = true;
  4872. this.openShake = true;
  4873. this.ui = ui;
  4874. this.ui.soundBtn.onClick(this, this.switchSound);
  4875. this.ui.shakeBtn.onClick(this, this.switchShake);
  4876. this.ui.xyBtn.onClick(this, this.onXy);
  4877. this.ui.clickNode.onClick(this, this.changeSetting);
  4878. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4879. this.ui.xyBtn.visible = false;
  4880. this.ui.shakeBtn.visible = false;
  4881. }
  4882. changeSetting() {
  4883. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4884. this.showSetting = !this.showSetting;
  4885. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4886. }
  4887. switchSound() {
  4888. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4889. this.openSound = !this.openSound;
  4890. Moyu.onSetting(this.openSound, this.openShake);
  4891. xGame.soundMgr.onSetting(this.openSound);
  4892. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4893. }
  4894. switchShake() {
  4895. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4896. this.openShake = !this.openShake;
  4897. Moyu.onSetting(this.openSound, this.openShake);
  4898. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4899. }
  4900. onXy() {
  4901. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4902. MoyuMgr.showXy(1);
  4903. }
  4904. }
  4905. class ui_UILevelDisplay extends fgui.GComponent {
  4906. static createInstance() {
  4907. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4908. }
  4909. onConstruct() {
  4910. this.n9 = (this.getChild("n9"));
  4911. this.myNode = (this.getChild("myNode"));
  4912. this.closeNode = (this.getChild("closeNode"));
  4913. }
  4914. }
  4915. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4916. class ui_UILevelProp extends fgui.GComponent {
  4917. static createInstance() {
  4918. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4919. }
  4920. onConstruct() {
  4921. this.n16 = (this.getChild("n16"));
  4922. this.myNode = (this.getChild("myNode"));
  4923. this.closeBtn = (this.getChild("closeBtn"));
  4924. this.moneyNode = (this.getChild("moneyNode"));
  4925. this.t1 = this.getTransition("t1");
  4926. }
  4927. }
  4928. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4929. class ui_ShowItem extends fgui.GComponent {
  4930. static createInstance() {
  4931. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4932. }
  4933. onConstruct() {
  4934. this.myImg = (this.getChild("myImg"));
  4935. }
  4936. }
  4937. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4938. class ShowItem {
  4939. constructor() {
  4940. this.ui = ui_ShowItem.createInstance();
  4941. }
  4942. destroySelf() {
  4943. if (!this.ui.isDisposed) {
  4944. this.ui.removeFromParent();
  4945. this.ui.dispose();
  4946. }
  4947. }
  4948. setParent(parent) {
  4949. parent.addChild(this.ui);
  4950. }
  4951. setPos(x, y) {
  4952. this.ui.x = x;
  4953. this.ui.y = y;
  4954. }
  4955. setUrl(index) {
  4956. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4957. }
  4958. }
  4959. class ui_UIPower extends fgui.GComponent {
  4960. static createInstance() {
  4961. return (fgui.UIPackage.createObject("game", "UIPower"));
  4962. }
  4963. onConstruct() {
  4964. this.n11 = (this.getChild("n11"));
  4965. this.myNode = (this.getChild("myNode"));
  4966. this.t0 = this.getTransition("t0");
  4967. }
  4968. }
  4969. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4970. class UIPower extends UIBase {
  4971. constructor() {
  4972. super();
  4973. }
  4974. onConstructor() {
  4975. this.ui = ui_UIPower.createInstance();
  4976. this.contentPane = this.ui;
  4977. this.isEject = false;
  4978. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4979. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4980. }
  4981. show() {
  4982. super.show();
  4983. this.ui.t0.play();
  4984. }
  4985. videoGetPower() {
  4986. console.log('zh:qjff_AD_for_uipower');
  4987. if (Laya.Browser.onAndroid) {
  4988. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4989. if (!boo) {
  4990. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4991. return;
  4992. }
  4993. }
  4994. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4995. }
  4996. else {
  4997. console.log('zh:AD 失败,直接发放奖励');
  4998. this.qjff_AD_for_uipower();
  4999. }
  5000. }
  5001. qjff_AD_for_uipower() {
  5002. DataMgr.setPower(xGame.common.videoPower, true);
  5003. xGame.eventMgr.event(POWER_TIME);
  5004. this.hide();
  5005. }
  5006. }
  5007. UIPower.uiName = "UIPower";
  5008. class UILevelProp extends UIBase {
  5009. constructor() {
  5010. super();
  5011. this.firstPos = 385;
  5012. this.secondPos = 467;
  5013. this.showItemArr = [];
  5014. }
  5015. onFontLoaded() {
  5016. try {
  5017. this.ui.myNode.conditionTxt.font = "arial";
  5018. console.log("zh: onFontLoaded 设置arial字体成功");
  5019. }
  5020. catch (error) {
  5021. console.log("zh: constructor onFontLoaded加载arial字体失败");
  5022. }
  5023. }
  5024. onConstructor() {
  5025. this.ui = ui_UILevelProp.createInstance();
  5026. this.contentPane = this.ui;
  5027. this.isEject = false;
  5028. this.addUIClick(this.ui.closeBtn, this.hide);
  5029. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5030. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5031. }
  5032. show(level) {
  5033. super.show();
  5034. this.ui.t1.play();
  5035. this.level = level;
  5036. this.data = cfgTable.placeballData[this.level];
  5037. this.updateSelf();
  5038. this.showPreView();
  5039. this.moneyNode.ui.c1.selectedIndex = 2;
  5040. this.moneyNode.checkPowerTime();
  5041. this.moneyNode.powerChange();
  5042. }
  5043. showPreView() {
  5044. let item;
  5045. let data;
  5046. for (let index = 0; index < this.showItemArr.length; index++) {
  5047. item = this.showItemArr[index];
  5048. item.destroySelf();
  5049. }
  5050. this.showItemArr = [];
  5051. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5052. for (const key in cfgData) {
  5053. data = cfgData[key];
  5054. item = new ShowItem();
  5055. item.setParent(this.ui.myNode.displayRoot);
  5056. item.setPos(data.x, data.y);
  5057. item.setUrl(data.value);
  5058. this.showItemArr.push(item);
  5059. }
  5060. }
  5061. updateSelf() {
  5062. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5063. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5064. if (this.data.ball == -1) {
  5065. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5066. }
  5067. else {
  5068. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5069. }
  5070. let localData = DataMgr.getPlaceBallLevel(this.level);
  5071. let getAward = localData.getAward;
  5072. let cfg = cfgTable.placeballData[this.level];
  5073. let coin = this.data.award[0];
  5074. let diamond = this.data.award[1];
  5075. if (cfg.type == PlaceBallType.challenge) {
  5076. diamond = 0;
  5077. coin = 100;
  5078. }
  5079. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5080. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5081. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5082. if (cfg.type == PlaceBallType.challenge) {
  5083. this.ui.myNode.coinNode.numTxt.text = "";
  5084. }
  5085. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5086. if (coin > 0 && diamond > 0) {
  5087. this.ui.myNode.diamondNode.x = 385;
  5088. this.ui.myNode.coinNode.x = 467;
  5089. }
  5090. else {
  5091. this.ui.myNode.diamondNode.x = 385;
  5092. this.ui.myNode.coinNode.x = 385;
  5093. }
  5094. if (!getAward) {
  5095. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5096. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5097. }
  5098. else {
  5099. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5100. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5101. }
  5102. }
  5103. startGame() {
  5104. if (DataMgr.powerEnough()) {
  5105. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5106. this.ui.myNode.startBtn.touchable = false;
  5107. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5108. console.log('zh:startGame ');
  5109. this.ui.myNode.startBtn.touchable = true;
  5110. DataMgr.setPower(-1);
  5111. xGame.eventMgr.event(POWER_TIME);
  5112. xGame.common.gameMode = GameMode.placeBall;
  5113. xGame.common.placeBallCurLevel = this.level;
  5114. xGame.uiMgr.Show(UIGame);
  5115. this.logEventForChallenge_level_start(this.level);
  5116. xGame.uiMgr.Hide(UILevelDisplay);
  5117. xGame.uiMgr.Hide(UIMain);
  5118. this.hide();
  5119. }));
  5120. }
  5121. else {
  5122. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5123. xGame.uiMgr.Show(UIPower);
  5124. }
  5125. }
  5126. logEventForChallenge_level_start(level) {
  5127. let keyStr = 'sjmd_challenge_level_start';
  5128. let jsonStr = {
  5129. "count": 1,
  5130. "gold_balance ": DataMgr.getCoin(),
  5131. "level": level,
  5132. "diamond_balance ": DataMgr.getDiamond()
  5133. };
  5134. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5135. const d = LocalStorageManager.getItem(keyStr);
  5136. if (level > d.level) {
  5137. jsonStr.count = d.count + 1;
  5138. LocalStorageManager.setItem(keyStr, jsonStr);
  5139. }
  5140. else {
  5141. }
  5142. }
  5143. else {
  5144. LocalStorageManager.setItem(keyStr, jsonStr);
  5145. }
  5146. const reqStr = JSON.stringify(jsonStr);
  5147. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5148. }
  5149. hide() {
  5150. super.hide();
  5151. }
  5152. }
  5153. UILevelProp.uiName = "UILevelProp";
  5154. class PutBallLevelDisplay {
  5155. constructor(ui, index) {
  5156. this.index = 0;
  5157. this.ui = ui;
  5158. this.index = index;
  5159. this.ui.onClick(this, this.clickSelf);
  5160. this.updateSelf();
  5161. this.ui.levelTxt.text = (this.index + 1) + "";
  5162. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5163. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5164. }
  5165. updateSelf() {
  5166. let level = this.index + 1;
  5167. this.data = DataMgr.getPlaceBallLevel(level);
  5168. this.ui.starNode.c1.selectedIndex = this.data.star;
  5169. let isChallenge = cfgTable.placeballData[level].type;
  5170. if (this.data.isCur) {
  5171. if (isChallenge) {
  5172. this.ui.c1.selectedIndex = 5;
  5173. }
  5174. else {
  5175. this.ui.c1.selectedIndex = 2;
  5176. }
  5177. }
  5178. else {
  5179. if (this.data.play) {
  5180. if (this.data.star == 3) {
  5181. this.ui.c1.selectedIndex = 0;
  5182. }
  5183. else {
  5184. this.ui.c1.selectedIndex = 1;
  5185. }
  5186. }
  5187. else {
  5188. if (isChallenge) {
  5189. this.ui.c1.selectedIndex = 4;
  5190. }
  5191. else {
  5192. this.ui.c1.selectedIndex = 3;
  5193. }
  5194. }
  5195. }
  5196. }
  5197. clickSelf() {
  5198. if (!this.data.play)
  5199. return;
  5200. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5201. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5202. }
  5203. }
  5204. class UILevelDisplay extends UIBase {
  5205. constructor() {
  5206. super();
  5207. }
  5208. onConstructor() {
  5209. this.ui = ui_UILevelDisplay.createInstance();
  5210. this.contentPane = this.ui;
  5211. this.isEject = false;
  5212. this.myList = this.ui.myNode.myList;
  5213. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5214. this.levelItemArr = [];
  5215. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5216. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5217. this.myList.numItems = levelNum;
  5218. if (Moyu.isKs)
  5219. this.ui.closeNode.closeBtn.x += 100;
  5220. }
  5221. levelItemRender(index, target) {
  5222. let item = new PutBallLevelDisplay(target, index);
  5223. this.levelItemArr.push(item);
  5224. }
  5225. show() {
  5226. super.show();
  5227. this.updateLevel();
  5228. this.scrollToPlace();
  5229. }
  5230. updateLevel() {
  5231. let temp;
  5232. for (let index = 0; index < this.levelItemArr.length; index++) {
  5233. temp = this.levelItemArr[index];
  5234. temp.updateSelf();
  5235. }
  5236. }
  5237. scrollToPlace() {
  5238. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5239. let passArr = DataMgr.getPlaceBallLevelList();
  5240. let offest = passArr.length;
  5241. if (offest >= maxNum - 1)
  5242. offest = maxNum - 1;
  5243. this.myList.scrollToView(offest, true, true);
  5244. }
  5245. hide() {
  5246. super.hide();
  5247. }
  5248. }
  5249. UILevelDisplay.uiName = "UILevelDisplay";
  5250. class ui_UIMatching extends fgui.GComponent {
  5251. static createInstance() {
  5252. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5253. }
  5254. onConstruct() {
  5255. this.n5 = (this.getChild("n5"));
  5256. this.n49 = (this.getChild("n49"));
  5257. this.n51 = (this.getChild("n51"));
  5258. this.n64 = (this.getChild("n64"));
  5259. this.n2 = (this.getChild("n2"));
  5260. this.n53 = (this.getChild("n53"));
  5261. this.n54 = (this.getChild("n54"));
  5262. this.n56 = (this.getChild("n56"));
  5263. this.n58 = (this.getChild("n58"));
  5264. this.n59 = (this.getChild("n59"));
  5265. this.n57 = (this.getChild("n57"));
  5266. this.n60 = (this.getChild("n60"));
  5267. this.n62 = (this.getChild("n62"));
  5268. this.awardTxt = (this.getChild("awardTxt"));
  5269. this.n61 = (this.getChild("n61"));
  5270. this.selfHead = (this.getChild("selfHead"));
  5271. this.aiHead = (this.getChild("aiHead"));
  5272. this.n82 = (this.getChild("n82"));
  5273. this.n84 = (this.getChild("n84"));
  5274. this.n83 = (this.getChild("n83"));
  5275. this.t1 = this.getTransition("t1");
  5276. this.t2 = this.getTransition("t2");
  5277. this.t3 = this.getTransition("t3");
  5278. this.t4 = this.getTransition("t4");
  5279. }
  5280. }
  5281. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5282. class UIMatching extends UIBase {
  5283. constructor() {
  5284. super();
  5285. }
  5286. onConstructor() {
  5287. this.ui = ui_UIMatching.createInstance();
  5288. this.contentPane = this.ui;
  5289. this.isEject = false;
  5290. }
  5291. show(callback) {
  5292. super.show();
  5293. PlatMgr.showBanner(true);
  5294. this.callback = callback;
  5295. let user = Moyu.getUserInfo();
  5296. if (!this.selfPot) {
  5297. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5298. }
  5299. if (!this.aiPot) {
  5300. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5301. }
  5302. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5303. this.ui.selfHead.nameTxt.text = user.nickName;
  5304. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5305. this.ui.aiHead.nameTxt.text = "???";
  5306. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5307. this.ui.selfHead.c1.selectedIndex = 0;
  5308. this.ui.aiHead.c1.selectedIndex = 0;
  5309. this.ui.selfHead.x = this.selfPot.x;
  5310. this.ui.selfHead.y = this.selfPot.y;
  5311. this.ui.aiHead.x = this.aiPot.x;
  5312. this.ui.aiHead.y = this.aiPot.y;
  5313. switch (xGame.common.gameMode) {
  5314. case GameMode.classic:
  5315. break;
  5316. case GameMode.bigMove:
  5317. this.initSkillData();
  5318. break;
  5319. default:
  5320. break;
  5321. }
  5322. this.ui.t1.play(Laya.Handler.create(this, () => {
  5323. this.ui.t2.play(Laya.Handler.create(this, () => {
  5324. switch (xGame.common.gameMode) {
  5325. case GameMode.classic:
  5326. this.waitingPeople();
  5327. break;
  5328. case GameMode.bigMove:
  5329. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5330. break;
  5331. default:
  5332. break;
  5333. }
  5334. }));
  5335. }));
  5336. }
  5337. initSkillData() {
  5338. this.skillSelectData = [];
  5339. let skillUrl = xGame.common.skillIconList;
  5340. let skillName = xGame.common.skillNameList;
  5341. let skillLevel = DataMgr.getBigSkillList();
  5342. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5343. for (let index = 0; index < 5; index++) {
  5344. let obj = {};
  5345. obj.skillImg = skillUrl[index];
  5346. obj.skillName = skillName[index];
  5347. obj.skillType = skillType[index];
  5348. obj.skillLevel = skillLevel[index];
  5349. this.skillSelectData.push(obj);
  5350. }
  5351. }
  5352. getAISkillLevel(myLevel) {
  5353. let video = xGame.common.upSkillLevel;
  5354. let aiLevel;
  5355. let temp;
  5356. if (video) {
  5357. temp = xGame.common.randomNum(-2, -1);
  5358. }
  5359. else {
  5360. if (myLevel <= 5) {
  5361. temp = xGame.common.randomNum(1, 3);
  5362. }
  5363. else if (myLevel <= 9) {
  5364. temp = xGame.common.randomNum(-2, 1);
  5365. }
  5366. else {
  5367. temp = xGame.common.randomNum(-4, 0);
  5368. }
  5369. }
  5370. aiLevel = temp + myLevel;
  5371. if (aiLevel <= 1)
  5372. aiLevel = 1;
  5373. if (aiLevel >= 10)
  5374. aiLevel = 10;
  5375. return aiLevel;
  5376. }
  5377. getAISkillType() {
  5378. return xGame.common.randomNum(1, 4);
  5379. let successTimes = DataMgr.getSkillSuccessTimes();
  5380. let info = cfgTable.aiskillData[successTimes];
  5381. if (!info) {
  5382. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5383. info = cfgTable.aiskillData[max];
  5384. }
  5385. let dataArr = info.skillselect;
  5386. let myCfg = {};
  5387. for (let index = 0; index < dataArr.length; index++) {
  5388. let temp = dataArr[index].split('-');
  5389. myCfg[temp[0]] = {};
  5390. myCfg[temp[0]].id = parseInt(temp[0]);
  5391. myCfg[temp[0]].weight = parseInt(temp[1]);
  5392. }
  5393. let aiCfg = xGame.common.initWeight(myCfg);
  5394. let curData = xGame.common.getRandomWeightData(aiCfg);
  5395. return parseInt(curData.id);
  5396. }
  5397. getAISkillData(index) {
  5398. let myLevel = this.skillSelectData[index].skillLevel;
  5399. let aiLevel = this.getAISkillLevel(myLevel);
  5400. let aiType = this.getAISkillType() - 1;
  5401. return { aiLevel, aiType } = { aiLevel, aiType };
  5402. }
  5403. skillSelectFinish(index) {
  5404. let aiInfo = this.getAISkillData(index);
  5405. xGame.common.gameMgr.selfCurSkill = index;
  5406. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5407. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5408. this.ui.selfHead.c1.selectedIndex = 1;
  5409. this.ui.aiHead.c1.selectedIndex = 1;
  5410. let myData = this.skillSelectData[index];
  5411. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5412. let guide = DataMgr.getSkillGuide();
  5413. if (guide == 0) {
  5414. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5415. }
  5416. else {
  5417. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5418. }
  5419. let aiData = this.skillSelectData[aiInfo.aiType];
  5420. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5421. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5422. this.waitingPeople();
  5423. }
  5424. waitingPeople() {
  5425. let time = xGame.common.randomNum(1000, 3000);
  5426. time += 1000;
  5427. Laya.timer.once(time, this, () => {
  5428. this.matchingSuccess();
  5429. });
  5430. }
  5431. matchingSuccess() {
  5432. let gameUI = xGame.common.gameUI;
  5433. let name = gameUI.ui.topNode.aiNameTxt.text;
  5434. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5435. this.ui.aiHead.nameTxt.text = name;
  5436. this.ui.aiHead.headImg.url = url;
  5437. name = gameUI.ui.topNode.selfNameTxt.text;
  5438. url = gameUI.ui.topNode.selfHeadLoader.url;
  5439. this.ui.selfHead.nameTxt.text = name;
  5440. this.ui.selfHead.headImg.url = url;
  5441. this.ui.t3.play(Laya.Handler.create(this, () => {
  5442. this.callback && this.callback();
  5443. this.ui.t4.play(Laya.Handler.create(this, () => {
  5444. this.destroySelf();
  5445. }));
  5446. }));
  5447. }
  5448. destroySelf() {
  5449. this.callback = null;
  5450. this.skillSelectData = null;
  5451. this.selfPot = null;
  5452. this.aiPot = null;
  5453. if (!this.ui.isDisposed) {
  5454. this.ui.removeFromParent();
  5455. this.ui.dispose();
  5456. }
  5457. xGame.uiMgr.destroyUI(this);
  5458. }
  5459. }
  5460. UIMatching.uiName = "UIMatching";
  5461. class ui_UIRanking extends fgui.GComponent {
  5462. static createInstance() {
  5463. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5464. }
  5465. onConstruct() {
  5466. this.n26 = (this.getChild("n26"));
  5467. this.myNode = (this.getChild("myNode"));
  5468. }
  5469. }
  5470. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5471. class UIRanking extends UIBase {
  5472. constructor() {
  5473. super();
  5474. this.showSelf = true;
  5475. this.rankType = 1;
  5476. this.rankList = [];
  5477. this.topX = 10;
  5478. this.myIndex = this.topX + 1;
  5479. this.myStar = 0;
  5480. }
  5481. onConstructor() {
  5482. this.ui = ui_UIRanking.createInstance();
  5483. this.contentPane = this.ui;
  5484. this.isEject = false;
  5485. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5486. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5487. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5488. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5489. this.ui.myNode.myList.setVirtual();
  5490. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5491. }
  5492. show() {
  5493. super.show();
  5494. this.getPaiHangBangDataFormJosnFile();
  5495. this.updateSelf();
  5496. let self = Moyu.getUserInfo();
  5497. if (!self.isAuth) {
  5498. Moyu.initUser(this, () => {
  5499. DataMgr.upRankData();
  5500. });
  5501. }
  5502. }
  5503. getPaiHangBangDataFormJosnFile() {
  5504. const rankingList = cfgTable.paiHangBangData.list;
  5505. this.updateItemData(rankingList);
  5506. }
  5507. updateSelfItem() {
  5508. console.log('zh:Moyu.platType =' + Moyu.platType);
  5509. let self = Moyu.getUserInfo();
  5510. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5511. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5512. if (this.myIndex > this.topX) {
  5513. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5514. }
  5515. else {
  5516. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5517. }
  5518. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5519. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5520. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5521. }
  5522. updateItemData(data) {
  5523. this.myStar = xGame.common.getAllStarNum();
  5524. if (this.rankList.length < 2) {
  5525. this.rankList = data;
  5526. let self = Moyu.getUserInfo();
  5527. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5528. self.headIcon = self.headIcon;
  5529. for (let i = 0; i < data.length; i++) {
  5530. let data = this.rankList[i];
  5531. if (data.userId == self.userId) {
  5532. this.rankList.splice(i, 1);
  5533. break;
  5534. }
  5535. }
  5536. for (let i = 0; i < data.length; i++) {
  5537. let data = this.rankList[i];
  5538. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5539. this.myIndex = i + 1;
  5540. let user = { headIcon: self.headIcon, nickName: "myself" };
  5541. let ud = { user: user, data: {} };
  5542. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5543. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5544. if (Moyu.platType < 11) {
  5545. user.headIcon = self.headIcon;
  5546. user.nickName = self.nickName;
  5547. }
  5548. this.rankList.splice(i, 0, md);
  5549. break;
  5550. }
  5551. }
  5552. }
  5553. this.updateSelfItem();
  5554. this.ui.myNode.myList.numItems = this.rankList.length;
  5555. }
  5556. updateItemUI(index, obj) {
  5557. let data = this.rankList[index];
  5558. let userData = JSON.parse(data.userData).user;
  5559. obj.nameTxt.text = userData.nickName.toString();
  5560. obj.valueTxt.text = data.rankScore;
  5561. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5562. obj.rankTxt.text = index + 1;
  5563. switch (index) {
  5564. case 0:
  5565. this.setImg(obj, 1, 0, 0);
  5566. obj.rankTxt.color = "#FFC047";
  5567. break;
  5568. case 1:
  5569. this.setImg(obj, 0, 1, 0);
  5570. obj.rankTxt.color = "#ACACAC";
  5571. break;
  5572. case 2:
  5573. this.setImg(obj, 0, 0, 1);
  5574. obj.rankTxt.color = "#D09672";
  5575. break;
  5576. default:
  5577. this.setImg(obj, 0, 0, 0);
  5578. obj.rankTxt.color = "#496FAB";
  5579. break;
  5580. }
  5581. }
  5582. setImg(obj, a, b, c) {
  5583. obj.img1.visible = a ? true : false;
  5584. obj.img2.visible = b ? true : false;
  5585. obj.img3.visible = c ? true : false;
  5586. }
  5587. changeList(type) {
  5588. this.rankType = type;
  5589. this.updateSelf();
  5590. }
  5591. changeSelfNode() {
  5592. this.showSelf = !this.showSelf;
  5593. this.updateSelf();
  5594. }
  5595. updateSelf() {
  5596. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5597. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5598. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5599. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5600. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5601. }
  5602. }
  5603. UIRanking.uiName = "UIRanking";
  5604. class ui_UISecretary extends fgui.GComponent {
  5605. static createInstance() {
  5606. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5607. }
  5608. onConstruct() {
  5609. this.n0 = (this.getChild("n0"));
  5610. this.myNode = (this.getChild("myNode"));
  5611. this.closeBtn = (this.getChild("closeBtn"));
  5612. this.t0 = this.getTransition("t0");
  5613. }
  5614. }
  5615. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5616. class UISecretary extends UIBase {
  5617. constructor() {
  5618. super();
  5619. this.curIndex = 1;
  5620. }
  5621. onConstructor() {
  5622. this.ui = ui_UISecretary.createInstance();
  5623. this.contentPane = this.ui;
  5624. this.isEject = false;
  5625. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5626. this.nodeObj = { left: null, right: null, cur: null };
  5627. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5628. }
  5629. show() {
  5630. super.show();
  5631. this.ui.t0.play();
  5632. this.updateData();
  5633. }
  5634. addSecretarySpine(node, spineName) {
  5635. if (spineName == "mishu") {
  5636. if (this.secretarySpine1) {
  5637. node.displayObject.destroyChildren();
  5638. this.playWoman(this.secretarySpine1, node.displayObject);
  5639. }
  5640. else {
  5641. let spine1 = new SpineMgr("mishu", () => {
  5642. this.secretarySpine1 = spine1;
  5643. this.playWoman(this.secretarySpine1, node.displayObject);
  5644. });
  5645. }
  5646. }
  5647. else {
  5648. if (this.secretarySpine2) {
  5649. node.displayObject.destroyChildren();
  5650. this.playWoman(this.secretarySpine2, node.displayObject);
  5651. }
  5652. else {
  5653. let spine2 = new SpineMgr("xiaomishu2", () => {
  5654. this.secretarySpine2 = spine2;
  5655. this.playWoman(this.secretarySpine2, node.displayObject);
  5656. });
  5657. }
  5658. }
  5659. }
  5660. playWoman(node, parent) {
  5661. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5662. let yy = this.ui.myNode.gameNode3.secretary.height;
  5663. let scale = 1.5;
  5664. if (node == this.secretarySpine2) {
  5665. scale = 1.2;
  5666. }
  5667. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5668. node.play(data, 0, true, parent);
  5669. }
  5670. turnLeft() {
  5671. this.curIndex--;
  5672. if (this.curIndex < 1) {
  5673. this.curIndex = 2;
  5674. }
  5675. let left = this.nodeObj.left;
  5676. let right = this.nodeObj.right;
  5677. let cur = this.nodeObj.cur;
  5678. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5679. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5680. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5681. this.updateData();
  5682. }));
  5683. this.ui.myNode.setChildIndex(right, 2);
  5684. this.nodeObj.left = cur;
  5685. this.nodeObj.right = left;
  5686. this.nodeObj.cur = right;
  5687. }
  5688. turnRight() {
  5689. this.curIndex++;
  5690. if (this.curIndex > 2) {
  5691. this.curIndex = 1;
  5692. }
  5693. let left = this.nodeObj.left;
  5694. let right = this.nodeObj.right;
  5695. let cur = this.nodeObj.cur;
  5696. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5697. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5698. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5699. this.updateData();
  5700. }));
  5701. this.ui.myNode.setChildIndex(left, 2);
  5702. this.nodeObj.left = right;
  5703. this.nodeObj.right = cur;
  5704. this.nodeObj.cur = left;
  5705. }
  5706. updateData() {
  5707. console.log('zh: updateData FFFFFFFFFF');
  5708. let data = cfgTable.secretaryshopData;
  5709. let children = this.ui.myNode._children;
  5710. let temp;
  5711. let curData;
  5712. for (let index = 0; index < children.length; index++) {
  5713. temp = children[index];
  5714. curData = data[1];
  5715. temp.heightTxt.text = curData.height;
  5716. temp.foodTxt.text = curData.food;
  5717. temp.historyTxt.text = curData.history;
  5718. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5719. this.addSecretarySpine(temp.secretary, curData.spine);
  5720. let womanIndex = curData.id - 1;
  5721. let getWoman = DataMgr.getSecretary(womanIndex);
  5722. let curUse = DataMgr.getCurSecretary();
  5723. if (getWoman) {
  5724. if (curUse == womanIndex) {
  5725. temp.purchaseBtn.c1.selectedIndex = 1;
  5726. }
  5727. else {
  5728. temp.purchaseBtn.c1.selectedIndex = 2;
  5729. }
  5730. }
  5731. else {
  5732. temp.purchaseBtn.c1.selectedIndex = 0;
  5733. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5734. }
  5735. temp.purchaseBtn.visible = false;
  5736. }
  5737. }
  5738. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5739. console.log('zh: 点击了clickSecretary ');
  5740. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5741. if (getWoman) {
  5742. if (curUse != womanIndex) {
  5743. console.log();
  5744. DataMgr.setCurSecretary(womanIndex);
  5745. this.updateData();
  5746. }
  5747. }
  5748. else {
  5749. console.log('zh:点击购买了');
  5750. let need = needDiamond;
  5751. if (DataMgr.diamondEnough(need)) {
  5752. DataMgr.setDiamond(-need);
  5753. DataMgr.setSecretary(womanIndex, 1);
  5754. DataMgr.setCurSecretary(womanIndex);
  5755. this.updateData();
  5756. }
  5757. else {
  5758. xGame.uiMgr.Show(UIAddProp, 1);
  5759. }
  5760. }
  5761. }
  5762. closeSelf() {
  5763. this.hide();
  5764. }
  5765. }
  5766. UISecretary.uiName = "UISecretary";
  5767. class ui_UIShop extends fgui.GComponent {
  5768. static createInstance() {
  5769. return (fgui.UIPackage.createObject("game", "UIShop"));
  5770. }
  5771. onConstruct() {
  5772. this.n48 = (this.getChild("n48"));
  5773. this.n0 = (this.getChild("n0"));
  5774. this.secretary = (this.getChild("secretary"));
  5775. this.talkNode = (this.getChild("talkNode"));
  5776. this.closeNode = (this.getChild("closeNode"));
  5777. this.moneyNode = (this.getChild("moneyNode"));
  5778. this.myNode = (this.getChild("myNode"));
  5779. }
  5780. }
  5781. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5782. class ui_UIMsg extends fgui.GComponent {
  5783. static createInstance() {
  5784. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5785. }
  5786. onConstruct() {
  5787. this.tipsNode = (this.getChild("tipsNode"));
  5788. }
  5789. }
  5790. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5791. class UIMsg extends UIBase {
  5792. constructor() {
  5793. super();
  5794. }
  5795. onConstructor() {
  5796. this.ui = ui_UIMsg.createInstance();
  5797. this.contentPane = this.ui;
  5798. this.isEject = false;
  5799. this.isMuti = true;
  5800. }
  5801. show(msg, callback) {
  5802. super.show();
  5803. this.ui.tipsNode.msgTxt.text = msg;
  5804. this.ui.alpha = 1;
  5805. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5806. this.hide();
  5807. callback && callback();
  5808. }), 1000);
  5809. }
  5810. }
  5811. UIMsg.uiName = "UIMsg";
  5812. class BallRodDisplay {
  5813. constructor(ui, index) {
  5814. this.index = 0;
  5815. this.uiIndex = 0;
  5816. this.ui = ui;
  5817. this.index = index;
  5818. this.initData();
  5819. }
  5820. initData() {
  5821. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5822. let data = cfgTable.ballrodData[this.index + 1];
  5823. this.ui.nameTxt.text = data.name;
  5824. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5825. this.ui.levelNode.c1.selectedIndex = data.quality;
  5826. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5827. if (data.spine) {
  5828. this.mySpine = new SpineMgr(data.spine, () => {
  5829. let xx = 150;
  5830. let yy = 70;
  5831. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5832. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5833. });
  5834. }
  5835. }
  5836. updateSelf() {
  5837. console.log('zh:updateSelf -------------- ');
  5838. let get = DataMgr.getBallRod(this.index);
  5839. if (get == null)
  5840. get = 1;
  5841. let curUse = DataMgr.getCurBallRod();
  5842. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5843. if (get) {
  5844. if (curUse == this.index) {
  5845. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5846. }
  5847. else {
  5848. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5849. }
  5850. }
  5851. else {
  5852. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5853. }
  5854. }
  5855. buyBallRod() {
  5856. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5857. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5858. switch (selectedIndex) {
  5859. case 0:
  5860. break;
  5861. case 1:
  5862. console.log('zh:点击了 USE THIS');
  5863. DataMgr.setCurBallRod(this.index);
  5864. let curUse = DataMgr.getCurBallRod();
  5865. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5866. let ui = xGame.uiMgr.getUI(UIShop);
  5867. ui.updateBallRod();
  5868. break;
  5869. case 2:
  5870. let data = cfgTable.ballrodData[this.index + 1];
  5871. let need = data.price;
  5872. if (DataMgr.diamondEnough(need)) {
  5873. this.buyQiuGan(data);
  5874. DataMgr.setDiamond(-need);
  5875. DataMgr.setBallRod(this.index, 1);
  5876. DataMgr.setCurBallRod(this.index);
  5877. let ui = xGame.uiMgr.getUI(UIShop);
  5878. ui.updateBallRod();
  5879. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5880. }
  5881. else {
  5882. xGame.uiMgr.Show(UIAddProp, 1);
  5883. }
  5884. break;
  5885. default:
  5886. break;
  5887. }
  5888. }
  5889. buyQiuGan(qgItem) {
  5890. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5891. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5892. if (userInfo == null) {
  5893. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5894. return;
  5895. }
  5896. let reqData = xGame.httpMgr.getReqData();
  5897. let pd = JSON.parse(reqData);
  5898. pd.qiuGanData = qgItem;
  5899. reqData = JSON.stringify(pd);
  5900. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5901. try {
  5902. console.log('zh:buySp res = ' + JSON.stringify(res));
  5903. let code = res.code;
  5904. let msg = res.msg;
  5905. if (code == 401) {
  5906. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5907. alert(TIP_MSG_key.loginTimeOut);
  5908. xGame.uiMgr.Show(UIMsg, msg);
  5909. return;
  5910. }
  5911. if (code == 200) {
  5912. xGame.uiMgr.Show(UIMsg, msg);
  5913. DataMgr.getUserZiChanInfo();
  5914. }
  5915. else {
  5916. xGame.uiMgr.Show(UIMsg, msg);
  5917. }
  5918. }
  5919. catch (error) {
  5920. console.log('error=' + error);
  5921. alert(error);
  5922. }
  5923. finally {
  5924. }
  5925. });
  5926. }
  5927. logEventForGouMaiGan(qiuGanName) {
  5928. const ev = {
  5929. value: qiuGanName
  5930. };
  5931. const jsonStr = JSON.stringify(ev);
  5932. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5933. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5934. }
  5935. }
  5936. class DaoJuDisplay {
  5937. constructor(ui, index) {
  5938. this.index = 0;
  5939. this.uiIndex = 0;
  5940. this.ggSpid = "";
  5941. this.spid = 0;
  5942. this.ui = ui;
  5943. this.index = index;
  5944. this.initData();
  5945. }
  5946. initData() {
  5947. this.ui.btn_buy.onClick(this, this.gotoBuy);
  5948. let data = cfgTable.daoJuData[this.index + 1];
  5949. console.log('zh:' + JSON.stringify(data));
  5950. this.ui.nameTxt.text = data.spbt;
  5951. this.ui.n_jiaGe.text = data.spjg + "";
  5952. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5953. this.ggSpid = data.ggSpid;
  5954. this.spid = data.spid;
  5955. let baseUrl = "asset/sound/ogg/";
  5956. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5957. }
  5958. gotoBuy() {
  5959. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5960. if (userInfo != null) {
  5961. let token = userInfo.token;
  5962. let ggSpid = this.ggSpid;
  5963. let spid = this.spid;
  5964. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  5965. console.log('zh:gotoBuy1 spid =' + spid);
  5966. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  5967. return;
  5968. }
  5969. else {
  5970. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5971. }
  5972. }
  5973. gotoBuy1() {
  5974. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5975. let djItem = cfgTable.daoJuData[this.index + 1];
  5976. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5977. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5978. if (userInfo == null) {
  5979. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5980. return;
  5981. }
  5982. let reqData = xGame.httpMgr.getReqData();
  5983. let pd = JSON.parse(reqData);
  5984. pd.spItem = djItem;
  5985. reqData = JSON.stringify(pd);
  5986. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5987. try {
  5988. console.log('zh:buySp res = ' + JSON.stringify(res));
  5989. let code = res.code;
  5990. let msg = res.msg;
  5991. if (code == 401) {
  5992. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5993. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5994. return;
  5995. }
  5996. if (code == 200) {
  5997. xGame.uiMgr.Show(UIMsg, msg);
  5998. DataMgr.getUserZiChanInfo();
  5999. }
  6000. else {
  6001. xGame.uiMgr.Show(UIMsg, msg);
  6002. }
  6003. }
  6004. catch (error) {
  6005. console.log('error=' + error);
  6006. alert(error);
  6007. }
  6008. finally {
  6009. }
  6010. });
  6011. }
  6012. }
  6013. class UIShop extends UIBase {
  6014. constructor() {
  6015. super();
  6016. this.itemNums = 0;
  6017. this.itemNumsForDj = 0;
  6018. this.curType = "";
  6019. }
  6020. onConstructor() {
  6021. this.ui = ui_UIShop.createInstance();
  6022. this.contentPane = this.ui;
  6023. this.isEject = false;
  6024. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6025. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6026. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6027. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6028. this.addUIClick(this.ui, this.interuptSecretary);
  6029. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6030. this.ballRodArr = [];
  6031. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6032. this.ui.myNode.myList.numItems = this.itemNums;
  6033. this.loadDjdata_old();
  6034. }
  6035. loadDjdata_old() {
  6036. let fff = cfgTable.daoJuData;
  6037. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6038. this.daoJuArr = [];
  6039. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6040. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6041. }
  6042. getProductList() {
  6043. let reqData = xGame.httpMgr.getReqData();
  6044. let pd = JSON.parse(reqData);
  6045. pd.splx = "Consumable";
  6046. reqData = JSON.stringify(pd);
  6047. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6048. try {
  6049. let code = res.code;
  6050. let msg = res.msg;
  6051. if (code == 401) {
  6052. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6053. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6054. return;
  6055. }
  6056. if (code == 200) {
  6057. let data = res.data;
  6058. for (let index = 0; index < data.length; index++) {
  6059. let element = data[index];
  6060. cfgTable.daoJuData[element.spid] = element;
  6061. }
  6062. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6063. }
  6064. else {
  6065. xGame.uiMgr.Show(UIMsg, msg);
  6066. }
  6067. }
  6068. catch (error) {
  6069. console.log('error=' + error);
  6070. alert(error);
  6071. }
  6072. finally {
  6073. }
  6074. });
  6075. }
  6076. show(type) {
  6077. super.show();
  6078. this.curType = type == 0 ? "qiugan" : "daoju";
  6079. this.switchBtn("qiugan");
  6080. this.playSecretaryIdle();
  6081. this.updateBallRod();
  6082. }
  6083. test123() {
  6084. console.log('zh:test123 ');
  6085. }
  6086. switchBtn(type) {
  6087. console.log('zh:1111切換 sel type=' + type);
  6088. if (type == "") {
  6089. type = this.curType;
  6090. }
  6091. else {
  6092. if (this.curType == type) {
  6093. return;
  6094. }
  6095. else {
  6096. this.curType = type;
  6097. }
  6098. }
  6099. if (type == "qiugan") {
  6100. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6101. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6102. this.ui.myNode.c1.selectedIndex = 0;
  6103. this.ui.myNode.myList.visible = true;
  6104. this.ui.myNode.djList.visible = false;
  6105. }
  6106. else {
  6107. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6108. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6109. this.ui.myNode.c1.selectedIndex = 1;
  6110. this.ui.myNode.myList.visible = false;
  6111. this.ui.myNode.djList.visible = true;
  6112. }
  6113. }
  6114. updateBallRod() {
  6115. for (let index = 0; index < this.ballRodArr.length; index++) {
  6116. this.ballRodArr[index].updateSelf();
  6117. }
  6118. }
  6119. renderBallRod(sort, obj) {
  6120. let index = this.getIndexBySort(sort + 1) - 1;
  6121. let ballRod = new BallRodDisplay(obj, index);
  6122. this.ballRodArr.push(ballRod);
  6123. }
  6124. renderDaoJu(idx, obj) {
  6125. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6126. let b = new DaoJuDisplay(obj, index);
  6127. this.daoJuArr.push(b);
  6128. }
  6129. getIndexBySort(sort) {
  6130. let object = cfgTable.ballrodData;
  6131. for (const key in object) {
  6132. if (object[key].sort == sort) {
  6133. return parseInt(key);
  6134. }
  6135. }
  6136. }
  6137. getIndexBySortForDj(idx) {
  6138. let object = cfgTable.daoJuData;
  6139. for (const key in object) {
  6140. if (object[key].idx == idx) {
  6141. return parseInt(key);
  6142. }
  6143. }
  6144. }
  6145. playSecretaryIdle() {
  6146. let parent = this.ui.secretary.displayObject;
  6147. parent.destroyChildren();
  6148. let xx = this.ui.secretary.width / 2;
  6149. let yy = this.ui.secretary.height;
  6150. let scale = xGame.common.getSecretaryScale();
  6151. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6152. xGame.common.secretary.play(data, 0, true, parent);
  6153. }
  6154. interuptSecretary() {
  6155. Laya.timer.clearAll(this);
  6156. this.playSecretaryRandomSound();
  6157. }
  6158. playSecretaryRandomSound() {
  6159. if (this.isHide)
  6160. return;
  6161. let time = xGame.common.randomNum(45000, 60000);
  6162. Laya.timer.once(time, this, () => {
  6163. if (this.isHide)
  6164. return;
  6165. let index = xGame.common.randomNum(4, 7);
  6166. xGame.soundMgr.playSound("s_main0" + index);
  6167. let words = 1;
  6168. switch (index) {
  6169. case 4:
  6170. words = 5;
  6171. break;
  6172. case 5:
  6173. words = 3;
  6174. break;
  6175. case 6:
  6176. words = 6;
  6177. break;
  6178. case 7:
  6179. words = 7;
  6180. break;
  6181. default:
  6182. break;
  6183. }
  6184. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6185. this.playSecretaryRandomSound();
  6186. });
  6187. }
  6188. closeSelf() {
  6189. this.hide();
  6190. }
  6191. }
  6192. UIShop.uiName = "UIShop";
  6193. class ui_UISign extends fgui.GComponent {
  6194. static createInstance() {
  6195. return (fgui.UIPackage.createObject("game", "UISign"));
  6196. }
  6197. onConstruct() {
  6198. this.n6 = (this.getChild("n6"));
  6199. this.closeNode = (this.getChild("closeNode"));
  6200. this.myNode = (this.getChild("myNode"));
  6201. this.moneyNode = (this.getChild("moneyNode"));
  6202. this.secretary = (this.getChild("secretary"));
  6203. this.talkNode = (this.getChild("talkNode"));
  6204. this.tripleBtn = (this.getChild("tripleBtn"));
  6205. this.normalBtn = (this.getChild("normalBtn"));
  6206. this.tipsNode = (this.getChild("tipsNode"));
  6207. this.againBtn = (this.getChild("againBtn"));
  6208. this.t0 = this.getTransition("t0");
  6209. }
  6210. }
  6211. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6212. class SignMax {
  6213. constructor(ui) {
  6214. this.ui = ui;
  6215. }
  6216. updateSelf(index, sameDay, curDayIndex) {
  6217. let data = cfgTable.signData[index + 1];
  6218. this.ui.titleTxt.text = data.title;
  6219. let arr1 = data.award[0].split('-');
  6220. let arr2 = data.award[1].split('-');
  6221. let num1 = parseInt(arr1[1]);
  6222. let num2 = parseInt(arr2[1]);
  6223. this.ui.numTxt1.text = num1 + "";
  6224. this.ui.numTxt2.text = num2 + "";
  6225. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6226. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6227. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6228. this.ui.numTxt1.visible = false;
  6229. }
  6230. else {
  6231. this.ui.numTxt1.visible = true;
  6232. }
  6233. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6234. this.ui.numTxt2.visible = false;
  6235. }
  6236. else {
  6237. this.ui.numTxt2.visible = true;
  6238. }
  6239. if (index < curDayIndex) {
  6240. this.ui.c1.selectedIndex = 1;
  6241. }
  6242. else if (index == curDayIndex) {
  6243. if (sameDay) {
  6244. this.ui.c1.selectedIndex = 2;
  6245. }
  6246. else {
  6247. this.ui.c1.selectedIndex = 2;
  6248. }
  6249. }
  6250. else {
  6251. this.ui.c1.selectedIndex = 0;
  6252. }
  6253. }
  6254. }
  6255. class SignNormal {
  6256. constructor(ui) {
  6257. this.ui = ui;
  6258. }
  6259. updateSelf(index, sameDay, curDayIndex) {
  6260. let data = cfgTable.signData[index + 1];
  6261. this.ui.titleTxt.text = data.title;
  6262. let arr = data.award[0].split('-');
  6263. let type = parseInt(arr[0]);
  6264. let num = parseInt(arr[1]);
  6265. this.ui.numTxt.text = num + "";
  6266. if (type > 2) {
  6267. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6268. this.ui.myIcon.rotation = 0;
  6269. }
  6270. else {
  6271. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6272. this.ui.myIcon.rotation = 0;
  6273. }
  6274. if (xGame.common.signAwardContainsRod(data.award)) {
  6275. this.ui.numTxt.visible = false;
  6276. }
  6277. else {
  6278. this.ui.numTxt.visible = true;
  6279. }
  6280. if (index < curDayIndex) {
  6281. this.ui.c1.selectedIndex = 1;
  6282. }
  6283. else if (index == curDayIndex) {
  6284. if (sameDay) {
  6285. this.ui.c1.selectedIndex = 2;
  6286. }
  6287. else {
  6288. this.ui.c1.selectedIndex = 2;
  6289. }
  6290. }
  6291. else {
  6292. this.ui.c1.selectedIndex = 0;
  6293. }
  6294. }
  6295. }
  6296. class UISign extends UIBase {
  6297. constructor() {
  6298. super();
  6299. this.curDayIndex = 0;
  6300. this.starX = 0;
  6301. }
  6302. onConstructor() {
  6303. this.ui = ui_UISign.createInstance();
  6304. this.contentPane = this.ui;
  6305. this.isEject = false;
  6306. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6307. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6308. this.initSignItem();
  6309. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6310. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6311. }
  6312. show() {
  6313. super.show();
  6314. this.ui.t0.play();
  6315. this.playSecretaryIdle();
  6316. this.updateSign();
  6317. }
  6318. initSignItem() {
  6319. this.signArr = [];
  6320. for (let index = 0; index < 6; index++) {
  6321. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6322. this.signArr.push(temp);
  6323. }
  6324. this.signMax = new SignMax(this.ui.myNode.day7);
  6325. if (Moyu.isKs)
  6326. this.ui.closeNode.closeBtn.x += 100;
  6327. }
  6328. updateSign() {
  6329. let sameDay = xGame.common.judgeSameDay();
  6330. let max = 7;
  6331. this.curDayIndex = DataMgr.getSignData();
  6332. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6333. this.curDayIndex = 0;
  6334. if (!sameDay) {
  6335. this.ui.normalBtn.visible = true;
  6336. this.ui.tipsNode.visible = false;
  6337. this.ui.againBtn.visible = false;
  6338. }
  6339. else {
  6340. this.ui.normalBtn.visible = false;
  6341. let again = DataMgr.getExtraSign();
  6342. let isCurrency = false;
  6343. let index = this.curDayIndex;
  6344. if (index == 0)
  6345. index = 7;
  6346. let award = cfgTable.signData[index].award;
  6347. let num = award[0].split("-")[0];
  6348. if (num == "1" || num == "2")
  6349. isCurrency = true;
  6350. let showAgain = again == 0 && isCurrency;
  6351. this.ui.againBtn.visible = showAgain;
  6352. this.ui.tipsNode.visible = !showAgain;
  6353. }
  6354. for (let index = 0; index < this.signArr.length; index++) {
  6355. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6356. }
  6357. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6358. }
  6359. playSecretaryIdle() {
  6360. let parent = this.ui.secretary.displayObject;
  6361. parent.destroyChildren();
  6362. let xx = this.ui.secretary.width / 2;
  6363. let yy = this.ui.secretary.height;
  6364. let scale = xGame.common.getSecretaryScale();
  6365. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6366. xGame.common.secretary.play(data, 0, true, parent);
  6367. }
  6368. closeSelf() {
  6369. this.hide();
  6370. }
  6371. normalGetAward() {
  6372. let sameDay = xGame.common.judgeSameDay();
  6373. if (!sameDay) {
  6374. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6375. let temp;
  6376. let type;
  6377. let num;
  6378. let arr = [];
  6379. for (let index = 0; index < award.length; index++) {
  6380. temp = award[index].split("-");
  6381. type = parseInt(temp[0]);
  6382. num = parseInt(temp[1]);
  6383. let awardType = new AwardType();
  6384. awardType.num = num;
  6385. awardType.type = type;
  6386. arr.push(awardType);
  6387. }
  6388. xGame.common.getAward(arr, (watchVideo) => {
  6389. this.curDayIndex++;
  6390. if (this.curDayIndex > 7)
  6391. this.curDayIndex = 0;
  6392. DataMgr.setSignData(this.curDayIndex);
  6393. DataMgr.setSignTime(new Date().getTime());
  6394. if (watchVideo) {
  6395. DataMgr.setExtraSign(1);
  6396. Moyu.sendDataEvent("signIn1");
  6397. }
  6398. this.updateSign();
  6399. });
  6400. }
  6401. }
  6402. againGetAward() {
  6403. Moyu.sendDataEvent("signIn2");
  6404. console.log('zh:qjff_AD_for_uisign');
  6405. if (Laya.Browser.onAndroid) {
  6406. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6407. if (!boo) {
  6408. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6409. return;
  6410. }
  6411. }
  6412. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6413. }
  6414. else {
  6415. console.log('zh:AD 失败,直接发放奖励');
  6416. this.qjff_AD_for_uisign();
  6417. }
  6418. }
  6419. qjff_AD_for_uisign() {
  6420. let index = this.curDayIndex;
  6421. if (index == 0)
  6422. index = 7;
  6423. let award = cfgTable.signData[index].award;
  6424. let temp;
  6425. let type;
  6426. let num;
  6427. for (let index = 0; index < award.length; index++) {
  6428. temp = award[index].split("-");
  6429. type = parseInt(temp[0]);
  6430. num = parseInt(temp[1]) * 3;
  6431. xGame.common.playObjFlyAnim(num, type);
  6432. }
  6433. DataMgr.setExtraSign(1);
  6434. this.updateSign();
  6435. }
  6436. }
  6437. UISign.uiName = "UISign";
  6438. class ui_UISkill extends fgui.GComponent {
  6439. static createInstance() {
  6440. return (fgui.UIPackage.createObject("game", "UISkill"));
  6441. }
  6442. onConstruct() {
  6443. this.n48 = (this.getChild("n48"));
  6444. this.n0 = (this.getChild("n0"));
  6445. this.secretary = (this.getChild("secretary"));
  6446. this.talkNode = (this.getChild("talkNode"));
  6447. this.closeNode = (this.getChild("closeNode"));
  6448. this.moneyNode = (this.getChild("moneyNode"));
  6449. this.skillNode = (this.getChild("skillNode"));
  6450. this.guideNode = (this.getChild("guideNode"));
  6451. }
  6452. }
  6453. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6454. class SkillDisplay {
  6455. constructor(ui, data, uiIndex) {
  6456. this.starX = 0;
  6457. this.starY = 0;
  6458. this.index = 0;
  6459. this.ui = ui;
  6460. this.data = data;
  6461. this.index = uiIndex;
  6462. this.initSelf();
  6463. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6464. }
  6465. initSelf() {
  6466. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6467. this.ui.nameTxt.text = this.data.name;
  6468. this.ui.describeTxt.text = this.data.describe;
  6469. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6470. this.ui.startBtn.onClick(this, this.startGame);
  6471. this.updateSelf();
  6472. }
  6473. updateSelf() {
  6474. this.checkTry();
  6475. let level = DataMgr.getBigSkillByIndex(this.index);
  6476. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6477. }
  6478. checkTry() {
  6479. let index = this.index;
  6480. let level = DataMgr.getBigSkillByIndex(index);
  6481. if (level == null) {
  6482. DataMgr.setBigSkill(index, 1, false);
  6483. level = 1;
  6484. }
  6485. this.ui.levelTxt.text = "LV." + level;
  6486. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6487. this.ui.tryNode.visible = true;
  6488. else
  6489. this.ui.tryNode.visible = false;
  6490. }
  6491. clickAddLevel() {
  6492. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6493. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6494. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6495. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6496. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6497. }
  6498. else {
  6499. console.log('zh:AD 失败,直接发放奖励');
  6500. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6501. }
  6502. }
  6503. qjff_AD_for_skilldisplay_clickAddLevel() {
  6504. DataMgr.setBigSkill(this.data.index, 1);
  6505. this.updateSelf();
  6506. xGame.common.upSkillLevel = true;
  6507. }
  6508. startGame() {
  6509. console.log('zh:rod skill startgame');
  6510. if (this.data.index == 3) {
  6511. alert('Coming soon!');
  6512. return;
  6513. }
  6514. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6515. let needCoin = xGame.common.bigMoveNeedCoin;
  6516. xGame.common.passAwardCoin = 2000;
  6517. let guide = DataMgr.getSkillGuide();
  6518. console.log('zh:startGame guide=' + guide);
  6519. xGame.common.temSelfLevel = 0;
  6520. if (guide == 0) {
  6521. needCoin = 0;
  6522. xGame.common.temSelfLevel = 100;
  6523. }
  6524. if (DataMgr.coinEnough(needCoin)) {
  6525. DataMgr.setCoin(-needCoin);
  6526. xGame.common.curPlayerSkillType = this.index;
  6527. if (guide == 0)
  6528. xGame.common.curPlayerSkillType = 0;
  6529. console.log('zh: skilldisplay 1');
  6530. xGame.uiMgr.Show(UIGame);
  6531. xGame.uiMgr.Hide(UIMain);
  6532. xGame.uiMgr.Show(UIMatching, () => {
  6533. xGame.common.gameUI.ui.alpha = 1;
  6534. xGame.common.gameUI.startGame();
  6535. xGame.uiMgr.Hide(UISkill);
  6536. });
  6537. this.logEventForRod_start();
  6538. }
  6539. else {
  6540. console.log('zh: skilldisplay 2');
  6541. xGame.uiMgr.Show(UIAddProp, 0);
  6542. Moyu.sendDataEvent("AddCoinVideo");
  6543. }
  6544. }
  6545. logEventForRod_start() {
  6546. let gfmsIdx = xGame.common.curPlayerSkillType;
  6547. console.log('zh:选择的技能=' + gfmsIdx);
  6548. let gfmc = 'Skyfall Shot';
  6549. if (gfmsIdx == 0) {
  6550. gfmc = 'Skyfall Shot';
  6551. }
  6552. if (gfmsIdx == 1) {
  6553. gfmc = 'Surging break';
  6554. }
  6555. if (gfmsIdx == 2) {
  6556. gfmc = 'Frost Lock';
  6557. }
  6558. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6559. let jsonStr = {
  6560. "count": 0,
  6561. "name": gfmc
  6562. };
  6563. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6564. const d = LocalStorageManager.getItem(keyStr);
  6565. jsonStr.count = d.count + 1;
  6566. LocalStorageManager.setItem(keyStr, jsonStr);
  6567. }
  6568. else {
  6569. LocalStorageManager.setItem(keyStr, jsonStr);
  6570. }
  6571. const reqStr = JSON.stringify(jsonStr);
  6572. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6573. }
  6574. }
  6575. class UISkill extends UIBase {
  6576. constructor() {
  6577. super();
  6578. this.skillData = [];
  6579. }
  6580. onConstructor() {
  6581. this.ui = ui_UISkill.createInstance();
  6582. this.contentPane = this.ui;
  6583. this.isEject = false;
  6584. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6585. this.initSkillData();
  6586. console.log('zh:aaaaaa1111111111');
  6587. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6588. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6589. console.log('zh:aaaaaa22222222');
  6590. this.displayList = [];
  6591. this.ui.skillNode.skillList.numItems = 3;
  6592. this.addUIClick(this.ui, this.interuptSecretary);
  6593. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6594. this.ui.talkNode.visible = false;
  6595. if (Moyu.isKs)
  6596. this.ui.closeNode.closeBtn.x += 100;
  6597. }
  6598. show() {
  6599. super.show();
  6600. this.playSecretaryIdle();
  6601. this.moneyNode.ui.c1.selectedIndex = 1;
  6602. Laya.timer.clearAll(this);
  6603. xGame.soundMgr.playSound("s_start");
  6604. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6605. let guide = DataMgr.getSkillGuide();
  6606. this.ui.guideNode.visible = guide == 0;
  6607. let item = this.getSkillItemByUIIndex(0);
  6608. if (guide == 0) {
  6609. item.ui.c1.selectedIndex = 1;
  6610. }
  6611. else {
  6612. item.ui.c1.selectedIndex = 0;
  6613. }
  6614. this.ui.guideNode.guideBtn.visible = guide == 0;
  6615. for (let index = 0; index < this.displayList.length; index++) {
  6616. this.displayList[index].checkTry();
  6617. }
  6618. }
  6619. getSkillItemByUIIndex(cur) {
  6620. for (let index = 0; index < this.displayList.length; index++) {
  6621. if (this.displayList[index].index == cur) {
  6622. return this.displayList[index];
  6623. }
  6624. }
  6625. }
  6626. enterGuideLevel() {
  6627. let item = this.getSkillItemByUIIndex(0);
  6628. item.startGame();
  6629. if (DataMgr.getNewUser())
  6630. Moyu.sendDataEvent("gameStart1");
  6631. }
  6632. initSkillData() {
  6633. this.skillData = [];
  6634. let nameList = xGame.common.skillNameList;
  6635. let iconList = xGame.common.skillIconList;
  6636. let describeList = [
  6637. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6638. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6639. "The power of frost descends—freezing the flow and taking full control of the game!"
  6640. ];
  6641. console.log('zh:initSkillData 111111111');
  6642. let data;
  6643. for (let index = 0; index < nameList.length; index++) {
  6644. data = {};
  6645. data.name = nameList[index];
  6646. data.icon = iconList[index];
  6647. data.describe = describeList[index];
  6648. data.index = index;
  6649. this.skillData.push(data);
  6650. }
  6651. }
  6652. updateSkillItem(index, target) {
  6653. if (this.displayList[index] == null) {
  6654. let uiIndex;
  6655. switch (index) {
  6656. case 0:
  6657. uiIndex = 1;
  6658. break;
  6659. case 1:
  6660. uiIndex = 0;
  6661. break;
  6662. case 2:
  6663. uiIndex = 2;
  6664. break;
  6665. case 3:
  6666. uiIndex = 3;
  6667. break;
  6668. default:
  6669. break;
  6670. }
  6671. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6672. this.displayList.push(temp);
  6673. }
  6674. }
  6675. playSecretaryIdle() {
  6676. let parent = this.ui.secretary.displayObject;
  6677. parent.destroyChildren();
  6678. let xx = this.ui.secretary.width / 2;
  6679. let yy = this.ui.secretary.height;
  6680. let scale = xGame.common.getSecretaryScale();
  6681. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6682. xGame.common.secretary.play(data, 0, true, parent);
  6683. }
  6684. returnUIMain() {
  6685. this.hide();
  6686. xGame.common.stopGirlPop(this.ui.talkNode);
  6687. xGame.uiMgr.Show(UIMain);
  6688. }
  6689. interuptSecretary() {
  6690. Laya.timer.clearAll(this);
  6691. this.playSecretaryRandomSound();
  6692. }
  6693. playSecretaryRandomSound() {
  6694. if (this.isHide)
  6695. return;
  6696. let time = xGame.common.randomNum(45000, 60000);
  6697. Laya.timer.once(time, this, () => {
  6698. if (this.isHide)
  6699. return;
  6700. let index = xGame.common.randomNum(4, 7);
  6701. xGame.soundMgr.playSound("s_main0" + index);
  6702. let words = 1;
  6703. switch (index) {
  6704. case 4:
  6705. words = 5;
  6706. break;
  6707. case 5:
  6708. words = 3;
  6709. break;
  6710. case 6:
  6711. words = 6;
  6712. break;
  6713. case 7:
  6714. words = 7;
  6715. break;
  6716. default:
  6717. break;
  6718. }
  6719. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6720. this.playSecretaryRandomSound();
  6721. });
  6722. }
  6723. }
  6724. UISkill.uiName = "UISkill";
  6725. class ui_UIModeSelection extends fgui.GComponent {
  6726. static createInstance() {
  6727. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6728. }
  6729. onConstruct() {
  6730. this.n19 = (this.getChild("n19"));
  6731. this.closeBtn = (this.getChild("closeBtn"));
  6732. this.myNode = (this.getChild("myNode"));
  6733. this.t0 = this.getTransition("t0");
  6734. }
  6735. }
  6736. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6737. class UIModeSelection extends UIBase {
  6738. constructor() {
  6739. super();
  6740. }
  6741. onConstructor() {
  6742. this.ui = ui_UIModeSelection.createInstance();
  6743. this.contentPane = this.ui;
  6744. this.isEject = false;
  6745. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6746. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6747. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6748. this.addUIClick(this.ui.closeBtn, this.hide);
  6749. this.peopleArr = [65, 990, 580];
  6750. this.peopleOffest = [5, 10, 10];
  6751. }
  6752. show(callback) {
  6753. this.updateSelf();
  6754. super.show();
  6755. this.ui.t0.play();
  6756. this.callback = callback;
  6757. }
  6758. updateSelf() {
  6759. let cfg = cfgTable.modeselectData;
  6760. for (let index = 1; index <= 3; index++) {
  6761. let node = this.ui.myNode["type" + index];
  6762. node.need.text = cfg[index].need;
  6763. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6764. node.peopleTxt.text = this.getRandPeople(index - 1);
  6765. }
  6766. }
  6767. enterGame(type) {
  6768. console.log('zh: 进入经典模式 type: ' + type);
  6769. xGame.common.classicRoomType = type;
  6770. let cfg = cfgTable.modeselectData[type];
  6771. let need = cfg.need;
  6772. xGame.common.passAwardCoin = cfg.award;
  6773. if (DataMgr.coinEnough(need)) {
  6774. DataMgr.setCoin(-need);
  6775. this.ui.myNode["type" + type].t0.play();
  6776. Laya.timer.once(200, this, () => {
  6777. this.callback && this.callback();
  6778. });
  6779. this.logEventForClassic_start();
  6780. }
  6781. else {
  6782. Moyu.sendDataEvent("AddCoinVideo");
  6783. xGame.uiMgr.Show(UIAddProp, 0);
  6784. }
  6785. }
  6786. getRandPeople(index) {
  6787. let rand = this.peopleOffest[index];
  6788. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6789. }
  6790. logEventForClassic_start() {
  6791. let rtype = xGame.common.classicRoomType;
  6792. let msmc = '';
  6793. if (rtype == 1) {
  6794. msmc = 'beginner';
  6795. }
  6796. if (rtype == 2) {
  6797. msmc = 'expert';
  6798. }
  6799. if (rtype == 3) {
  6800. msmc = 'master';
  6801. }
  6802. let keyStr = 'sjmd_classic_start_' + rtype;
  6803. let jsonStr = {
  6804. "difficulty": msmc,
  6805. "classic_count": 1,
  6806. "difficulty_count": 1
  6807. };
  6808. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6809. const d = LocalStorageManager.getItem(keyStr);
  6810. jsonStr.classic_count = d.classic_count + 1;
  6811. jsonStr.difficulty_count = d.difficulty_count + 1;
  6812. LocalStorageManager.setItem(keyStr, jsonStr);
  6813. }
  6814. else {
  6815. LocalStorageManager.setItem(keyStr, jsonStr);
  6816. }
  6817. const reqStr = JSON.stringify(jsonStr);
  6818. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6819. }
  6820. }
  6821. UIModeSelection.uiName = "UIModeSelection";
  6822. class ui_UIReg extends fgui.GComponent {
  6823. static createInstance() {
  6824. return (fgui.UIPackage.createObject("game", "UIReg"));
  6825. }
  6826. onConstruct() {
  6827. this.n38 = (this.getChild("n38"));
  6828. this.n9 = (this.getChild("n9"));
  6829. this.n14 = (this.getChild("n14"));
  6830. this.n15 = (this.getChild("n15"));
  6831. this.n34 = (this.getChild("n34"));
  6832. this.closeBtn = (this.getChild("closeBtn"));
  6833. this.lab_tip = (this.getChild("lab_tip"));
  6834. this.n43 = (this.getChild("n43"));
  6835. this.txt_ua = (this.getChild("txt_ua"));
  6836. this.n44 = (this.getChild("n44"));
  6837. this.txt_up1 = (this.getChild("txt_up1"));
  6838. this.n45 = (this.getChild("n45"));
  6839. this.txt_up2 = (this.getChild("txt_up2"));
  6840. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6841. this.btn_reg = (this.getChild("btn_reg"));
  6842. this.n50 = (this.getChild("n50"));
  6843. }
  6844. }
  6845. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6846. class ui_UILogin extends fgui.GComponent {
  6847. static createInstance() {
  6848. return (fgui.UIPackage.createObject("game", "UILogin"));
  6849. }
  6850. onConstruct() {
  6851. this.c1 = this.getController("c1");
  6852. this.n18 = (this.getChild("n18"));
  6853. this.n7 = (this.getChild("n7"));
  6854. this.n5 = (this.getChild("n5"));
  6855. this.n6 = (this.getChild("n6"));
  6856. this.closeBtn = (this.getChild("closeBtn"));
  6857. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6858. this.btn_login = (this.getChild("btn_login"));
  6859. this.n30 = (this.getChild("n30"));
  6860. this.n31 = (this.getChild("n31"));
  6861. this.txt_up = (this.getChild("txt_up"));
  6862. this.n32 = (this.getChild("n32"));
  6863. this.txt_ua = (this.getChild("txt_ua"));
  6864. }
  6865. }
  6866. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6867. class UILogin extends UIBase {
  6868. constructor() {
  6869. super();
  6870. }
  6871. onConstructor() {
  6872. this.ui = ui_UILogin.createInstance();
  6873. this.contentPane = this.ui;
  6874. this.isEject = false;
  6875. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6876. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6877. this.addUIClick(this.ui.btn_login, this.userLogin);
  6878. }
  6879. show() {
  6880. super.show();
  6881. this.x = (Laya.stage.width - this.width) / 2;
  6882. this.y = (Laya.stage.height - this.height) / 2;
  6883. }
  6884. closeSelf() {
  6885. this.hide();
  6886. }
  6887. userLogin() {
  6888. let ua = this.ui.txt_ua.text;
  6889. let up = this.ui.txt_up.text;
  6890. if (ua && up) {
  6891. let reqData = JSON.stringify({
  6892. username: ua.trim(),
  6893. password: up.trim(),
  6894. fromMark: 'app_game'
  6895. });
  6896. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6897. try {
  6898. console.log('zh:res = ' + JSON.stringify(res));
  6899. let code = res.code;
  6900. let msg = res.msg;
  6901. if (code == 200) {
  6902. let keyStr = keyForLoginInfo;
  6903. let jsonStr = {
  6904. "username": res.username,
  6905. "token": res.token,
  6906. "buySpids": { 1: false, 7: false }
  6907. };
  6908. LocalStorageManager.setItem(keyStr, jsonStr);
  6909. let myu = Moyu.getUserInfo();
  6910. console.log('zh:myu = ' + JSON.stringify(myu));
  6911. DataMgr.updateUserNickName(res.username);
  6912. Moyu.updateUserInfo(res.username);
  6913. xGame.uiMgr.Show(UIMsg, msg);
  6914. DataMgr.getUserZiChanInfo();
  6915. xGame.eventMgr.event(LOGIN_IN);
  6916. this.closeSelf();
  6917. }
  6918. else {
  6919. xGame.uiMgr.Show(UIMsg, msg);
  6920. }
  6921. }
  6922. catch (error) {
  6923. console.log('error=' + error);
  6924. alert(error);
  6925. }
  6926. finally {
  6927. }
  6928. });
  6929. }
  6930. else {
  6931. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6932. }
  6933. }
  6934. gotoRegPage() {
  6935. this.closeSelf();
  6936. xGame.uiMgr.Show(UIReg);
  6937. }
  6938. }
  6939. UILogin.uiName = "UILogin";
  6940. class UIReg extends UIBase {
  6941. constructor() {
  6942. super();
  6943. }
  6944. onConstructor() {
  6945. this.ui = ui_UIReg.createInstance();
  6946. this.contentPane = this.ui;
  6947. this.isEject = false;
  6948. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6949. this.addUIClick(this.ui.btn_reg, this.regUser);
  6950. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6951. }
  6952. show() {
  6953. super.show();
  6954. this.x = (Laya.stage.width - this.width) / 2;
  6955. this.y = (Laya.stage.height - this.height) / 2;
  6956. }
  6957. closeSelf() {
  6958. this.hide();
  6959. }
  6960. regUser() {
  6961. this.ui.lab_tip.visible = false;
  6962. let ua = this.ui.txt_ua.text;
  6963. let up1 = this.ui.txt_up1.text;
  6964. let up2 = this.ui.txt_up2.text;
  6965. if (ua && up1 && up2 && up1 == up2) {
  6966. let reqData = JSON.stringify({
  6967. username: ua.trim(),
  6968. password: up1.trim(),
  6969. fromMark: 'app_game'
  6970. });
  6971. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6972. try {
  6973. console.log('zh:res = ' + JSON.stringify(res));
  6974. let code = res.code;
  6975. let msg = res.msg;
  6976. xGame.uiMgr.Show(UIMsg, msg);
  6977. if (code == 200) {
  6978. this.ui.lab_tip.color = "#FFFFFF";
  6979. xGame.uiMgr.Show(UIMsg, msg);
  6980. this.closeSelf();
  6981. }
  6982. else {
  6983. this.ui.lab_tip.color = "#FF0000";
  6984. xGame.uiMgr.Show(UIMsg, msg);
  6985. }
  6986. }
  6987. catch (error) {
  6988. console.log('error=' + error);
  6989. alert(error);
  6990. }
  6991. finally {
  6992. }
  6993. });
  6994. }
  6995. else {
  6996. if (up1 != up2) {
  6997. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6998. }
  6999. else {
  7000. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7001. }
  7002. }
  7003. }
  7004. gotoLogin() {
  7005. this.closeSelf();
  7006. xGame.uiMgr.Show(UILogin);
  7007. }
  7008. }
  7009. UIReg.uiName = "UIReg";
  7010. class ui_UIFuli1 extends fgui.GComponent {
  7011. static createInstance() {
  7012. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7013. }
  7014. onConstruct() {
  7015. this.n1 = (this.getChild("n1"));
  7016. this.n2 = (this.getChild("n2"));
  7017. }
  7018. }
  7019. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7020. class UIFuli1 extends UIBase {
  7021. constructor() {
  7022. super();
  7023. }
  7024. onConstructor() {
  7025. this.ui = ui_UIFuli1.createInstance();
  7026. this.contentPane = this.ui;
  7027. this.isEject = false;
  7028. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7029. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7030. }
  7031. show() {
  7032. super.show();
  7033. this.x = (Laya.stage.width - this.width) / 2;
  7034. this.y = (Laya.stage.height - this.height) / 2;
  7035. }
  7036. closeSelf() {
  7037. this.hide();
  7038. }
  7039. gotoBuy() {
  7040. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7041. if (userInfo != null) {
  7042. let token = userInfo.token;
  7043. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7044. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7045. return;
  7046. }
  7047. else {
  7048. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7049. }
  7050. }
  7051. gotoBuy2() {
  7052. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7053. if (userInfo == null) {
  7054. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7055. return;
  7056. }
  7057. let reqData = xGame.httpMgr.getReqData();
  7058. let pd = JSON.parse(reqData);
  7059. pd.productId = 1;
  7060. reqData = JSON.stringify(pd);
  7061. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7062. try {
  7063. console.log('zh:buySp res = ' + JSON.stringify(res));
  7064. let code = res.code;
  7065. let msg = res.msg;
  7066. if (code == 401) {
  7067. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7068. alert(TIP_MSG_key.loginTimeOut);
  7069. xGame.uiMgr.Show(UIMsg, msg);
  7070. return;
  7071. }
  7072. if (code == 200) {
  7073. xGame.uiMgr.Show(UIMsg, msg);
  7074. DataMgr.getUserZiChanInfo();
  7075. this.closeSelf();
  7076. }
  7077. else {
  7078. xGame.uiMgr.Show(UIMsg, msg);
  7079. }
  7080. }
  7081. catch (error) {
  7082. console.log('error=' + error);
  7083. alert(error);
  7084. }
  7085. finally {
  7086. }
  7087. });
  7088. }
  7089. }
  7090. UIFuli1.uiName = "UIFuli1";
  7091. class ui_UIFuli2 extends fgui.GComponent {
  7092. static createInstance() {
  7093. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7094. }
  7095. onConstruct() {
  7096. this.n1 = (this.getChild("n1"));
  7097. this.n0 = (this.getChild("n0"));
  7098. }
  7099. }
  7100. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7101. class UIFuli2 extends UIBase {
  7102. constructor() {
  7103. super();
  7104. }
  7105. onConstructor() {
  7106. this.ui = ui_UIFuli2.createInstance();
  7107. this.contentPane = this.ui;
  7108. this.isEject = false;
  7109. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7110. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7111. }
  7112. show() {
  7113. super.show();
  7114. this.x = (Laya.stage.width - this.width) / 2;
  7115. this.y = (Laya.stage.height - this.height) / 2;
  7116. }
  7117. closeSelf() {
  7118. this.hide();
  7119. }
  7120. gotoBuy() {
  7121. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7122. if (userInfo != null) {
  7123. let token = userInfo.token;
  7124. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7125. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7126. return;
  7127. }
  7128. else {
  7129. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7130. }
  7131. }
  7132. gotoBuy1() {
  7133. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7134. if (userInfo == null) {
  7135. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7136. return;
  7137. }
  7138. let reqData = xGame.httpMgr.getReqData();
  7139. let pd = JSON.parse(reqData);
  7140. pd.productId = 2;
  7141. reqData = JSON.stringify(pd);
  7142. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7143. try {
  7144. console.log('zh:buySp res = ' + JSON.stringify(res));
  7145. let code = res.code;
  7146. let msg = res.msg;
  7147. if (code == 401) {
  7148. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7149. alert(TIP_MSG_key.loginTimeOut);
  7150. xGame.uiMgr.Show(UIMsg, msg);
  7151. return;
  7152. }
  7153. if (code == 200) {
  7154. xGame.uiMgr.Show(UIMsg, msg);
  7155. DataMgr.getUserZiChanInfo();
  7156. this.closeSelf();
  7157. }
  7158. else {
  7159. xGame.uiMgr.Show(UIMsg, msg);
  7160. }
  7161. }
  7162. catch (error) {
  7163. console.log('error=' + error);
  7164. alert(error);
  7165. }
  7166. finally {
  7167. }
  7168. });
  7169. }
  7170. }
  7171. UIFuli2.uiName = "UIFuli2";
  7172. class ui_UIGetAward extends fgui.GComponent {
  7173. static createInstance() {
  7174. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7175. }
  7176. onConstruct() {
  7177. this.n4 = (this.getChild("n4"));
  7178. this.n0 = (this.getChild("n0"));
  7179. this.myList = (this.getChild("myList"));
  7180. this.n1 = (this.getChild("n1"));
  7181. this.eftNode = (this.getChild("eftNode"));
  7182. this.btnNode = (this.getChild("btnNode"));
  7183. this.t0 = this.getTransition("t0");
  7184. }
  7185. }
  7186. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7187. class UIGetAward extends UIBase {
  7188. constructor() {
  7189. super();
  7190. this.showTriple = true;
  7191. }
  7192. onConstructor() {
  7193. this.ui = ui_UIGetAward.createInstance();
  7194. this.contentPane = this.ui;
  7195. this.isEject = false;
  7196. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7197. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7198. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7199. }
  7200. show(arr, showTriple, callback) {
  7201. super.show();
  7202. this.ui.t0.play();
  7203. this.ui.eftNode.visible = true;
  7204. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7205. this.ui.eftNode.visible = false;
  7206. }), 1, 0, 0, 0.9);
  7207. this.awardArr = arr;
  7208. this.showTriple = showTriple;
  7209. this.callback = callback;
  7210. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7211. this.ui.myList.numItems = arr.length;
  7212. xGame.soundMgr.playSound("getaward");
  7213. }
  7214. updateSelf(index, obj) {
  7215. let temp = this.awardArr[index];
  7216. let icon = this.getIcon(temp.type);
  7217. let str = icon;
  7218. if (temp.type > 2) {
  7219. str = "s" + icon;
  7220. }
  7221. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7222. obj.myIcon.rotation = 0;
  7223. obj.numTxt.text = temp.num + "";
  7224. obj.numTxt.visible = temp.type > 2 ? false : true;
  7225. obj.nameTxt.text = this.getNameStr(temp.type);
  7226. }
  7227. renderItem(index, obj) {
  7228. this.updateSelf(index, obj);
  7229. }
  7230. tripleGetAward() {
  7231. console.log('zh:qjff_AD_for_uigetAward');
  7232. if (Laya.Browser.onAndroid) {
  7233. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7234. if (!boo) {
  7235. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7236. return;
  7237. }
  7238. }
  7239. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7240. }
  7241. else {
  7242. console.log('zh:AD 失败,直接发放奖励');
  7243. this.qjff_AD_for_uigetAward();
  7244. }
  7245. }
  7246. qjff_AD_for_uigetAward() {
  7247. this.getAward(3);
  7248. }
  7249. normalGetAward() {
  7250. if (PlatMgr.isMisVideo())
  7251. this.tripleGetAward();
  7252. else
  7253. this.getAward();
  7254. }
  7255. getAward(times = 1) {
  7256. this.hide();
  7257. for (let index = 0; index < this.awardArr.length; index++) {
  7258. this.awardArr[index].num *= times;
  7259. }
  7260. this.callback && this.callback(times != 1);
  7261. }
  7262. getIcon(type) {
  7263. switch (type) {
  7264. case Prop.diamond:
  7265. return "ty_zs";
  7266. case Prop.coin:
  7267. return "ty_jb";
  7268. case Prop.gan1:
  7269. return "qg1";
  7270. case Prop.gan2:
  7271. return "qg2";
  7272. case Prop.gan3:
  7273. return "qg3";
  7274. case Prop.gan4:
  7275. return "qg4";
  7276. default:
  7277. break;
  7278. }
  7279. }
  7280. getNameStr(type) {
  7281. switch (type) {
  7282. case Prop.diamond:
  7283. return "Diamond";
  7284. case Prop.coin:
  7285. return "Coins";
  7286. case Prop.gan1:
  7287. case Prop.gan2:
  7288. case Prop.gan3:
  7289. case Prop.gan4:
  7290. return cfgTable.ballrodData[type - 1].name;
  7291. default:
  7292. break;
  7293. }
  7294. }
  7295. }
  7296. UIGetAward.uiName = "UIGetAward";
  7297. class ui_UIRepentProp extends fgui.GComponent {
  7298. static createInstance() {
  7299. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7300. }
  7301. onConstruct() {
  7302. this.c1 = this.getController("c1");
  7303. this.n11 = (this.getChild("n11"));
  7304. this.regretNode = (this.getChild("regretNode"));
  7305. this.helpLineNode = (this.getChild("helpLineNode"));
  7306. this.t0 = this.getTransition("t0");
  7307. }
  7308. }
  7309. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7310. class UIRepentProp extends UIBase {
  7311. constructor() {
  7312. super();
  7313. this.viewType = 0;
  7314. this.regretType = 0;
  7315. }
  7316. onConstructor() {
  7317. this.ui = ui_UIRepentProp.createInstance();
  7318. this.contentPane = this.ui;
  7319. this.isEject = false;
  7320. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7321. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7322. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7323. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7324. }
  7325. show(viewType, regretType, callback) {
  7326. PlatMgr.showInsert(true);
  7327. this.viewType = viewType;
  7328. this.regretType = regretType;
  7329. this.callback = callback;
  7330. super.show();
  7331. this.ui.t0.play();
  7332. this.ui.c1.selectedIndex = this.viewType;
  7333. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7334. if (this.viewType == 0) {
  7335. let guide = DataMgr.getGuideHelpLine();
  7336. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7337. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7338. }
  7339. xGame.common.gameMgr.gamePause = true;
  7340. }
  7341. hideSelf() {
  7342. xGame.common.gameMgr.gamePause = false;
  7343. this.callback && this.callback(false);
  7344. this.hide();
  7345. }
  7346. videoRegret() {
  7347. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7348. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7349. }
  7350. else {
  7351. console.log('zh:AD 失败,直接发放奖励');
  7352. this.qjff_AD_for_UIrepentProp_videoRegret();
  7353. }
  7354. }
  7355. qjff_AD_for_UIrepentProp_videoRegret() {
  7356. this.callback && this.callback(true);
  7357. this.hideSelf();
  7358. }
  7359. videoAddHelpLine() {
  7360. let guide = DataMgr.getGuideHelpLine();
  7361. if (guide == 0) {
  7362. this.callback && this.callback(true);
  7363. this.hideSelf();
  7364. DataMgr.setGuideHelpLine();
  7365. xGame.common.gameUI.ui.guideNode.visible = false;
  7366. }
  7367. else {
  7368. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7369. if (Laya.Browser.onAndroid) {
  7370. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7371. if (!boo) {
  7372. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7373. return;
  7374. }
  7375. }
  7376. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7377. }
  7378. else {
  7379. console.log('zh:AD 失败,直接发放奖励');
  7380. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7381. }
  7382. }
  7383. }
  7384. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7385. this.callback && this.callback(true);
  7386. this.hideSelf();
  7387. }
  7388. }
  7389. UIRepentProp.uiName = "UIRepentProp";
  7390. class UIMain extends UIBase {
  7391. constructor() {
  7392. super();
  7393. this.firstEnter = true;
  7394. }
  7395. nativeCallJs(msg) {
  7396. let t = msg;
  7397. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7398. switch (t) {
  7399. case 'qjff_chouJiang':
  7400. let dui = xGame.uiMgr.getUI(UIDraw);
  7401. dui.qjff_chouJiang();
  7402. break;
  7403. case 'qjff_AD_for_uisign':
  7404. let dui2 = xGame.uiMgr.getUI(UISign);
  7405. dui2.qjff_AD_for_uisign();
  7406. break;
  7407. case 'qjff_AD_for_uitry':
  7408. let dui3 = xGame.uiMgr.getUI(UITry);
  7409. dui3.qjff_AD_for_uitry();
  7410. break;
  7411. case 'qjff_AD_for_uipower':
  7412. let dui4 = xGame.uiMgr.getUI(UIPower);
  7413. dui4.qjff_AD_for_uipower();
  7414. break;
  7415. case 'qjff_AD_for_uigetAward':
  7416. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7417. dui5.qjff_AD_for_uigetAward();
  7418. break;
  7419. case 'qjff_AD_for_uiGameEnd':
  7420. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7421. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7422. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7423. break;
  7424. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7425. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7426. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7427. break;
  7428. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7429. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7430. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7431. break;
  7432. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7433. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7434. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7435. break;
  7436. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7437. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7438. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7439. break;
  7440. case 'qjff_AD_for_UIBOX_onOpenBox':
  7441. let dui11 = xGame.uiMgr.getUI(UIBox);
  7442. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7443. break;
  7444. case 'qjff_AD_for_UIAddCoin':
  7445. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7446. dui12.qjff_AD_for_UIAddCoin();
  7447. break;
  7448. case '111a':
  7449. let dui14 = xGame.uiMgr.getUI(UISign);
  7450. dui14.qjff_AD_for_uisign();
  7451. break;
  7452. case '222a':
  7453. let dui15 = xGame.uiMgr.getUI(UISign);
  7454. dui15.qjff_AD_for_uisign();
  7455. break;
  7456. case '333a':
  7457. let dui16 = xGame.uiMgr.getUI(UISign);
  7458. dui16.qjff_AD_for_uisign();
  7459. break;
  7460. default:
  7461. console.log('zh:未知的方法名字' + t);
  7462. break;
  7463. }
  7464. }
  7465. onConstructor() {
  7466. console.log('zh: UIMain onConstructor');
  7467. this.ui = ui_UIMain.createInstance();
  7468. this.contentPane = this.ui;
  7469. this.isEject = false;
  7470. this.addEvent();
  7471. this.addClickSpine();
  7472. this.settingNode = new SettingNode(this.ui.settingNode);
  7473. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7474. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7475. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7476. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7477. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7478. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7479. let curUse = DataMgr.getCurSecretary();
  7480. this.changeSecretary(curUse);
  7481. this.ui.talkNode.visible = false;
  7482. let guide = DataMgr.getSkillGuide();
  7483. if (xGame.common.isNewDay && guide == 1) {
  7484. xGame.common.isNewDay = false;
  7485. xGame.soundMgr.playSound("s_main01");
  7486. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7487. console.log("zh:播放小秘书每天语音");
  7488. }
  7489. this.onGetUserInfo();
  7490. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7491. DataMgr.getUserZiChanInfo();
  7492. }
  7493. this.ui.n83.visible = false;
  7494. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7495. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7496. let ua = d.username;
  7497. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7498. }
  7499. this.c_btn_for_user();
  7500. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7501. this.loadUserSpOrderForAd();
  7502. this.ui.n_fuli.visible = false;
  7503. }
  7504. Logout() {
  7505. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7506. LocalStorageManager.removeItem(keyForLoginInfo);
  7507. this.freshUser();
  7508. }
  7509. JSBridgeUtils.instance.loginOutForApp();
  7510. this.setUserDefaultNickname();
  7511. }
  7512. setUserDefaultNickname() {
  7513. let defUsername = "player";
  7514. this.ui.headNode.nameTxt.text = defUsername;
  7515. DataMgr.updateUserNickName(defUsername);
  7516. Moyu.updateUserInfo(defUsername);
  7517. }
  7518. gotoLogin() {
  7519. xGame.uiMgr.Show(UILogin);
  7520. }
  7521. gotoRegUser() {
  7522. xGame.uiMgr.Show(UIReg);
  7523. }
  7524. showFuLiSp1() {
  7525. console.log('zh:福利1');
  7526. this.checkForShowFuLi17(1);
  7527. }
  7528. showFuLiSp7() {
  7529. console.log('zh:福利7');
  7530. this.checkForShowFuLi17(7);
  7531. }
  7532. loadUserSpOrderForAd() {
  7533. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7534. if (userInfo == null) {
  7535. return;
  7536. }
  7537. let reqData = xGame.httpMgr.getReqData();
  7538. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  7539. try {
  7540. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  7541. let code = res.code;
  7542. let msg = res.msg;
  7543. if (code == 401) {
  7544. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7545. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7546. return;
  7547. }
  7548. if (code == 200) {
  7549. let data = res.data;
  7550. let buy_spid1 = false;
  7551. let buy_spid7 = false;
  7552. for (let index = 0; index < data.length; index++) {
  7553. let element = data[index];
  7554. console.log('zh:list element.spid = ' + element.spid);
  7555. if (element.spid == 1) {
  7556. buy_spid1 = true;
  7557. }
  7558. if (element.spid == 7) {
  7559. buy_spid7 = true;
  7560. }
  7561. }
  7562. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  7563. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  7564. }
  7565. else {
  7566. xGame.uiMgr.Show(UIMsg, msg);
  7567. }
  7568. }
  7569. catch (error) {
  7570. console.log('error=' + error);
  7571. alert(error);
  7572. }
  7573. finally {
  7574. }
  7575. });
  7576. }
  7577. checkForShowFuLi17(spid) {
  7578. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7579. if (userInfo == null) {
  7580. if (spid === 1) {
  7581. xGame.uiMgr.Show(UIFuli1);
  7582. }
  7583. if (spid === 7) {
  7584. xGame.uiMgr.Show(UIFuli2);
  7585. }
  7586. return;
  7587. }
  7588. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7589. let reqData = xGame.httpMgr.getReqData();
  7590. let pd = JSON.parse(reqData);
  7591. pd.productId = spid;
  7592. reqData = JSON.stringify(pd);
  7593. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7594. try {
  7595. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7596. let code = res.code;
  7597. let msg = res.msg;
  7598. if (code == 401) {
  7599. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7600. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7601. return;
  7602. }
  7603. if (code == 200) {
  7604. let isBuyOk = res.data;
  7605. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7606. if (isBuyOk === false) {
  7607. if (spid === 1) {
  7608. xGame.uiMgr.Show(UIFuli1);
  7609. }
  7610. if (spid === 7) {
  7611. xGame.uiMgr.Show(UIFuli2);
  7612. }
  7613. }
  7614. else {
  7615. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7616. }
  7617. }
  7618. else {
  7619. xGame.uiMgr.Show(UIMsg, msg);
  7620. }
  7621. }
  7622. catch (error) {
  7623. console.log('error=' + error);
  7624. alert(error);
  7625. }
  7626. finally {
  7627. }
  7628. });
  7629. }
  7630. c_btn_for_user() {
  7631. this.ui.n_Logout.visible = false;
  7632. this.ui.n_dengLu.visible = false;
  7633. this.ui.n_zhuCe.visible = false;
  7634. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7635. this.ui.n_Logout.visible = true;
  7636. }
  7637. else {
  7638. this.ui.n_dengLu.visible = true;
  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.startGame, [GameMode.bigMove]);
  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.n_Logout, this.Logout);
  7679. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7680. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7681. this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
  7682. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7683. }
  7684. show(showFailWords) {
  7685. super.show();
  7686. this.loadUserSpOrderForAd();
  7687. this.moneyNode.ui.c1.selectedIndex = 1;
  7688. this.playSecretaryIdle();
  7689. xGame.soundMgr.playMusic("caromhall01", 0);
  7690. Laya.timer.clearAll(this);
  7691. this.playSecretaryRandomSound();
  7692. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7693. if (showFailWords) {
  7694. console.log('zh:uimain.ts ');
  7695. setTimeout(() => {
  7696. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7697. let words = -1;
  7698. if (str == "s_main02") {
  7699. words = 2;
  7700. }
  7701. else {
  7702. words = 3;
  7703. }
  7704. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7705. xGame.soundMgr.playSound(str);
  7706. }, 300);
  7707. }
  7708. this.showGuide();
  7709. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7710. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7711. let guide = DataMgr.getSkillGuide();
  7712. if (guide == 1) {
  7713. let randTime = xGame.common.randomNum(300, 800);
  7714. if (this.firstEnter) {
  7715. console.log("zh: firstEnter");
  7716. this.firstEnter = false;
  7717. randTime += 900;
  7718. }
  7719. else {
  7720. console.log("zh: no firstEnter");
  7721. }
  7722. Laya.timer.once(randTime, this, () => {
  7723. });
  7724. Laya.timer.once(1000, this, () => {
  7725. console.log('zh: 1秒后 showFuLiSp1');
  7726. this.showFuLiSp1();
  7727. });
  7728. Laya.timer.once(10000, this, () => {
  7729. console.log('zh: 10秒后 showFuLiSp1');
  7730. this.showFuLiSp7();
  7731. });
  7732. }
  7733. }
  7734. checkActive(show) {
  7735. }
  7736. showGuide() {
  7737. let guide = DataMgr.getSkillGuide();
  7738. this.ui.guideBtn.visible = guide == 0;
  7739. this.ui.enterGuide.visible = false;
  7740. this.ui.secretaryGuide.visible = guide == 0;
  7741. if (guide == 0) {
  7742. console.log("zh:显示引导");
  7743. xGame.soundMgr.playSound("s_guide");
  7744. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7745. }
  7746. else {
  7747. console.log("zh:不需要显示引导");
  7748. }
  7749. }
  7750. ensureSecretary() {
  7751. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7752. this.ui.secretaryGuide.visible = false;
  7753. this.ui.enterGuide.visible = true;
  7754. this.ui.wordsNode.t0.play();
  7755. if (DataMgr.getNewUser())
  7756. Moyu.sendDataEvent("gameReady");
  7757. }
  7758. playSecretaryIdle() {
  7759. let parent = this.ui.secretary.displayObject;
  7760. parent.destroyChildren();
  7761. let xx = this.ui.secretary.width / 2;
  7762. let yy = this.ui.secretary.height;
  7763. let scale = xGame.common.getSecretaryScale();
  7764. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7765. xGame.common.secretary.play(data, 0, true, parent);
  7766. }
  7767. startGame(type) {
  7768. if (!this.isReadyForLoadNetSource()) {
  7769. return;
  7770. }
  7771. xGame.common.gameMode = type;
  7772. Moyu.sendDataEvent("PlayGame", { type: type });
  7773. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7774. switch (xGame.common.gameMode) {
  7775. case GameMode.classic:
  7776. console.log('zh:进入经典模式111111111');
  7777. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7778. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7779. console.log('zh:classic db_over_lev=', db_over_lev);
  7780. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7781. console.log('zh:判断是否可以玩该模式classic =NO');
  7782. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7783. xGame.uiMgr.Show(UIMsg, tipStr);
  7784. return;
  7785. }
  7786. else {
  7787. console.log('zh:可以玩该模式classic 66666666666666');
  7788. this.beginGame();
  7789. }
  7790. }
  7791. else {
  7792. console.log('zh:不需要判断是否可以玩该classic');
  7793. let challengeTimes = DataMgr.getChallengeTimes();
  7794. if (challengeTimes == 0) {
  7795. xGame.uiMgr.Show(UIInvitation);
  7796. }
  7797. else {
  7798. this.beginGame();
  7799. }
  7800. break;
  7801. }
  7802. case GameMode.bigMove:
  7803. console.error('zh:bigMove check');
  7804. let guide = DataMgr.getSkillGuide();
  7805. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7806. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7807. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7808. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7809. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7810. xGame.uiMgr.Show(UIMsg, tipStr);
  7811. return;
  7812. }
  7813. else {
  7814. console.log('zh:可以玩该模式 bigMove');
  7815. this.beginGame();
  7816. if (DataMgr.getNewUser())
  7817. Moyu.sendDataEvent("gameStart0");
  7818. }
  7819. }
  7820. else {
  7821. this.beginGame();
  7822. if (DataMgr.getNewUser())
  7823. Moyu.sendDataEvent("gameStart0");
  7824. }
  7825. break;
  7826. default:
  7827. console.error('zh:未知错误!!!!');
  7828. break;
  7829. }
  7830. }
  7831. beginGame(isNice = false) {
  7832. console.log('zh:beginGame ');
  7833. let guide = DataMgr.getSkillGuide();
  7834. if (guide == 1) {
  7835. console.log('zh:非新手引导,showInternAd ');
  7836. JSBridgeUtils.instance.showInternAd('beginGame');
  7837. }
  7838. else {
  7839. console.log('zh:新手引导,不显示AD ');
  7840. }
  7841. console.log('zh:beginGame 2 go');
  7842. if (xGame.common.gameMode == GameMode.classic) {
  7843. if (isNice) {
  7844. this.enterClassic();
  7845. }
  7846. else {
  7847. xGame.uiMgr.Show(UIModeSelection, () => {
  7848. console.log('zh:BBBBBBBBBBBBBBB');
  7849. this.enterClassic();
  7850. });
  7851. }
  7852. }
  7853. else if (xGame.common.gameMode == GameMode.bigMove) {
  7854. this.ui.enterGuide.visible = false;
  7855. xGame.uiMgr.Show(UISkill);
  7856. }
  7857. }
  7858. enterClassic() {
  7859. xGame.uiMgr.Show(UIGame);
  7860. xGame.uiMgr.Show(UIMatching, () => {
  7861. if (!this.isHide)
  7862. this.hide();
  7863. xGame.common.gameUI.ui.alpha = 1;
  7864. xGame.common.gameUI.startGame();
  7865. xGame.uiMgr.Hide(UIGameEnd);
  7866. });
  7867. }
  7868. start_debug_for_moni_payOk() {
  7869. console.log('zh:start_debug_for_moni_payOk');
  7870. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7871. if (userInfo != null) {
  7872. let token = userInfo.token;
  7873. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7874. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7875. alert('模拟支付OK');
  7876. return;
  7877. }
  7878. else {
  7879. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7880. }
  7881. }
  7882. startGlobal() {
  7883. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7884. }
  7885. startWeekly() {
  7886. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7887. }
  7888. zhouSaiMonth() {
  7889. console.log('zh: zhouSaiMonth 被调用');
  7890. }
  7891. isReadyForLoadNetSource() {
  7892. let reqCount = xGame.cfgMgr.httpReqCount;
  7893. let ok = xGame.cfgMgr.httpReqOkCount;
  7894. if (reqCount > ok) {
  7895. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7896. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7897. Laya.timer.once(5000, this, () => {
  7898. let retryCount = 0;
  7899. const maxRetries = 3;
  7900. const tryFetchConfig = () => {
  7901. try {
  7902. xGame.cfgMgr.getConfigFromServer();
  7903. }
  7904. catch (error) {
  7905. if (retryCount < maxRetries) {
  7906. retryCount++;
  7907. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7908. Laya.timer.once(5000, this, tryFetchConfig);
  7909. }
  7910. else {
  7911. console.error("❌ 达到最大重试次数,配置获取失败");
  7912. }
  7913. }
  7914. };
  7915. tryFetchConfig();
  7916. });
  7917. return false;
  7918. }
  7919. return true;
  7920. }
  7921. startPlaceBall() {
  7922. if (!this.isReadyForLoadNetSource()) {
  7923. return;
  7924. }
  7925. xGame.uiMgr.Show(UILevelDisplay);
  7926. }
  7927. hide() {
  7928. console.log('zh:uimain hide ...');
  7929. super.hide();
  7930. xGame.common.stopGirlPop(this.ui.talkNode);
  7931. }
  7932. onGetUserInfo(force = false) {
  7933. if (Moyu.isWx) {
  7934. let info = Moyu.getSystemInfo();
  7935. if (info)
  7936. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7937. }
  7938. else {
  7939. Moyu.initUser(this, this.freshUser, force);
  7940. }
  7941. this.freshUser();
  7942. }
  7943. event_login_in() {
  7944. console.log("zh:event_login_in被触发");
  7945. this.freshUser();
  7946. }
  7947. freshUser() {
  7948. let user = Moyu.getUserInfo();
  7949. if (!user.isAuth) {
  7950. user.headIcon = 'res/ty_touxiang.png';
  7951. }
  7952. else {
  7953. DataMgr.upRankData();
  7954. }
  7955. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7956. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7957. let keyStr = keyForLoginInfo;
  7958. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7959. const d = LocalStorageManager.getItem(keyStr);
  7960. let ua = d.username;
  7961. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7962. }
  7963. else {
  7964. }
  7965. this.c_btn_for_user();
  7966. }
  7967. interuptSecretary() {
  7968. Laya.timer.clearAll(this);
  7969. this.playSecretaryRandomSound();
  7970. }
  7971. playSecretaryRandomSound() {
  7972. if (this.isHide)
  7973. return;
  7974. let time = xGame.common.randomNum(45000, 60000);
  7975. Laya.timer.once(time, this, () => {
  7976. if (this.isHide)
  7977. return;
  7978. let index = xGame.common.randomNum(4, 7);
  7979. xGame.soundMgr.playSound("s_main0" + index);
  7980. let words = 1;
  7981. switch (index) {
  7982. case 4:
  7983. words = 5;
  7984. break;
  7985. case 5:
  7986. words = 3;
  7987. break;
  7988. case 6:
  7989. words = 6;
  7990. break;
  7991. case 7:
  7992. words = 7;
  7993. break;
  7994. default:
  7995. break;
  7996. }
  7997. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7998. this.playSecretaryRandomSound();
  7999. });
  8000. }
  8001. openSecretaryView() {
  8002. xGame.uiMgr.Show(UISecretary);
  8003. Moyu.sendDataEvent("secretary");
  8004. }
  8005. openShopView() {
  8006. xGame.uiMgr.Show(UIShop, 0);
  8007. }
  8008. openSignView() {
  8009. xGame.uiMgr.Show(UISign);
  8010. }
  8011. openDrawView() {
  8012. xGame.uiMgr.Show(UIDraw);
  8013. }
  8014. openRanking() {
  8015. console.log('zh:phb openRanking');
  8016. xGame.uiMgr.Show(UIRanking);
  8017. Moyu.sendDataEvent("rankingList");
  8018. }
  8019. }
  8020. UIMain.uiName = "UIMain";
  8021. class UIGameEnd extends UIBase {
  8022. constructor() {
  8023. super();
  8024. this.success = false;
  8025. this.awardCoinNum = 1000;
  8026. this.awardDiamondNum = 10;
  8027. }
  8028. onConstructor() {
  8029. this.ui = ui_UIGameEnd.createInstance();
  8030. this.contentPane = this.ui;
  8031. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8032. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8033. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8034. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8035. this.ui.talkNode.visible = false;
  8036. if (Moyu.isKs)
  8037. this.ui.closeNode.closeBtn.x += 100;
  8038. }
  8039. updateType() {
  8040. switch (xGame.common.gameMode) {
  8041. case GameMode.classic:
  8042. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8043. this.ui.coinNode.visible = this.success;
  8044. if (!this.success) {
  8045. Laya.timer.once(500, this, () => {
  8046. xGame.uiMgr.Show(UIAddCoin);
  8047. });
  8048. }
  8049. else {
  8050. this.logEventForClassic_win();
  8051. }
  8052. this.logEventForClassic_complete();
  8053. this.ui.isGetAward.visible = false;
  8054. this.ui.leftBtn.c1.selectedIndex = 3;
  8055. this.ui.rightBtn.c1.selectedIndex = 0;
  8056. this.moneyNode.ui.c1.selectedIndex = 1;
  8057. break;
  8058. case GameMode.bigMove:
  8059. console.log('zh:招法模式 aaaaaa bigMove');
  8060. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8061. this.ui.coinNode.visible = this.success;
  8062. if (xGame.common.gameMode == GameMode.bigMove) {
  8063. if (this.success) {
  8064. DataMgr.setSkillSuccessTimes(1, true);
  8065. DataMgr.setSkillAccTimes(1);
  8066. }
  8067. else {
  8068. DataMgr.setSkillSuccessTimes(0, false);
  8069. }
  8070. }
  8071. this.logEventForRod_complete_N();
  8072. if (!this.success) {
  8073. Laya.timer.once(500, this, () => {
  8074. xGame.uiMgr.Show(UIAddCoin);
  8075. });
  8076. }
  8077. else {
  8078. this.logEventForRod_win();
  8079. }
  8080. this.ui.isGetAward.visible = false;
  8081. this.ui.leftBtn.c1.selectedIndex = 3;
  8082. this.ui.rightBtn.c1.selectedIndex = 0;
  8083. this.moneyNode.ui.c1.selectedIndex = 1;
  8084. break;
  8085. case GameMode.placeBall:
  8086. this.ui.coinNode.visible = false;
  8087. if (this.success) {
  8088. if (xGame.common.placeBallStarNum == 3) {
  8089. this.ui.c1.selectedIndex = 2;
  8090. }
  8091. else {
  8092. this.ui.c1.selectedIndex = 3;
  8093. }
  8094. let level = xGame.common.placeBallCurLevel;
  8095. if (level > 59) {
  8096. this.logEventForChallenge_level_complete(level);
  8097. }
  8098. else {
  8099. this.logEventForChallenge_level_N(level);
  8100. }
  8101. }
  8102. else {
  8103. this.ui.c1.selectedIndex = 4;
  8104. }
  8105. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8106. if (cfg.type == PlaceBallType.challenge) {
  8107. this.ui.c1.selectedIndex = 2;
  8108. }
  8109. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8110. this.updatePlaceBallBtn();
  8111. this.updatePlaceBallStarNum();
  8112. this.updatePlaceBallAwardState();
  8113. this.moneyNode.ui.c1.selectedIndex = 2;
  8114. this.moneyNode.checkPowerTime();
  8115. this.moneyNode.powerChange();
  8116. DataMgr.upRankData();
  8117. break;
  8118. default:
  8119. break;
  8120. }
  8121. }
  8122. logEventForRod_complete_N() {
  8123. let gfmsIdx = xGame.common.curPlayerSkillType;
  8124. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8125. let gfmc = 'Skyfall Shot';
  8126. if (gfmsIdx == 0) {
  8127. gfmc = 'Skyfall Shot';
  8128. }
  8129. if (gfmsIdx == 1) {
  8130. gfmc = 'Surging break';
  8131. }
  8132. if (gfmsIdx == 2) {
  8133. gfmc = 'Frost Lock';
  8134. }
  8135. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8136. console.log('zh:logEventForRod_complete_N level = ' + level);
  8137. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8138. let jsonStr = {
  8139. "count": 0,
  8140. "name": gfmc
  8141. };
  8142. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8143. const d = LocalStorageManager.getItem(keyStr);
  8144. jsonStr.count = d.count + 1;
  8145. LocalStorageManager.setItem(keyStr, jsonStr);
  8146. }
  8147. else {
  8148. LocalStorageManager.setItem(keyStr, jsonStr);
  8149. }
  8150. const d2 = LocalStorageManager.getItem(keyStr);
  8151. let count = d2.count;
  8152. console.log('zh:logEventForRod_complete_N count = ' + count);
  8153. if (count % 5 == 0) {
  8154. const reqStr = JSON.stringify(jsonStr);
  8155. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8156. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8157. }
  8158. }
  8159. logEventForRod_win() {
  8160. console.log('zh:logEventForRod_win,胜利');
  8161. let gfmsIdx = xGame.common.curPlayerSkillType;
  8162. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8163. let gfmc = 'Skyfall Shot';
  8164. if (gfmsIdx == 0) {
  8165. gfmc = 'Skyfall Shot';
  8166. }
  8167. if (gfmsIdx == 1) {
  8168. gfmc = 'Surging break';
  8169. }
  8170. if (gfmsIdx == 2) {
  8171. gfmc = 'Frost Lock';
  8172. }
  8173. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8174. console.log('zh:logEventForRod_win level = ' + level);
  8175. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8176. let jsonStr = {
  8177. "count": 1,
  8178. "name": gfmc + ' Lev' + level
  8179. };
  8180. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8181. const d = LocalStorageManager.getItem(keyStr);
  8182. jsonStr.count = d.count + 1;
  8183. LocalStorageManager.setItem(keyStr, jsonStr);
  8184. }
  8185. else {
  8186. LocalStorageManager.setItem(keyStr, jsonStr);
  8187. }
  8188. const reqStr = JSON.stringify(jsonStr);
  8189. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8190. }
  8191. logEventForClassic_win() {
  8192. console.log('zh:logEventForClassic_win,胜利');
  8193. let rtype = xGame.common.classicRoomType;
  8194. let msmc = '';
  8195. if (rtype == 1) {
  8196. msmc = 'beginner';
  8197. }
  8198. if (rtype == 2) {
  8199. msmc = 'expert';
  8200. }
  8201. if (rtype == 3) {
  8202. msmc = 'master';
  8203. }
  8204. let keyStr = 'sjmd_classic_win_' + rtype;
  8205. let jsonStr = {
  8206. "difficulty": msmc,
  8207. "classic_count": 1,
  8208. "difficulty_count": 1
  8209. };
  8210. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8211. const d = LocalStorageManager.getItem(keyStr);
  8212. jsonStr.classic_count = d.classic_count + 1;
  8213. jsonStr.difficulty_count = d.difficulty_count + 1;
  8214. LocalStorageManager.setItem(keyStr, jsonStr);
  8215. }
  8216. else {
  8217. LocalStorageManager.setItem(keyStr, jsonStr);
  8218. }
  8219. const reqStr = JSON.stringify(jsonStr);
  8220. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8221. }
  8222. logEventForClassic_complete() {
  8223. console.log('zh:logEventForClassic_complete,胜利');
  8224. let rtype = xGame.common.classicRoomType;
  8225. let msmc = '';
  8226. if (rtype == 1) {
  8227. msmc = 'beginner';
  8228. }
  8229. if (rtype == 2) {
  8230. msmc = 'expert';
  8231. }
  8232. if (rtype == 3) {
  8233. msmc = 'master';
  8234. }
  8235. let keyStr = 'sjmd_classic_complete_' + rtype;
  8236. let jsonStr = {
  8237. "msmc": msmc,
  8238. "count": 0
  8239. };
  8240. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8241. const d = LocalStorageManager.getItem(keyStr);
  8242. jsonStr.count = d.count + 1;
  8243. LocalStorageManager.setItem(keyStr, jsonStr);
  8244. }
  8245. else {
  8246. LocalStorageManager.setItem(keyStr, jsonStr);
  8247. }
  8248. if (jsonStr.count % 5 == 0) {
  8249. const reqStr = JSON.stringify(jsonStr);
  8250. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8251. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8252. }
  8253. }
  8254. updatePlaceBallBtn() {
  8255. this.ui.leftBtn.c1.selectedIndex = 5;
  8256. if (this.success) {
  8257. this.ui.rightBtn.c1.selectedIndex = 14;
  8258. }
  8259. else {
  8260. if (xGame.common.placeBallStarNum == 3) {
  8261. this.ui.rightBtn.c1.selectedIndex = 14;
  8262. }
  8263. else {
  8264. this.ui.rightBtn.c1.selectedIndex = 1;
  8265. }
  8266. }
  8267. }
  8268. updatePlaceBallStarNum() {
  8269. let starNum = xGame.common.placeBallStarNum;
  8270. if (starNum == 0)
  8271. this.ui.starNumNode.c1.selectedIndex = 3;
  8272. else {
  8273. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8274. }
  8275. }
  8276. updatePlaceBallAwardState() {
  8277. let level = xGame.common.placeBallCurLevel;
  8278. let starNum = xGame.common.placeBallStarNum;
  8279. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8280. let data = cfgTable.placeballData[level].award;
  8281. let cfg = cfgTable.placeballData[level];
  8282. this.awardDiamondNum = data[1];
  8283. this.awardCoinNum = data[0];
  8284. if (cfg.type == PlaceBallType.challenge) {
  8285. this.awardDiamondNum = 0;
  8286. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8287. }
  8288. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8289. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8290. if (cfg.type == PlaceBallType.challenge) {
  8291. this.ui.awardNode.coinNode.visible = true;
  8292. }
  8293. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8294. this.ui.awardNode.diamondNode.x = 265;
  8295. this.ui.awardNode.coinNode.x = 354;
  8296. }
  8297. else {
  8298. this.ui.awardNode.diamondNode.x = 291;
  8299. this.ui.awardNode.coinNode.x = 291;
  8300. }
  8301. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8302. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8303. if (this.awardCoinNum == 0) {
  8304. this.ui.awardNode.coinNode.numTxt.text = "";
  8305. }
  8306. if (getAward) {
  8307. this.ui.isGetAward.visible = true;
  8308. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8309. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8310. }
  8311. else {
  8312. this.ui.isGetAward.visible = false;
  8313. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8314. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8315. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8316. }
  8317. else {
  8318. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8319. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8320. }
  8321. }
  8322. }
  8323. show(success) {
  8324. super.show();
  8325. xGame.eventMgr.event(RESET_GAME);
  8326. this.success = success;
  8327. Laya.timer.clearAll(this);
  8328. this.playSecretaryAni();
  8329. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8330. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8331. offsetTime = Math.floor(offsetTime / 1000);
  8332. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8333. this.updateType();
  8334. Laya.timer.once(200, this, () => {
  8335. this.addAward(() => {
  8336. this.updateType();
  8337. Laya.timer.once(500, this, () => {
  8338. this.showChallengeLevel();
  8339. });
  8340. });
  8341. });
  8342. if (this.success) {
  8343. JSBridgeUtils.instance.showInternAd('gameend_success');
  8344. console.log('zh:game end 成功');
  8345. xGame.soundMgr.playSound('slots_roll01');
  8346. xGame.soundMgr.playSound("s_win");
  8347. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8348. this.diyGameDataUtilForGameWin();
  8349. }
  8350. else {
  8351. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8352. console.log('zh:game end失败');
  8353. xGame.soundMgr.playSound('matchwin01');
  8354. xGame.soundMgr.playSound("s_lose");
  8355. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8356. }
  8357. let challengeNum = DataMgr.getChallengeTimes();
  8358. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8359. DataMgr.setChallengeTimes(1);
  8360. }
  8361. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8362. DataMgr.setClassicTimes();
  8363. }
  8364. }
  8365. diyGameDataUtilForGameWin() {
  8366. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8367. switch (xGame.common.gameMode) {
  8368. case GameMode.classic:
  8369. console.log('zh:DiyGameDataUtilForGameWin 111');
  8370. case GameMode.bigMove:
  8371. console.log('zh:DiyGameDataUtilForGameWin 222');
  8372. this.restartGame();
  8373. break;
  8374. case GameMode.placeBall:
  8375. console.log('zh:DiyGameDataUtilForGameWin 333');
  8376. var level = xGame.common.placeBallCurLevel;
  8377. console.log('zh:练习模式 联系了多少LEV=' + level);
  8378. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8379. if (level > db_over_lev) {
  8380. DataMgr.setChallengeMode_overLev(level);
  8381. }
  8382. break;
  8383. default:
  8384. console.log('zh:DiyGameDataUtilForGameWin 444');
  8385. break;
  8386. }
  8387. }
  8388. showChallengeLevel() {
  8389. if (DataMgr.getChallengeTimes() != 0)
  8390. return;
  8391. let skill = DataMgr.getSkillAccTimes();
  8392. let put = DataMgr.getPlaceBallLevelList().length;
  8393. if (skill >= 3 || put >= 5) {
  8394. xGame.uiMgr.Show(UIInvitation);
  8395. this.hide();
  8396. }
  8397. }
  8398. addAward(callback) {
  8399. if (!this.success) {
  8400. callback && callback();
  8401. return;
  8402. }
  8403. switch (xGame.common.gameMode) {
  8404. case GameMode.classic:
  8405. this.awardCoinNum = xGame.common.passAwardCoin;
  8406. this.awardDiamondNum = 0;
  8407. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8408. break;
  8409. case GameMode.bigMove:
  8410. this.awardCoinNum = xGame.common.passAwardCoin;
  8411. this.awardDiamondNum = 0;
  8412. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8413. callback && callback();
  8414. break;
  8415. case GameMode.placeBall:
  8416. let level = xGame.common.placeBallCurLevel;
  8417. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8418. if (xGame.common.placeBallStarNum != 3) {
  8419. callback && callback();
  8420. return;
  8421. }
  8422. else {
  8423. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8424. if (getAward) {
  8425. callback && callback();
  8426. return;
  8427. }
  8428. }
  8429. let cfg = cfgTable.placeballData[level];
  8430. let data = cfgTable.placeballData[level].award;
  8431. this.awardCoinNum = data[0];
  8432. this.awardDiamondNum = data[1];
  8433. if (cfg.type == PlaceBallType.challenge) {
  8434. this.awardDiamondNum = 0;
  8435. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8436. }
  8437. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8438. let diamondAward;
  8439. if (this.awardDiamondNum > 0) {
  8440. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8441. xGame.common.getAward([diamondAward, coinAward], callback);
  8442. }
  8443. else {
  8444. xGame.common.getAward([coinAward], callback);
  8445. }
  8446. if (cfg.type == PlaceBallType.normal) {
  8447. DataMgr.setPlaceBallAward(level);
  8448. }
  8449. break;
  8450. default:
  8451. break;
  8452. }
  8453. }
  8454. playSecretaryAni_old() {
  8455. let parent = this.ui.secretary.displayObject;
  8456. parent.destroyChildren();
  8457. let xx = this.ui.secretary.width / 2;
  8458. let yy = this.ui.secretary.height;
  8459. let scale = xGame.common.getSecretaryScale();
  8460. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8461. if (this.success) {
  8462. let rand = Math.random() <= 0.5 ? 2 : 3;
  8463. xGame.common.secretary.play(data, rand, false, parent, () => {
  8464. xGame.common.secretary.play(data, 1, true, parent);
  8465. });
  8466. }
  8467. else {
  8468. xGame.common.secretary.play(data, 0, true, parent);
  8469. }
  8470. }
  8471. playSecretaryAni() {
  8472. let parent = this.ui.secretary.displayObject;
  8473. parent.destroyChildren();
  8474. let xx = this.ui.secretary.width / 2;
  8475. let yy = this.ui.secretary.height;
  8476. let scale = xGame.common.getSecretaryScale();
  8477. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8478. if (this.success) {
  8479. let rand = 0;
  8480. xGame.common.secretary.play(data, 0, true, parent);
  8481. }
  8482. else {
  8483. xGame.common.secretary.play(data, 0, true, parent);
  8484. }
  8485. }
  8486. restartGame() {
  8487. switch (xGame.common.gameMode) {
  8488. case GameMode.classic:
  8489. xGame.eventMgr.event(RESTART_GAME);
  8490. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8491. break;
  8492. case GameMode.bigMove:
  8493. this.hide();
  8494. xGame.eventMgr.event(RESTART_GAME);
  8495. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8496. break;
  8497. default:
  8498. break;
  8499. }
  8500. }
  8501. hide() {
  8502. super.hide();
  8503. xGame.common.stopGirlPop(this.ui.talkNode);
  8504. PlatMgr.showBanner(false);
  8505. }
  8506. returnHome() {
  8507. this.hide();
  8508. let showFailWords = !this.success;
  8509. xGame.uiMgr.Show(UIMain, showFailWords);
  8510. }
  8511. clickLeftBtn() {
  8512. switch (xGame.common.gameMode) {
  8513. case GameMode.classic:
  8514. case GameMode.bigMove:
  8515. this.returnHome();
  8516. break;
  8517. case GameMode.placeBall:
  8518. let level = xGame.common.placeBallCurLevel;
  8519. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8520. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8521. break;
  8522. default:
  8523. break;
  8524. }
  8525. }
  8526. powerStartPlaceBallLevel(level, btn) {
  8527. if (DataMgr.powerEnough()) {
  8528. btn.touchable = false;
  8529. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8530. btn.touchable = true;
  8531. DataMgr.setPower(-1);
  8532. xGame.eventMgr.event(POWER_TIME);
  8533. this.startPlaceBallLevel(level);
  8534. this.logEventForChallenge_level_start(level);
  8535. }));
  8536. }
  8537. else {
  8538. xGame.uiMgr.Show(UIPower, 0);
  8539. }
  8540. }
  8541. clickRightBtn() {
  8542. switch (xGame.common.gameMode) {
  8543. case GameMode.classic:
  8544. console.log('zh:clickRightBtn 111');
  8545. case GameMode.bigMove:
  8546. console.log('zh:clickRightBtn 222');
  8547. this.restartGame();
  8548. break;
  8549. case GameMode.placeBall:
  8550. console.log('zh:clickRightBtn 333');
  8551. let level = xGame.common.placeBallCurLevel;
  8552. let data = DataMgr.getPlaceBallLevel(level);
  8553. let curPss = data.play && !data.isCur;
  8554. if (curPss) {
  8555. console.log('zh:clickRightBtn 333-111');
  8556. console.log('zh:当前LV=' + level);
  8557. if (level == 60) {
  8558. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8559. Laya.timer.once(3000, this, () => {
  8560. this.returnHome();
  8561. });
  8562. }
  8563. else {
  8564. let lev = level + 1;
  8565. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8566. }
  8567. }
  8568. else {
  8569. console.log('zh:clickRightBtn 333-000');
  8570. Moyu.sendDataEvent("placeBallNextLevel");
  8571. console.log('zh:qjff_AD_for_uiGameEnd');
  8572. if (Laya.Browser.onAndroid) {
  8573. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8574. if (!boo) {
  8575. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8576. return;
  8577. }
  8578. }
  8579. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8580. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8581. }
  8582. else {
  8583. console.log('zh:AD 失败,直接发放奖励');
  8584. this.qjff_AD_for_uiGameEnd(level);
  8585. }
  8586. }
  8587. break;
  8588. default:
  8589. console.log('zh:clickRightBtn 444');
  8590. break;
  8591. }
  8592. }
  8593. logEventForChallenge_level_start(level) {
  8594. let keyStr = 'sjmd_challenge_level_start';
  8595. let jsonStr = {
  8596. "count": 0,
  8597. "gold_balance ": DataMgr.getCoin(),
  8598. "level": level,
  8599. "diamond_balance ": DataMgr.getDiamond()
  8600. };
  8601. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8602. const d = LocalStorageManager.getItem(keyStr);
  8603. if (level > d.level) {
  8604. jsonStr.count = d.count + 1;
  8605. LocalStorageManager.setItem(keyStr, jsonStr);
  8606. }
  8607. else {
  8608. }
  8609. }
  8610. else {
  8611. LocalStorageManager.setItem(keyStr, jsonStr);
  8612. }
  8613. const reqStr = JSON.stringify(jsonStr);
  8614. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8615. }
  8616. qjff_AD_for_uiGameEnd(level) {
  8617. DataMgr.setPlaceBallLevel(level, 1);
  8618. this.startPlaceBallLevel(level + 1);
  8619. }
  8620. startPlaceBallLevel(level) {
  8621. xGame.common.gameMode = GameMode.placeBall;
  8622. xGame.common.placeBallCurLevel = level;
  8623. xGame.uiMgr.Show(UIGame);
  8624. this.hide();
  8625. }
  8626. logEventForChallenge_level_complete(level) {
  8627. let keyStr = 'sjmd_challenge_level_complete';
  8628. let jsonStr = {
  8629. "count": 1,
  8630. "gold_balance ": DataMgr.getCoin(),
  8631. "level": level,
  8632. "diamond_balance ": DataMgr.getDiamond()
  8633. };
  8634. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8635. const d = LocalStorageManager.getItem(keyStr);
  8636. jsonStr.count = d.count + 1;
  8637. LocalStorageManager.setItem(keyStr, jsonStr);
  8638. }
  8639. else {
  8640. LocalStorageManager.setItem(keyStr, jsonStr);
  8641. }
  8642. const reqStr = JSON.stringify(jsonStr);
  8643. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8644. }
  8645. logEventForChallenge_level_N(level) {
  8646. console.log('zh:logEventForChallenge_level_N ' + level);
  8647. let keyStr = 'sjmd_challenge_level_N';
  8648. if (LocalStorageManager.hasKey(keyStr)) {
  8649. let lev = LocalStorageManager.getItem(keyStr);
  8650. if (level > lev) {
  8651. LocalStorageManager.setItem(keyStr, level);
  8652. }
  8653. if ((level) % 5 == 0) {
  8654. console.log('zh:每5关上报1次');
  8655. let sjmc = 'challenge_level_' + level;
  8656. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8657. let sjmcForFirebase = 'challenge_level_' + level;
  8658. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8659. }
  8660. else {
  8661. console.log('zh:5 no 上报');
  8662. }
  8663. }
  8664. else {
  8665. LocalStorageManager.setItem(keyStr, level);
  8666. }
  8667. }
  8668. }
  8669. UIGameEnd.uiName = "UIGameEnd";
  8670. class ui_UIVideoShare extends fgui.GComponent {
  8671. static createInstance() {
  8672. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8673. }
  8674. onConstruct() {
  8675. this.n10 = (this.getChild("n10"));
  8676. this.myNode = (this.getChild("myNode"));
  8677. this.t0 = this.getTransition("t0");
  8678. }
  8679. }
  8680. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8681. class UIVideoShare extends UIBase {
  8682. constructor() {
  8683. super();
  8684. this.success = false;
  8685. this.awardNum = 0;
  8686. this.isShared = true;
  8687. }
  8688. onConstructor() {
  8689. this.ui = ui_UIVideoShare.createInstance();
  8690. this.contentPane = this.ui;
  8691. this.isEject = false;
  8692. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8693. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8694. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8695. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8696. }
  8697. show(success) {
  8698. super.show();
  8699. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8700. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8701. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8702. this.success = success;
  8703. let time = xGame.common.randomNum(600, 1500);
  8704. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8705. if (success)
  8706. xGame.soundMgr.playSound("applause");
  8707. this.ui.t0.play();
  8708. this.checkShareState();
  8709. let times = DataMgr.getDailyVideoShareTimes();
  8710. this.awardNum = times == 0 ? 2000 : 200;
  8711. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8712. }
  8713. checkShareState() {
  8714. if (PlatMgr.forceShare == 0) {
  8715. this.ui.myNode.closeBtn.visible = true;
  8716. this.ui.myNode.tipsNode.visible = false;
  8717. this.ui.myNode.closeBtn.x = 90;
  8718. this.ui.myNode.shareBtn.x = 342;
  8719. }
  8720. else if (PlatMgr.forceShare == 1) {
  8721. this.ui.myNode.closeBtn.visible = false;
  8722. this.ui.myNode.tipsNode.visible = true;
  8723. this.ui.myNode.shareBtn.x = 218;
  8724. this.isShared = true;
  8725. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8726. }
  8727. }
  8728. checkForceShare() {
  8729. this.isShared = !this.isShared;
  8730. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8731. }
  8732. videoShare() {
  8733. if (PlatMgr.forceShare == 1) {
  8734. if (this.isShared) {
  8735. this.shareGame();
  8736. }
  8737. else {
  8738. this.hideSelf();
  8739. }
  8740. }
  8741. else {
  8742. this.shareGame();
  8743. }
  8744. }
  8745. shareGame() {
  8746. Moyu.sendDataEvent("VideoShare");
  8747. if (Moyu.canShare() > 100) {
  8748. Moyu.shareGame((success) => {
  8749. if (success) {
  8750. DataMgr.setDailyVideoShareTimes(1);
  8751. DataMgr.setCoin(this.awardNum);
  8752. }
  8753. this.hideSelf();
  8754. }, this);
  8755. }
  8756. else {
  8757. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8758. this.hideSelf();
  8759. }
  8760. }
  8761. hideSelf() {
  8762. this.hide();
  8763. xGame.uiMgr.Show(UIGameEnd, this.success);
  8764. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8765. xGame.common.screenImg.destroy();
  8766. xGame.common.screenImg = null;
  8767. }
  8768. }
  8769. }
  8770. UIVideoShare.uiName = "UIVideoShare";
  8771. class ui_UITips extends fgui.GComponent {
  8772. static createInstance() {
  8773. return (fgui.UIPackage.createObject("game", "UITips"));
  8774. }
  8775. onConstruct() {
  8776. this.n0 = (this.getChild("n0"));
  8777. this.myNode = (this.getChild("myNode"));
  8778. this.t0 = this.getTransition("t0");
  8779. }
  8780. }
  8781. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8782. class UITips extends UIBase {
  8783. constructor() {
  8784. super();
  8785. this.type = 0;
  8786. }
  8787. onConstructor() {
  8788. this.ui = ui_UITips.createInstance();
  8789. this.contentPane = this.ui;
  8790. this.isEject = false;
  8791. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8792. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8793. }
  8794. show(tipsTxt, womanTxt, type) {
  8795. super.show();
  8796. this.ui.t0.play();
  8797. this.ui.myNode.tipsTxt.text = tipsTxt;
  8798. this.ui.myNode.womanTxt.text = womanTxt;
  8799. PlatMgr.showInsert(true);
  8800. this.ui.myNode.c1.selectedIndex = type;
  8801. this.type = type;
  8802. switch (this.type) {
  8803. case TipsType.exitGame:
  8804. xGame.common.gameMgr.gamePause = true;
  8805. break;
  8806. case TipsType.foul:
  8807. Laya.timer.once(200, this, () => {
  8808. xGame.common.gameMgr.gamePause = true;
  8809. });
  8810. break;
  8811. default:
  8812. break;
  8813. }
  8814. }
  8815. clickLeftBtn() {
  8816. this.hide();
  8817. xGame.common.gameMgr.gamePause = false;
  8818. switch (this.type) {
  8819. case TipsType.exitGame:
  8820. break;
  8821. case TipsType.foul:
  8822. break;
  8823. default:
  8824. break;
  8825. }
  8826. }
  8827. clickRightBtn() {
  8828. this.hide();
  8829. switch (this.type) {
  8830. case TipsType.exitGame:
  8831. xGame.eventMgr.event(RESET_GAME);
  8832. xGame.uiMgr.Show(UIMain);
  8833. Moyu.recordEnd(this, null);
  8834. xGame.common.longHelpLine = false;
  8835. break;
  8836. case TipsType.foul:
  8837. xGame.common.gameMgr.gamePause = false;
  8838. Laya.timer.clearAll(this);
  8839. break;
  8840. default:
  8841. break;
  8842. }
  8843. }
  8844. }
  8845. UITips.uiName = "UITips";
  8846. class GameMgr {
  8847. constructor() {
  8848. this.selfCamp = "";
  8849. this.selfFoulNum = 0;
  8850. this.selfBallArr = [];
  8851. this.selfTimer = 0;
  8852. this.selfScore = 0;
  8853. this.aiCamp = "";
  8854. this.aiFoulNum = 0;
  8855. this.aiBallArr = [];
  8856. this.aiTimer = 0;
  8857. this.aiScore = 0;
  8858. this.aiSkillLevelNum = 1;
  8859. this.targertScore = 0;
  8860. this.setTime = 30;
  8861. this.selfTurnRate = 0.5;
  8862. this.accTime = 0;
  8863. this.curFoul = "";
  8864. this.maxFoulTimes = 3;
  8865. this.isFirstInGame = true;
  8866. this.firstColliObj = null;
  8867. this.inHoleBalls = [];
  8868. this.blackNum = 8;
  8869. this.success = false;
  8870. this.holePosList = [];
  8871. this.posObj = {};
  8872. this._selfTurn = false;
  8873. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8874. this.ensureBallType = false;
  8875. this.isOpenBall = true;
  8876. this.finishOneShoot = true;
  8877. this.isEnd = false;
  8878. this.isChangeTurn = false;
  8879. this.isInterrupt = false;
  8880. this.aiPlayedBreakArmy = false;
  8881. this.isTouchedBall = false;
  8882. this.finishBalls = 0;
  8883. this.needBalls = 0;
  8884. this.allBallNum = 0;
  8885. this.placeBallPosData = {};
  8886. this.curHP = 0;
  8887. this.showLongView = false;
  8888. this.firstShoot = true;
  8889. this._gamePause = false;
  8890. this.trunCount = 0;
  8891. this.isBlackInHole = false;
  8892. this.isEnter = true;
  8893. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8894. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8895. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8896. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8897. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8898. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8899. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8900. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8901. }
  8902. get gamePause() {
  8903. return this._gamePause;
  8904. }
  8905. set gamePause(v) {
  8906. if (v) {
  8907. Laya.physicsTimer.pause();
  8908. }
  8909. else {
  8910. Laya.physicsTimer.resume();
  8911. }
  8912. this._gamePause = v;
  8913. }
  8914. get selfTurn() {
  8915. return this._selfTurn;
  8916. }
  8917. set selfTurn(val) {
  8918. this.trunCount++;
  8919. this._selfTurn = val;
  8920. if (val) {
  8921. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8922. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8923. }
  8924. else {
  8925. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8926. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8927. if (this.trunCount > 1)
  8928. PlatMgr.openBox();
  8929. }
  8930. }
  8931. resetGame() {
  8932. this.inHoleBalls = [];
  8933. this.isFirstInGame = true;
  8934. this.firstColliObj = null;
  8935. this.aiCamp = "";
  8936. this.selfCamp = "";
  8937. this.aiFoulNum = 0;
  8938. this.selfFoulNum = 0;
  8939. this.selfBallArr = [];
  8940. this.aiBallArr = [];
  8941. this.gamePause = false;
  8942. this.ensureBallType = false;
  8943. this.isInterrupt = false;
  8944. this.updateLeftBall();
  8945. this.clearTime();
  8946. this.aiPlayedBreakArmy = false;
  8947. this.isBlackInHole = false;
  8948. this.placeBallPosData = {};
  8949. if (xGame.common.d3World.knifeRoot) {
  8950. xGame.common.d3World.knifeRoot.destroyChildren();
  8951. }
  8952. }
  8953. gameReady() {
  8954. this.trunCount = 0;
  8955. this.firstColliObj = null;
  8956. this.isFirstInGame = true;
  8957. this.selfTurn = Math.random() <= this.selfTurnRate;
  8958. let challengeNum = DataMgr.getChallengeTimes();
  8959. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8960. this.selfTurn = true;
  8961. }
  8962. if (xGame.common.gameMode == GameMode.placeBall)
  8963. this.selfTurn = true;
  8964. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8965. this.selfTurn = true;
  8966. }
  8967. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8968. this.checkGuide();
  8969. if (xGame.common.uiRodMethod)
  8970. xGame.common.uiRodMethod.resetRod();
  8971. xGame.common.d2World.getHelpLine();
  8972. this.isOpenBall = true;
  8973. this.isTouchedBall = false;
  8974. xGame.common.aiPlayer.stopRun();
  8975. this.setTime = 30;
  8976. let ui = xGame.common.gameUI.ui;
  8977. switch (xGame.common.gameMode) {
  8978. case GameMode.classic:
  8979. xGame.common.aiPlayer.init();
  8980. this.blackNum = 8;
  8981. this.placeRootBall();
  8982. this.peoplePlay(9, 10);
  8983. ui.wordsBtn.visible = true;
  8984. ui.aiWordsBtn.visible = true;
  8985. xGame.common.talkMgr.changeAIState(true);
  8986. DataMgr.gameData.gameCount++;
  8987. DataMgr.saveGameData();
  8988. break;
  8989. case GameMode.bigMove:
  8990. this.blackNum = -1;
  8991. this.selfScore = 0;
  8992. this.aiScore = 0;
  8993. xGame.common.aiPlayer.init();
  8994. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8995. this.updateSelfScore();
  8996. this.updateAIScore();
  8997. this.updateTargetSroce();
  8998. this.placeRootBall();
  8999. this.peoplePlay(9, 10);
  9000. ui.wordsBtn.visible = true;
  9001. ui.aiWordsBtn.visible = true;
  9002. xGame.common.talkMgr.changeAIState(true);
  9003. if (DataMgr.getSkillGuide() < 1)
  9004. DataMgr.gameData.gameCount = 0;
  9005. else {
  9006. DataMgr.gameData.gameCount++;
  9007. DataMgr.saveGameData();
  9008. PlatMgr.openTry();
  9009. }
  9010. if (xGame.common.d3World.knifeRoot) {
  9011. xGame.common.d3World.knifeRoot.destroyChildren();
  9012. }
  9013. break;
  9014. case GameMode.placeBall:
  9015. this.blackNum = -1;
  9016. this.selfTurn = true;
  9017. this.setTime = 10000;
  9018. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9019. this.curHP = this.placeBallData.hp;
  9020. if (this.placeBallData.ball == -1)
  9021. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9022. else
  9023. this.needBalls = this.placeBallData.ball;
  9024. console.log("需要的进球数目", this.needBalls);
  9025. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9026. this.finishBalls = 0;
  9027. this.placeBallPosData = {};
  9028. this.updatePlaceBallPos();
  9029. this.updatePlaceBallState();
  9030. this.finishOneShoot = true;
  9031. xGame.common.gameUI.ui.moveNode.visible = false;
  9032. this.isOpenBall = false;
  9033. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9034. ui.wordsBtn.visible = false;
  9035. ui.aiWordsBtn.visible = false;
  9036. xGame.common.talkMgr.changeAIState(false);
  9037. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9038. PlatMgr.openBox();
  9039. });
  9040. break;
  9041. default:
  9042. break;
  9043. }
  9044. this.showLongView = false;
  9045. xGame.common.wordsMgr.comboTimes = 1;
  9046. let guide = DataMgr.getSkillGuide();
  9047. if (guide)
  9048. xGame.eventMgr.event(WAIT_SHOOT);
  9049. xGame.common.upSkillLevel = false;
  9050. xGame.common.gameStartTime = new Date().getTime();
  9051. this.firstShoot = true;
  9052. }
  9053. checkGuide() {
  9054. let guide = DataMgr.getSkillGuide();
  9055. let gameUI = xGame.common.gameUI.ui;
  9056. gameUI.guide1.visible = false;
  9057. gameUI.guide2.visible = false;
  9058. gameUI.guide3.visible = false;
  9059. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9060. this.selfTurn = true;
  9061. }
  9062. else {
  9063. return;
  9064. }
  9065. let oneBall = this.getOneBall();
  9066. gameUI.guide1.visible = true;
  9067. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9068. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9069. }
  9070. getOneBall() {
  9071. let arr = xGame.common.d2World.ballArr;
  9072. for (let index = 0; index < arr.length; index++) {
  9073. if (arr[index].number == 0)
  9074. continue;
  9075. return arr[index];
  9076. }
  9077. }
  9078. updateSelfScore() {
  9079. let ui = xGame.common.gameUI.ui.topNode;
  9080. ui.selfScoreTxt.text = this.selfScore + "";
  9081. }
  9082. updateAIScore() {
  9083. let ui = xGame.common.gameUI.ui.topNode;
  9084. ui.aiScoreTxt.text = this.aiScore + "";
  9085. }
  9086. updateTargetSroce() {
  9087. let ui = xGame.common.gameUI.ui.topNode;
  9088. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9089. }
  9090. updateLeftBall() {
  9091. let topUI = xGame.common.gameUI.ui.topNode;
  9092. topUI.selfBallList.numItems = this.selfBallArr.length;
  9093. topUI.aiBallList.numItems = this.aiBallArr.length;
  9094. }
  9095. ballShoot() {
  9096. this.clearTime();
  9097. this.finishOneShoot = false;
  9098. xGame.common.gameUI.ui.moveNode.visible = false;
  9099. if (xGame.common.gameUI.ui.guideNode.visible) {
  9100. xGame.common.gameUI.ui.guideNode.visible = false;
  9101. }
  9102. if (this.firstShoot) {
  9103. this.firstShoot = false;
  9104. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9105. }
  9106. }
  9107. ensureCamp(number) {
  9108. this.ensureBallType = true;
  9109. this.isOpenBall = false;
  9110. if (xGame.common.gameMode != GameMode.classic)
  9111. return;
  9112. let full = [1, 2, 3, 4, 5, 6, 7];
  9113. let flower = [9, 10, 11, 12, 13, 14, 15];
  9114. let sayWords = "";
  9115. if (this.selfTurn) {
  9116. if (number <= 7) {
  9117. this.selfCamp = ballCamp.full;
  9118. this.selfBallArr = full;
  9119. this.aiCamp = ballCamp.flower;
  9120. this.aiBallArr = flower;
  9121. sayWords = cfgTable.wordsData[3].msg;
  9122. }
  9123. else {
  9124. this.selfCamp = ballCamp.flower;
  9125. this.selfBallArr = flower;
  9126. this.aiCamp = ballCamp.full;
  9127. this.aiBallArr = full;
  9128. sayWords = cfgTable.wordsData[4].msg;
  9129. }
  9130. }
  9131. else {
  9132. if (number <= 7) {
  9133. this.selfCamp = ballCamp.flower;
  9134. this.selfBallArr = flower;
  9135. this.aiCamp = ballCamp.full;
  9136. this.aiBallArr = full;
  9137. sayWords = cfgTable.wordsData[2].msg;
  9138. }
  9139. else {
  9140. this.selfCamp = ballCamp.full;
  9141. this.selfBallArr = full;
  9142. this.aiCamp = ballCamp.flower;
  9143. this.aiBallArr = flower;
  9144. sayWords = cfgTable.wordsData[1].msg;
  9145. }
  9146. }
  9147. this.updateLeftBall();
  9148. xGame.uiMgr.Show(UIMsg, sayWords);
  9149. }
  9150. updatePlaceBallState() {
  9151. let ui = xGame.common.gameUI.ui;
  9152. switch (this.placeBallData.type) {
  9153. case PlaceBallType.normal:
  9154. let normal = ui.placeNormalNode;
  9155. normal.hpTxt.text = this.curHP + "";
  9156. this.updatePlaceBallStar(normal);
  9157. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9158. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9159. break;
  9160. case PlaceBallType.challenge:
  9161. let challenge = ui.placeChallengeNode;
  9162. challenge.hpTxt.text = "Shots:" + this.curHP;
  9163. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9164. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9165. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9166. break;
  9167. default:
  9168. break;
  9169. }
  9170. }
  9171. playSubHpAni() {
  9172. let ui = xGame.common.gameUI.ui;
  9173. switch (this.placeBallData.type) {
  9174. case PlaceBallType.normal:
  9175. let normal = ui.placeNormalNode;
  9176. normal.hpTxt.visible = false;
  9177. normal.starAni.c1.selectedIndex = 1;
  9178. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9179. normal.hpTxt.visible = true;
  9180. normal.starAni.c1.selectedIndex = 0;
  9181. }));
  9182. break;
  9183. default:
  9184. break;
  9185. }
  9186. }
  9187. getEndStarNum() {
  9188. let num;
  9189. let level = xGame.common.placeBallCurLevel;
  9190. if (this.curHP == this.placeBallData.hp) {
  9191. num = 3;
  9192. }
  9193. else if (this.curHP <= 1) {
  9194. num = 1;
  9195. }
  9196. else {
  9197. num = 2;
  9198. }
  9199. if (!this.success) {
  9200. num = 0;
  9201. }
  9202. else {
  9203. DataMgr.setPlaceBallLevel(level, num);
  9204. }
  9205. let myType = cfgTable.placeballData[level].type;
  9206. if (this.success && myType == 1) {
  9207. num = 3;
  9208. }
  9209. xGame.common.placeBallStarNum = num;
  9210. }
  9211. updatePlaceBallStar(node) {
  9212. let star = 0;
  9213. if (this.curHP == this.placeBallData.hp) {
  9214. star = 3;
  9215. }
  9216. else if (this.curHP >= 2) {
  9217. star = 2;
  9218. }
  9219. else if (this.curHP == 1) {
  9220. star = 1;
  9221. }
  9222. else {
  9223. star = 0;
  9224. }
  9225. let temp;
  9226. for (let index = 1; index <= 3; index++) {
  9227. temp = node["star" + index];
  9228. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9229. }
  9230. node.myProgress.value = (star / 3) * 100;
  9231. }
  9232. openRegretView(isFoul, GoalNum, challenge = false) {
  9233. let regretType = -1;
  9234. if (isFoul) {
  9235. regretType = 1;
  9236. }
  9237. else {
  9238. if (GoalNum <= 0) {
  9239. regretType = 0;
  9240. }
  9241. }
  9242. if (challenge) {
  9243. regretType = 1;
  9244. }
  9245. if (regretType != -1) {
  9246. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9247. if (success) {
  9248. this.curHP++;
  9249. this.updatePlaceBallState();
  9250. this.setPlaceBallAllPos();
  9251. xGame.common.gameUI.ui.moveNode.visible = false;
  9252. }
  9253. else {
  9254. if (this.curHP <= 0) {
  9255. this.success = false;
  9256. this.gameEnd();
  9257. }
  9258. this.playSubHpAni();
  9259. }
  9260. this.updatePlaceBallState();
  9261. this.updatePlaceBallPos();
  9262. });
  9263. }
  9264. }
  9265. setPlaceBallAllPos() {
  9266. let allBall = xGame.common.d2World.ballArr;
  9267. let cfgArr = this.placeBallPosData;
  9268. let temp;
  9269. let obj;
  9270. for (let index = 0; index < allBall.length; index++) {
  9271. temp = allBall[index];
  9272. if (temp.destroyed)
  9273. continue;
  9274. obj = cfgArr[temp.myUNID];
  9275. if (obj && obj.src && !obj.src.destroyed) {
  9276. temp.gameObj.x = obj.posX;
  9277. temp.gameObj.y = obj.posY;
  9278. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9279. }
  9280. }
  9281. xGame.common.d2World.getHelpLine();
  9282. }
  9283. updatePlaceBallPos() {
  9284. let arr = xGame.common.d2World.ballArr;
  9285. let temp;
  9286. for (let index = 0; index < arr.length; index++) {
  9287. temp = arr[index];
  9288. if (!this.placeBallPosData[temp.myUNID]) {
  9289. this.placeBallPosData[temp.myUNID] = {
  9290. src: temp,
  9291. posX: temp.gameObj.x,
  9292. posY: temp.gameObj.y
  9293. };
  9294. }
  9295. else {
  9296. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9297. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9298. }
  9299. }
  9300. let check;
  9301. for (const key in this.placeBallPosData) {
  9302. check = this.placeBallPosData[key];
  9303. if (check.src.destroyed) {
  9304. delete this.placeBallPosData[key];
  9305. }
  9306. }
  9307. }
  9308. gameRun(type) {
  9309. if (this.gamePause)
  9310. return;
  9311. this.curFoul = this.getFoulType();
  9312. if (type) {
  9313. xGame.common.d2World.d2Gan.shoot();
  9314. xGame.common.gameUI.forceCancel();
  9315. this.curFoul = type;
  9316. }
  9317. this.isEnd = false;
  9318. this.isChangeTurn = true;
  9319. if (xGame.common.gameMode == GameMode.classic) {
  9320. this.judgeClassic(this.curFoul);
  9321. this.checkClassicWords(() => {
  9322. xGame.common.destroyClassicEmotion();
  9323. if (this.isEnd) {
  9324. if (this.isBlackInHole) {
  9325. xGame.common.gameUI.ui.blackAni.visible = true;
  9326. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9327. xGame.common.gameUI.ui.blackAni.visible = false;
  9328. this.gameEnd();
  9329. }));
  9330. }
  9331. else {
  9332. this.gameEnd();
  9333. }
  9334. }
  9335. else {
  9336. this.waitShoot();
  9337. xGame.eventMgr.event(WAIT_SHOOT);
  9338. }
  9339. });
  9340. }
  9341. else if (xGame.common.gameMode == GameMode.bigMove) {
  9342. xGame.common.aiPlayer.stopRun();
  9343. let scoreArr = this.getScore(this.curFoul);
  9344. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9345. this.isEnd = true;
  9346. }
  9347. this.checkBigSkillWords(() => {
  9348. if (this.isEnd) {
  9349. this.gameEnd();
  9350. }
  9351. else {
  9352. this.waitShoot();
  9353. xGame.eventMgr.event(WAIT_SHOOT);
  9354. }
  9355. });
  9356. }
  9357. else if (xGame.common.gameMode == GameMode.placeBall) {
  9358. xGame.common.destroyAwardSpine();
  9359. let isFoul = this.curFoul == FoulType.rootHole;
  9360. let GoalNum = this.inHoleBalls.length;
  9361. if (this.inHoleBalls.indexOf(0) > -1)
  9362. GoalNum -= 1;
  9363. if (isFoul) {
  9364. this.placeRootBall();
  9365. }
  9366. console.log("neeballs", this.needBalls);
  9367. console.log("当前完成的goalNum", GoalNum);
  9368. this.finishBalls += GoalNum;
  9369. console.log("当前完成的finishballs", this.finishBalls);
  9370. let need = this.needBalls;
  9371. if (this.placeBallData.type == PlaceBallType.challenge) {
  9372. need += 100;
  9373. }
  9374. if (this.finishBalls >= need) {
  9375. this.success = true;
  9376. this.gameEnd();
  9377. }
  9378. else {
  9379. switch (this.placeBallData.type) {
  9380. case PlaceBallType.normal:
  9381. if (!isFoul && GoalNum > 0) {
  9382. this.updatePlaceBallPos();
  9383. this.updatePlaceBallState();
  9384. }
  9385. else {
  9386. this.curHP--;
  9387. this.openRegretView(isFoul, GoalNum);
  9388. }
  9389. this.waitShoot();
  9390. xGame.eventMgr.event(WAIT_SHOOT);
  9391. break;
  9392. case PlaceBallType.challenge:
  9393. this.curHP--;
  9394. this.updatePlaceBallState();
  9395. if (isFoul) {
  9396. this.openRegretView(isFoul, GoalNum, true);
  9397. }
  9398. else {
  9399. this.updatePlaceBallPos();
  9400. if (this.curHP <= 0) {
  9401. this.success = true;
  9402. this.gameEnd();
  9403. }
  9404. }
  9405. this.waitShoot();
  9406. xGame.eventMgr.event(WAIT_SHOOT);
  9407. break;
  9408. default:
  9409. break;
  9410. }
  9411. }
  9412. }
  9413. }
  9414. checkClassicWords(callback) {
  9415. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9416. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9417. let type = this.getClassicWordsType();
  9418. if (condition && type != -1) {
  9419. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9420. xGame.soundMgr.playSound(str);
  9421. xGame.common.wordsMgr.playClassicWords(type, callback);
  9422. }
  9423. else {
  9424. Laya.timer.once(300, this, () => {
  9425. callback && callback();
  9426. });
  9427. }
  9428. }
  9429. getClassicWordsType() {
  9430. let d2world = xGame.common.d2World;
  9431. let type = -1;
  9432. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9433. type = ClassicWordsType.perfectShow;
  9434. return type;
  9435. }
  9436. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9437. type = ClassicWordsType.directShoot;
  9438. return type;
  9439. }
  9440. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9441. type = ClassicWordsType.anotherShoot;
  9442. return type;
  9443. }
  9444. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9445. type = ClassicWordsType.bigPower;
  9446. return type;
  9447. }
  9448. let minSpeed = 1;
  9449. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9450. type = ClassicWordsType.hardShoot;
  9451. return type;
  9452. }
  9453. if (this.inHoleBalls.length > 0) {
  9454. type = ClassicWordsType.directShoot;
  9455. return type;
  9456. }
  9457. return type;
  9458. }
  9459. checkBigSkillWords(callback) {
  9460. if (this.curFoul == FoulType.timeOut) {
  9461. callback && callback();
  9462. }
  9463. else {
  9464. let playSkill = false;
  9465. if (this.selfTurn) {
  9466. playSkill = true;
  9467. }
  9468. else {
  9469. if (!this.aiPlayedBreakArmy) {
  9470. this.aiPlayedBreakArmy = true;
  9471. playSkill = true;
  9472. }
  9473. if (this.aiCurSkill != SkillType.breakArmy) {
  9474. playSkill = true;
  9475. }
  9476. }
  9477. if (xGame.common.skillMgr.playedLastSkill) {
  9478. xGame.common.skillMgr.playedLastSkill = false;
  9479. playSkill = false;
  9480. }
  9481. if (playSkill) {
  9482. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9483. let selfExtra = 0;
  9484. let aiExtra = 0;
  9485. if (this.selfTurn)
  9486. selfExtra += extraScore;
  9487. else
  9488. aiExtra += extraScore;
  9489. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9490. this.isEnd = true;
  9491. }
  9492. this.playBigSkillTimes(callback);
  9493. });
  9494. }
  9495. else {
  9496. this.playBigSkillTimes(callback);
  9497. }
  9498. }
  9499. }
  9500. playBigSkillTimes(callback) {
  9501. let length = this.inHoleBalls.length;
  9502. if (this.inHoleBalls.indexOf(0) > -1) {
  9503. length = this.inHoleBalls.length - 1;
  9504. }
  9505. if (length <= 0) {
  9506. callback && callback();
  9507. return;
  9508. }
  9509. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9510. callback && callback();
  9511. });
  9512. }
  9513. playSkillTips() {
  9514. let levelNum = 0;
  9515. let curType;
  9516. if (this.selfTurn) {
  9517. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9518. curType = this.selfCurSkill;
  9519. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9520. levelNum += 5;
  9521. }
  9522. }
  9523. else {
  9524. levelNum = this.aiSkillLevelNum;
  9525. curType = this.aiCurSkill;
  9526. }
  9527. let str = ``;
  9528. switch (curType) {
  9529. case SkillType.highSpace:
  9530. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9531. break;
  9532. case SkillType.breakArmy:
  9533. str = `You pocketed ${levelNum} extra balls`;
  9534. break;
  9535. case SkillType.ice:
  9536. str = `${levelNum * 2} extra balls were frozen`;
  9537. break;
  9538. case SkillType.fireworks:
  9539. str = `${levelNum} extra balls exploded `;
  9540. break;
  9541. case SkillType.GuanYu:
  9542. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9543. break;
  9544. default:
  9545. break;
  9546. }
  9547. xGame.uiMgr.Show(UIMsg, str);
  9548. }
  9549. getFoulType() {
  9550. let foulType = "";
  9551. if (this.firstColliObj == null) {
  9552. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9553. return FoulType.rootHole;
  9554. }
  9555. return FoulType.notTouch;
  9556. }
  9557. else {
  9558. if (this.selfTurn) {
  9559. if (this.selfBallArr.length > 0) {
  9560. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9561. foulType = FoulType.wrongTouch;
  9562. }
  9563. }
  9564. else {
  9565. if (this.ensureBallType) {
  9566. }
  9567. else {
  9568. if (this.firstColliObj == this.blackNum) {
  9569. foulType = FoulType.wrongTouch;
  9570. }
  9571. }
  9572. }
  9573. }
  9574. else {
  9575. if (this.aiBallArr.length > 0) {
  9576. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9577. foulType = FoulType.wrongTouch;
  9578. }
  9579. }
  9580. else {
  9581. if (this.ensureBallType) {
  9582. }
  9583. else {
  9584. if (this.firstColliObj == this.blackNum) {
  9585. foulType = FoulType.wrongTouch;
  9586. }
  9587. }
  9588. }
  9589. }
  9590. if (this.inHoleBalls.length <= 0) {
  9591. return foulType;
  9592. }
  9593. let temp;
  9594. if (this.inHoleBalls.indexOf(0) > -1) {
  9595. foulType = FoulType.rootHole;
  9596. }
  9597. else {
  9598. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9599. temp = this.inHoleBalls[index];
  9600. if (this.selfTurn) {
  9601. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9602. foulType = FoulType.wrongHole;
  9603. break;
  9604. }
  9605. }
  9606. else {
  9607. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9608. foulType = FoulType.wrongHole;
  9609. break;
  9610. }
  9611. }
  9612. }
  9613. }
  9614. let foo;
  9615. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9616. temp = this.inHoleBalls[index];
  9617. foo = this.selfBallArr.indexOf(temp);
  9618. if (foo > -1) {
  9619. this.selfBallArr.splice(foo, 1);
  9620. }
  9621. foo = this.aiBallArr.indexOf(temp);
  9622. if (foo > -1) {
  9623. this.aiBallArr.splice(foo, 1);
  9624. }
  9625. }
  9626. this.updateLeftBall();
  9627. }
  9628. return foulType;
  9629. }
  9630. judgeGameEndByBlack(arr) {
  9631. if (this.selfTurn) {
  9632. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9633. this.selfFoulNum = this.maxFoulTimes;
  9634. return true;
  9635. }
  9636. }
  9637. else {
  9638. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9639. this.aiFoulNum = this.maxFoulTimes;
  9640. return true;
  9641. }
  9642. }
  9643. }
  9644. judgeClassic(type) {
  9645. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9646. xGame.common.aiPlayer.stopRun();
  9647. if (this.judgeNormalSuccess()) {
  9648. this.isEnd = true;
  9649. return;
  9650. }
  9651. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9652. if (this.selfTurn) {
  9653. if (isFoul) {
  9654. this.selfFoulNum++;
  9655. }
  9656. if (this.selfFoulNum >= this.maxFoulTimes) {
  9657. this.success = false;
  9658. this.isEnd = true;
  9659. return;
  9660. }
  9661. }
  9662. else {
  9663. if (isFoul)
  9664. this.aiFoulNum++;
  9665. if (this.aiFoulNum >= this.maxFoulTimes) {
  9666. this.success = true;
  9667. this.isEnd = true;
  9668. return;
  9669. }
  9670. }
  9671. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9672. this.isChangeTurn = false;
  9673. }
  9674. else {
  9675. this.isInterrupt = true;
  9676. }
  9677. }
  9678. waitShoot() {
  9679. if (xGame.common.gameMode == GameMode.classic) {
  9680. switch (this.curFoul) {
  9681. case FoulType.timeOut:
  9682. case FoulType.rootHole:
  9683. this.selfTurn = !this.selfTurn;
  9684. this.peoplePlay(5, 6, true);
  9685. break;
  9686. case FoulType.notTouch:
  9687. this.selfTurn = !this.selfTurn;
  9688. this.peoplePlay(7, 7);
  9689. break;
  9690. case FoulType.wrongHole:
  9691. this.selfTurn = !this.selfTurn;
  9692. this.peoplePlay(11, 11);
  9693. break;
  9694. default:
  9695. if (this.inHoleBalls.length > 0) {
  9696. this.peoplePlay(0, 0, false, false);
  9697. }
  9698. else {
  9699. this.selfTurn = !this.selfTurn;
  9700. this.peoplePlay(7, 7);
  9701. }
  9702. break;
  9703. }
  9704. }
  9705. else if (xGame.common.gameMode == GameMode.bigMove) {
  9706. if (this.curFoul == FoulType.timeOut) {
  9707. this.selfTurn = !this.selfTurn;
  9708. this.peoplePlay(14, 15);
  9709. this.placeRootBall();
  9710. }
  9711. else {
  9712. this.selfTurn = !this.selfTurn;
  9713. if (this.curFoul == FoulType.rootHole) {
  9714. this.peoplePlay(12, 13);
  9715. this.placeRootBall();
  9716. }
  9717. else {
  9718. this.peoplePlay(0, 0, false, false);
  9719. }
  9720. }
  9721. }
  9722. else if (xGame.common.gameMode == GameMode.placeBall) {
  9723. this.finishOneShoot = true;
  9724. }
  9725. this.gameResult();
  9726. }
  9727. gameResult() {
  9728. this.firstColliObj = null;
  9729. this.inHoleBalls = [];
  9730. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9731. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9732. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9733. if (xGame.common.uiRodMethod)
  9734. xGame.common.uiRodMethod.resetRod();
  9735. xGame.common.d2World.rootBall.showSelf();
  9736. this.clearIceSkill();
  9737. if (this.selfTurn) {
  9738. PlatMgr.gameInsert();
  9739. }
  9740. xGame.common.d3World.knifeRoot.destroyChildren();
  9741. if (this.selfTurn) {
  9742. xGame.common.gameUI.showHelpLineGuide();
  9743. xGame.common.gameUI.setTurnAlpha(true);
  9744. }
  9745. else {
  9746. xGame.common.gameUI.setTurnAlpha(false);
  9747. }
  9748. }
  9749. getScore(type) {
  9750. let selfAdd = 0;
  9751. let aiAdd = 0;
  9752. if (type == FoulType.timeOut) {
  9753. if (this.selfTurn)
  9754. aiAdd += 3;
  9755. else
  9756. selfAdd += 3;
  9757. }
  9758. else {
  9759. if (this.inHoleBalls.length > 0) {
  9760. if (this.selfTurn) {
  9761. if (type == FoulType.rootHole) {
  9762. aiAdd += 3;
  9763. if (this.inHoleBalls.length - 1 > 0) {
  9764. selfAdd += this.inHoleBalls.length - 1;
  9765. }
  9766. }
  9767. else {
  9768. selfAdd += this.inHoleBalls.length;
  9769. }
  9770. }
  9771. else {
  9772. if (type == FoulType.rootHole) {
  9773. selfAdd += 3;
  9774. if (this.inHoleBalls.length - 1 > 0) {
  9775. aiAdd += this.inHoleBalls.length - 1;
  9776. }
  9777. }
  9778. else {
  9779. aiAdd += this.inHoleBalls.length;
  9780. }
  9781. }
  9782. }
  9783. }
  9784. return [selfAdd, aiAdd];
  9785. }
  9786. judgeScoreEnd(selfAdd, aiAdd) {
  9787. this.selfScore += selfAdd;
  9788. this.aiScore += aiAdd;
  9789. this.updateAIScore();
  9790. this.updateSelfScore();
  9791. if (this.selfScore >= this.targertScore) {
  9792. this.success = true;
  9793. return true;
  9794. }
  9795. if (this.aiScore >= this.targertScore) {
  9796. this.success = false;
  9797. return true;
  9798. }
  9799. let ballArr = xGame.common.d2World.ballArr;
  9800. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9801. if (this.selfScore > this.aiScore) {
  9802. this.success = true;
  9803. return true;
  9804. }
  9805. else if (this.selfScore < this.aiScore) {
  9806. this.success = false;
  9807. return true;
  9808. }
  9809. else {
  9810. if (this.selfTurn) {
  9811. this.success = false;
  9812. }
  9813. else {
  9814. this.success = true;
  9815. }
  9816. return true;
  9817. }
  9818. }
  9819. }
  9820. clearIceSkill() {
  9821. let arr = xGame.common.d2World.ballArr;
  9822. let temp;
  9823. if (this.selfTurn) {
  9824. if (this.selfCurSkill == SkillType.ice) {
  9825. for (let index = 0; index < arr.length; index++) {
  9826. temp = arr[index];
  9827. if (temp.ballFunc == "ice") {
  9828. temp.setBallFunc("normal", "self");
  9829. }
  9830. }
  9831. }
  9832. }
  9833. else {
  9834. if (this.aiCurSkill == SkillType.ice) {
  9835. for (let index = 0; index < arr.length; index++) {
  9836. temp = arr[index];
  9837. if (temp.ballFunc == "ice") {
  9838. temp.setBallFunc("normal", "ai");
  9839. }
  9840. }
  9841. }
  9842. }
  9843. }
  9844. judgeNormalSuccess() {
  9845. if (this.selfTurn) {
  9846. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9847. this.success = true;
  9848. return true;
  9849. }
  9850. }
  9851. else {
  9852. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9853. this.success = false;
  9854. return true;
  9855. }
  9856. }
  9857. }
  9858. gameEnd() {
  9859. if (Moyu.isTT) {
  9860. xGame.common.screenImg = getScreenImg();
  9861. }
  9862. console.log("游戏结束", this.success);
  9863. xGame.common.aiPlayer.stopRun();
  9864. if (xGame.common.gameMode == GameMode.placeBall) {
  9865. this.getEndStarNum();
  9866. this.updatePlaceBallState();
  9867. }
  9868. this.isEnter = false;
  9869. Moyu.recordEnd(this, () => {
  9870. if (this.isEnter)
  9871. return;
  9872. this.isEnter = true;
  9873. console.log("进入录结束回调");
  9874. this.enterNext();
  9875. });
  9876. Laya.timer.once(1000, this, () => {
  9877. if (this.isEnter)
  9878. return;
  9879. this.isEnter = true;
  9880. this.enterNext();
  9881. });
  9882. xGame.common.longHelpLine = false;
  9883. }
  9884. enterNext() {
  9885. Laya.timer.clearAll(this);
  9886. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9887. xGame.uiMgr.Show(UIVideoShare, this.success);
  9888. }
  9889. else {
  9890. xGame.uiMgr.Show(UIGameEnd, this.success);
  9891. }
  9892. }
  9893. aiLeave() {
  9894. let ui = xGame.common.gameUI.ui;
  9895. ui.topNode.aiNameTxt.text = "offline";
  9896. }
  9897. aiGameEnd(suc) {
  9898. this.success = suc;
  9899. xGame.common.aiPlayer.stopRun();
  9900. if (this.success) {
  9901. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9902. Laya.timer.once(1000, this, () => {
  9903. this.clearTime();
  9904. this.gameEnd();
  9905. });
  9906. }
  9907. }
  9908. openTimer() {
  9909. let src = xGame.common.gameUI;
  9910. if (this.selfTurn) {
  9911. src.ui.topNode.selfProgress.visible = true;
  9912. src.ui.topNode.aiProgress.visible = false;
  9913. this.curTimer = src.ui.topNode.selfProgress;
  9914. }
  9915. else {
  9916. src.ui.topNode.selfProgress.visible = false;
  9917. src.ui.topNode.aiProgress.visible = true;
  9918. this.curTimer = src.ui.topNode.aiProgress;
  9919. }
  9920. this.accTime = 0;
  9921. Laya.timer.clearAll(this);
  9922. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9923. this.curTimer.value = 100;
  9924. }
  9925. updateTime(dt) {
  9926. if (this.gamePause)
  9927. return;
  9928. this.accTime += dt;
  9929. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9930. if (this.accTime >= this.setTime) {
  9931. this.clearTime();
  9932. console.log("时钟进入了gameRun");
  9933. this.gameRun(FoulType.timeOut);
  9934. }
  9935. }
  9936. clearTime() {
  9937. let src = xGame.common.gameUI;
  9938. src.ui.topNode.selfProgress.visible = false;
  9939. src.ui.topNode.aiProgress.visible = false;
  9940. Laya.timer.clearAll(this);
  9941. }
  9942. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9943. let ui = xGame.common.gameUI.ui;
  9944. let selfMsg, aiMsg;
  9945. if (sayWords) {
  9946. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9947. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9948. if (Foul) {
  9949. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9950. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9951. this.placeRootBall();
  9952. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9953. if (this.curFoul == FoulType.rootHole) {
  9954. if (!DataMgr.getRootBallFoul()) {
  9955. DataMgr.setRootBallFoul();
  9956. aiMsg = "";
  9957. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9958. let woman = "Boss, pay attention next time~";
  9959. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9960. }
  9961. }
  9962. else if (this.curFoul == FoulType.timeOut) {
  9963. if (!DataMgr.getTimeoutFoul()) {
  9964. DataMgr.setTimeoutFoul();
  9965. aiMsg = "";
  9966. let tips = "Game timeout, 3 fouls, this game failed.";
  9967. let woman = "Boss, pay attention to the timeline~";
  9968. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9969. }
  9970. }
  9971. }
  9972. }
  9973. }
  9974. if (this.selfTurn) {
  9975. if (sayWords) {
  9976. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9977. ui.selfTurn.visible = true;
  9978. ui.aiTurn.visible = false;
  9979. ui.selfTurn.t0.play();
  9980. Moyu.vibration();
  9981. });
  9982. }
  9983. }
  9984. else {
  9985. let aiNum = xGame.tools.random(1, 11);
  9986. let challengeNum = DataMgr.getChallengeTimes();
  9987. let delay = false;
  9988. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9989. aiNum = 9;
  9990. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9991. aiNum = 3;
  9992. if (challengeNum == 3) {
  9993. if (!this.showLongView) {
  9994. this.showLongView = true;
  9995. delay = true;
  9996. }
  9997. }
  9998. }
  9999. }
  10000. if (delay) {
  10001. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10002. if (success) {
  10003. xGame.common.longHelpLine = true;
  10004. xGame.common.d2World.getHelpLine();
  10005. }
  10006. else {
  10007. aiNum = 10;
  10008. }
  10009. xGame.common.aiPlayer.setAiLevel(aiNum);
  10010. if (sayWords) {
  10011. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10012. xGame.common.aiPlayer.runAI();
  10013. ui.selfTurn.visible = false;
  10014. ui.aiTurn.visible = true;
  10015. ui.aiTurn.t0.play();
  10016. });
  10017. }
  10018. else {
  10019. xGame.common.aiPlayer.runAI();
  10020. }
  10021. this.openTimer();
  10022. this.finishOneShoot = true;
  10023. if (this.selfTurn) {
  10024. ui.topNode.selfKuang.visible = true;
  10025. ui.topNode.aiKuang.visible = false;
  10026. ui.topNode.selfTips.visible = true;
  10027. ui.topNode.aiTips.visible = false;
  10028. }
  10029. else {
  10030. ui.topNode.selfKuang.visible = false;
  10031. ui.topNode.aiKuang.visible = true;
  10032. ui.topNode.selfTips.visible = false;
  10033. ui.topNode.aiTips.visible = true;
  10034. }
  10035. });
  10036. return;
  10037. }
  10038. if (xGame.common.gameMode == GameMode.classic) {
  10039. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10040. if (cfg) {
  10041. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10042. aiNum = aiLevel;
  10043. }
  10044. }
  10045. xGame.common.aiPlayer.setAiLevel(aiNum);
  10046. if (sayWords) {
  10047. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10048. xGame.common.aiPlayer.runAI();
  10049. ui.selfTurn.visible = false;
  10050. ui.aiTurn.visible = true;
  10051. ui.aiTurn.t0.play();
  10052. });
  10053. }
  10054. else {
  10055. xGame.common.aiPlayer.runAI();
  10056. }
  10057. }
  10058. this.openTimer();
  10059. this.finishOneShoot = true;
  10060. if (this.selfTurn) {
  10061. ui.topNode.selfKuang.visible = true;
  10062. ui.topNode.aiKuang.visible = false;
  10063. ui.topNode.selfTips.visible = true;
  10064. ui.topNode.aiTips.visible = false;
  10065. }
  10066. else {
  10067. ui.topNode.selfKuang.visible = false;
  10068. ui.topNode.aiKuang.visible = true;
  10069. ui.topNode.selfTips.visible = false;
  10070. ui.topNode.aiTips.visible = true;
  10071. }
  10072. }
  10073. placeRootBall() {
  10074. let rootBall = xGame.common.d2World.rootBall;
  10075. if (!rootBall)
  10076. return;
  10077. rootBall.gameObj.x = this.lastRootBallPos.x;
  10078. rootBall.gameObj.y = this.lastRootBallPos.y;
  10079. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10080. let moveNode = xGame.common.gameUI.ui.moveNode;
  10081. moveNode.visible = true;
  10082. moveNode.x = this.lastRootBallPos.x;
  10083. moveNode.y = this.lastRootBallPos.y;
  10084. if (!this.selfTurn) {
  10085. xGame.common.aiPlayer.resetRoot();
  10086. }
  10087. }
  10088. }
  10089. class ui_guanyuAni extends fgui.GComponent {
  10090. static createInstance() {
  10091. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10092. }
  10093. onConstruct() {
  10094. this.n0 = (this.getChild("n0"));
  10095. }
  10096. }
  10097. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10098. class UIFireworks extends UIBase {
  10099. constructor() {
  10100. super();
  10101. }
  10102. onConstructor() {
  10103. this.isEject = false;
  10104. }
  10105. show(callback) {
  10106. super.show();
  10107. }
  10108. }
  10109. UIFireworks.uiName = "UIFireworks";
  10110. class ui_UIGuanYu extends fgui.GComponent {
  10111. static createInstance() {
  10112. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10113. }
  10114. onConstruct() {
  10115. this.n2 = (this.getChild("n2"));
  10116. this.n1 = (this.getChild("n1"));
  10117. this.n3 = (this.getChild("n3"));
  10118. this.n4 = (this.getChild("n4"));
  10119. this.n5 = (this.getChild("n5"));
  10120. this.n6 = (this.getChild("n6"));
  10121. this.n8 = (this.getChild("n8"));
  10122. this.n7 = (this.getChild("n7"));
  10123. this.t0 = this.getTransition("t0");
  10124. }
  10125. }
  10126. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10127. class UIGuanYu extends UIBase {
  10128. constructor() {
  10129. super();
  10130. }
  10131. onConstructor() {
  10132. this.ui = ui_UIGuanYu.createInstance();
  10133. this.contentPane = this.ui;
  10134. this.isEject = false;
  10135. }
  10136. show(callback) {
  10137. super.show();
  10138. this.ui.t0.play(Laya.Handler.create(this, () => {
  10139. callback && callback();
  10140. this.hide();
  10141. }));
  10142. }
  10143. }
  10144. UIGuanYu.uiName = "UIGuanYu";
  10145. class SkillMgr {
  10146. constructor() {
  10147. this.leveNum = 0;
  10148. this.extraScore = 0;
  10149. this.selfTurn = false;
  10150. this.playedLastSkill = false;
  10151. this.tweenArr = [];
  10152. this._finishNum = 0;
  10153. this._curFinish = 0;
  10154. this._rootX = 0;
  10155. this._rootY = 0;
  10156. this.knifeTimes = 0;
  10157. this.knifeV2 = new Laya.Vector2();
  10158. this.knifeV3 = new Laya.Vector3();
  10159. this.rtStarX = 0;
  10160. this.rtStarY = 0;
  10161. this.addBigSkillSpine();
  10162. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10163. }
  10164. addBigSkillSpine() {
  10165. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10166. console.log("extra2 success");
  10167. });
  10168. }
  10169. runBigSkill(callback) {
  10170. this.tweenArr = [];
  10171. this.callback = callback;
  10172. this.judgeSkill();
  10173. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10174. let guide = DataMgr.getSkillGuide();
  10175. if (!xGame.common.gameMgr.selfTurn) {
  10176. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10177. }
  10178. else {
  10179. if (xGame.common.temSelfLevel != 0) {
  10180. this.leveNum = xGame.common.temSelfLevel;
  10181. }
  10182. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10183. this.leveNum += 5;
  10184. }
  10185. }
  10186. if (guide == 0) {
  10187. DataMgr.setSkillGuide(1);
  10188. if (DataMgr.getNewUser()) {
  10189. Moyu.sendDataEvent("gameFirstPlay");
  10190. DataMgr.setNewUser();
  10191. }
  10192. }
  10193. this.playSpineAni(() => {
  10194. switch (this.curSkill) {
  10195. case SkillType.highSpace:
  10196. this.runHighSpace();
  10197. break;
  10198. case SkillType.breakArmy:
  10199. this.runBreakArmy();
  10200. break;
  10201. case SkillType.ice:
  10202. this.runIce();
  10203. break;
  10204. case SkillType.fireworks:
  10205. this.runFireworks();
  10206. break;
  10207. case SkillType.GuanYu:
  10208. this.runGuanYu();
  10209. break;
  10210. default:
  10211. break;
  10212. }
  10213. });
  10214. }
  10215. judgeSkill() {
  10216. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10217. let gameMgr = xGame.common.gameMgr;
  10218. let type;
  10219. for (let index = 0; index < typeArr.length; index++) {
  10220. type = typeArr[index];
  10221. if (gameMgr.selfTurn) {
  10222. if (gameMgr.selfCurSkill == type) {
  10223. this.selfTurn = true;
  10224. this.curSkill = type;
  10225. return;
  10226. }
  10227. }
  10228. else {
  10229. if (gameMgr.aiCurSkill == type) {
  10230. this.selfTurn = false;
  10231. this.curSkill = type;
  10232. return;
  10233. }
  10234. }
  10235. }
  10236. }
  10237. playSpineAni(callback) {
  10238. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10239. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10240. parent.destroyChildren();
  10241. let aniIndex = 0;
  10242. let skillSpine;
  10243. switch (this.curSkill) {
  10244. case SkillType.highSpace:
  10245. aniIndex = 1;
  10246. xGame.soundMgr.playSound("skill01");
  10247. skillSpine = this.skillSpine2;
  10248. data.scaleX = 0.5;
  10249. data.scaleY = 0.5;
  10250. skillSpine.play(data, 1, false, parent, () => {
  10251. callback && callback();
  10252. });
  10253. break;
  10254. case SkillType.breakArmy:
  10255. aniIndex = 2;
  10256. xGame.soundMgr.playSound("skill02");
  10257. skillSpine = this.skillSpine2;
  10258. data.scaleX = 0.5;
  10259. data.scaleY = 0.5;
  10260. skillSpine.play(data, 2, false, parent, () => {
  10261. callback && callback();
  10262. });
  10263. break;
  10264. case SkillType.ice:
  10265. aniIndex = 0;
  10266. xGame.soundMgr.playSound("skill03");
  10267. skillSpine = this.skillSpine2;
  10268. data.scaleX = 0.5;
  10269. data.scaleY = 0.5;
  10270. skillSpine.play(data, 0, false, parent, () => {
  10271. callback && callback();
  10272. });
  10273. break;
  10274. case SkillType.fireworks:
  10275. xGame.soundMgr.playSound("skill_04_01");
  10276. xGame.soundMgr.playSound("skill04");
  10277. xGame.uiMgr.Show(UIFireworks, callback);
  10278. break;
  10279. case SkillType.GuanYu:
  10280. xGame.soundMgr.playSound("skill05_1");
  10281. xGame.soundMgr.playSound("skill05");
  10282. xGame.uiMgr.Show(UIGuanYu, callback);
  10283. break;
  10284. default:
  10285. break;
  10286. }
  10287. }
  10288. getAllBallArr() {
  10289. let arr = xGame.common.d2World.ballArr;
  10290. let outArr = [];
  10291. for (let index = 0; index < arr.length; index++) {
  10292. if (arr[index] instanceof D2RootBallSrc)
  10293. continue;
  10294. if (arr[index].ballFunc == "ice")
  10295. continue;
  10296. if (arr[index].destroyed)
  10297. continue;
  10298. outArr.push(arr[index]);
  10299. }
  10300. return outArr;
  10301. }
  10302. getOneArr(deletObj) {
  10303. let allArr = this.getAllBallArr();
  10304. let temp;
  10305. for (let index = 0; index < allArr.length; index++) {
  10306. temp = allArr[index];
  10307. if (temp.id == deletObj.id) {
  10308. allArr.splice(index, 1);
  10309. break;
  10310. }
  10311. }
  10312. return allArr;
  10313. }
  10314. getNearBallBag(ball) {
  10315. let ui = xGame.common.gameUI.ui;
  10316. let circleArr = [];
  10317. for (let index = 1; index <= 6; index++) {
  10318. circleArr.push(ui.border["circle" + index]);
  10319. }
  10320. let outIndex = 0;
  10321. let temp;
  10322. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10323. ;
  10324. let dis = 0;
  10325. for (let index = 1; index < circleArr.length; index++) {
  10326. temp = circleArr[index];
  10327. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10328. if (dis < min) {
  10329. min = dis;
  10330. outIndex = index;
  10331. }
  10332. }
  10333. return [circleArr[outIndex], outIndex];
  10334. }
  10335. ballFlyToBag(ballArr, time = 300) {
  10336. let temp;
  10337. let hole;
  10338. this._finishNum = ballArr.length;
  10339. this._curFinish = 0;
  10340. let holeObj = {};
  10341. let holeCfg = {
  10342. "1": 0,
  10343. "2": 0,
  10344. "3": 0,
  10345. "4": 0,
  10346. "5": 0,
  10347. "6": 0
  10348. };
  10349. for (let index = 0; index < ballArr.length; index++) {
  10350. temp = ballArr[index];
  10351. temp.outColli.isSensor = true;
  10352. temp.innerColli.isSensor = true;
  10353. temp.isRunSkillAni = true;
  10354. let holeArr = this.getNearBallBag(temp);
  10355. hole = holeArr[0];
  10356. holeObj[index] = holeArr[1];
  10357. temp.d3BallSrc.scaleXYZ = 0.5;
  10358. this.tweenArr.push(temp.d3BallSrc, temp);
  10359. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10360. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10361. }));
  10362. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10363. let mIndex = holeObj[this._curFinish];
  10364. let isDone = holeCfg[mIndex];
  10365. if (isDone) {
  10366. ballArr[this._curFinish].checkWrongBall(false);
  10367. }
  10368. else {
  10369. holeCfg[mIndex] = 1;
  10370. ballArr[this._curFinish].checkWrongBall();
  10371. }
  10372. this._curFinish++;
  10373. if (this._curFinish >= this._finishNum) {
  10374. if (this.curSkill == SkillType.highSpace) {
  10375. }
  10376. else if (this.curSkill == SkillType.breakArmy) {
  10377. let rootBall = xGame.common.d2World.rootBall;
  10378. rootBall.gameObj.x = this._rootX;
  10379. rootBall.gameObj.y = this._rootY;
  10380. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10381. xGame.common.d2World.d2Gan.ui.visible = true;
  10382. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10383. xGame.common.d2World.getHelpLine();
  10384. this.callback && this.callback(this.extraScore);
  10385. }
  10386. }
  10387. }));
  10388. }
  10389. }
  10390. runHighSpace() {
  10391. let rootBall = xGame.common.d2World.rootBall;
  10392. rootBall.showSelf();
  10393. let d3Src = rootBall.d3BallSrc;
  10394. let allArr = this.getAllBallArr();
  10395. if (allArr.length <= 0) {
  10396. this.callback && this.callback(0);
  10397. return;
  10398. }
  10399. let selectBall = xGame.common.d2World.targetBall;
  10400. let wrong = selectBall && selectBall.destroyed;
  10401. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10402. selectBall = xGame.common.getRandArrEle(allArr);
  10403. }
  10404. let targetD3Src = selectBall.d3BallSrc;
  10405. xGame.common.d2World.d2Gan.ui.visible = false;
  10406. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10407. d3Src.scaleXYZ = 0.5;
  10408. this.tweenArr.push(d3Src);
  10409. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10410. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10411. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10412. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10413. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10414. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10415. let outArr = [selectBall];
  10416. let other = this.leveNum - 1;
  10417. if (other > 0) {
  10418. let nearArr = this.getOneArr(selectBall);
  10419. if (nearArr.length > 0) {
  10420. xGame.common.botherArr(nearArr);
  10421. if (other >= nearArr.length)
  10422. other = nearArr.length;
  10423. for (let index = 0; index < other; index++) {
  10424. outArr.push(nearArr[index]);
  10425. }
  10426. }
  10427. }
  10428. xGame.common.extraMoveNum = other + 1;
  10429. this.extraScore = other + 1;
  10430. this._rootX = selectBall.gameObj.x;
  10431. this._rootY = selectBall.gameObj.y;
  10432. rootBall.gameObj.x = this._rootX;
  10433. rootBall.gameObj.y = this._rootY;
  10434. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10435. Laya.Tween.clearAll(d3Src);
  10436. this.addRandomForce(outArr);
  10437. }));
  10438. }));
  10439. }
  10440. addRandomForce(outArr) {
  10441. if (outArr.length > 0) {
  10442. xGame.common.d2World.openCheckStill = true;
  10443. this.playedLastSkill = true;
  10444. }
  10445. let temp;
  10446. for (let index = 0; index < outArr.length; index++) {
  10447. let angle = xGame.common.randomNum(0, 360);
  10448. let linearPercent = xGame.common.randomNum(65, 100);
  10449. temp = outArr[index];
  10450. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10451. }
  10452. }
  10453. setLinearSpeed(angle, rigy, linearPercent) {
  10454. let sin = Math.sin(angle * Math.PI / 180);
  10455. let cos = Math.cos(angle * Math.PI / 180);
  10456. let maxSpeed = 4;
  10457. let speed = new Laya.Vector2();
  10458. speed.x = maxSpeed * linearPercent * sin;
  10459. speed.y = -maxSpeed * linearPercent * cos;
  10460. rigy.applyLinearImpulseToCenter(speed);
  10461. }
  10462. runBreakArmy() {
  10463. xGame.common.d2World.d2Gan.ui.visible = false;
  10464. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10465. let gameUI = xGame.common.gameUI.ui;
  10466. gameUI.skillRod.visible = true;
  10467. gameUI.skillRod.rotation = 110;
  10468. let outArr = this.getAllBallArr();
  10469. if (outArr.length <= 0) {
  10470. gameUI.skillRod.visible = false;
  10471. this.callback && this.callback(0);
  10472. return;
  10473. }
  10474. xGame.common.botherArr(outArr);
  10475. if (this.leveNum >= outArr.length)
  10476. this.leveNum = outArr.length;
  10477. let deleteNum = outArr.length - this.leveNum;
  10478. outArr.splice(0, deleteNum);
  10479. this.extraScore = this.leveNum;
  10480. let potX = gameUI.skillRod.x;
  10481. let potY = gameUI.skillRod.y;
  10482. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10483. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10484. let disArr = [];
  10485. for (let index = 0; index < outArr.length; index++) {
  10486. let obj = outArr[index];
  10487. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10488. dis = Math.pow(dis, 0.5);
  10489. disArr.push(dis);
  10490. }
  10491. this.tweenArr.push(gameUI.skillRod);
  10492. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10493. })).update = Laya.Handler.create(this, (e, t, c) => {
  10494. let angle = gameUI.skillRod.rotation;
  10495. let xx;
  10496. let yy;
  10497. let temp;
  10498. for (let index = 0; index < outArr.length; index++) {
  10499. temp = outArr[index];
  10500. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10501. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10502. yy -= 20;
  10503. temp.gameObj.x = xx;
  10504. temp.gameObj.y = yy;
  10505. temp.d3BallSrc.setTransPos(xx, yy);
  10506. }
  10507. if (angle <= 60) {
  10508. Laya.Tween.clearAll(gameUI.skillRod);
  10509. this.ballFlyToBag(outArr, 150);
  10510. gameUI.skillRod.visible = false;
  10511. }
  10512. }, null, false);
  10513. }
  10514. runIce() {
  10515. let ballArr = xGame.common.d2World.ballArr;
  10516. this.leveNum *= 2;
  10517. if (this.leveNum >= ballArr.length - 1)
  10518. this.leveNum = ballArr.length - 1;
  10519. let tempArr = [];
  10520. let outArr = [];
  10521. for (let index = 0; index < ballArr.length; index++) {
  10522. if (ballArr[index] instanceof D2RootBallSrc)
  10523. continue;
  10524. tempArr.push(ballArr[index]);
  10525. }
  10526. if (tempArr.length <= 0) {
  10527. this.callback && this.callback(0);
  10528. return;
  10529. }
  10530. xGame.common.botherArr(tempArr);
  10531. for (let index = 0; index < this.leveNum; index++) {
  10532. outArr.push(tempArr[index]);
  10533. }
  10534. this.extraScore = this.leveNum;
  10535. let temp;
  10536. for (let index = 0; index < outArr.length; index++) {
  10537. temp = outArr[index];
  10538. temp.d3BallSrc.playIceEft();
  10539. }
  10540. Laya.timer.once(2000, this, () => {
  10541. for (let index = 0; index < outArr.length; index++) {
  10542. temp = outArr[index];
  10543. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10544. temp.setBallFunc("ice", str);
  10545. }
  10546. this.callback && this.callback(0);
  10547. });
  10548. }
  10549. runFireworks() {
  10550. let allArr = this.getAllBallArr();
  10551. if (allArr.length <= 0) {
  10552. this.callback && this.callback(0);
  10553. return;
  10554. }
  10555. xGame.common.d2World.d2Gan.ui.visible = false;
  10556. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10557. let outArr = [];
  10558. let other = this.leveNum;
  10559. if (other > 0) {
  10560. if (allArr.length > 0) {
  10561. xGame.common.botherArr(allArr);
  10562. if (other >= allArr.length)
  10563. other = allArr.length;
  10564. for (let index = 0; index < other; index++) {
  10565. outArr.push(allArr[index]);
  10566. }
  10567. }
  10568. }
  10569. xGame.common.extraMoveNum = other;
  10570. this.extraScore = other;
  10571. this.addRandmomFireworks(outArr);
  10572. }
  10573. addRandmomFireworks(outArr) {
  10574. Laya.timer.once(1100, this, () => {
  10575. if (outArr.length > 0) {
  10576. xGame.common.d2World.openCheckStill = true;
  10577. this.playedLastSkill = true;
  10578. }
  10579. });
  10580. xGame.soundMgr.playSound("skill_04_02");
  10581. let temp;
  10582. let delay = -200;
  10583. for (let index = 0; index < outArr.length; index++) {
  10584. temp = outArr[index];
  10585. delay += 200;
  10586. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10587. let angle = xGame.common.randomNum(0, 360);
  10588. angle = this.getFireworksAngle(obj);
  10589. let linearPercent = xGame.common.randomNum(45, 80);
  10590. if (!obj.destroyed)
  10591. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10592. });
  10593. }
  10594. }
  10595. getFireworksAngle(obj) {
  10596. let rootBall = xGame.common.d2World.rootBall;
  10597. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10598. }
  10599. resetGame() {
  10600. Laya.timer.clearAll(this);
  10601. if (this.tweenArr) {
  10602. for (let index = 0; index < this.tweenArr.length; index++) {
  10603. Laya.Tween.clearAll(this.tweenArr[index]);
  10604. }
  10605. }
  10606. this.tweenArr = null;
  10607. }
  10608. runGuanYu() {
  10609. xGame.common.d2World.d2Gan.ui.visible = false;
  10610. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10611. let rootBall = xGame.common.d2World.rootBall;
  10612. if (rootBall.isInHole) {
  10613. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10614. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10615. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10616. rootBall.showSelf();
  10617. }
  10618. this.rtStarX = rootBall.gameObj.x;
  10619. this.rtStarY = rootBall.gameObj.y;
  10620. this.knifeTimes = 0;
  10621. this.playedLastSkill = true;
  10622. rootBall.forceRun = true;
  10623. rootBall.rigy.type = "static";
  10624. xGame.common.d2World.openCheckStill = true;
  10625. this.guanyuRandomKnife();
  10626. }
  10627. guanyuRandomKnife() {
  10628. let rootBall = xGame.common.d2World.rootBall;
  10629. let dir = this.getRandDir();
  10630. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10631. console.log("当前angle", angle);
  10632. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10633. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10634. let dis = 324;
  10635. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10636. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10637. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10638. this.rtStarX = rootBall.gameObj.x;
  10639. this.rtStarY = rootBall.gameObj.y;
  10640. this.knifeTimes++;
  10641. let skillLevel;
  10642. if (xGame.common.gameMgr.selfTurn) {
  10643. skillLevel = DataMgr.getBigSkillByIndex(4);
  10644. }
  10645. else {
  10646. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10647. }
  10648. if (!skillLevel)
  10649. skillLevel = 1;
  10650. skillLevel += 2;
  10651. if (this.knifeTimes < skillLevel) {
  10652. Laya.timer.once(400, this, () => {
  10653. this.guanyuRandomKnife();
  10654. });
  10655. }
  10656. else {
  10657. rootBall.forceRun = false;
  10658. rootBall.rigy.type = "dynamic";
  10659. xGame.common.extraMoveNum = skillLevel;
  10660. }
  10661. }));
  10662. }
  10663. getRandDir() {
  10664. let rootBall = xGame.common.d2World.rootBall;
  10665. let allBall = this.getAllBallArr();
  10666. let target = xGame.common.getRandArrEle(allBall);
  10667. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10668. return this.knifeV2;
  10669. }
  10670. cloneKnife(x, y, rotation) {
  10671. let parent = xGame.common.d3World.knifeRoot;
  10672. let prefab = xGame.common.d3World.knife;
  10673. let clone = prefab.clone();
  10674. parent.addChild(clone);
  10675. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10676. clone.transform.localPositionX = this.knifeV3.x;
  10677. clone.transform.localPositionY = 0;
  10678. clone.transform.localPositionZ = this.knifeV3.z;
  10679. clone.transform.localRotationEulerX = 0;
  10680. clone.transform.localRotationEulerY = rotation;
  10681. clone.transform.localRotationEulerZ = 0;
  10682. clone.active = true;
  10683. return clone;
  10684. }
  10685. cloneGuanYuEft(x, y, angle) {
  10686. return;
  10687. let parent = xGame.common.gameUI.ui.guanyuNode;
  10688. let eft = new ui_guanyuAni();
  10689. eft.parent = parent;
  10690. eft.x = x;
  10691. eft.y = y;
  10692. eft.rotation = angle;
  10693. }
  10694. }
  10695. class ui_UIWordsList extends fgui.GComponent {
  10696. static createInstance() {
  10697. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10698. }
  10699. onConstruct() {
  10700. this.c1 = this.getController("c1");
  10701. this.n74 = (this.getChild("n74"));
  10702. this.clickNode = (this.getChild("clickNode"));
  10703. this.myNode = (this.getChild("myNode"));
  10704. this.n68 = (this.getChild("n68"));
  10705. this.n66 = (this.getChild("n66"));
  10706. this.n55 = (this.getChild("n55"));
  10707. this.wordsBtn = (this.getChild("wordsBtn"));
  10708. this.emotionBtn = (this.getChild("emotionBtn"));
  10709. this.mybggg = (this.getChild("mybggg"));
  10710. this.wordsList = (this.getChild("wordsList"));
  10711. this.emotionList = (this.getChild("emotionList"));
  10712. this.myRoot = (this.getChild("myRoot"));
  10713. }
  10714. }
  10715. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10716. class EmotionDisplay {
  10717. constructor(index, ui) {
  10718. this.ui = ui;
  10719. this.index = index;
  10720. this.ui.onClick(this, this.clickSelf);
  10721. this.updateSelf();
  10722. }
  10723. updateSelf() {
  10724. let data = cfgTable.emotionData[this.index + 1];
  10725. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10726. }
  10727. clickSelf() {
  10728. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10729. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10730. xGame.common.talkMgr.closeTalkView();
  10731. }
  10732. }
  10733. class WordsDisplay {
  10734. constructor(index, ui) {
  10735. this.ui = ui;
  10736. this.index = index;
  10737. this.ui.onClick(this, this.clickSelf);
  10738. this.updateSelf();
  10739. }
  10740. updateSelf() {
  10741. let data = cfgTable.talkwordsData[this.index + 1];
  10742. this.ui.txt.text = data.msg;
  10743. }
  10744. clickSelf() {
  10745. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10746. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10747. xGame.common.talkMgr.closeTalkView();
  10748. }
  10749. }
  10750. class UIWordsList extends UIBase {
  10751. constructor() {
  10752. super();
  10753. }
  10754. onConstructor() {
  10755. this.ui = ui_UIWordsList.createInstance();
  10756. this.contentPane = this.ui;
  10757. this.isEject = false;
  10758. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10759. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10760. this.addUIClick(this.ui.clickNode, this.hide);
  10761. this.initTalkList();
  10762. this.initEmotionList();
  10763. }
  10764. show() {
  10765. super.show();
  10766. }
  10767. initTalkList() {
  10768. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10769. let data = cfgTable.talkwordsData;
  10770. let length = Object.keys(data).length;
  10771. this.ui.wordsList.numItems = length;
  10772. }
  10773. initEmotionList() {
  10774. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10775. let data = cfgTable.emotionData;
  10776. let length = Object.keys(data).length;
  10777. this.ui.emotionList.numItems = length;
  10778. }
  10779. renderTalkItem(index, obj) {
  10780. let temp = new WordsDisplay(index, obj);
  10781. }
  10782. renderEmotionItem(index, obj) {
  10783. let temp = new EmotionDisplay(index, obj);
  10784. }
  10785. openTalkList() {
  10786. this.ui.c1.selectedIndex = 0;
  10787. }
  10788. openEmotionList() {
  10789. this.ui.c1.selectedIndex = 1;
  10790. }
  10791. }
  10792. UIWordsList.uiName = "UIWordsList";
  10793. class TalkMgr {
  10794. constructor() {
  10795. this.aiSpeak = true;
  10796. this.emotionList = [];
  10797. this.talkList = [];
  10798. this.addEvent();
  10799. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10800. this.emotionList = [];
  10801. this.talkList = [];
  10802. for (let k in cfgTable.emotionData) {
  10803. this.emotionList.push(cfgTable.emotionData[k].id);
  10804. }
  10805. for (let k in cfgTable.talkwordsData) {
  10806. this.talkList.push(cfgTable.talkwordsData[k].id);
  10807. }
  10808. }
  10809. addEvent() {
  10810. let ui = xGame.common.gameUI.ui;
  10811. ui.wordsBtn.visible = true;
  10812. ui.wordsBtn.onClick(this, this.openTalkView);
  10813. ui.aiWordsBtn.visible = true;
  10814. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10815. }
  10816. openTalkView() {
  10817. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10818. xGame.uiMgr.Show(UIWordsList);
  10819. }
  10820. closeTalkView() {
  10821. xGame.uiMgr.Hide(UIWordsList);
  10822. }
  10823. clickAIState() {
  10824. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10825. this.aiSpeak = !this.aiSpeak;
  10826. this.changeAIState(this.aiSpeak);
  10827. }
  10828. changeAIState(speak) {
  10829. this.aiSpeak = speak;
  10830. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10831. if (speak) {
  10832. btn.c1.selectedIndex = 0;
  10833. }
  10834. else {
  10835. btn.c1.selectedIndex = 1;
  10836. }
  10837. }
  10838. showSelfTalk(wordsId) {
  10839. let ui = xGame.common.gameUI.ui;
  10840. ui.selfTalk.visible = true;
  10841. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10842. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10843. ui.selfTalk.t0.play();
  10844. }
  10845. showSelfEmotion(emotionId) {
  10846. let ui = xGame.common.gameUI.ui;
  10847. ui.selfTalk.visible = true;
  10848. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10849. this.selfSpine && this.selfSpine.dispose();
  10850. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10851. let spineData = cfgTable.emotionData[emotionId].spine;
  10852. this.selfSpine = new SpineMgr(spineData, () => {
  10853. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10854. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10855. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10856. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10857. });
  10858. ui.selfTalk.t0.play();
  10859. }
  10860. showAITalk(wordsId) {
  10861. if (!this.aiSpeak)
  10862. return;
  10863. if (DataMgr.gameData.gameCount < 2)
  10864. return;
  10865. if (wordsId < 1)
  10866. wordsId = this.getRandTalk();
  10867. let ui = xGame.common.gameUI.ui;
  10868. ui.aiTalk.visible = true;
  10869. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10870. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10871. ui.aiTalk.t0.play();
  10872. }
  10873. getRandTalk() {
  10874. let rand = xGame.tools.random(0, this.talkList.length);
  10875. return this.emotionList[rand];
  10876. }
  10877. getRandEmotion() {
  10878. let rand = xGame.tools.random(0, this.emotionList.length);
  10879. return this.emotionList[rand];
  10880. }
  10881. showAIEmotion(emotionId) {
  10882. if (!this.aiSpeak)
  10883. return;
  10884. if (DataMgr.gameData.gameCount < 2)
  10885. return;
  10886. if (emotionId < 1)
  10887. emotionId = this.getRandEmotion();
  10888. let ui = xGame.common.gameUI.ui;
  10889. ui.aiTalk.visible = true;
  10890. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10891. this.aiSpine && this.aiSpine.dispose();
  10892. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10893. let spineData = cfgTable.emotionData[emotionId].spine;
  10894. this.aiSpine = new SpineMgr(spineData, () => {
  10895. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10896. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10897. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10898. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10899. });
  10900. ui.aiTalk.t0.play();
  10901. }
  10902. resetGame() {
  10903. let ui = xGame.common.gameUI.ui;
  10904. ui.aiTalk.visible = false;
  10905. ui.selfTalk.visible = false;
  10906. this.aiSpine && this.aiSpine.dispose();
  10907. this.selfSpine && this.selfSpine.dispose();
  10908. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10909. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10910. this.closeTalkView();
  10911. }
  10912. }
  10913. class WordsMgr {
  10914. constructor() {
  10915. this.comboTimes = 1;
  10916. this.skillTimes = 0;
  10917. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10918. this.comboSpine = new SpineMgr("yxz_liangan");
  10919. this.skillSpine = new SpineMgr("yiganxqiu");
  10920. this.scoreSpine = new SpineMgr("defen");
  10921. }
  10922. setClassicCombo(isInterrupt) {
  10923. if (isInterrupt) {
  10924. this.comboTimes = 0;
  10925. }
  10926. }
  10927. playClassicWords(type, callback) {
  10928. this.callback = callback;
  10929. let aniIndex = type;
  10930. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10931. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10932. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10933. mySpine.destroy(true);
  10934. this.playClassicTimes();
  10935. });
  10936. }
  10937. playClassicTimes() {
  10938. this.comboTimes++;
  10939. if (this.comboTimes <= 1) {
  10940. this.callback && this.callback();
  10941. }
  10942. else {
  10943. let aniIndex = this.comboTimes - 1;
  10944. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10945. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10946. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10947. mySpine.destroy(true);
  10948. this.callback && this.callback();
  10949. });
  10950. }
  10951. }
  10952. playBigSkillTimes(times, callback) {
  10953. if (times <= 0) {
  10954. callback && callback();
  10955. return;
  10956. }
  10957. this.callback = callback;
  10958. let pre = "sz_0";
  10959. let aniIndex = 0;
  10960. this.getWordsImg(times, pre, () => {
  10961. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10962. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10963. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10964. let r1 = ``;
  10965. let r2 = ``;
  10966. if (times <= 9) {
  10967. r1 = `res/d2Res/${pre}${times}.png`;
  10968. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10969. aniIndex = 0;
  10970. }
  10971. else {
  10972. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10973. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10974. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10975. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10976. aniIndex = 1;
  10977. }
  10978. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10979. mySpine.destroy(true);
  10980. xGame.common.gameMgr.playSkillTips();
  10981. this.playScore(times);
  10982. xGame.common.playRandomMutiBallBigSkillSound();
  10983. }, mySpine);
  10984. });
  10985. }
  10986. playScore(score) {
  10987. let pre = "sz_";
  10988. let aniIndex = 0;
  10989. this.getWordsImg(score, pre, () => {
  10990. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10991. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10992. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10993. let r1 = ``;
  10994. let r2 = ``;
  10995. if (score <= 9) {
  10996. r1 = `res/d2Res/${pre}${score}.png`;
  10997. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10998. aniIndex = 0;
  10999. }
  11000. else {
  11001. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11002. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11003. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11004. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11005. aniIndex = 1;
  11006. }
  11007. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11008. mySpine.destroy(true);
  11009. this.callback && this.callback();
  11010. }, mySpine);
  11011. });
  11012. }
  11013. getWordsImg(number, pre = "", callback) {
  11014. let arr = [];
  11015. if (number <= 9) {
  11016. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11017. }
  11018. else {
  11019. 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 });
  11020. }
  11021. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11022. callback && callback();
  11023. }));
  11024. }
  11025. }
  11026. class ui_UIRodMethod extends fgui.GComponent {
  11027. static createInstance() {
  11028. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11029. }
  11030. onConstruct() {
  11031. this.n24 = (this.getChild("n24"));
  11032. this.white = (this.getChild("white"));
  11033. this.dot = (this.getChild("dot"));
  11034. this.sureBtn = (this.getChild("sureBtn"));
  11035. this.n20 = (this.getChild("n20"));
  11036. this.n21 = (this.getChild("n21"));
  11037. this.n22 = (this.getChild("n22"));
  11038. this.n23 = (this.getChild("n23"));
  11039. this.n5 = (this.getChild("n5"));
  11040. this.n14 = (this.getChild("n14"));
  11041. this.t0 = this.getTransition("t0");
  11042. }
  11043. }
  11044. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11045. class UIRodMethod extends UIBase {
  11046. constructor() {
  11047. super();
  11048. this.isPressd = false;
  11049. }
  11050. onConstructor() {
  11051. this.ui = ui_UIRodMethod.createInstance();
  11052. this.contentPane = this.ui;
  11053. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11054. this.moveDir = new Laya.Vector2();
  11055. this.moveDest = new Laya.Vector2();
  11056. this.centerPos = new Laya.Vector2();
  11057. xGame.common.uiRodMethod = this;
  11058. }
  11059. show() {
  11060. super.show();
  11061. xGame.common.gameMgr.gamePause = true;
  11062. this.openPressDotEvent();
  11063. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11064. this.centerPos.x = this.ui.white.x;
  11065. this.centerPos.y = this.ui.white.y;
  11066. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11067. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11068. this.setDot();
  11069. }
  11070. setDot() {
  11071. this.ui.dot.x = this.moveDest.x;
  11072. this.ui.dot.y = this.moveDest.y;
  11073. }
  11074. closeSelf() {
  11075. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11076. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11077. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11078. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11079. xGame.common.gameMgr.gamePause = false;
  11080. this.hide();
  11081. }
  11082. openPressDotEvent() {
  11083. this.closePressDotEvent();
  11084. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11085. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11086. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11087. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11088. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11089. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11090. }
  11091. closePressDotEvent() {
  11092. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11093. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11094. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11095. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11096. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11097. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11098. }
  11099. onDown(e) {
  11100. if (e.type == Laya.Event.MOUSE_DOWN)
  11101. this.isPressd = true;
  11102. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11103. this.isPressd = false;
  11104. if (!this.isPressd)
  11105. return;
  11106. this.moveDest.x = e.stageX;
  11107. this.moveDest.y = e.stageY;
  11108. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11109. if (dis > 6724) {
  11110. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11111. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11112. }
  11113. this.setDot();
  11114. }
  11115. resetRod() {
  11116. this.ui.dot.x = this.ui.white.x;
  11117. this.ui.dot.y = this.ui.white.y;
  11118. this.gameRod.dot.x = this.gameRod.bg.x;
  11119. this.gameRod.dot.y = this.gameRod.bg.y;
  11120. xGame.common.rodOffest.x = 0;
  11121. xGame.common.rodOffest.y = 0;
  11122. }
  11123. }
  11124. UIRodMethod.uiName = "UIRodMethod";
  11125. class UIGame extends UIBase {
  11126. constructor() {
  11127. super();
  11128. this.powerNum = 0;
  11129. this.isD3Inited = false;
  11130. this.isPrePlay = false;
  11131. this.isMoveRod = false;
  11132. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11133. this.rulerDis = 20;
  11134. this.rulerOffset = 0;
  11135. }
  11136. onConstructor() {
  11137. this.ui = ui_UIGame.createInstance();
  11138. this.contentPane = this.ui;
  11139. this.ui.x += xGame.common.sysOffestNum;
  11140. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11141. this.isEject = false;
  11142. xGame.common.gameUI = this;
  11143. this.initSelf();
  11144. }
  11145. isTurnSelf() {
  11146. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11147. return true;
  11148. }
  11149. }
  11150. initSelf() {
  11151. let topUI = this.ui.topNode;
  11152. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11153. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11154. this.barInfo = {};
  11155. this.barInfo.curY = 0;
  11156. this.barInfo.height = this.ui.powerNode.height;
  11157. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11158. this.barInfo.powerStartY = this.ui.powerNode.y;
  11159. xGame.common.aiPlayer = new AIPlayer();
  11160. xGame.common.gameMgr = new GameMgr();
  11161. xGame.common.skillMgr = new SkillMgr();
  11162. xGame.common.wordsMgr = new WordsMgr();
  11163. xGame.common.talkMgr = new TalkMgr();
  11164. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11165. console.log("加载经典模式表情文件chenggon !");
  11166. });
  11167. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11168. console.log("挑战模式奖励模式spine加载成功!");
  11169. });
  11170. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11171. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11172. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11173. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11174. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11175. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11176. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11177. }
  11178. getGanZiImg() {
  11179. let index = DataMgr.getCurBallRod();
  11180. let data = cfgTable.ballrodData[index + 1];
  11181. let gan_url = xGame.common.getGameIconUrl(data.img);
  11182. console.log('zh:getGanZiImg gan_url==' + gan_url);
  11183. this.ui.powerNode.showImg.url = gan_url;
  11184. console.log('zh:修改杆子图标O K');
  11185. }
  11186. returnHome() {
  11187. let tips = "Are you sure to exit the game?";
  11188. let woman = "Boss, why don't you play for a while longer?";
  11189. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11190. }
  11191. addRodMethodClick() {
  11192. if (this.isTurnSelf()) {
  11193. xGame.uiMgr.Show(UIRodMethod);
  11194. }
  11195. }
  11196. clickHelpLineBtn(force = false) {
  11197. if (!this.isTurnSelf())
  11198. return;
  11199. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11200. if (success) {
  11201. xGame.common.longHelpLine = true;
  11202. xGame.common.d2World.getHelpLine();
  11203. Moyu.sendDataEvent("guideNum");
  11204. }
  11205. else {
  11206. }
  11207. });
  11208. }
  11209. renderSelfDisplayBalls(index, target) {
  11210. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11211. target.myImg.url = xGame.common.getGameIconUrl(str);
  11212. }
  11213. renderAIDisplayBalls(index, target) {
  11214. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11215. target.myImg.url = xGame.common.getGameIconUrl(str);
  11216. ;
  11217. }
  11218. updateMode() {
  11219. if (xGame.common.gameMode == GameMode.classic) {
  11220. this.ui.topNode.scoreNode.visible = false;
  11221. }
  11222. else if (xGame.common.gameMode == GameMode.bigMove) {
  11223. this.ui.topNode.scoreNode.visible = true;
  11224. }
  11225. }
  11226. show() {
  11227. super.show();
  11228. console.log("zh:uigame show AADD");
  11229. this.ui.alpha = 0;
  11230. this.updateSelf();
  11231. xGame.common.gameMgr.gamePause = false;
  11232. xGame.common.gameUI.ui.blackAni.visible = false;
  11233. xGame.common.gameUI.ui.whiteAni.visible = false;
  11234. this.ui.powerEft.visible = false;
  11235. this.ui.colorNode.visible = false;
  11236. this.updateHead();
  11237. let curUse = DataMgr.getCurBallRod();
  11238. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11239. this.getGanZiImg();
  11240. }
  11241. updateSelf() {
  11242. if (xGame.common.gameMode == GameMode.classic) {
  11243. this.ui.c1.selectedIndex = 0;
  11244. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11245. this.ui.topNode.middleNode.visible = true;
  11246. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11247. }
  11248. else if (xGame.common.gameMode == GameMode.bigMove) {
  11249. this.ui.c1.selectedIndex = 0;
  11250. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11251. this.ui.topNode.middleNode.visible = false;
  11252. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11253. let rand = xGame.common.randomNum(1, max);
  11254. let guide = DataMgr.getSkillGuide();
  11255. if (guide == 0)
  11256. rand = 1;
  11257. xGame.common.bigMoveLevelIndex = rand;
  11258. }
  11259. else if (xGame.common.gameMode == GameMode.placeBall) {
  11260. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11261. this.ui.c1.selectedIndex = 1 + data.type;
  11262. this.ui.alpha = 1;
  11263. this.startGame();
  11264. }
  11265. this.updateMode();
  11266. this.initD3world();
  11267. this.initD2world();
  11268. }
  11269. startGame() {
  11270. this.ui.snowNode.visible = Math.random() <= 0.1;
  11271. this.ui.d2Node.visible = false;
  11272. xGame.common.d3World.d3Hand.gameObj.active = false;
  11273. xGame.common.d3World.tableSrc.init();
  11274. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11275. this.cameraViewChange(() => {
  11276. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11277. switch (xGame.common.gameMode) {
  11278. case GameMode.classic:
  11279. xGame.common.d3World.d3Hand.gameObj.active = true;
  11280. this.playPutBallD3Ani();
  11281. break;
  11282. case GameMode.bigMove:
  11283. this.enterGame();
  11284. Laya.timer.once(500, this, () => {
  11285. this.ui.topNode.middleNode.visible = true;
  11286. this.ui.topNode.middleNode.t0.play();
  11287. });
  11288. break;
  11289. case GameMode.placeBall:
  11290. this.enterGame();
  11291. break;
  11292. default:
  11293. break;
  11294. }
  11295. });
  11296. PlatMgr.showBanner(false);
  11297. }
  11298. enterGame() {
  11299. this.ui.d2Node.visible = true;
  11300. xGame.common.d3World.d3Hand.gameObj.active = false;
  11301. xGame.common.showOneCamera("mainCamera");
  11302. Moyu.recordGame(30, true);
  11303. if (!this.isPrePlay) {
  11304. this.isPrePlay = true;
  11305. xGame.common.d3World.prePlayEft();
  11306. }
  11307. xGame.common.gameMgr.gameReady();
  11308. this.openAllEvent();
  11309. this.ui.snowNode.visible = false;
  11310. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11311. this.ui.helpBtn.visible = condition;
  11312. }
  11313. showHelpLineGuide() {
  11314. let longGuide = DataMgr.getGuideHelpLine();
  11315. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11316. this.ui.helpBtn.visible = true;
  11317. this.ui.guideNode.visible = true;
  11318. }
  11319. }
  11320. setTurnAlpha(alpha) {
  11321. this.ui.keduNode.alpha = alpha;
  11322. this.ui.ganNode.alpha = alpha;
  11323. this.ui.rodMethodNode.alpha = alpha;
  11324. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11325. }
  11326. cameraViewChange(callback) {
  11327. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11328. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11329. xGame.common.showOneCamera("visitAngle");
  11330. cameraSrc.localRotationEulerY = 180;
  11331. cameraSrc.localRotationEulerZ = 0;
  11332. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11333. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11334. callback && callback();
  11335. }));
  11336. }));
  11337. }
  11338. playPutBallD3Ani() {
  11339. xGame.common.showOneCamera("mainCamera");
  11340. let handSrc = xGame.common.d3World.d3Hand;
  11341. handSrc.gameObj.active = true;
  11342. handSrc.transform.localPositionZ = 3;
  11343. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11344. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11345. handSrc.gameObj.active = false;
  11346. this.enterGame();
  11347. }), 400);
  11348. }));
  11349. }
  11350. updateHead() {
  11351. let user = Moyu.getUserInfo();
  11352. this.ui.topNode.selfNameTxt.text = user.nickName;
  11353. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11354. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11355. if (DataMgr.getSkillGuide() < 1) {
  11356. this.ui.topNode.aiNameTxt.text = 'billiards';
  11357. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11358. }
  11359. else {
  11360. this.ui.topNode.aiNameTxt.text = aiData.name;
  11361. let randNo = Math.floor(Math.random() * 10) + 1;
  11362. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11363. }
  11364. }
  11365. initD2world() {
  11366. let node = this.ui.d2Root.displayObject;
  11367. let src = node.getComponent(D2World);
  11368. if (!src) {
  11369. xGame.common.d2World = node.addComponent(D2World);
  11370. }
  11371. xGame.common.d2World.initSelf();
  11372. }
  11373. initD3world() {
  11374. if (this.isD3Inited)
  11375. return;
  11376. this.isD3Inited = true;
  11377. let scene3D = xGame.common.d3Scene;
  11378. this.ui.d3Root.displayObject.addChild(scene3D);
  11379. scene3D.active = true;
  11380. xGame.common.d3World.tableSrc.setBorderPos();
  11381. }
  11382. onRootMove(e) {
  11383. let rootBall = xGame.common.d2World.rootBall;
  11384. this.ui.moveNode.x = e.x;
  11385. this.ui.moveNode.y = e.y;
  11386. rootBall.gameObj.x = e.x;
  11387. rootBall.gameObj.y = e.y;
  11388. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11389. }
  11390. aiRootMove(move) {
  11391. if (move)
  11392. this.hideBallUI();
  11393. else {
  11394. this.showBallUI();
  11395. xGame.common.d2World.getHelpLine();
  11396. }
  11397. }
  11398. aiForce(type, force = 0) {
  11399. this.pressTarget = PressType.powerNode;
  11400. if (type == 1)
  11401. this.onEventUp({ force: true });
  11402. else if (type == 2)
  11403. this.onEventMove({ stageY: force, force: true });
  11404. }
  11405. onEventPress(e) {
  11406. if (e.stopPropagation)
  11407. e.stopPropagation();
  11408. if (!this.isTurnSelf())
  11409. return;
  11410. let target = e.target;
  11411. switch (target) {
  11412. case this.ui.myPowerNode.displayObject:
  11413. this.pressTarget = PressType.powerNode;
  11414. this.barInfo.curY = e.stageY;
  11415. this.updateBarInfo();
  11416. break;
  11417. case this.ui.moveNode.displayObject:
  11418. this.pressTarget = PressType.moveNode;
  11419. this.hideBallUI();
  11420. this.eventObj.curX = this.ui.moveNode.x;
  11421. this.eventObj.curY = this.ui.moveNode.y;
  11422. this.ui.moveNode.finger.visible = false;
  11423. this.eventObj.lastX = e.stageX;
  11424. this.eventObj.lastY = e.stageY;
  11425. break;
  11426. case this.ui.rulerClickNode.displayObject:
  11427. this.pressTarget = PressType.rulerNode;
  11428. this.eventObj.lastY = e.stageY;
  11429. break;
  11430. case this.ui.d2Root.displayObject:
  11431. this.pressTarget = PressType.d2Root;
  11432. this.eventObj.lastX = e.stageX;
  11433. this.eventObj.lastY = e.stageY;
  11434. this.eventObj.starX = e.stageX;
  11435. this.eventObj.starY = e.stageY;
  11436. this.eventObj.curX = 0;
  11437. this.eventObj.curY = 0;
  11438. xGame.common.d2World.d2Gan.setGanLastInfo();
  11439. this.rulerOffset = 0;
  11440. break;
  11441. default:
  11442. break;
  11443. }
  11444. }
  11445. onEventMove(e) {
  11446. if (e.stopPropagation)
  11447. e.stopPropagation();
  11448. if (e && e.force) {
  11449. }
  11450. else {
  11451. if (!this.isTurnSelf())
  11452. return;
  11453. }
  11454. switch (this.pressTarget) {
  11455. case PressType.powerNode:
  11456. this.barInfo.curY = e.stageY;
  11457. this.updateBarInfo();
  11458. this.isMoveRod = true;
  11459. break;
  11460. case PressType.moveNode:
  11461. let rootBall = xGame.common.d2World.rootBall;
  11462. let radius = rootBall.gameObj.width / 2;
  11463. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11464. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11465. let border = xGame.common.d2World.borderRect;
  11466. if (curX <= border.x + radius)
  11467. curX = border.x + radius;
  11468. else if (curX >= border.x + border.width - radius)
  11469. curX = border.x + border.width - radius;
  11470. if (curY <= border.y + radius)
  11471. curY = border.y + radius;
  11472. else if (curY >= border.y + border.height - radius)
  11473. curY = border.y + border.height - radius;
  11474. if (xGame.common.gameMgr.isOpenBall) {
  11475. if (curX >= border.x + border.openBallW - radius)
  11476. curX = border.x + border.openBallW - radius;
  11477. }
  11478. this.ui.moveNode.x = curX;
  11479. this.ui.moveNode.y = curY;
  11480. rootBall.gameObj.x = curX;
  11481. rootBall.gameObj.y = curY;
  11482. rootBall.d3BallSrc.setTransPos(curX, curY);
  11483. this.isMoveRod = true;
  11484. break;
  11485. case PressType.rulerNode:
  11486. let yy = e.stageY - this.eventObj.lastY;
  11487. this.eventObj.lastY = e.stageY;
  11488. let ruler1 = this.ui.rulerNode.img1;
  11489. let ruler2 = this.ui.rulerNode.img2;
  11490. ruler1.y += yy;
  11491. ruler2.y += yy;
  11492. this.rulerOffset += yy;
  11493. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11494. this.rulerOffset = 0;
  11495. xGame.soundMgr.playSound("inch", 1, 10);
  11496. }
  11497. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11498. let h = ruler1.height;
  11499. this.checkGuide();
  11500. this.isMoveRod = true;
  11501. if (ruler1.y >= h) {
  11502. ruler1.y = -h;
  11503. ruler2.y = 0;
  11504. return;
  11505. }
  11506. else if (ruler1.y <= -h) {
  11507. ruler1.y = h;
  11508. ruler2.y = 0;
  11509. return;
  11510. }
  11511. if (ruler2.y >= h) {
  11512. ruler2.y = -h;
  11513. ruler1.y = 0;
  11514. return;
  11515. }
  11516. else if (ruler2.y <= -h) {
  11517. ruler2.y = h;
  11518. ruler1.y = 0;
  11519. return;
  11520. }
  11521. break;
  11522. case PressType.d2Root:
  11523. this.eventObj.curX = e.stageX;
  11524. this.eventObj.curY = e.stageY;
  11525. let offset = this.checkRodMoveDir();
  11526. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11527. this.eventObj.lastX = e.stageX;
  11528. this.eventObj.lastY = e.stageY;
  11529. break;
  11530. default:
  11531. break;
  11532. }
  11533. }
  11534. onEventUp(e) {
  11535. if (e.stopPropagation)
  11536. e.stopPropagation();
  11537. if (e && e.force) {
  11538. }
  11539. else {
  11540. if (!this.isTurnSelf())
  11541. return;
  11542. }
  11543. switch (this.pressTarget) {
  11544. case PressType.powerNode:
  11545. this.ui.powerNode.value = 0;
  11546. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11547. this.ui.powerTxt.text = "";
  11548. if (this.powerNum > 0) {
  11549. xGame.eventMgr.event(BALL_SHOOT);
  11550. xGame.common.d2World.shoot(this.powerNum);
  11551. xGame.common.d2World.d2Gan.shoot();
  11552. xGame.common.d2World.d2HelpLine.shoot();
  11553. this.finishGuide();
  11554. this.ui.powerEft.visible = false;
  11555. this.ui.colorNode.visible = false;
  11556. let ganStr = "";
  11557. if (this.powerNum <= 30) {
  11558. ganStr = "gan_30";
  11559. }
  11560. else if (this.powerNum <= 60) {
  11561. ganStr = "gan_50";
  11562. }
  11563. else {
  11564. ganStr = "gan_80";
  11565. }
  11566. xGame.soundMgr.playSound(ganStr);
  11567. }
  11568. break;
  11569. case PressType.moveNode:
  11570. let rootBall = xGame.common.d2World.rootBall;
  11571. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11572. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11573. let isIntersect = this.judgeBallIntersect();
  11574. if (isIntersect) {
  11575. this.ui.moveNode.x = lastX;
  11576. this.ui.moveNode.y = lastY;
  11577. rootBall.gameObj.x = lastX;
  11578. rootBall.gameObj.y = lastY;
  11579. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11580. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11581. }
  11582. else {
  11583. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11584. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11585. }
  11586. this.showBallUI();
  11587. this.ui.moveNode.finger.visible = true;
  11588. xGame.common.d2World.getHelpLine();
  11589. break;
  11590. case PressType.rulerNode:
  11591. break;
  11592. case PressType.d2Root:
  11593. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11594. if (dis <= 25) {
  11595. this.moveToClickDot(e);
  11596. }
  11597. break;
  11598. default:
  11599. break;
  11600. }
  11601. this.pressTarget = -1;
  11602. }
  11603. checkGuide() {
  11604. let guide = DataMgr.getSkillGuide();
  11605. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11606. xGame.common.guideStep++;
  11607. xGame.common.gameUI.ui.guide2.visible = false;
  11608. xGame.common.gameUI.ui.guide3.visible = true;
  11609. }
  11610. }
  11611. finishGuide() {
  11612. let guide = DataMgr.getSkillGuide();
  11613. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11614. xGame.common.guideStep = 10;
  11615. this.closeAllGuide();
  11616. console.log('zh: 新手引导完毕');
  11617. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11618. }
  11619. }
  11620. closeAllGuide() {
  11621. xGame.common.gameUI.ui.guide1.visible = false;
  11622. xGame.common.gameUI.ui.guide2.visible = false;
  11623. xGame.common.gameUI.ui.guide3.visible = false;
  11624. }
  11625. updateBarInfo() {
  11626. let star = this.ui.powerNode.y;
  11627. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11628. if (rate >= 1)
  11629. rate = 1;
  11630. if (rate <= 0)
  11631. rate = 0;
  11632. this.powerNum = Math.ceil(rate * 100);
  11633. this.ui.powerNode.value = this.powerNum;
  11634. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11635. this.ui.colorNode.value = this.powerNum;
  11636. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11637. this.ui.powerEft.visible = this.powerNum != 0;
  11638. this.ui.colorNode.visible = this.powerNum != 0;
  11639. this.ui.powerTxt.text = this.powerNum + "";
  11640. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11641. }
  11642. forceCancel() {
  11643. this.ui.powerNode.value = 0;
  11644. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11645. this.ui.powerTxt.text = "";
  11646. }
  11647. checkRodMoveDir() {
  11648. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11649. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11650. if (tempX >= 0 && tempY <= 0) {
  11651. return this.checkDir();
  11652. }
  11653. else if (tempX < 0 && tempY < 0) {
  11654. return this.checkDir(1, -1);
  11655. }
  11656. else if (tempX < 0 && tempY > 0) {
  11657. return this.checkDir(-1, -1);
  11658. }
  11659. else {
  11660. return this.checkDir(-1, 1);
  11661. }
  11662. }
  11663. checkDir(flagX = 1, flagY = 1) {
  11664. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11665. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11666. if (offsetY == 0) {
  11667. return offsetX * flagX;
  11668. }
  11669. if (offsetX == 0) {
  11670. return offsetY * flagY;
  11671. }
  11672. let angle = offsetY / offsetX;
  11673. if (Math.abs(angle) >= 1) {
  11674. return offsetY * flagY;
  11675. }
  11676. else {
  11677. return offsetX * flagX;
  11678. }
  11679. }
  11680. judgeBallIntersect() {
  11681. let rootBall = xGame.common.d2World.rootBall;
  11682. let ballArr = xGame.common.d2World.ballArr;
  11683. let radius = rootBall.gameObj.width / 2;
  11684. let temp;
  11685. let isIntersect = false;
  11686. for (let index = 0; index < ballArr.length; index++) {
  11687. temp = ballArr[index];
  11688. if (temp.number == rootBall.number)
  11689. continue;
  11690. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11691. if (isIntersect) {
  11692. break;
  11693. }
  11694. }
  11695. return isIntersect;
  11696. }
  11697. hideBallUI() {
  11698. let d2Gan = xGame.common.d2World.d2Gan;
  11699. if (!d2Gan.ui.isDisposed)
  11700. d2Gan.ui.visible = false;
  11701. let d2Help = xGame.common.d2World.d2HelpLine;
  11702. if (!d2Help.ui.isDisposed)
  11703. d2Help.ui.visible = false;
  11704. let rootBall = xGame.common.d2World.rootBall;
  11705. if (!rootBall.destroyed) {
  11706. rootBall.gameObj.active = false;
  11707. }
  11708. }
  11709. showBallUI() {
  11710. let d2Gan = xGame.common.d2World.d2Gan;
  11711. if (!d2Gan.ui.isDisposed)
  11712. d2Gan.ui.visible = true;
  11713. let d2Help = xGame.common.d2World.d2HelpLine;
  11714. if (!d2Help.ui.isDisposed)
  11715. d2Help.ui.visible = true;
  11716. let rootBall = xGame.common.d2World.rootBall;
  11717. if (!rootBall.destroyed) {
  11718. rootBall.gameObj.active = true;
  11719. }
  11720. }
  11721. moveToClickDot(e) {
  11722. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11723. let root = xGame.common.d2World.rootBall.gameObj;
  11724. let xx = e.stageX - xGame.common.sysOffestNum;
  11725. let yy = e.stageY;
  11726. let x = xx - root.x;
  11727. let y = yy - root.y;
  11728. let angle = xGame.common.getfguiRotation(x, y);
  11729. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11730. xGame.common.d2World.getHelpLine();
  11731. }
  11732. this.isMoveRod = false;
  11733. xGame.common.clickedBall = false;
  11734. }
  11735. openAllEvent() {
  11736. this.closeAllEvent();
  11737. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11738. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11739. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11740. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11741. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11742. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11743. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11744. }
  11745. closeAllEvent() {
  11746. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11747. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11748. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11749. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11750. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11751. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11752. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11753. }
  11754. resetGame() {
  11755. this.closeAllEvent();
  11756. this.hideBallUI();
  11757. xGame.common.gameMgr.gamePause = true;
  11758. }
  11759. }
  11760. UIGame.uiName = "UIGame";
  11761. class UIAddProp extends UIBase {
  11762. constructor() {
  11763. super();
  11764. this.curType = "";
  11765. }
  11766. onConstructor() {
  11767. this.ui = ui_UIAddProp.createInstance();
  11768. this.contentPane = this.ui;
  11769. this.isEject = false;
  11770. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11771. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11772. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11773. this.updateUI();
  11774. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11775. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11776. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11777. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11778. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11779. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11780. }
  11781. show(type) {
  11782. super.show();
  11783. this.curType = type == 0 ? "coin" : "diamond";
  11784. this.switchBtn("");
  11785. this.ui.t0.play();
  11786. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11787. PlatMgr.showInsert(true);
  11788. }
  11789. closeSelf() {
  11790. this.hide();
  11791. }
  11792. updateUI() {
  11793. let data = cfgTable.moneyData;
  11794. let temp;
  11795. let obj;
  11796. for (const key in data) {
  11797. temp = data[key];
  11798. obj = this.ui.myNode["node" + key];
  11799. if (parseInt(key) <= 2) {
  11800. obj.diamondTxt.text = "+" + temp.num;
  11801. }
  11802. else {
  11803. obj.coinTxt.text = temp.num;
  11804. obj.diamondTxt.text = temp.get.split('_')[1];
  11805. }
  11806. }
  11807. this.updateDiamondShare();
  11808. }
  11809. updateDiamondShare() {
  11810. let data = DataMgr.getShareDiamondTimes();
  11811. if (data >= xGame.common.maxShareDiamondTimes) {
  11812. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11813. this.ui.myNode.node1.touchable = false;
  11814. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11815. }
  11816. else {
  11817. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11818. this.ui.myNode.node1.touchable = true;
  11819. }
  11820. }
  11821. switchBtn(type) {
  11822. if (type == "")
  11823. type = this.curType;
  11824. else {
  11825. if (this.curType == type) {
  11826. return;
  11827. }
  11828. else {
  11829. this.curType = type;
  11830. }
  11831. }
  11832. if (type == "coin") {
  11833. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11834. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11835. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11836. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11837. this.ui.myNode.c1.selectedIndex = 0;
  11838. }
  11839. else {
  11840. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11841. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11842. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11843. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11844. this.ui.myNode.c1.selectedIndex = 1;
  11845. }
  11846. }
  11847. convertCoin(index) {
  11848. let data = cfgTable.moneyData[index];
  11849. let coinNum = data.num;
  11850. let str = data.get.split('_')[1];
  11851. let needDiamond = parseInt(str);
  11852. if (DataMgr.diamondEnough(needDiamond)) {
  11853. DataMgr.setDiamond(-needDiamond);
  11854. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11855. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11856. }
  11857. else {
  11858. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11859. this.switchBtn("diamond");
  11860. }
  11861. }
  11862. videoGetDiamond() {
  11863. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11864. if (Laya.Browser.onAndroid) {
  11865. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11866. if (!boo) {
  11867. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11868. return;
  11869. }
  11870. }
  11871. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11872. }
  11873. else {
  11874. console.log('zh:AD 失败,直接发放奖励');
  11875. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11876. }
  11877. }
  11878. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11879. let num = cfgTable.moneyData[2].num;
  11880. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11881. this.closeSelf();
  11882. }
  11883. videoGetCoin() {
  11884. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11885. if (Laya.Browser.onAndroid) {
  11886. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11887. if (!boo) {
  11888. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11889. return;
  11890. }
  11891. }
  11892. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11893. }
  11894. else {
  11895. console.log('zh:AD 失败,直接发放奖励');
  11896. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11897. }
  11898. }
  11899. qjff_AD_for_uiAddProp_videoGetCoin() {
  11900. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11901. this.closeSelf();
  11902. }
  11903. shareGetDiamond() {
  11904. let times = DataMgr.getShareDiamondTimes();
  11905. if (times >= xGame.common.maxShareDiamondTimes) {
  11906. console.log('zh: 233333333333 maxShareDiamondTimes');
  11907. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11908. }
  11909. else {
  11910. console.log('zh:33333333333333ad');
  11911. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11912. if (Laya.Browser.onAndroid) {
  11913. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11914. if (!boo) {
  11915. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11916. return;
  11917. }
  11918. }
  11919. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11920. }
  11921. else {
  11922. console.log('zh:AD 失败,直接发放奖励');
  11923. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11924. }
  11925. }
  11926. }
  11927. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11928. let diamond = xGame.common.randomNum(50, 100);
  11929. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11930. DataMgr.setShareDiamondTimes(1);
  11931. this.updateDiamondShare();
  11932. }
  11933. openPutBallView() {
  11934. let end = xGame.uiMgr.getUI(UIGameEnd);
  11935. let skill = xGame.uiMgr.getUI(UISkill);
  11936. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11937. let uigame = xGame.uiMgr.getUI(UIGame);
  11938. if (end && !end.isHide) {
  11939. xGame.uiMgr.Hide(UIGameEnd);
  11940. xGame.uiMgr.Show(UIMain);
  11941. }
  11942. if (skill && !skill.isHide)
  11943. xGame.uiMgr.Hide(UISkill);
  11944. if (uigame && !uigame.isHide)
  11945. xGame.uiMgr.Hide(UIGame);
  11946. if (level && !level.isHide) {
  11947. }
  11948. else {
  11949. xGame.uiMgr.Show(UILevelDisplay);
  11950. }
  11951. this.closeSelf();
  11952. }
  11953. }
  11954. UIAddProp.uiName = "UIAddProp";
  11955. class MoneyNode {
  11956. constructor(ui) {
  11957. this.leftTime = 0;
  11958. this.ui = ui;
  11959. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11960. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11961. this.ui.addPowerBtn.onClick(this, this.addPower);
  11962. this.ui.c1.selectedIndex = 1;
  11963. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11964. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11965. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11966. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11967. this.coinChange();
  11968. this.diamondChange();
  11969. this.powerChange();
  11970. }
  11971. addPower() {
  11972. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11973. xGame.uiMgr.Show(UIPower);
  11974. }
  11975. powerChange() {
  11976. let powerNum = DataMgr.getPower();
  11977. this.ui.powerTxt.text = powerNum + "";
  11978. }
  11979. checkPowerTime() {
  11980. let cur = new Date().getTime();
  11981. let last = DataMgr.getPowerTime();
  11982. if (last == 0) {
  11983. last = cur;
  11984. DataMgr.setPowerTime(cur);
  11985. }
  11986. let power = DataMgr.getPower();
  11987. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11988. Laya.timer.clearAll(this);
  11989. if (power >= xGame.common.natureMaxPower) {
  11990. this.ui.powerTimeTxt.text = "";
  11991. DataMgr.setPowerTime(cur);
  11992. return;
  11993. }
  11994. if (power + offset >= xGame.common.natureMaxPower) {
  11995. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11996. this.ui.powerTimeTxt.text = "";
  11997. DataMgr.setPowerTime(cur);
  11998. }
  11999. else {
  12000. if (offset > 0) {
  12001. DataMgr.setPower(offset);
  12002. DataMgr.setPowerTime(cur);
  12003. }
  12004. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12005. this.leftTime = xGame.common.powerRecoverNum - time;
  12006. if (this.leftTime <= 0)
  12007. this.leftTime = 0;
  12008. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12009. Laya.timer.loop(1000, this, this.updatePowerTime);
  12010. }
  12011. }
  12012. updatePowerTime() {
  12013. this.leftTime -= 1;
  12014. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12015. if (this.leftTime <= 0) {
  12016. this.checkPowerTime();
  12017. }
  12018. }
  12019. coinChange() {
  12020. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12021. }
  12022. diamondChange() {
  12023. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12024. }
  12025. addCoin() {
  12026. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12027. Moyu.sendDataEvent("AddCoinBtn");
  12028. xGame.uiMgr.Show(UIAddProp, 0);
  12029. }
  12030. addDiamond() {
  12031. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12032. Moyu.sendDataEvent("AddDiamondBtn");
  12033. xGame.uiMgr.Show(UIAddProp, 1);
  12034. }
  12035. }
  12036. class UIDraw extends UIBase {
  12037. constructor() {
  12038. super();
  12039. this.curKey = 0;
  12040. }
  12041. onConstructor() {
  12042. this.ui = ui_UIDraw.createInstance();
  12043. this.contentPane = this.ui;
  12044. this.isEject = false;
  12045. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12046. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12047. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12048. this.initDraw();
  12049. this.initUI();
  12050. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12051. if (Moyu.isKs)
  12052. this.ui.closeNode.closeBtn.x += 100;
  12053. }
  12054. show() {
  12055. super.show();
  12056. this.ui.t0.play();
  12057. this.playSecretaryIdle();
  12058. this.updateDraw();
  12059. this.checkFree();
  12060. if (PlatMgr.bannerDelay > 0) {
  12061. this.ui.closeNode.closeBtn.visible = false;
  12062. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12063. this.ui.closeNode.closeBtn.visible = true;
  12064. });
  12065. }
  12066. PlatMgr.showRateBanner();
  12067. }
  12068. hide() {
  12069. Laya.timer.clearAll(this);
  12070. super.hide();
  12071. }
  12072. checkFree() {
  12073. let isFree = DataMgr.getDailyfreeDrawTimes();
  12074. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12075. }
  12076. initDraw() {
  12077. this.drawObj = [];
  12078. let data = cfgTable.drawData;
  12079. let temp;
  12080. let weight = 0;
  12081. for (const key in data) {
  12082. temp = data[key];
  12083. weight += temp.weight;
  12084. this.drawObj.push(weight);
  12085. }
  12086. this.allWeight = weight;
  12087. }
  12088. initUI() {
  12089. let data = cfgTable.drawData;
  12090. let temp;
  12091. let img;
  12092. let txt;
  12093. for (const key in data) {
  12094. temp = data[key];
  12095. img = this.ui.myNode.rotNode["img" + key];
  12096. txt = this.ui.myNode.rotNode["txt" + key];
  12097. img.url = xGame.common.getGameIconUrl(temp.icon);
  12098. txt.visible = true;
  12099. if (temp.award > 2) {
  12100. img.rotation = 0;
  12101. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12102. }
  12103. else {
  12104. img.rotation = temp.rotation;
  12105. txt.text = temp.num;
  12106. }
  12107. }
  12108. }
  12109. getCurkey() {
  12110. let rand = Math.random() * this.allWeight;
  12111. let temp;
  12112. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12113. temp = this.drawObj[index];
  12114. if (index == 0) {
  12115. if (rand < temp) {
  12116. return index + 1;
  12117. }
  12118. }
  12119. else {
  12120. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12121. return index + 1;
  12122. }
  12123. }
  12124. }
  12125. return 2;
  12126. }
  12127. startDraw() {
  12128. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12129. if (freeTimes > 0) {
  12130. this.beginDraw();
  12131. DataMgr.setDailyfreeDrawTimes(0);
  12132. this.checkFree();
  12133. }
  12134. else {
  12135. if (Laya.Browser.onAndroid) {
  12136. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12137. if (!boo) {
  12138. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12139. return;
  12140. }
  12141. }
  12142. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12143. }
  12144. else {
  12145. console.log('zh:AD 失败,直接发放奖励');
  12146. this.qjff_chouJiang();
  12147. }
  12148. }
  12149. }
  12150. qjff_chouJiang() {
  12151. this.beginDraw();
  12152. }
  12153. beginDraw() {
  12154. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12155. this.ui.drawBtn.touchable = false;
  12156. this.curKey = this.getCurkey();
  12157. console.log("当前key", this.curKey);
  12158. let cell = 60;
  12159. let lap = 3;
  12160. let angle = cell * (this.curKey - 1) + lap * 360;
  12161. let target = this.ui.myNode.rotNode;
  12162. target.rotation = 0;
  12163. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12164. console.log("旋转完成");
  12165. this.ui.drawBtn.touchable = true;
  12166. this.getAward();
  12167. }));
  12168. }
  12169. getAward() {
  12170. let data = cfgTable.drawData[this.curKey];
  12171. let temp = new AwardType();
  12172. temp.type = data.award;
  12173. temp.num = data.num;
  12174. xGame.common.getAward([temp], () => {
  12175. DataMgr.setDrawTimes(1);
  12176. this.updateDraw();
  12177. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12178. });
  12179. }
  12180. updateDraw() {
  12181. let drawTimes = DataMgr.getDrawTimes();
  12182. let awardTimes = DataMgr.getDrawAwardTimes();
  12183. if (Math.floor(drawTimes / 3) > awardTimes) {
  12184. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12185. this.ui.extraNode.boxBtn.touchable = true;
  12186. this.ui.extraNode.tipsTxt.text = "3/3";
  12187. this.ui.extraNode.barNode.width = 265;
  12188. this.getExtraAward();
  12189. }
  12190. else {
  12191. this.ui.extraNode.boxBtn.t0.stop();
  12192. this.ui.extraNode.boxBtn.touchable = false;
  12193. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12194. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12195. }
  12196. let data = cfgTable.drawData[1];
  12197. if (awardTimes == 0) {
  12198. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12199. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12200. this.ui.myNode.rotNode.img1.rotation = 0;
  12201. }
  12202. else {
  12203. let award = data.nextid;
  12204. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12205. this.ui.myNode.rotNode.txt1.text = award[1];
  12206. this.ui.myNode.rotNode.img1.rotation = 0;
  12207. }
  12208. }
  12209. getExtraAward() {
  12210. let drawTimes = DataMgr.getDrawTimes();
  12211. let awardTimes = DataMgr.getDrawAwardTimes();
  12212. let data = cfgTable.drawData[1];
  12213. let award = new AwardType();
  12214. if (awardTimes == 0) {
  12215. award.num = data.num;
  12216. award.type = data.award;
  12217. xGame.common.getAward([award], () => {
  12218. let all = Math.floor(drawTimes / 3);
  12219. DataMgr.setDrawAwardTimes(all);
  12220. this.updateDraw();
  12221. });
  12222. }
  12223. else {
  12224. award.num = parseInt(data.nextid[1]);
  12225. award.type = parseInt(data.nextid[0]);
  12226. xGame.common.getAward([award], () => {
  12227. let all = Math.floor(drawTimes / 3);
  12228. DataMgr.setDrawAwardTimes(all);
  12229. this.updateDraw();
  12230. });
  12231. }
  12232. }
  12233. closeSelf() {
  12234. this.hide();
  12235. }
  12236. playSecretaryIdle() {
  12237. let parent = this.ui.secretary.displayObject;
  12238. parent.destroyChildren();
  12239. let xx = this.ui.secretary.width / 2;
  12240. let yy = this.ui.secretary.height;
  12241. let scale = xGame.common.getSecretaryScale();
  12242. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12243. xGame.common.secretary.play(data, 0, true, parent);
  12244. }
  12245. }
  12246. UIDraw.uiName = "UIDraw";
  12247. class ui_UIFlyEft extends fgui.GComponent {
  12248. static createInstance() {
  12249. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12250. }
  12251. onConstruct() {
  12252. this.n0 = (this.getChild("n0"));
  12253. this.n1 = (this.getChild("n1"));
  12254. this.n2 = (this.getChild("n2"));
  12255. this.n3 = (this.getChild("n3"));
  12256. this.n4 = (this.getChild("n4"));
  12257. this.n5 = (this.getChild("n5"));
  12258. this.n6 = (this.getChild("n6"));
  12259. this.n7 = (this.getChild("n7"));
  12260. this.iconNode = (this.getChild("iconNode"));
  12261. this.txt = (this.getChild("txt"));
  12262. this.txtNode = (this.getChild("txtNode"));
  12263. }
  12264. }
  12265. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12266. class UIFlyEft extends UIBase {
  12267. constructor() {
  12268. super();
  12269. this.max = 8;
  12270. this.delay = 0;
  12271. }
  12272. onConstructor() {
  12273. this.ui = ui_UIFlyEft.createInstance();
  12274. this.contentPane = this.ui;
  12275. this.isEject = false;
  12276. this.isMuti = true;
  12277. this.ui.x += xGame.common.sysOffestNum;
  12278. }
  12279. getArrPos() {
  12280. if (this.iconPos && this.iconPos.length > 0)
  12281. return;
  12282. this.iconPos = [];
  12283. let temp;
  12284. for (let index = 0; index < this.max; index++) {
  12285. temp = this.ui["n" + index];
  12286. this.iconPos.push([temp.x, temp.y]);
  12287. }
  12288. }
  12289. show(stPos, edPos, num, type, callback) {
  12290. super.show();
  12291. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12292. this.getArrPos();
  12293. this.updateUI(type);
  12294. this.updatePos();
  12295. this.runFly(edPos, callback);
  12296. this.runWorlds(stPos, num);
  12297. }
  12298. updateUI(type) {
  12299. let temp;
  12300. let str;
  12301. for (let index = 0; index < this.max; index++) {
  12302. temp = this.ui["n" + index];
  12303. str = this.getIconStr(type);
  12304. temp.url = xGame.common.getGameIconUrl(str);
  12305. }
  12306. }
  12307. getIconStr(type) {
  12308. switch (type) {
  12309. case Prop.diamond:
  12310. return "ty_zs";
  12311. case Prop.coin:
  12312. return "ty_jb";
  12313. default:
  12314. break;
  12315. }
  12316. }
  12317. updatePos() {
  12318. let temp;
  12319. for (let index = 0; index < this.max; index++) {
  12320. temp = this.ui["n" + index];
  12321. temp.x = this.iconPos[index][0];
  12322. temp.y = this.iconPos[index][1];
  12323. }
  12324. }
  12325. runFly(endPos, callback) {
  12326. let all = 0;
  12327. let temp;
  12328. for (let index = 0; index < this.max; index++) {
  12329. temp = this.ui["n" + index];
  12330. temp.visible = true;
  12331. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12332. temp.visible = false;
  12333. all++;
  12334. if (all >= this.max) {
  12335. callback && callback();
  12336. }
  12337. }), 20 * index);
  12338. }
  12339. }
  12340. runWorlds(stPos, num) {
  12341. let str = "+" + num;
  12342. this.ui.txt.text = str;
  12343. let starX = stPos.x;
  12344. let starY = stPos.y + 50;
  12345. this.ui.txt.x = starX;
  12346. this.ui.txt.y = starY;
  12347. this.ui.txt.visible = true;
  12348. this.ui.txt.alpha = 1;
  12349. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12350. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12351. this.ui.txt.visible = false;
  12352. this.hide();
  12353. }));
  12354. }));
  12355. }
  12356. }
  12357. UIFlyEft.uiName = "UIFlyEft";
  12358. class Common {
  12359. constructor() {
  12360. this.convertNum = 0.025;
  12361. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12362. this.scaleV3One = new Laya.Vector3();
  12363. this.scaleV3Two = new Laya.Vector3();
  12364. this.posV4 = new Laya.Vector4();
  12365. this.showDebug = false;
  12366. this.openGuide = true;
  12367. this.rodOffest = new Laya.Vector2(0, 0);
  12368. this.rodAngle = 0;
  12369. this.gameMode = GameMode.classic;
  12370. this.bigMoveLevelIndex = 1;
  12371. this.bigMoveNeedCoin = 1000;
  12372. this.classicNiceNeddCoin = 1000;
  12373. this.passAwardCoin = 2000;
  12374. this.classicRoomType = 1;
  12375. this.maxPower = 20;
  12376. this.natureMaxPower = 5;
  12377. this.videoPower = 2;
  12378. this.powerRecoverNum = 900;
  12379. this.curPlayerSkillType = 0;
  12380. this.isNewDay = false;
  12381. this.clickedBall = false;
  12382. this.placeBallCurLevel = 0;
  12383. this.placeBallStarNum = 0;
  12384. this.longHelpLine = false;
  12385. this.maxShareDiamondTimes = 3;
  12386. this.guideStep = 0;
  12387. this.temSelfLevel = 0;
  12388. this.extraMoveNum = 0;
  12389. this.curRankID = 0;
  12390. this.rankID = {
  12391. normalStar: 12000,
  12392. wxStar: 12001
  12393. };
  12394. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12395. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12396. this.btnClickStr = "buttonclick";
  12397. this.maxSkillLevel = 10;
  12398. this.upSkillLevel = false;
  12399. this.gameStartTime = 0;
  12400. this._sysOffestNum = 0;
  12401. this.angleV2 = new Laya.Vector2();
  12402. this.rootV = new Laya.Vector2(0, 1);
  12403. this.tempDir1 = new Laya.Vector2();
  12404. this.tempDir2 = new Laya.Vector2();
  12405. this.ballSize = 33;
  12406. this.stPos = new Laya.Point();
  12407. this.edPos = new Laya.Point();
  12408. Common._instance = this;
  12409. window["common"] = this;
  12410. }
  12411. static getInstance() {
  12412. if (!this._instance) {
  12413. this._instance = new Common();
  12414. }
  12415. return this._instance;
  12416. }
  12417. get sysOffestNum() {
  12418. if (this._sysOffestNum == 0) {
  12419. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12420. }
  12421. return this._sysOffestNum;
  12422. }
  12423. testShader() {
  12424. let test = new LightShader();
  12425. test.texture = "res/d3Res/ballTexture/ball1.png";
  12426. Laya.stage.addChild(test);
  12427. }
  12428. playScale(node) {
  12429. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12430. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12431. }));
  12432. }));
  12433. }
  12434. setGroup(colli, ...group) {
  12435. let out = 0;
  12436. for (let index = 0; index < group.length; index++) {
  12437. if (index == 0) {
  12438. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12439. }
  12440. else {
  12441. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12442. }
  12443. }
  12444. colli.collisionGroup = out;
  12445. }
  12446. setCanGroupWith(colli, ...group) {
  12447. let out = 0;
  12448. for (let index = 0; index < group.length; index++) {
  12449. if (index == 0) {
  12450. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12451. }
  12452. else {
  12453. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12454. }
  12455. }
  12456. colli.canCollideWith = out;
  12457. }
  12458. loadPrefab(name, callback) {
  12459. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12460. let prefab = new Laya.Prefab();
  12461. prefab.json = obj;
  12462. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12463. callback && callback(img);
  12464. }));
  12465. }
  12466. pos2to3Convert(x, y, d3Pos) {
  12467. x = x + this.sysOffestNum;
  12468. d3Pos.setValue(x, y, 0);
  12469. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12470. if (success) {
  12471. }
  12472. else {
  12473. console.error("转换出错了。。。。。。。。");
  12474. }
  12475. }
  12476. scale2to3Convert(num) {
  12477. this.scaleV3One.setValue(0, 0, 0);
  12478. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12479. this.scaleV3Two.setValue(0, num, 0);
  12480. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12481. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12482. return outNum;
  12483. }
  12484. pos3to2Convert(d3Pos) {
  12485. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12486. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12487. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12488. d3Pos.x -= this.sysOffestNum;
  12489. }
  12490. scale3to2Convert(num) {
  12491. let scale = this.scale2to3Convert(1);
  12492. let d2Out = num / scale;
  12493. return d2Out;
  12494. }
  12495. getCollider(type, restitution = 0.9, density = 10) {
  12496. let colli;
  12497. if (type == "box")
  12498. colli = new Laya.BoxCollider();
  12499. else
  12500. colli = new Laya.CircleCollider();
  12501. colli.friction = 0;
  12502. colli.restitution = restitution;
  12503. colli.density = density;
  12504. return colli;
  12505. }
  12506. getRigbody() {
  12507. let rigy = new Laya.RigidBody();
  12508. rigy.bullet = true;
  12509. rigy.allowRotation = false;
  12510. rigy.allowSleep = false;
  12511. rigy.gravityScale = 0;
  12512. return rigy;
  12513. }
  12514. getfguiRotation(x, y) {
  12515. this.angleV2.setValue(x, y);
  12516. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12517. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12518. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12519. angle = -angle;
  12520. }
  12521. return 180 + angle;
  12522. }
  12523. getAngle(x, y) {
  12524. this.angleV2.setValue(x, y);
  12525. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12526. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12527. return angle;
  12528. }
  12529. randomNum(a, b) {
  12530. return a + Math.floor((b - a + 1) * Math.random());
  12531. }
  12532. getRandArrEle(arr) {
  12533. return arr[Math.floor(arr.length * Math.random())];
  12534. }
  12535. getSign(val) {
  12536. return val >= 0 ? 1 : -1;
  12537. }
  12538. botherArr(arr) {
  12539. let times = arr.length + 2;
  12540. let length = arr.length;
  12541. let a;
  12542. let b;
  12543. let temp;
  12544. for (let index = 0; index < times; index++) {
  12545. a = Math.floor(Math.random() * length);
  12546. b = Math.floor(Math.random() * length);
  12547. temp = arr[a];
  12548. arr[a] = arr[b];
  12549. arr[b] = temp;
  12550. }
  12551. }
  12552. getGameIconUrl(id) {
  12553. return "ui://game/" + id;
  12554. }
  12555. getComponentUrl(id) {
  12556. return "ui://game/" + id;
  12557. }
  12558. getAnimation() {
  12559. }
  12560. judgeSkillType(type = SkillType.highSpace) {
  12561. if (this.gameMode == GameMode.classic)
  12562. return;
  12563. let gameMgr = this.gameMgr;
  12564. if (gameMgr.selfTurn) {
  12565. if (gameMgr.selfCurSkill == type) {
  12566. return true;
  12567. }
  12568. }
  12569. else {
  12570. if (gameMgr.aiCurSkill == type) {
  12571. return true;
  12572. }
  12573. }
  12574. }
  12575. ballColliHole(collider) {
  12576. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12577. xGame.common.gameMgr.isFirstInGame = false;
  12578. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12579. }
  12580. collider.owner.mySrc.checkWrongBall();
  12581. }
  12582. getArrMaxEle(arr) {
  12583. let max = -Infinity;
  12584. for (let index = 0; index < arr.length; index++) {
  12585. max = Math.max(arr[index], max);
  12586. }
  12587. return max;
  12588. }
  12589. getArrMinEle(arr) {
  12590. let min = Infinity;
  12591. for (let index = 0; index < arr.length; index++) {
  12592. min = Math.min(arr[index], min);
  12593. }
  12594. return min;
  12595. }
  12596. playRandomMutiBallBigSkillSound() {
  12597. if (Math.random() <= 0.5)
  12598. return;
  12599. let rand = this.randomNum(1, 6);
  12600. let str = "ganfa0" + rand;
  12601. xGame.soundMgr.playSound(str);
  12602. }
  12603. showOneCamera(type) {
  12604. let object = xGame.common.d3World.cameraObj;
  12605. for (const key in object) {
  12606. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12607. object[key].init();
  12608. object[key].owner.active = key == type;
  12609. }
  12610. }
  12611. }
  12612. checkBallOverBorder(x, y) {
  12613. let radius = 17;
  12614. let condition = this._checkBorder(x + radius, y) ||
  12615. this._checkBorder(x - radius, y) ||
  12616. this._checkBorder(x, y + radius) ||
  12617. this._checkBorder(x, y - radius);
  12618. if (condition) {
  12619. return true;
  12620. }
  12621. }
  12622. _checkBorder(x, y) {
  12623. let borderRect = this.d2World.borderRect;
  12624. let xOffest = 20;
  12625. let yOffest = 20;
  12626. if (y <= borderRect.y - yOffest) {
  12627. return true;
  12628. }
  12629. if (y >= borderRect.y + borderRect.height + yOffest) {
  12630. return true;
  12631. }
  12632. if (x <= borderRect.x - xOffest) {
  12633. return true;
  12634. }
  12635. if (x >= borderRect.x + borderRect.width + xOffest) {
  12636. return true;
  12637. }
  12638. }
  12639. initWeight(cfg) {
  12640. let allCfgData = { data: {}, allWeightNum: 0 };
  12641. let weightCfg = allCfgData.data;
  12642. let weight = 0;
  12643. for (const key in cfg) {
  12644. weightCfg[key] = {};
  12645. weightCfg[key].id = cfg[key].id;
  12646. weightCfg[key].minWeight = weight;
  12647. weight += cfg[key].weight;
  12648. weightCfg[key].maxWeight = weight;
  12649. }
  12650. allCfgData.allWeightNum = weight;
  12651. return allCfgData;
  12652. }
  12653. getRandomWeightData(cfg) {
  12654. let weightCfg = cfg.data;
  12655. let allWeightNum = cfg.allWeightNum;
  12656. let rand = Math.floor(Math.random() * allWeightNum);
  12657. for (const key in weightCfg) {
  12658. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12659. return weightCfg[key];
  12660. }
  12661. }
  12662. return weightCfg[1];
  12663. }
  12664. showGirlTalkPop(wordsIndex, node, msgNode) {
  12665. node.visible = true;
  12666. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12667. node.t0.play(Laya.Handler.create(this, () => {
  12668. node.visible = false;
  12669. }));
  12670. }
  12671. stopGirlPop(node) {
  12672. node.t0.stop();
  12673. node.visible = false;
  12674. }
  12675. createHead(loader, url, size = 107) {
  12676. if (Laya.Browser.name == "Browser") {
  12677. loader.url = url;
  12678. return;
  12679. }
  12680. else {
  12681. console.log('zh:url=', url);
  12682. loader.url = url;
  12683. }
  12684. }
  12685. addTestCoin(num) {
  12686. DataMgr.setCoin(num);
  12687. }
  12688. addTestDiamond(num) {
  12689. DataMgr.setDiamond(num);
  12690. }
  12691. addTestSkill() {
  12692. DataMgr.setBigSkill(0, 99);
  12693. DataMgr.setBigSkill(1, 99);
  12694. DataMgr.setBigSkill(2, 99);
  12695. }
  12696. playClassicEmotion(number, x, y) {
  12697. if (this.gameMode == GameMode.bigMove)
  12698. return;
  12699. let randIndex = this.randomNum(0, 2);
  12700. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12701. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12702. if (this.gameMgr.selfTurn) {
  12703. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12704. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12705. }
  12706. else {
  12707. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12708. }
  12709. else {
  12710. if (number == this.gameMgr.blackNum) {
  12711. if (this.gameMgr.selfBallArr.length == 0) {
  12712. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12713. }
  12714. else {
  12715. }
  12716. }
  12717. else {
  12718. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12719. }
  12720. }
  12721. }
  12722. }
  12723. else {
  12724. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12725. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12726. }
  12727. else {
  12728. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12729. }
  12730. else {
  12731. if (number == this.gameMgr.blackNum) {
  12732. if (this.gameMgr.aiBallArr.length == 0) {
  12733. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12734. }
  12735. else {
  12736. }
  12737. }
  12738. else {
  12739. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12740. }
  12741. }
  12742. }
  12743. }
  12744. }
  12745. playHappySound(number) {
  12746. if (this.gameMode != GameMode.classic)
  12747. return;
  12748. if (number == 8)
  12749. return;
  12750. let play = false;
  12751. if (this.gameMgr.selfTurn) {
  12752. if (this.gameMgr.ensureBallType) {
  12753. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12754. play = true;
  12755. }
  12756. }
  12757. else {
  12758. play = true;
  12759. }
  12760. }
  12761. else {
  12762. if (this.gameMgr.ensureBallType) {
  12763. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12764. play = true;
  12765. }
  12766. }
  12767. else {
  12768. play = true;
  12769. }
  12770. }
  12771. if (play)
  12772. xGame.soundMgr.playSound("applause");
  12773. }
  12774. destroyClassicEmotion() {
  12775. if (this.gameMode == GameMode.bigMove)
  12776. return;
  12777. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12778. parent.destroyChildren();
  12779. }
  12780. playAwardSpine(x, y) {
  12781. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12782. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12783. this.awardSpine.play(data, 0, false, parent);
  12784. }
  12785. destroyAwardSpine() {
  12786. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12787. parent.destroyChildren();
  12788. }
  12789. isBlock(bx, by, hx, hy, except = null) {
  12790. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12791. let balls = xGame.common.d2World.ballArr;
  12792. let outArr = [];
  12793. for (let index = 0; index < balls.length; index++) {
  12794. let obj = balls[index];
  12795. if (obj.number == 0)
  12796. continue;
  12797. if (obj == except)
  12798. continue;
  12799. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12800. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12801. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12802. if (num >= 1)
  12803. num = 1;
  12804. if (num < 0)
  12805. continue;
  12806. let gap = Math.sin(Math.acos(num)) * dis;
  12807. if (gap < this.ballSize) {
  12808. outArr.push({
  12809. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12810. disHon: Math.cos(Math.acos(num)) * dis,
  12811. disVer: Math.sin(Math.acos(num)) * dis,
  12812. src: balls[index],
  12813. dir: this.tempDir1
  12814. });
  12815. }
  12816. }
  12817. if (outArr.length > 0) {
  12818. outArr.sort((a, b) => { return a.dis - b.dis; });
  12819. return outArr[0];
  12820. }
  12821. }
  12822. AngleBetween(vector1, vector2) {
  12823. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12824. return rad * (180 / Math.PI);
  12825. }
  12826. getSecretaryScale() {
  12827. if (this.secretary.spineName == "mishu") {
  12828. return 1.28;
  12829. }
  12830. else {
  12831. return 1.024;
  12832. }
  12833. }
  12834. signAwardContainsRod(arr) {
  12835. let temp;
  12836. for (let index = 0; index < arr.length; index++) {
  12837. temp = arr[index].split('-')[0];
  12838. if (parseInt(temp) > 2) {
  12839. return true;
  12840. }
  12841. }
  12842. }
  12843. judgeSameDay() {
  12844. let lastTime = DataMgr.getSignTime();
  12845. let curTime = new Date().getTime();
  12846. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12847. return true;
  12848. }
  12849. return false;
  12850. }
  12851. getAward(arr, callback) {
  12852. let showTriple = arr[0].type <= 2;
  12853. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12854. let temp;
  12855. for (let index = 0; index < arr.length; index++) {
  12856. temp = arr[index];
  12857. switch (temp.type) {
  12858. case 1:
  12859. this.playObjFlyAnim(temp.num, temp.type);
  12860. break;
  12861. case 2:
  12862. this.playObjFlyAnim(temp.num, temp.type);
  12863. break;
  12864. case 3:
  12865. case 4:
  12866. case 5:
  12867. case 6:
  12868. DataMgr.setBallRod(temp.type - 2, 1);
  12869. DataMgr.setCurBallRod(temp.type - 2);
  12870. break;
  12871. default:
  12872. break;
  12873. }
  12874. }
  12875. callback && callback(watchVideo);
  12876. });
  12877. }
  12878. getMoneyNode() {
  12879. let moneyNode;
  12880. let sign = xGame.uiMgr.getUI(UISign);
  12881. let draw = xGame.uiMgr.getUI(UIDraw);
  12882. let end = xGame.uiMgr.getUI(UIGameEnd);
  12883. let skill = xGame.uiMgr.getUI(UISkill);
  12884. if (sign && !sign.isHide)
  12885. moneyNode = sign.ui.moneyNode;
  12886. if (draw && !draw.isHide)
  12887. moneyNode = draw.ui.moneyNode;
  12888. if (end && !end.isHide)
  12889. moneyNode = end.ui.moneyNode;
  12890. if (skill && !skill.isHide)
  12891. moneyNode = skill.ui.moneyNode;
  12892. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12893. let main = xGame.uiMgr.getUI(UIMain);
  12894. if (condition1 && main && !main.isHide) {
  12895. moneyNode = main.ui.moneyNode;
  12896. }
  12897. return moneyNode;
  12898. }
  12899. playObjFlyAnim(num, type, callback = null) {
  12900. this.stPos.x = Laya.stage.width / 2;
  12901. this.stPos.y = Laya.stage.height / 2;
  12902. let moneyNode = this.getMoneyNode();
  12903. switch (type) {
  12904. case Prop.diamond:
  12905. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12906. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12907. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12908. this.edPos.x /= 2;
  12909. this.edPos.y /= 2;
  12910. break;
  12911. case Prop.coin:
  12912. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12913. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12914. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12915. this.edPos.x /= 2;
  12916. this.edPos.y /= 2;
  12917. break;
  12918. default:
  12919. break;
  12920. }
  12921. xGame.soundMgr.playSound("coinbag");
  12922. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12923. switch (type) {
  12924. case Prop.diamond:
  12925. DataMgr.setDiamond(num);
  12926. break;
  12927. case Prop.coin:
  12928. DataMgr.setCoin(num);
  12929. break;
  12930. default:
  12931. break;
  12932. }
  12933. callback && callback();
  12934. });
  12935. }
  12936. autoPopUIView() {
  12937. let arr = [];
  12938. let sign = this.judgeSameDay() ? false : true;
  12939. if (sign)
  12940. arr.push("sign");
  12941. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12942. if (draw)
  12943. arr.push("draw");
  12944. if (arr.length <= 0)
  12945. return;
  12946. let str = this.getRandArrEle(arr);
  12947. switch (str) {
  12948. case "sign":
  12949. xGame.uiMgr.Show(UISign);
  12950. break;
  12951. case "draw":
  12952. xGame.uiMgr.Show(UIDraw);
  12953. break;
  12954. default:
  12955. break;
  12956. }
  12957. }
  12958. getMSTime(time) {
  12959. let min = Math.floor(time / 60);
  12960. let sec = Math.floor((time - min * 60));
  12961. if (sec < 10)
  12962. sec = "0" + sec;
  12963. if (min < 10)
  12964. min = "0" + min;
  12965. return `${min}:${sec}`;
  12966. }
  12967. testPower() {
  12968. DataMgr.setPower(0, false);
  12969. }
  12970. getAllStarNum() {
  12971. let data = DataMgr.getPlaceBallLevelList();
  12972. let out = 0;
  12973. for (let index = 0; index < data.length; index++) {
  12974. out += data[index].star;
  12975. }
  12976. return out;
  12977. }
  12978. recoverCameraView() {
  12979. Laya.timer.once(900, this, () => {
  12980. xGame.common.showOneCamera("mainCamera");
  12981. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12982. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12983. xGame.common.gameUI.ui.border.alpha = 0;
  12984. if (Laya.physicsTimer.scale < 1) {
  12985. Laya.physicsTimer.scale = 1;
  12986. }
  12987. }
  12988. });
  12989. }
  12990. getClassicLevel() {
  12991. let successTimes = DataMgr.getClassicTimes();
  12992. let needKey = "";
  12993. let lastKey = "";
  12994. let cfg = cfgTable.classictimesData;
  12995. let data;
  12996. for (const key in cfg) {
  12997. data = cfg[key];
  12998. if (successTimes <= data.times) {
  12999. needKey = key;
  13000. }
  13001. lastKey = key;
  13002. }
  13003. if (needKey == "")
  13004. needKey = lastKey;
  13005. return cfg[needKey];
  13006. }
  13007. }
  13008. Common._instance = null;
  13009. class ui_Component92 extends fgui.GComponent {
  13010. static createInstance() {
  13011. return (fgui.UIPackage.createObject("game", "Component92"));
  13012. }
  13013. onConstruct() {
  13014. this.n0 = (this.getChild("n0"));
  13015. }
  13016. }
  13017. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13018. class ui_Component129 extends fgui.GProgressBar {
  13019. static createInstance() {
  13020. return (fgui.UIPackage.createObject("game", "Component129"));
  13021. }
  13022. onConstruct() {
  13023. this.bar_v = (this.getChild("bar_v"));
  13024. this.n84 = (this.getChild("n84"));
  13025. }
  13026. }
  13027. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13028. class ui_Component130 extends fgui.GComponent {
  13029. static createInstance() {
  13030. return (fgui.UIPackage.createObject("game", "Component130"));
  13031. }
  13032. onConstruct() {
  13033. this.ani = (this.getChild("ani"));
  13034. this.t0 = this.getTransition("t0");
  13035. }
  13036. }
  13037. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13038. class ui_powerEft extends fgui.GComponent {
  13039. static createInstance() {
  13040. return (fgui.UIPackage.createObject("game", "powerEft"));
  13041. }
  13042. onConstruct() {
  13043. this.ani = (this.getChild("ani"));
  13044. this.n88 = (this.getChild("n88"));
  13045. this.n89 = (this.getChild("n89"));
  13046. }
  13047. }
  13048. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13049. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13050. static createInstance() {
  13051. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13052. }
  13053. onConstruct() {
  13054. this.c1 = this.getController("c1");
  13055. this.n2 = (this.getChild("n2"));
  13056. this.n22 = (this.getChild("n22"));
  13057. this.n23 = (this.getChild("n23"));
  13058. this.n15 = (this.getChild("n15"));
  13059. this.challenge = (this.getChild("challenge"));
  13060. this.n17 = (this.getChild("n17"));
  13061. this.n3 = (this.getChild("n3"));
  13062. this.starNode = (this.getChild("starNode"));
  13063. this.levelTxt = (this.getChild("levelTxt"));
  13064. this.n14 = (this.getChild("n14"));
  13065. this.n19 = (this.getChild("n19"));
  13066. this.n20 = (this.getChild("n20"));
  13067. this.n21 = (this.getChild("n21"));
  13068. this.special = (this.getChild("special"));
  13069. }
  13070. }
  13071. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13072. class ui_Component79 extends fgui.GComponent {
  13073. static createInstance() {
  13074. return (fgui.UIPackage.createObject("game", "Component79"));
  13075. }
  13076. onConstruct() {
  13077. this.c1 = this.getController("c1");
  13078. this.n7 = (this.getChild("n7"));
  13079. this.n8 = (this.getChild("n8"));
  13080. this.n9 = (this.getChild("n9"));
  13081. this.n10 = (this.getChild("n10"));
  13082. this.n11 = (this.getChild("n11"));
  13083. this.n12 = (this.getChild("n12"));
  13084. }
  13085. }
  13086. ui_Component79.URL = "ui://isxx5ak7avag477";
  13087. class ui_Component80 extends fgui.GComponent {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "Component80"));
  13090. }
  13091. onConstruct() {
  13092. this.n0 = (this.getChild("n0"));
  13093. this.n1 = (this.getChild("n1"));
  13094. this.myList = (this.getChild("myList"));
  13095. this.t0 = this.getTransition("t0");
  13096. }
  13097. }
  13098. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13099. class ui_SignNormal extends fgui.GComponent {
  13100. static createInstance() {
  13101. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13102. }
  13103. onConstruct() {
  13104. this.c1 = this.getController("c1");
  13105. this.n7 = (this.getChild("n7"));
  13106. this.n15 = (this.getChild("n15"));
  13107. this.titleTxt = (this.getChild("titleTxt"));
  13108. this.n8 = (this.getChild("n8"));
  13109. this.myIcon = (this.getChild("myIcon"));
  13110. this.numTxt = (this.getChild("numTxt"));
  13111. this.n12 = (this.getChild("n12"));
  13112. this.n13 = (this.getChild("n13"));
  13113. this.n17 = (this.getChild("n17"));
  13114. this.n14 = (this.getChild("n14"));
  13115. }
  13116. }
  13117. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13118. class ui_Button_reg extends fgui.GButton {
  13119. static createInstance() {
  13120. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13121. }
  13122. onConstruct() {
  13123. this.button = this.getController("button");
  13124. this.n6 = (this.getChild("n6"));
  13125. this.n4 = (this.getChild("n4"));
  13126. }
  13127. }
  13128. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13129. class ui_screenNode extends fgui.GComponent {
  13130. static createInstance() {
  13131. return (fgui.UIPackage.createObject("game", "screenNode"));
  13132. }
  13133. onConstruct() {
  13134. this.n9 = (this.getChild("n9"));
  13135. this.screenImg = (this.getChild("screenImg"));
  13136. }
  13137. }
  13138. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13139. class ui_GetAwrad_com1 extends fgui.GComponent {
  13140. static createInstance() {
  13141. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13142. }
  13143. onConstruct() {
  13144. this.n38 = (this.getChild("n38"));
  13145. this.n39 = (this.getChild("n39"));
  13146. this.n40 = (this.getChild("n40"));
  13147. this.t0 = this.getTransition("t0");
  13148. this.t1 = this.getTransition("t1");
  13149. }
  13150. }
  13151. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13152. class ui_GetAwrad_com2 extends fgui.GComponent {
  13153. static createInstance() {
  13154. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13155. }
  13156. onConstruct() {
  13157. this.n39 = (this.getChild("n39"));
  13158. this.n40 = (this.getChild("n40"));
  13159. this.t0 = this.getTransition("t0");
  13160. }
  13161. }
  13162. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13163. class ui_Component128 extends fgui.GComponent {
  13164. static createInstance() {
  13165. return (fgui.UIPackage.createObject("game", "Component128"));
  13166. }
  13167. onConstruct() {
  13168. this.n38 = (this.getChild("n38"));
  13169. this.n40 = (this.getChild("n40"));
  13170. }
  13171. }
  13172. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13173. class ui_Component100_1 extends fgui.GComponent {
  13174. static createInstance() {
  13175. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13176. }
  13177. onConstruct() {
  13178. this.myNode = (this.getChild("myNode"));
  13179. this.t0 = this.getTransition("t0");
  13180. }
  13181. }
  13182. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13183. class ui_Component142 extends fgui.GComponent {
  13184. static createInstance() {
  13185. return (fgui.UIPackage.createObject("game", "Component142"));
  13186. }
  13187. onConstruct() {
  13188. this.n41 = (this.getChild("n41"));
  13189. this.n42 = (this.getChild("n42"));
  13190. }
  13191. }
  13192. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13193. class ui_main_guang extends fgui.GComponent {
  13194. static createInstance() {
  13195. return (fgui.UIPackage.createObject("game", "main_guang"));
  13196. }
  13197. onConstruct() {
  13198. this.n1 = (this.getChild("n1"));
  13199. this.n2 = (this.getChild("n2"));
  13200. this.n3 = (this.getChild("n3"));
  13201. this.n4 = (this.getChild("n4"));
  13202. this.n5 = (this.getChild("n5"));
  13203. this.n6 = (this.getChild("n6"));
  13204. this.n8 = (this.getChild("n8"));
  13205. this.t0 = this.getTransition("t0");
  13206. }
  13207. }
  13208. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13209. class ui_try_com1 extends fgui.GComponent {
  13210. static createInstance() {
  13211. return (fgui.UIPackage.createObject("game", "try_com1"));
  13212. }
  13213. onConstruct() {
  13214. this.c1 = this.getController("c1");
  13215. this.n0 = (this.getChild("n0"));
  13216. this.n2 = (this.getChild("n2"));
  13217. this.cancelBtn = (this.getChild("cancelBtn"));
  13218. this.videoBtn = (this.getChild("videoBtn"));
  13219. this.n9 = (this.getChild("n9"));
  13220. this.n24 = (this.getChild("n24"));
  13221. this.titleTxt = (this.getChild("titleTxt"));
  13222. this.n32 = (this.getChild("n32"));
  13223. this.n29 = (this.getChild("n29"));
  13224. this.n36 = (this.getChild("n36"));
  13225. this.txtTime = (this.getChild("txtTime"));
  13226. this.t0 = this.getTransition("t0");
  13227. }
  13228. }
  13229. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13230. class ui_try_com2 extends fgui.GComponent {
  13231. static createInstance() {
  13232. return (fgui.UIPackage.createObject("game", "try_com2"));
  13233. }
  13234. onConstruct() {
  13235. this.skillicon = (this.getChild("skillicon"));
  13236. this.n35 = (this.getChild("n35"));
  13237. this.n31 = (this.getChild("n31"));
  13238. this.n32 = (this.getChild("n32"));
  13239. this.n33 = (this.getChild("n33"));
  13240. this.n34 = (this.getChild("n34"));
  13241. }
  13242. }
  13243. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13244. class ui_try_com3 extends fgui.GComponent {
  13245. static createInstance() {
  13246. return (fgui.UIPackage.createObject("game", "try_com3"));
  13247. }
  13248. onConstruct() {
  13249. this.n33 = (this.getChild("n33"));
  13250. this.n34 = (this.getChild("n34"));
  13251. this.n35 = (this.getChild("n35"));
  13252. this.t0 = this.getTransition("t0");
  13253. }
  13254. }
  13255. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13256. class ui_huihe1 extends fgui.GComponent {
  13257. static createInstance() {
  13258. return (fgui.UIPackage.createObject("game", "huihe1"));
  13259. }
  13260. onConstruct() {
  13261. this.n0 = (this.getChild("n0"));
  13262. this.n1 = (this.getChild("n1"));
  13263. this.t0 = this.getTransition("t0");
  13264. }
  13265. }
  13266. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13267. class ui_huihe2 extends fgui.GComponent {
  13268. static createInstance() {
  13269. return (fgui.UIPackage.createObject("game", "huihe2"));
  13270. }
  13271. onConstruct() {
  13272. this.n0 = (this.getChild("n0"));
  13273. this.n1 = (this.getChild("n1"));
  13274. this.t0 = this.getTransition("t0");
  13275. }
  13276. }
  13277. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13278. class ui_Component143 extends fgui.GComponent {
  13279. static createInstance() {
  13280. return (fgui.UIPackage.createObject("game", "Component143"));
  13281. }
  13282. onConstruct() {
  13283. this.n3 = (this.getChild("n3"));
  13284. this.n4 = (this.getChild("n4"));
  13285. this.n5 = (this.getChild("n5"));
  13286. this.n6 = (this.getChild("n6"));
  13287. this.n7 = (this.getChild("n7"));
  13288. this.n8 = (this.getChild("n8"));
  13289. this.n9 = (this.getChild("n9"));
  13290. this.n10 = (this.getChild("n10"));
  13291. this.t0 = this.getTransition("t0");
  13292. }
  13293. }
  13294. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13295. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13298. }
  13299. onConstruct() {
  13300. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13301. }
  13302. }
  13303. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13304. class ui_dh_jingbi2 extends fgui.GComponent {
  13305. static createInstance() {
  13306. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13307. }
  13308. onConstruct() {
  13309. this.n0 = (this.getChild("n0"));
  13310. this.n1 = (this.getChild("n1"));
  13311. this.n2 = (this.getChild("n2"));
  13312. this.n3 = (this.getChild("n3"));
  13313. this.n4 = (this.getChild("n4"));
  13314. this.n5 = (this.getChild("n5"));
  13315. this.n6 = (this.getChild("n6"));
  13316. this.n8 = (this.getChild("n8"));
  13317. this.n10 = (this.getChild("n10"));
  13318. this.t0 = this.getTransition("t0");
  13319. }
  13320. }
  13321. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13322. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13323. static createInstance() {
  13324. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13325. }
  13326. onConstruct() {
  13327. this.n1 = (this.getChild("n1"));
  13328. this.n4 = (this.getChild("n4"));
  13329. this.t0 = this.getTransition("t0");
  13330. }
  13331. }
  13332. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13333. class ui_dh_jingbi3 extends fgui.GComponent {
  13334. static createInstance() {
  13335. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13336. }
  13337. onConstruct() {
  13338. this.n0 = (this.getChild("n0"));
  13339. this.n1 = (this.getChild("n1"));
  13340. this.n2 = (this.getChild("n2"));
  13341. this.n3 = (this.getChild("n3"));
  13342. this.n4 = (this.getChild("n4"));
  13343. this.n5 = (this.getChild("n5"));
  13344. this.n6 = (this.getChild("n6"));
  13345. this.n8 = (this.getChild("n8"));
  13346. this.n10 = (this.getChild("n10"));
  13347. this.t0 = this.getTransition("t0");
  13348. }
  13349. }
  13350. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13351. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13352. static createInstance() {
  13353. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13354. }
  13355. onConstruct() {
  13356. this.n3 = (this.getChild("n3"));
  13357. this.n1 = (this.getChild("n1"));
  13358. this.t0 = this.getTransition("t0");
  13359. }
  13360. }
  13361. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13362. class ui_hb_jinbi1 extends fgui.GButton {
  13363. static createInstance() {
  13364. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13365. }
  13366. onConstruct() {
  13367. this.n20 = (this.getChild("n20"));
  13368. this.n25 = (this.getChild("n25"));
  13369. this.coinTxt = (this.getChild("coinTxt"));
  13370. this.n28 = (this.getChild("n28"));
  13371. this.n32 = (this.getChild("n32"));
  13372. this.n38 = (this.getChild("n38"));
  13373. this.n45 = (this.getChild("n45"));
  13374. this.getTips = (this.getChild("getTips"));
  13375. this.n39 = (this.getChild("n39"));
  13376. this.diamondTxt = (this.getChild("diamondTxt"));
  13377. this.n41 = (this.getChild("n41"));
  13378. this.n42 = (this.getChild("n42"));
  13379. this.n46 = (this.getChild("n46"));
  13380. this.n47 = (this.getChild("n47"));
  13381. this.n48 = (this.getChild("n48"));
  13382. this.t0 = this.getTransition("t0");
  13383. }
  13384. }
  13385. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13386. class ui_hb_jinbi2 extends fgui.GButton {
  13387. static createInstance() {
  13388. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13389. }
  13390. onConstruct() {
  13391. this.n20 = (this.getChild("n20"));
  13392. this.n25 = (this.getChild("n25"));
  13393. this.coinTxt = (this.getChild("coinTxt"));
  13394. this.n28 = (this.getChild("n28"));
  13395. this.n32 = (this.getChild("n32"));
  13396. this.n38 = (this.getChild("n38"));
  13397. this.n39 = (this.getChild("n39"));
  13398. this.diamondTxt = (this.getChild("diamondTxt"));
  13399. this.n41 = (this.getChild("n41"));
  13400. this.n42 = (this.getChild("n42"));
  13401. this.n43 = (this.getChild("n43"));
  13402. this.n44 = (this.getChild("n44"));
  13403. this.n45 = (this.getChild("n45"));
  13404. this.t0 = this.getTransition("t0");
  13405. }
  13406. }
  13407. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13408. class ui_hb_jinbi3 extends fgui.GButton {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13411. }
  13412. onConstruct() {
  13413. this.n20 = (this.getChild("n20"));
  13414. this.n25 = (this.getChild("n25"));
  13415. this.coinTxt = (this.getChild("coinTxt"));
  13416. this.n28 = (this.getChild("n28"));
  13417. this.n32 = (this.getChild("n32"));
  13418. this.n38 = (this.getChild("n38"));
  13419. this.n39 = (this.getChild("n39"));
  13420. this.diamondTxt = (this.getChild("diamondTxt"));
  13421. this.n41 = (this.getChild("n41"));
  13422. this.n42 = (this.getChild("n42"));
  13423. this.n43 = (this.getChild("n43"));
  13424. this.n44 = (this.getChild("n44"));
  13425. this.n45 = (this.getChild("n45"));
  13426. this.t0 = this.getTransition("t0");
  13427. }
  13428. }
  13429. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13430. class ui_Component104 extends fgui.GComponent {
  13431. static createInstance() {
  13432. return (fgui.UIPackage.createObject("game", "Component104"));
  13433. }
  13434. onConstruct() {
  13435. this.c1 = this.getController("c1");
  13436. this.n12 = (this.getChild("n12"));
  13437. this.coinBtn = (this.getChild("coinBtn"));
  13438. this.diamondBtn = (this.getChild("diamondBtn"));
  13439. this.node3 = (this.getChild("node3"));
  13440. this.node4 = (this.getChild("node4"));
  13441. this.node5 = (this.getChild("node5"));
  13442. this.node1 = (this.getChild("node1"));
  13443. this.node2 = (this.getChild("node2"));
  13444. this.node6 = (this.getChild("node6"));
  13445. this.t0 = this.getTransition("t0");
  13446. }
  13447. }
  13448. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13449. class ui_Component105 extends fgui.GButton {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "Component105"));
  13452. }
  13453. onConstruct() {
  13454. this.c1 = this.getController("c1");
  13455. this.n49 = (this.getChild("n49"));
  13456. this.n18 = (this.getChild("n18"));
  13457. this.n46 = (this.getChild("n46"));
  13458. this.n48 = (this.getChild("n48"));
  13459. }
  13460. }
  13461. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13462. class ui_Component106 extends fgui.GButton {
  13463. static createInstance() {
  13464. return (fgui.UIPackage.createObject("game", "Component106"));
  13465. }
  13466. onConstruct() {
  13467. this.c1 = this.getController("c1");
  13468. this.n49 = (this.getChild("n49"));
  13469. this.n18 = (this.getChild("n18"));
  13470. this.n46 = (this.getChild("n46"));
  13471. this.n48 = (this.getChild("n48"));
  13472. }
  13473. }
  13474. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13475. class ui_hb_zs1 extends fgui.GButton {
  13476. static createInstance() {
  13477. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13478. }
  13479. onConstruct() {
  13480. this.c1 = this.getController("c1");
  13481. this.n20 = (this.getChild("n20"));
  13482. this.n21 = (this.getChild("n21"));
  13483. this.n26 = (this.getChild("n26"));
  13484. this.n27 = (this.getChild("n27"));
  13485. this.shareTxt = (this.getChild("shareTxt"));
  13486. this.n32 = (this.getChild("n32"));
  13487. this.n38 = (this.getChild("n38"));
  13488. this.n39 = (this.getChild("n39"));
  13489. this.n44 = (this.getChild("n44"));
  13490. this.diamondTxt = (this.getChild("diamondTxt"));
  13491. this.n41 = (this.getChild("n41"));
  13492. this.n45 = (this.getChild("n45"));
  13493. this.n47 = (this.getChild("n47"));
  13494. this.n48 = (this.getChild("n48"));
  13495. this.randTxt = (this.getChild("randTxt"));
  13496. this.n50 = (this.getChild("n50"));
  13497. this.t0 = this.getTransition("t0");
  13498. }
  13499. }
  13500. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13501. class ui_dh_zs1 extends fgui.GComponent {
  13502. static createInstance() {
  13503. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13504. }
  13505. onConstruct() {
  13506. this.n10 = (this.getChild("n10"));
  13507. this.n9 = (this.getChild("n9"));
  13508. this.n1 = (this.getChild("n1"));
  13509. this.n2 = (this.getChild("n2"));
  13510. this.n3 = (this.getChild("n3"));
  13511. this.n4 = (this.getChild("n4"));
  13512. this.n5 = (this.getChild("n5"));
  13513. this.n6 = (this.getChild("n6"));
  13514. this.n8 = (this.getChild("n8"));
  13515. this.n11 = (this.getChild("n11"));
  13516. this.t0 = this.getTransition("t0");
  13517. }
  13518. }
  13519. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13520. class ui_dh_zs1_1 extends fgui.GComponent {
  13521. static createInstance() {
  13522. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13523. }
  13524. onConstruct() {
  13525. this.n3 = (this.getChild("n3"));
  13526. this.n1 = (this.getChild("n1"));
  13527. this.t0 = this.getTransition("t0");
  13528. }
  13529. }
  13530. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13531. class ui_hb_zs2 extends fgui.GButton {
  13532. static createInstance() {
  13533. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13534. }
  13535. onConstruct() {
  13536. this.n20 = (this.getChild("n20"));
  13537. this.n21 = (this.getChild("n21"));
  13538. this.n26 = (this.getChild("n26"));
  13539. this.n27 = (this.getChild("n27"));
  13540. this.n32 = (this.getChild("n32"));
  13541. this.n38 = (this.getChild("n38"));
  13542. this.n39 = (this.getChild("n39"));
  13543. this.n44 = (this.getChild("n44"));
  13544. this.diamondTxt = (this.getChild("diamondTxt"));
  13545. this.n41 = (this.getChild("n41"));
  13546. this.n45 = (this.getChild("n45"));
  13547. this.t0 = this.getTransition("t0");
  13548. }
  13549. }
  13550. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13551. class ui_hb_zs3 extends fgui.GButton {
  13552. static createInstance() {
  13553. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13554. }
  13555. onConstruct() {
  13556. this.n20 = (this.getChild("n20"));
  13557. this.n21 = (this.getChild("n21"));
  13558. this.n26 = (this.getChild("n26"));
  13559. this.n27 = (this.getChild("n27"));
  13560. this.n32 = (this.getChild("n32"));
  13561. this.n38 = (this.getChild("n38"));
  13562. this.n47 = (this.getChild("n47"));
  13563. this.t0 = this.getTransition("t0");
  13564. }
  13565. }
  13566. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13567. class ui_dh_zs2 extends fgui.GComponent {
  13568. static createInstance() {
  13569. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13570. }
  13571. onConstruct() {
  13572. this.n10 = (this.getChild("n10"));
  13573. this.n9 = (this.getChild("n9"));
  13574. this.n1 = (this.getChild("n1"));
  13575. this.n2 = (this.getChild("n2"));
  13576. this.n3 = (this.getChild("n3"));
  13577. this.n4 = (this.getChild("n4"));
  13578. this.n5 = (this.getChild("n5"));
  13579. this.n6 = (this.getChild("n6"));
  13580. this.n8 = (this.getChild("n8"));
  13581. this.n11 = (this.getChild("n11"));
  13582. this.t0 = this.getTransition("t0");
  13583. }
  13584. }
  13585. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13586. class ui_dh_zs2_1 extends fgui.GComponent {
  13587. static createInstance() {
  13588. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13589. }
  13590. onConstruct() {
  13591. this.n3 = (this.getChild("n3"));
  13592. this.n1 = (this.getChild("n1"));
  13593. this.t0 = this.getTransition("t0");
  13594. }
  13595. }
  13596. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13597. class ui_dh_zs3 extends fgui.GComponent {
  13598. static createInstance() {
  13599. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13600. }
  13601. onConstruct() {
  13602. this.n10 = (this.getChild("n10"));
  13603. this.n9 = (this.getChild("n9"));
  13604. this.n1 = (this.getChild("n1"));
  13605. this.n2 = (this.getChild("n2"));
  13606. this.n3 = (this.getChild("n3"));
  13607. this.n4 = (this.getChild("n4"));
  13608. this.n5 = (this.getChild("n5"));
  13609. this.n6 = (this.getChild("n6"));
  13610. this.n8 = (this.getChild("n8"));
  13611. this.n11 = (this.getChild("n11"));
  13612. this.t0 = this.getTransition("t0");
  13613. }
  13614. }
  13615. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13616. class ui_dh_zs3_1 extends fgui.GComponent {
  13617. static createInstance() {
  13618. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13619. }
  13620. onConstruct() {
  13621. this.n3 = (this.getChild("n3"));
  13622. this.n1 = (this.getChild("n1"));
  13623. this.t0 = this.getTransition("t0");
  13624. }
  13625. }
  13626. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13627. class ui_Component107 extends fgui.GComponent {
  13628. static createInstance() {
  13629. return (fgui.UIPackage.createObject("game", "Component107"));
  13630. }
  13631. onConstruct() {
  13632. this.n18 = (this.getChild("n18"));
  13633. this.n19 = (this.getChild("n19"));
  13634. this.n20 = (this.getChild("n20"));
  13635. this.n21 = (this.getChild("n21"));
  13636. this.n22 = (this.getChild("n22"));
  13637. this.levelTxt = (this.getChild("levelTxt"));
  13638. this.t0 = this.getTransition("t0");
  13639. }
  13640. }
  13641. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13642. class ui_box_com1 extends fgui.GComponent {
  13643. static createInstance() {
  13644. return (fgui.UIPackage.createObject("game", "box_com1"));
  13645. }
  13646. onConstruct() {
  13647. this.n14 = (this.getChild("n14"));
  13648. this.n6 = (this.getChild("n6"));
  13649. this.t0 = this.getTransition("t0");
  13650. }
  13651. }
  13652. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13653. class ui_box_com2 extends fgui.GProgressBar {
  13654. static createInstance() {
  13655. return (fgui.UIPackage.createObject("game", "box_com2"));
  13656. }
  13657. onConstruct() {
  13658. this.bg0 = (this.getChild("bg0"));
  13659. this.bg = (this.getChild("bg"));
  13660. this.bar = (this.getChild("bar"));
  13661. this.n7 = (this.getChild("n7"));
  13662. this.n8 = (this.getChild("n8"));
  13663. this.n10 = (this.getChild("n10"));
  13664. this.n11 = (this.getChild("n11"));
  13665. this.n12 = (this.getChild("n12"));
  13666. }
  13667. }
  13668. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13669. class ui_box_com4 extends fgui.GComponent {
  13670. static createInstance() {
  13671. return (fgui.UIPackage.createObject("game", "box_com4"));
  13672. }
  13673. onConstruct() {
  13674. this.n8 = (this.getChild("n8"));
  13675. this.t0 = this.getTransition("t0");
  13676. }
  13677. }
  13678. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13679. class ui_box_com3 extends fgui.GComponent {
  13680. static createInstance() {
  13681. return (fgui.UIPackage.createObject("game", "box_com3"));
  13682. }
  13683. onConstruct() {
  13684. this.n2 = (this.getChild("n2"));
  13685. this.n3 = (this.getChild("n3"));
  13686. this.n4 = (this.getChild("n4"));
  13687. this.n5 = (this.getChild("n5"));
  13688. this.t0 = this.getTransition("t0");
  13689. this.t1 = this.getTransition("t1");
  13690. }
  13691. }
  13692. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13693. class ui_Component97 extends fgui.GComponent {
  13694. static createInstance() {
  13695. return (fgui.UIPackage.createObject("game", "Component97"));
  13696. }
  13697. onConstruct() {
  13698. this.c1 = this.getController("c1");
  13699. this.n46 = (this.getChild("n46"));
  13700. this.diamondNode = (this.getChild("diamondNode"));
  13701. this.coinNode = (this.getChild("coinNode"));
  13702. this.t0 = this.getTransition("t0");
  13703. }
  13704. }
  13705. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13706. class ui_Component98 extends fgui.GButton {
  13707. static createInstance() {
  13708. return (fgui.UIPackage.createObject("game", "Component98"));
  13709. }
  13710. onConstruct() {
  13711. this.n8 = (this.getChild("n8"));
  13712. this.n40 = (this.getChild("n40"));
  13713. }
  13714. }
  13715. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13716. class ui_Component28_11 extends fgui.GButton {
  13717. static createInstance() {
  13718. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13719. }
  13720. onConstruct() {
  13721. this.c1 = this.getController("c1");
  13722. this.n12 = (this.getChild("n12"));
  13723. this.n17 = (this.getChild("n17"));
  13724. this.n13 = (this.getChild("n13"));
  13725. this.diamondTxt = (this.getChild("diamondTxt"));
  13726. this.n15 = (this.getChild("n15"));
  13727. this.n16 = (this.getChild("n16"));
  13728. }
  13729. }
  13730. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13731. class ui_Component58_11 extends fgui.GComponent {
  13732. static createInstance() {
  13733. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13734. }
  13735. onConstruct() {
  13736. this.c1 = this.getController("c1");
  13737. this.n23 = (this.getChild("n23"));
  13738. this.n41 = (this.getChild("n41"));
  13739. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13740. this.n_daoju = (this.getChild("n_daoju"));
  13741. this.myList = (this.getChild("myList"));
  13742. this.djList = (this.getChild("djList"));
  13743. this.t0 = this.getTransition("t0");
  13744. }
  13745. }
  13746. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13747. class ui_Component100 extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Component100"));
  13750. }
  13751. onConstruct() {
  13752. this.c1 = this.getController("c1");
  13753. this.n75 = (this.getChild("n75"));
  13754. this.n76 = (this.getChild("n76"));
  13755. this.n80 = (this.getChild("n80"));
  13756. this.txt = (this.getChild("txt"));
  13757. this.spineRoot = (this.getChild("spineRoot"));
  13758. }
  13759. }
  13760. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13761. class ui_Component101 extends fgui.GComponent {
  13762. static createInstance() {
  13763. return (fgui.UIPackage.createObject("game", "Component101"));
  13764. }
  13765. onConstruct() {
  13766. this.c1 = this.getController("c1");
  13767. this.n36 = (this.getChild("n36"));
  13768. this.n35 = (this.getChild("n35"));
  13769. this.n33 = (this.getChild("n33"));
  13770. this.n34 = (this.getChild("n34"));
  13771. }
  13772. }
  13773. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13774. class ui_Component53 extends fgui.GComponent {
  13775. static createInstance() {
  13776. return (fgui.UIPackage.createObject("game", "Component53"));
  13777. }
  13778. onConstruct() {
  13779. this.n0 = (this.getChild("n0"));
  13780. this.n1 = (this.getChild("n1"));
  13781. this.n2 = (this.getChild("n2"));
  13782. this.n3 = (this.getChild("n3"));
  13783. this.n4 = (this.getChild("n4"));
  13784. this.n5 = (this.getChild("n5"));
  13785. this.n6 = (this.getChild("n6"));
  13786. this.n7 = (this.getChild("n7"));
  13787. this.n8 = (this.getChild("n8"));
  13788. this.n9 = (this.getChild("n9"));
  13789. this.n10 = (this.getChild("n10"));
  13790. this.n11 = (this.getChild("n11"));
  13791. this.n12 = (this.getChild("n12"));
  13792. this.n13 = (this.getChild("n13"));
  13793. this.n14 = (this.getChild("n14"));
  13794. this.n15 = (this.getChild("n15"));
  13795. this.n16 = (this.getChild("n16"));
  13796. this.n19 = (this.getChild("n19"));
  13797. this.n20 = (this.getChild("n20"));
  13798. this.n21 = (this.getChild("n21"));
  13799. this.n22 = (this.getChild("n22"));
  13800. this.n23 = (this.getChild("n23"));
  13801. this.n24 = (this.getChild("n24"));
  13802. this.n25 = (this.getChild("n25"));
  13803. this.n26 = (this.getChild("n26"));
  13804. this.n27 = (this.getChild("n27"));
  13805. this.n28 = (this.getChild("n28"));
  13806. this.n29 = (this.getChild("n29"));
  13807. this.n30 = (this.getChild("n30"));
  13808. this.n31 = (this.getChild("n31"));
  13809. this.n32 = (this.getChild("n32"));
  13810. this.n33 = (this.getChild("n33"));
  13811. this.n34 = (this.getChild("n34"));
  13812. this.n35 = (this.getChild("n35"));
  13813. this.t0 = this.getTransition("t0");
  13814. }
  13815. }
  13816. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13817. class ui_Component58 extends fgui.GComponent {
  13818. static createInstance() {
  13819. return (fgui.UIPackage.createObject("game", "Component58"));
  13820. }
  13821. onConstruct() {
  13822. this.n23 = (this.getChild("n23"));
  13823. this.n41 = (this.getChild("n41"));
  13824. this.n8 = (this.getChild("n8"));
  13825. this.skillList = (this.getChild("skillList"));
  13826. this.t0 = this.getTransition("t0");
  13827. }
  13828. }
  13829. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13830. class ui_Component59 extends fgui.GComponent {
  13831. static createInstance() {
  13832. return (fgui.UIPackage.createObject("game", "Component59"));
  13833. }
  13834. onConstruct() {
  13835. this.n3 = (this.getChild("n3"));
  13836. this.msgTxt = (this.getChild("msgTxt"));
  13837. this.t0 = this.getTransition("t0");
  13838. }
  13839. }
  13840. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13841. class ui_RulerNode extends fgui.GComponent {
  13842. static createInstance() {
  13843. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13844. }
  13845. onConstruct() {
  13846. this.n6 = (this.getChild("n6"));
  13847. this.n4 = (this.getChild("n4"));
  13848. this.img1 = (this.getChild("img1"));
  13849. this.img2 = (this.getChild("img2"));
  13850. }
  13851. }
  13852. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13853. class ui_Component108 extends fgui.GComponent {
  13854. static createInstance() {
  13855. return (fgui.UIPackage.createObject("game", "Component108"));
  13856. }
  13857. onConstruct() {
  13858. this.n19 = (this.getChild("n19"));
  13859. this.t0 = this.getTransition("t0");
  13860. }
  13861. }
  13862. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13863. class ui_Component63 extends fgui.GComponent {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "Component63"));
  13866. }
  13867. onConstruct() {
  13868. this.n66 = (this.getChild("n66"));
  13869. this.n56 = (this.getChild("n56"));
  13870. this.n63 = (this.getChild("n63"));
  13871. this.n65 = (this.getChild("n65"));
  13872. this.t0 = this.getTransition("t0");
  13873. }
  13874. }
  13875. ui_Component63.URL = "ui://isxx5ak7h657452";
  13876. class ui_topNode extends fgui.GComponent {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "topNode"));
  13879. }
  13880. onConstruct() {
  13881. this.selfProgress = (this.getChild("selfProgress"));
  13882. this.aiProgress = (this.getChild("aiProgress"));
  13883. this.selfKuang = (this.getChild("selfKuang"));
  13884. this.aiKuang = (this.getChild("aiKuang"));
  13885. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13886. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13887. this.n33 = (this.getChild("n33"));
  13888. this.n34 = (this.getChild("n34"));
  13889. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13890. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13891. this.selfBallList = (this.getChild("selfBallList"));
  13892. this.aiBallList = (this.getChild("aiBallList"));
  13893. this.middleNode = (this.getChild("middleNode"));
  13894. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13895. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13896. this.scoreNode = (this.getChild("scoreNode"));
  13897. this.selfTips = (this.getChild("selfTips"));
  13898. this.aiTips = (this.getChild("aiTips"));
  13899. }
  13900. }
  13901. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13902. class ui_selfProgress extends fgui.GProgressBar {
  13903. static createInstance() {
  13904. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13905. }
  13906. onConstruct() {
  13907. this.n3 = (this.getChild("n3"));
  13908. this.bar = (this.getChild("bar"));
  13909. }
  13910. }
  13911. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13912. class ui_aiProgress extends fgui.GProgressBar {
  13913. static createInstance() {
  13914. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13915. }
  13916. onConstruct() {
  13917. this.n3 = (this.getChild("n3"));
  13918. this.bar = (this.getChild("bar"));
  13919. }
  13920. }
  13921. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13922. class ui_ballDisplay extends fgui.GComponent {
  13923. static createInstance() {
  13924. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13925. }
  13926. onConstruct() {
  13927. this.myImg = (this.getChild("myImg"));
  13928. }
  13929. }
  13930. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13931. class ui_moveNode extends fgui.GComponent {
  13932. static createInstance() {
  13933. return (fgui.UIPackage.createObject("game", "moveNode"));
  13934. }
  13935. onConstruct() {
  13936. this.n8 = (this.getChild("n8"));
  13937. this.finger = (this.getChild("finger"));
  13938. }
  13939. }
  13940. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13941. class ui_cancelBtn extends fgui.GButton {
  13942. static createInstance() {
  13943. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13944. }
  13945. onConstruct() {
  13946. this.c1 = this.getController("c1");
  13947. this.n0 = (this.getChild("n0"));
  13948. this.n1 = (this.getChild("n1"));
  13949. }
  13950. }
  13951. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13952. class ui_shareBtn extends fgui.GButton {
  13953. static createInstance() {
  13954. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13955. }
  13956. onConstruct() {
  13957. this.c1 = this.getController("c1");
  13958. this.n2 = (this.getChild("n2"));
  13959. this.n1 = (this.getChild("n1"));
  13960. this.n3 = (this.getChild("n3"));
  13961. this.n4 = (this.getChild("n4"));
  13962. this.n5 = (this.getChild("n5"));
  13963. this.n6 = (this.getChild("n6"));
  13964. }
  13965. }
  13966. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13967. class ui_share2Btn extends fgui.GButton {
  13968. static createInstance() {
  13969. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13970. }
  13971. onConstruct() {
  13972. this.n3 = (this.getChild("n3"));
  13973. }
  13974. }
  13975. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13976. class ui_rodMethodNode extends fgui.GComponent {
  13977. static createInstance() {
  13978. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13979. }
  13980. onConstruct() {
  13981. this.bg = (this.getChild("bg"));
  13982. this.dot = (this.getChild("dot"));
  13983. }
  13984. }
  13985. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13986. class ui_sureBtn extends fgui.GButton {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13989. }
  13990. onConstruct() {
  13991. this.n2 = (this.getChild("n2"));
  13992. this.n1 = (this.getChild("n1"));
  13993. }
  13994. }
  13995. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13996. class ui_Component18 extends fgui.GComponent {
  13997. static createInstance() {
  13998. return (fgui.UIPackage.createObject("game", "Component18"));
  13999. }
  14000. onConstruct() {
  14001. this.c1 = this.getController("c1");
  14002. this.nameTxt = (this.getChild("nameTxt"));
  14003. this.headImg = (this.getChild("headImg"));
  14004. this.n24 = (this.getChild("n24"));
  14005. this.skillImg = (this.getChild("skillImg"));
  14006. this.skillTxt = (this.getChild("skillTxt"));
  14007. }
  14008. }
  14009. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14010. class ui_Component45 extends fgui.GComponent {
  14011. static createInstance() {
  14012. return (fgui.UIPackage.createObject("game", "Component45"));
  14013. }
  14014. onConstruct() {
  14015. this.c1 = this.getController("c1");
  14016. this.n40 = (this.getChild("n40"));
  14017. this.n41 = (this.getChild("n41"));
  14018. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14019. this.n42 = (this.getChild("n42"));
  14020. this.awardTxt = (this.getChild("awardTxt"));
  14021. this.n44 = (this.getChild("n44"));
  14022. this.t0 = this.getTransition("t0");
  14023. }
  14024. }
  14025. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14026. class ui_emotionDisplay extends fgui.GButton {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14029. }
  14030. onConstruct() {
  14031. this.myIcon = (this.getChild("myIcon"));
  14032. }
  14033. }
  14034. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14035. class ui_Component49 extends fgui.GButton {
  14036. static createInstance() {
  14037. return (fgui.UIPackage.createObject("game", "Component49"));
  14038. }
  14039. onConstruct() {
  14040. this.n69 = (this.getChild("n69"));
  14041. this.n56 = (this.getChild("n56"));
  14042. }
  14043. }
  14044. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14045. class ui_Component50 extends fgui.GButton {
  14046. static createInstance() {
  14047. return (fgui.UIPackage.createObject("game", "Component50"));
  14048. }
  14049. onConstruct() {
  14050. this.n54 = (this.getChild("n54"));
  14051. this.n65 = (this.getChild("n65"));
  14052. }
  14053. }
  14054. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14055. class ui_Component51 extends fgui.GButton {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "Component51"));
  14058. }
  14059. onConstruct() {
  14060. this.c1 = this.getController("c1");
  14061. this.n51 = (this.getChild("n51"));
  14062. this.n54 = (this.getChild("n54"));
  14063. }
  14064. }
  14065. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14066. class ui_Button5 extends fgui.GButton {
  14067. static createInstance() {
  14068. return (fgui.UIPackage.createObject("game", "Button5"));
  14069. }
  14070. onConstruct() {
  14071. this.c1 = this.getController("c1");
  14072. this.n0 = (this.getChild("n0"));
  14073. this.n2 = (this.getChild("n2"));
  14074. }
  14075. }
  14076. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14077. class ui_Component124 extends fgui.GComponent {
  14078. static createInstance() {
  14079. return (fgui.UIPackage.createObject("game", "Component124"));
  14080. }
  14081. onConstruct() {
  14082. this.n22 = (this.getChild("n22"));
  14083. this.shareNode = (this.getChild("shareNode"));
  14084. }
  14085. }
  14086. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14087. class ui_Component125 extends fgui.GComponent {
  14088. static createInstance() {
  14089. return (fgui.UIPackage.createObject("game", "Component125"));
  14090. }
  14091. onConstruct() {
  14092. this.n29 = (this.getChild("n29"));
  14093. this.coinTxt = (this.getChild("coinTxt"));
  14094. }
  14095. }
  14096. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14097. class ui_Component52 extends fgui.GButton {
  14098. static createInstance() {
  14099. return (fgui.UIPackage.createObject("game", "Component52"));
  14100. }
  14101. onConstruct() {
  14102. this.n35 = (this.getChild("n35"));
  14103. this.n36 = (this.getChild("n36"));
  14104. }
  14105. }
  14106. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14107. class ui_Component_fl_1 extends fgui.GComponent {
  14108. static createInstance() {
  14109. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14110. }
  14111. onConstruct() {
  14112. this.n0 = (this.getChild("n0"));
  14113. this.n6 = (this.getChild("n6"));
  14114. this.n7 = (this.getChild("n7"));
  14115. this.n8 = (this.getChild("n8"));
  14116. this.n5 = (this.getChild("n5"));
  14117. this.n9 = (this.getChild("n9"));
  14118. this.n10 = (this.getChild("n10"));
  14119. this.txt_price = (this.getChild("txt_price"));
  14120. this.n_no = (this.getChild("n_no"));
  14121. this.n_buy = (this.getChild("n_buy"));
  14122. }
  14123. }
  14124. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14125. class ui_Component_fl_2 extends fgui.GComponent {
  14126. static createInstance() {
  14127. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14128. }
  14129. onConstruct() {
  14130. this.n0 = (this.getChild("n0"));
  14131. this.txt_price = (this.getChild("txt_price"));
  14132. this.n4 = (this.getChild("n4"));
  14133. this.n6 = (this.getChild("n6"));
  14134. this.n7 = (this.getChild("n7"));
  14135. this.n5 = (this.getChild("n5"));
  14136. this.n8 = (this.getChild("n8"));
  14137. this.n9 = (this.getChild("n9"));
  14138. this.n_no = (this.getChild("n_no"));
  14139. this.n_buy = (this.getChild("n_buy"));
  14140. }
  14141. }
  14142. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14143. class ui_drawBtn extends fgui.GButton {
  14144. static createInstance() {
  14145. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14146. }
  14147. onConstruct() {
  14148. this.c1 = this.getController("c1");
  14149. this.n2 = (this.getChild("n2"));
  14150. this.n1 = (this.getChild("n1"));
  14151. this.n5 = (this.getChild("n5"));
  14152. }
  14153. }
  14154. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14155. class ui_Component43 extends fgui.GButton {
  14156. static createInstance() {
  14157. return (fgui.UIPackage.createObject("game", "Component43"));
  14158. }
  14159. onConstruct() {
  14160. this.n49 = (this.getChild("n49"));
  14161. }
  14162. }
  14163. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14164. class ui_wordsDisplay extends fgui.GComponent {
  14165. static createInstance() {
  14166. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14167. }
  14168. onConstruct() {
  14169. this.txt = (this.getChild("txt"));
  14170. this.n63 = (this.getChild("n63"));
  14171. }
  14172. }
  14173. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14174. class ui_Component_phb extends fgui.GComponent {
  14175. static createInstance() {
  14176. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14177. }
  14178. onConstruct() {
  14179. this.n3 = (this.getChild("n3"));
  14180. this.n4 = (this.getChild("n4"));
  14181. }
  14182. }
  14183. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14184. class ui_Component3 extends fgui.GComponent {
  14185. static createInstance() {
  14186. return (fgui.UIPackage.createObject("game", "Component3"));
  14187. }
  14188. onConstruct() {
  14189. this.n26 = (this.getChild("n26"));
  14190. this.n24 = (this.getChild("n24"));
  14191. this.nameTxt = (this.getChild("nameTxt"));
  14192. this.headRoot = (this.getChild("headRoot"));
  14193. }
  14194. }
  14195. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14196. class ui_Component4 extends fgui.GComponent {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "Component4"));
  14199. }
  14200. onConstruct() {
  14201. this.headImg = (this.getChild("headImg"));
  14202. }
  14203. }
  14204. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14205. class ui_Component7 extends fgui.GButton {
  14206. static createInstance() {
  14207. return (fgui.UIPackage.createObject("game", "Component7"));
  14208. }
  14209. onConstruct() {
  14210. this.n17 = (this.getChild("n17"));
  14211. }
  14212. }
  14213. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14214. class ui_Component8 extends fgui.GButton {
  14215. static createInstance() {
  14216. return (fgui.UIPackage.createObject("game", "Component8"));
  14217. }
  14218. onConstruct() {
  14219. this.n19 = (this.getChild("n19"));
  14220. }
  14221. }
  14222. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14223. class ui_Component10 extends fgui.GButton {
  14224. static createInstance() {
  14225. return (fgui.UIPackage.createObject("game", "Component10"));
  14226. }
  14227. onConstruct() {
  14228. this.c1 = this.getController("c1");
  14229. this.n40 = (this.getChild("n40"));
  14230. }
  14231. }
  14232. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14233. class ui_Component11 extends fgui.GButton {
  14234. static createInstance() {
  14235. return (fgui.UIPackage.createObject("game", "Component11"));
  14236. }
  14237. onConstruct() {
  14238. this.n34 = (this.getChild("n34"));
  14239. }
  14240. }
  14241. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14242. class ui_Component12 extends fgui.GButton {
  14243. static createInstance() {
  14244. return (fgui.UIPackage.createObject("game", "Component12"));
  14245. }
  14246. onConstruct() {
  14247. this.n35 = (this.getChild("n35"));
  14248. }
  14249. }
  14250. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14251. class ui_Component13 extends fgui.GButton {
  14252. static createInstance() {
  14253. return (fgui.UIPackage.createObject("game", "Component13"));
  14254. }
  14255. onConstruct() {
  14256. this.n27 = (this.getChild("n27"));
  14257. this.n36 = (this.getChild("n36"));
  14258. }
  14259. }
  14260. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14261. class ui_dh_js_tuowei extends fgui.GComponent {
  14262. static createInstance() {
  14263. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14264. }
  14265. onConstruct() {
  14266. this.n19 = (this.getChild("n19"));
  14267. this.n18 = (this.getChild("n18"));
  14268. this.n0 = (this.getChild("n0"));
  14269. this.n3 = (this.getChild("n3"));
  14270. this.n4 = (this.getChild("n4"));
  14271. this.n5 = (this.getChild("n5"));
  14272. this.n6 = (this.getChild("n6"));
  14273. this.n8 = (this.getChild("n8"));
  14274. this.n9 = (this.getChild("n9"));
  14275. this.n10 = (this.getChild("n10"));
  14276. this.n11 = (this.getChild("n11"));
  14277. this.n12 = (this.getChild("n12"));
  14278. this.n13 = (this.getChild("n13"));
  14279. this.n14 = (this.getChild("n14"));
  14280. this.n15 = (this.getChild("n15"));
  14281. this.n20 = (this.getChild("n20"));
  14282. this.t0 = this.getTransition("t0");
  14283. this.t1 = this.getTransition("t1");
  14284. }
  14285. }
  14286. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14287. class ui_dh_js_tw_g extends fgui.GComponent {
  14288. static createInstance() {
  14289. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14290. }
  14291. onConstruct() {
  14292. this.n0 = (this.getChild("n0"));
  14293. this.n1 = (this.getChild("n1"));
  14294. this.t0 = this.getTransition("t0");
  14295. }
  14296. }
  14297. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14298. class ui_dh_js_xingxing extends fgui.GComponent {
  14299. static createInstance() {
  14300. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14301. }
  14302. onConstruct() {
  14303. this.n1 = (this.getChild("n1"));
  14304. this.n2 = (this.getChild("n2"));
  14305. this.n3 = (this.getChild("n3"));
  14306. this.n4 = (this.getChild("n4"));
  14307. this.n0 = (this.getChild("n0"));
  14308. this.t2 = this.getTransition("t2");
  14309. this.t1 = this.getTransition("t1");
  14310. }
  14311. }
  14312. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14313. class ui_dh_zy_jiazai extends fgui.GComponent {
  14314. static createInstance() {
  14315. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14316. }
  14317. onConstruct() {
  14318. this.c1 = this.getController("c1");
  14319. this.n0 = (this.getChild("n0"));
  14320. this.n1 = (this.getChild("n1"));
  14321. this.n2 = (this.getChild("n2"));
  14322. this.n4 = (this.getChild("n4"));
  14323. this.n5 = (this.getChild("n5"));
  14324. this.n6 = (this.getChild("n6"));
  14325. this.n8 = (this.getChild("n8"));
  14326. this.n7 = (this.getChild("n7"));
  14327. this.t0 = this.getTransition("t0");
  14328. }
  14329. }
  14330. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14331. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14332. static createInstance() {
  14333. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14334. }
  14335. onConstruct() {
  14336. this.c1 = this.getController("c1");
  14337. this.n3 = (this.getChild("n3"));
  14338. this.n5 = (this.getChild("n5"));
  14339. this.n4 = (this.getChild("n4"));
  14340. this.n0 = (this.getChild("n0"));
  14341. this.n1 = (this.getChild("n1"));
  14342. this.n2 = (this.getChild("n2"));
  14343. }
  14344. }
  14345. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14346. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14347. static createInstance() {
  14348. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14349. }
  14350. onConstruct() {
  14351. this.n19 = (this.getChild("n19"));
  14352. this.n21 = (this.getChild("n21"));
  14353. this.n0 = (this.getChild("n0"));
  14354. this.n3 = (this.getChild("n3"));
  14355. this.n4 = (this.getChild("n4"));
  14356. this.n5 = (this.getChild("n5"));
  14357. this.n6 = (this.getChild("n6"));
  14358. this.n8 = (this.getChild("n8"));
  14359. this.n9 = (this.getChild("n9"));
  14360. this.n10 = (this.getChild("n10"));
  14361. this.n11 = (this.getChild("n11"));
  14362. this.n12 = (this.getChild("n12"));
  14363. this.n13 = (this.getChild("n13"));
  14364. this.n14 = (this.getChild("n14"));
  14365. this.n15 = (this.getChild("n15"));
  14366. this.n23 = (this.getChild("n23"));
  14367. this.t0 = this.getTransition("t0");
  14368. this.t1 = this.getTransition("t1");
  14369. }
  14370. }
  14371. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14372. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14373. static createInstance() {
  14374. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14375. }
  14376. onConstruct() {
  14377. this.n1 = (this.getChild("n1"));
  14378. this.n2 = (this.getChild("n2"));
  14379. this.t0 = this.getTransition("t0");
  14380. }
  14381. }
  14382. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14383. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14384. static createInstance() {
  14385. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14386. }
  14387. onConstruct() {
  14388. this.n4 = (this.getChild("n4"));
  14389. this.n2 = (this.getChild("n2"));
  14390. this.n3 = (this.getChild("n3"));
  14391. this.idle = this.getTransition("idle");
  14392. this.attack = this.getTransition("attack");
  14393. }
  14394. }
  14395. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14396. class ui_special extends fgui.GComponent {
  14397. static createInstance() {
  14398. return (fgui.UIPackage.createObject("game", "special"));
  14399. }
  14400. onConstruct() {
  14401. this.n18 = (this.getChild("n18"));
  14402. this.n19 = (this.getChild("n19"));
  14403. this.n20 = (this.getChild("n20"));
  14404. this.n21 = (this.getChild("n21"));
  14405. this.n22 = (this.getChild("n22"));
  14406. this.levelTxt = (this.getChild("levelTxt"));
  14407. this.n24 = (this.getChild("n24"));
  14408. this.n25 = (this.getChild("n25"));
  14409. this.t0 = this.getTransition("t0");
  14410. }
  14411. }
  14412. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14413. class ui_Component145 extends fgui.GComponent {
  14414. static createInstance() {
  14415. return (fgui.UIPackage.createObject("game", "Component145"));
  14416. }
  14417. onConstruct() {
  14418. this.guanyuNode = (this.getChild("guanyuNode"));
  14419. }
  14420. }
  14421. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14422. class ui_longBtn extends fgui.GButton {
  14423. static createInstance() {
  14424. return (fgui.UIPackage.createObject("game", "longBtn"));
  14425. }
  14426. onConstruct() {
  14427. this.c1 = this.getController("c1");
  14428. this.n2 = (this.getChild("n2"));
  14429. this.n1 = (this.getChild("n1"));
  14430. this.n4 = (this.getChild("n4"));
  14431. }
  14432. }
  14433. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14434. class ui_Component146 extends fgui.GComponent {
  14435. static createInstance() {
  14436. return (fgui.UIPackage.createObject("game", "Component146"));
  14437. }
  14438. onConstruct() {
  14439. this.n89 = (this.getChild("n89"));
  14440. this.n90 = (this.getChild("n90"));
  14441. this.guideBtn = (this.getChild("guideBtn"));
  14442. }
  14443. }
  14444. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14445. class ui_Component146_11 extends fgui.GComponent {
  14446. static createInstance() {
  14447. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14448. }
  14449. onConstruct() {
  14450. this.n89 = (this.getChild("n89"));
  14451. this.n90 = (this.getChild("n90"));
  14452. this.guideBtn = (this.getChild("guideBtn"));
  14453. }
  14454. }
  14455. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14456. class ui_Component111_1 extends fgui.GComponent {
  14457. static createInstance() {
  14458. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14459. }
  14460. onConstruct() {
  14461. this.n68 = (this.getChild("n68"));
  14462. this.myMask = (this.getChild("myMask"));
  14463. }
  14464. }
  14465. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14466. class ui_Component64_1 extends fgui.GComponent {
  14467. static createInstance() {
  14468. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14469. }
  14470. onConstruct() {
  14471. this.n57 = (this.getChild("n57"));
  14472. this.n54 = (this.getChild("n54"));
  14473. this.n55 = (this.getChild("n55"));
  14474. this.n56 = (this.getChild("n56"));
  14475. this.t1 = this.getTransition("t1");
  14476. }
  14477. }
  14478. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14479. class ui_ModeSelection_com123 extends fgui.GComponent {
  14480. static createInstance() {
  14481. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14482. }
  14483. onConstruct() {
  14484. this.type1 = (this.getChild("type1"));
  14485. this.type2 = (this.getChild("type2"));
  14486. this.type3 = (this.getChild("type3"));
  14487. this.n38 = (this.getChild("n38"));
  14488. this.t0 = this.getTransition("t0");
  14489. }
  14490. }
  14491. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14492. class ui_Component132_2 extends fgui.GComponent {
  14493. static createInstance() {
  14494. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14495. }
  14496. onConstruct() {
  14497. this.n25 = (this.getChild("n25"));
  14498. this.n26 = (this.getChild("n26"));
  14499. this.n27 = (this.getChild("n27"));
  14500. this.t0 = this.getTransition("t0");
  14501. }
  14502. }
  14503. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14504. class ui_UIPower$1 extends fgui.GComponent {
  14505. static createInstance() {
  14506. return (fgui.UIPackage.createObject("game", "UIPower"));
  14507. }
  14508. onConstruct() {
  14509. this.n11 = (this.getChild("n11"));
  14510. this.myNode = (this.getChild("myNode"));
  14511. this.t0 = this.getTransition("t0");
  14512. }
  14513. }
  14514. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14515. class ui_Component133 extends fgui.GComponent {
  14516. static createInstance() {
  14517. return (fgui.UIPackage.createObject("game", "Component133"));
  14518. }
  14519. onConstruct() {
  14520. this.n29 = (this.getChild("n29"));
  14521. this.n30 = (this.getChild("n30"));
  14522. }
  14523. }
  14524. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14525. class ui_Component134 extends fgui.GComponent {
  14526. static createInstance() {
  14527. return (fgui.UIPackage.createObject("game", "Component134"));
  14528. }
  14529. onConstruct() {
  14530. this.n30 = (this.getChild("n30"));
  14531. this.n31 = (this.getChild("n31"));
  14532. this.t0 = this.getTransition("t0");
  14533. }
  14534. }
  14535. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14536. class ui_Component135 extends fgui.GComponent {
  14537. static createInstance() {
  14538. return (fgui.UIPackage.createObject("game", "Component135"));
  14539. }
  14540. onConstruct() {
  14541. this.n30 = (this.getChild("n30"));
  14542. this.t0 = this.getTransition("t0");
  14543. }
  14544. }
  14545. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14546. class ui_Component137 extends fgui.GComponent {
  14547. static createInstance() {
  14548. return (fgui.UIPackage.createObject("game", "Component137"));
  14549. }
  14550. onConstruct() {
  14551. this.n28 = (this.getChild("n28"));
  14552. this.n29 = (this.getChild("n29"));
  14553. this.n30 = (this.getChild("n30"));
  14554. this.n32 = (this.getChild("n32"));
  14555. }
  14556. }
  14557. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14558. class ui_dh_zuanshi extends fgui.GButton {
  14559. static createInstance() {
  14560. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14561. }
  14562. onConstruct() {
  14563. this.n1 = (this.getChild("n1"));
  14564. this.n2 = (this.getChild("n2"));
  14565. this.n0 = (this.getChild("n0"));
  14566. this.n3 = (this.getChild("n3"));
  14567. this.n4 = (this.getChild("n4"));
  14568. }
  14569. }
  14570. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14571. class ui_Component138 extends fgui.GComponent {
  14572. static createInstance() {
  14573. return (fgui.UIPackage.createObject("game", "Component138"));
  14574. }
  14575. onConstruct() {
  14576. this.n1 = (this.getChild("n1"));
  14577. this.n2 = (this.getChild("n2"));
  14578. this.t0 = this.getTransition("t0");
  14579. }
  14580. }
  14581. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14582. class ui_Component139 extends fgui.GComponent {
  14583. static createInstance() {
  14584. return (fgui.UIPackage.createObject("game", "Component139"));
  14585. }
  14586. onConstruct() {
  14587. this.n0 = (this.getChild("n0"));
  14588. this.t0 = this.getTransition("t0");
  14589. }
  14590. }
  14591. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14592. class ui_Component140 extends fgui.GComponent {
  14593. static createInstance() {
  14594. return (fgui.UIPackage.createObject("game", "Component140"));
  14595. }
  14596. onConstruct() {
  14597. this.n2 = (this.getChild("n2"));
  14598. this.n3 = (this.getChild("n3"));
  14599. this.t0 = this.getTransition("t0");
  14600. }
  14601. }
  14602. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14603. class ui_Component141 extends fgui.GComponent {
  14604. static createInstance() {
  14605. return (fgui.UIPackage.createObject("game", "Component141"));
  14606. }
  14607. onConstruct() {
  14608. this.n0 = (this.getChild("n0"));
  14609. this.t0 = this.getTransition("t0");
  14610. }
  14611. }
  14612. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14613. class ui_powerNode extends fgui.GProgressBar {
  14614. static createInstance() {
  14615. return (fgui.UIPackage.createObject("game", "powerNode"));
  14616. }
  14617. onConstruct() {
  14618. this.n2 = (this.getChild("n2"));
  14619. this.bar_v = (this.getChild("bar_v"));
  14620. this.showImg = (this.getChild("showImg"));
  14621. this.n12 = (this.getChild("n12"));
  14622. }
  14623. }
  14624. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14625. class ui_dh_jingbi1 extends fgui.GComponent {
  14626. static createInstance() {
  14627. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14628. }
  14629. onConstruct() {
  14630. this.n0 = (this.getChild("n0"));
  14631. this.n1 = (this.getChild("n1"));
  14632. this.n2 = (this.getChild("n2"));
  14633. this.n3 = (this.getChild("n3"));
  14634. this.n4 = (this.getChild("n4"));
  14635. this.n5 = (this.getChild("n5"));
  14636. this.n6 = (this.getChild("n6"));
  14637. this.n8 = (this.getChild("n8"));
  14638. this.t0 = this.getTransition("t0");
  14639. }
  14640. }
  14641. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14642. class ui_Component94 extends fgui.GButton {
  14643. static createInstance() {
  14644. return (fgui.UIPackage.createObject("game", "Component94"));
  14645. }
  14646. onConstruct() {
  14647. this.n77 = (this.getChild("n77"));
  14648. }
  14649. }
  14650. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14651. class ui_Component95 extends fgui.GButton {
  14652. static createInstance() {
  14653. return (fgui.UIPackage.createObject("game", "Component95"));
  14654. }
  14655. onConstruct() {
  14656. this.n77 = (this.getChild("n77"));
  14657. }
  14658. }
  14659. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14660. class ui_Component126 extends fgui.GComponent {
  14661. static createInstance() {
  14662. return (fgui.UIPackage.createObject("game", "Component126"));
  14663. }
  14664. onConstruct() {
  14665. this.c1 = this.getController("c1");
  14666. this.normalBtn = (this.getChild("normalBtn"));
  14667. this.tripleBtn = (this.getChild("tripleBtn"));
  14668. }
  14669. }
  14670. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14671. class ui_Component60 extends fgui.GComponent {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("game", "Component60"));
  14674. }
  14675. onConstruct() {
  14676. this.c1 = this.getController("c1");
  14677. this.n48 = (this.getChild("n48"));
  14678. this.womanTxt = (this.getChild("womanTxt"));
  14679. this.t0 = this.getTransition("t0");
  14680. }
  14681. }
  14682. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14683. class ui_Component_fuli1 extends fgui.GComponent {
  14684. static createInstance() {
  14685. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14686. }
  14687. onConstruct() {
  14688. this.n0 = (this.getChild("n0"));
  14689. }
  14690. }
  14691. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14692. class ui_Button_h extends fgui.GButton {
  14693. static createInstance() {
  14694. return (fgui.UIPackage.createObject("game", "Button_h"));
  14695. }
  14696. onConstruct() {
  14697. this.button = this.getController("button");
  14698. this.n0 = (this.getChild("n0"));
  14699. this.n1 = (this.getChild("n1"));
  14700. }
  14701. }
  14702. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14703. class ui_Button_lv extends fgui.GButton {
  14704. static createInstance() {
  14705. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14706. }
  14707. onConstruct() {
  14708. this.button = this.getController("button");
  14709. this.n0 = (this.getChild("n0"));
  14710. this.n1 = (this.getChild("n1"));
  14711. }
  14712. }
  14713. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14714. class ui_Component98_3 extends fgui.GButton {
  14715. static createInstance() {
  14716. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14717. }
  14718. onConstruct() {
  14719. this.c1 = this.getController("c1");
  14720. this.n8 = (this.getChild("n8"));
  14721. this.n41 = (this.getChild("n41"));
  14722. this.n40 = (this.getChild("n40"));
  14723. }
  14724. }
  14725. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14726. class ui_ModeSelection_com1 extends fgui.GButton {
  14727. static createInstance() {
  14728. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14729. }
  14730. onConstruct() {
  14731. this.n34 = (this.getChild("n34"));
  14732. this.n36 = (this.getChild("n36"));
  14733. this.n22 = (this.getChild("n22"));
  14734. this.n20 = (this.getChild("n20"));
  14735. this.n23 = (this.getChild("n23"));
  14736. this.n24 = (this.getChild("n24"));
  14737. this.n26 = (this.getChild("n26"));
  14738. this.n33 = (this.getChild("n33"));
  14739. this.coinImg = (this.getChild("coinImg"));
  14740. this.need = (this.getChild("need"));
  14741. this.n35 = (this.getChild("n35"));
  14742. this.n29 = (this.getChild("n29"));
  14743. this.tipsTxt = (this.getChild("tipsTxt"));
  14744. this.n30 = (this.getChild("n30"));
  14745. this.peopleTxt = (this.getChild("peopleTxt"));
  14746. this.t0 = this.getTransition("t0");
  14747. }
  14748. }
  14749. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14750. class ui_ModeSelection_com2 extends fgui.GButton {
  14751. static createInstance() {
  14752. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14753. }
  14754. onConstruct() {
  14755. this.n36 = (this.getChild("n36"));
  14756. this.n34 = (this.getChild("n34"));
  14757. this.n22 = (this.getChild("n22"));
  14758. this.n20 = (this.getChild("n20"));
  14759. this.n23 = (this.getChild("n23"));
  14760. this.n24 = (this.getChild("n24"));
  14761. this.n26 = (this.getChild("n26"));
  14762. this.n33 = (this.getChild("n33"));
  14763. this.coinImg = (this.getChild("coinImg"));
  14764. this.need = (this.getChild("need"));
  14765. this.n35 = (this.getChild("n35"));
  14766. this.n29 = (this.getChild("n29"));
  14767. this.tipsTxt = (this.getChild("tipsTxt"));
  14768. this.n30 = (this.getChild("n30"));
  14769. this.peopleTxt = (this.getChild("peopleTxt"));
  14770. this.t0 = this.getTransition("t0");
  14771. }
  14772. }
  14773. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14774. class ui_ModeSelection_com3 extends fgui.GButton {
  14775. static createInstance() {
  14776. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14777. }
  14778. onConstruct() {
  14779. this.n34 = (this.getChild("n34"));
  14780. this.n36 = (this.getChild("n36"));
  14781. this.n22 = (this.getChild("n22"));
  14782. this.n20 = (this.getChild("n20"));
  14783. this.n23 = (this.getChild("n23"));
  14784. this.n24 = (this.getChild("n24"));
  14785. this.n26 = (this.getChild("n26"));
  14786. this.n33 = (this.getChild("n33"));
  14787. this.coinImg = (this.getChild("coinImg"));
  14788. this.need = (this.getChild("need"));
  14789. this.n35 = (this.getChild("n35"));
  14790. this.n29 = (this.getChild("n29"));
  14791. this.tipsTxt = (this.getChild("tipsTxt"));
  14792. this.n30 = (this.getChild("n30"));
  14793. this.peopleTxt = (this.getChild("peopleTxt"));
  14794. this.t0 = this.getTransition("t0");
  14795. }
  14796. }
  14797. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14798. class ui_Invitation_com1 extends fgui.GComponent {
  14799. static createInstance() {
  14800. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14801. }
  14802. onConstruct() {
  14803. this.n14 = (this.getChild("n14"));
  14804. this.n13 = (this.getChild("n13"));
  14805. this.n3 = (this.getChild("n3"));
  14806. this.n1 = (this.getChild("n1"));
  14807. this.n6 = (this.getChild("n6"));
  14808. this.n7 = (this.getChild("n7"));
  14809. this.enterBtn = (this.getChild("enterBtn"));
  14810. this.n11 = (this.getChild("n11"));
  14811. this.n12 = (this.getChild("n12"));
  14812. this.n15 = (this.getChild("n15"));
  14813. this.t0 = this.getTransition("t0");
  14814. this.t1 = this.getTransition("t1");
  14815. }
  14816. }
  14817. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14818. class ui_Component87_1 extends fgui.GComponent {
  14819. static createInstance() {
  14820. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14821. }
  14822. onConstruct() {
  14823. this.n74 = (this.getChild("n74"));
  14824. this.n73 = (this.getChild("n73"));
  14825. this.ballTxt = (this.getChild("ballTxt"));
  14826. this.n76 = (this.getChild("n76"));
  14827. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14828. this.levelTxt = (this.getChild("levelTxt"));
  14829. this.n87 = (this.getChild("n87"));
  14830. this.n84 = (this.getChild("n84"));
  14831. this.hpTxt = (this.getChild("hpTxt"));
  14832. this.n89 = (this.getChild("n89"));
  14833. this.tipsTxt = (this.getChild("tipsTxt"));
  14834. }
  14835. }
  14836. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14837. class ui_sqg1 extends fgui.GComponent {
  14838. static createInstance() {
  14839. return (fgui.UIPackage.createObject("game", "sqg1"));
  14840. }
  14841. onConstruct() {
  14842. this.n1 = (this.getChild("n1"));
  14843. this.n0 = (this.getChild("n0"));
  14844. }
  14845. }
  14846. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14847. class ui_sqg2 extends fgui.GComponent {
  14848. static createInstance() {
  14849. return (fgui.UIPackage.createObject("game", "sqg2"));
  14850. }
  14851. onConstruct() {
  14852. this.n1 = (this.getChild("n1"));
  14853. this.n0 = (this.getChild("n0"));
  14854. }
  14855. }
  14856. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14857. class ui_sqg3 extends fgui.GComponent {
  14858. static createInstance() {
  14859. return (fgui.UIPackage.createObject("game", "sqg3"));
  14860. }
  14861. onConstruct() {
  14862. this.n1 = (this.getChild("n1"));
  14863. this.n0 = (this.getChild("n0"));
  14864. }
  14865. }
  14866. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14867. class ui_sqg4 extends fgui.GComponent {
  14868. static createInstance() {
  14869. return (fgui.UIPackage.createObject("game", "sqg4"));
  14870. }
  14871. onConstruct() {
  14872. this.n1 = (this.getChild("n1"));
  14873. this.n0 = (this.getChild("n0"));
  14874. }
  14875. }
  14876. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14877. class ui_Component36 extends fgui.GButton {
  14878. static createInstance() {
  14879. return (fgui.UIPackage.createObject("game", "Component36"));
  14880. }
  14881. onConstruct() {
  14882. this.c1 = this.getController("c1");
  14883. this.n53 = (this.getChild("n53"));
  14884. this.n56 = (this.getChild("n56"));
  14885. }
  14886. }
  14887. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14888. class ui_Component37 extends fgui.GButton {
  14889. static createInstance() {
  14890. return (fgui.UIPackage.createObject("game", "Component37"));
  14891. }
  14892. onConstruct() {
  14893. this.c1 = this.getController("c1");
  14894. this.n52 = (this.getChild("n52"));
  14895. this.n54 = (this.getChild("n54"));
  14896. }
  14897. }
  14898. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14899. class ui_UISetting extends fgui.GComponent {
  14900. static createInstance() {
  14901. return (fgui.UIPackage.createObject("game", "UISetting"));
  14902. }
  14903. onConstruct() {
  14904. this.c1 = this.getController("c1");
  14905. this.n4 = (this.getChild("n4"));
  14906. this.soundBtn = (this.getChild("soundBtn"));
  14907. this.shakeBtn = (this.getChild("shakeBtn"));
  14908. this.clickNode = (this.getChild("clickNode"));
  14909. this.xyBtn = (this.getChild("xyBtn"));
  14910. }
  14911. }
  14912. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14913. class ui_Component39 extends fgui.GComponent {
  14914. static createInstance() {
  14915. return (fgui.UIPackage.createObject("game", "Component39"));
  14916. }
  14917. onConstruct() {
  14918. this.n5 = (this.getChild("n5"));
  14919. this.n6 = (this.getChild("n6"));
  14920. this.n7 = (this.getChild("n7"));
  14921. this.t0 = this.getTransition("t0");
  14922. }
  14923. }
  14924. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14925. class ui_Component40 extends fgui.GButton {
  14926. static createInstance() {
  14927. return (fgui.UIPackage.createObject("game", "Component40"));
  14928. }
  14929. onConstruct() {
  14930. this.n46 = (this.getChild("n46"));
  14931. this.n47 = (this.getChild("n47"));
  14932. }
  14933. }
  14934. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14935. class ui_Component41 extends fgui.GComponent {
  14936. static createInstance() {
  14937. return (fgui.UIPackage.createObject("game", "Component41"));
  14938. }
  14939. onConstruct() {
  14940. this.c1 = this.getController("c1");
  14941. this.n0 = (this.getChild("n0"));
  14942. this.titleTxt = (this.getChild("titleTxt"));
  14943. this.n2 = (this.getChild("n2"));
  14944. this.msgTips = (this.getChild("msgTips"));
  14945. this.numTxt = (this.getChild("numTxt"));
  14946. this.n18 = (this.getChild("n18"));
  14947. this.cancelBtn = (this.getChild("cancelBtn"));
  14948. this.videoBtn = (this.getChild("videoBtn"));
  14949. this.n10 = (this.getChild("n10"));
  14950. }
  14951. }
  14952. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14953. class ui_Component42 extends fgui.GComponent {
  14954. static createInstance() {
  14955. return (fgui.UIPackage.createObject("game", "Component42"));
  14956. }
  14957. onConstruct() {
  14958. this.c1 = this.getController("c1");
  14959. this.n1 = (this.getChild("n1"));
  14960. this.n2 = (this.getChild("n2"));
  14961. this.n3 = (this.getChild("n3"));
  14962. this.tipsTxt = (this.getChild("tipsTxt"));
  14963. this.cancelBtn = (this.getChild("cancelBtn"));
  14964. this.sureBtn = (this.getChild("sureBtn"));
  14965. this.n11 = (this.getChild("n11"));
  14966. this.n13 = (this.getChild("n13"));
  14967. this.n14 = (this.getChild("n14"));
  14968. this.womanTxt = (this.getChild("womanTxt"));
  14969. this.t0 = this.getTransition("t0");
  14970. }
  14971. }
  14972. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14973. class ui_dh_js_shengli extends fgui.GComponent {
  14974. static createInstance() {
  14975. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14976. }
  14977. onConstruct() {
  14978. this.n3 = (this.getChild("n3"));
  14979. this.n4 = (this.getChild("n4"));
  14980. this.n1 = (this.getChild("n1"));
  14981. this.n2 = (this.getChild("n2"));
  14982. this.n5 = (this.getChild("n5"));
  14983. this.n6 = (this.getChild("n6"));
  14984. this.n7 = (this.getChild("n7"));
  14985. this.n8 = (this.getChild("n8"));
  14986. this.attack = this.getTransition("attack");
  14987. this.idle = this.getTransition("idle");
  14988. }
  14989. }
  14990. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14991. class ui_dh_js_shengli_g extends fgui.GComponent {
  14992. static createInstance() {
  14993. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14994. }
  14995. onConstruct() {
  14996. this.n3 = (this.getChild("n3"));
  14997. this.n1 = (this.getChild("n1"));
  14998. this.t0 = this.getTransition("t0");
  14999. }
  15000. }
  15001. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15002. class ui_dh_js_shibai extends fgui.GComponent {
  15003. static createInstance() {
  15004. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15005. }
  15006. onConstruct() {
  15007. this.n0 = (this.getChild("n0"));
  15008. this.n1 = (this.getChild("n1"));
  15009. this.n2 = (this.getChild("n2"));
  15010. this.n3 = (this.getChild("n3"));
  15011. this.idle = this.getTransition("idle");
  15012. this.attack = this.getTransition("attack");
  15013. }
  15014. }
  15015. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15016. class ui_dh_zy_ganfa extends fgui.GButton {
  15017. static createInstance() {
  15018. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15019. }
  15020. onConstruct() {
  15021. this.n0 = (this.getChild("n0"));
  15022. }
  15023. }
  15024. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15025. class ui_dh_zy_sc_guang extends fgui.GButton {
  15026. static createInstance() {
  15027. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15028. }
  15029. onConstruct() {
  15030. this.n0 = (this.getChild("n0"));
  15031. this.n2 = (this.getChild("n2"));
  15032. }
  15033. }
  15034. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15035. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15036. static createInstance() {
  15037. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15038. }
  15039. onConstruct() {
  15040. this.n0 = (this.getChild("n0"));
  15041. this.n3 = (this.getChild("n3"));
  15042. this.t0 = this.getTransition("t0");
  15043. }
  15044. }
  15045. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15046. class ui_dh_zy_wanfa extends fgui.GButton {
  15047. static createInstance() {
  15048. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15049. }
  15050. onConstruct() {
  15051. this.n0 = (this.getChild("n0"));
  15052. }
  15053. }
  15054. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15055. class ui_Button_login extends fgui.GButton {
  15056. static createInstance() {
  15057. return (fgui.UIPackage.createObject("game", "Button_login"));
  15058. }
  15059. onConstruct() {
  15060. this.button = this.getController("button");
  15061. this.n5 = (this.getChild("n5"));
  15062. this.n3 = (this.getChild("n3"));
  15063. }
  15064. }
  15065. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15066. class ui_Component53_1 extends fgui.GComponent {
  15067. static createInstance() {
  15068. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15069. }
  15070. onConstruct() {
  15071. this.n0 = (this.getChild("n0"));
  15072. this.n1 = (this.getChild("n1"));
  15073. this.n2 = (this.getChild("n2"));
  15074. this.n3 = (this.getChild("n3"));
  15075. this.n4 = (this.getChild("n4"));
  15076. this.n5 = (this.getChild("n5"));
  15077. this.n6 = (this.getChild("n6"));
  15078. this.n7 = (this.getChild("n7"));
  15079. this.n8 = (this.getChild("n8"));
  15080. this.n9 = (this.getChild("n9"));
  15081. this.n10 = (this.getChild("n10"));
  15082. this.n11 = (this.getChild("n11"));
  15083. this.n12 = (this.getChild("n12"));
  15084. this.n13 = (this.getChild("n13"));
  15085. this.n14 = (this.getChild("n14"));
  15086. this.n15 = (this.getChild("n15"));
  15087. this.n16 = (this.getChild("n16"));
  15088. this.n19 = (this.getChild("n19"));
  15089. this.n20 = (this.getChild("n20"));
  15090. this.n21 = (this.getChild("n21"));
  15091. this.n22 = (this.getChild("n22"));
  15092. this.n23 = (this.getChild("n23"));
  15093. this.n24 = (this.getChild("n24"));
  15094. this.n25 = (this.getChild("n25"));
  15095. this.n26 = (this.getChild("n26"));
  15096. this.n27 = (this.getChild("n27"));
  15097. this.n28 = (this.getChild("n28"));
  15098. this.n29 = (this.getChild("n29"));
  15099. this.n30 = (this.getChild("n30"));
  15100. this.n31 = (this.getChild("n31"));
  15101. this.n32 = (this.getChild("n32"));
  15102. this.n33 = (this.getChild("n33"));
  15103. this.n34 = (this.getChild("n34"));
  15104. this.n35 = (this.getChild("n35"));
  15105. this.t0 = this.getTransition("t0");
  15106. }
  15107. }
  15108. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15109. class ui_Component30 extends fgui.GComponent {
  15110. static createInstance() {
  15111. return (fgui.UIPackage.createObject("game", "Component30"));
  15112. }
  15113. onConstruct() {
  15114. this.c1 = this.getController("c1");
  15115. this.n46 = (this.getChild("n46"));
  15116. this.n47 = (this.getChild("n47"));
  15117. this.numTxt = (this.getChild("numTxt"));
  15118. this.n50 = (this.getChild("n50"));
  15119. this.n53 = (this.getChild("n53"));
  15120. this.n54 = (this.getChild("n54"));
  15121. this.n55 = (this.getChild("n55"));
  15122. this.n56 = (this.getChild("n56"));
  15123. }
  15124. }
  15125. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15126. class ui_Component30_1 extends fgui.GComponent {
  15127. static createInstance() {
  15128. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15129. }
  15130. onConstruct() {
  15131. this.c1 = this.getController("c1");
  15132. this.n46 = (this.getChild("n46"));
  15133. this.n47 = (this.getChild("n47"));
  15134. this.numTxt = (this.getChild("numTxt"));
  15135. this.n50 = (this.getChild("n50"));
  15136. this.n51 = (this.getChild("n51"));
  15137. this.n52 = (this.getChild("n52"));
  15138. this.n53 = (this.getChild("n53"));
  15139. this.n54 = (this.getChild("n54"));
  15140. }
  15141. }
  15142. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15143. class ui_Component31 extends fgui.GComponent {
  15144. static createInstance() {
  15145. return (fgui.UIPackage.createObject("game", "Component31"));
  15146. }
  15147. onConstruct() {
  15148. this.n55 = (this.getChild("n55"));
  15149. this.n54 = (this.getChild("n54"));
  15150. this.conditionTxt = (this.getChild("conditionTxt"));
  15151. this.n57 = (this.getChild("n57"));
  15152. this.t0 = this.getTransition("t0");
  15153. }
  15154. }
  15155. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15156. class ui_Component32 extends fgui.GComponent {
  15157. static createInstance() {
  15158. return (fgui.UIPackage.createObject("game", "Component32"));
  15159. }
  15160. onConstruct() {
  15161. this.n5 = (this.getChild("n5"));
  15162. this.n6 = (this.getChild("n6"));
  15163. this.n7 = (this.getChild("n7"));
  15164. this.t0 = this.getTransition("t0");
  15165. }
  15166. }
  15167. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15168. class ui_AwardItem extends fgui.GComponent {
  15169. static createInstance() {
  15170. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15171. }
  15172. onConstruct() {
  15173. this.n9 = (this.getChild("n9"));
  15174. this.myIcon = (this.getChild("myIcon"));
  15175. this.numTxt = (this.getChild("numTxt"));
  15176. this.nameTxt = (this.getChild("nameTxt"));
  15177. this.n16 = (this.getChild("n16"));
  15178. this.n17 = (this.getChild("n17"));
  15179. }
  15180. }
  15181. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15182. class ui_ranking_com1 extends fgui.GButton {
  15183. static createInstance() {
  15184. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15185. }
  15186. onConstruct() {
  15187. this.c1 = this.getController("c1");
  15188. this.n49 = (this.getChild("n49"));
  15189. this.n18 = (this.getChild("n18"));
  15190. this.n46 = (this.getChild("n46"));
  15191. this.n48 = (this.getChild("n48"));
  15192. this.n50 = (this.getChild("n50"));
  15193. }
  15194. }
  15195. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15196. class ui_ranking_com2 extends fgui.GButton {
  15197. static createInstance() {
  15198. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15199. }
  15200. onConstruct() {
  15201. this.c1 = this.getController("c1");
  15202. this.n49 = (this.getChild("n49"));
  15203. this.n18 = (this.getChild("n18"));
  15204. this.n46 = (this.getChild("n46"));
  15205. this.n48 = (this.getChild("n48"));
  15206. this.n50 = (this.getChild("n50"));
  15207. }
  15208. }
  15209. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15210. class ui_ranking_com3 extends fgui.GComponent {
  15211. static createInstance() {
  15212. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15213. }
  15214. onConstruct() {
  15215. this.n17 = (this.getChild("n17"));
  15216. this.myIcon = (this.getChild("myIcon"));
  15217. }
  15218. }
  15219. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15220. class ui_ranking_com4 extends fgui.GComponent {
  15221. static createInstance() {
  15222. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15223. }
  15224. onConstruct() {
  15225. this.n16 = (this.getChild("n16"));
  15226. this.head = (this.getChild("head"));
  15227. }
  15228. }
  15229. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15230. class ui_ranking_com5 extends fgui.GComponent {
  15231. static createInstance() {
  15232. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15233. }
  15234. onConstruct() {
  15235. this.c1 = this.getController("c1");
  15236. this.c2 = this.getController("c2");
  15237. this.n2 = (this.getChild("n2"));
  15238. this.n3 = (this.getChild("n3"));
  15239. this.levelBtn = (this.getChild("levelBtn"));
  15240. this.starBtn = (this.getChild("starBtn"));
  15241. this.n23 = (this.getChild("n23"));
  15242. this.n24 = (this.getChild("n24"));
  15243. this.n25 = (this.getChild("n25"));
  15244. this.myList = (this.getChild("myList"));
  15245. this.selfNode = (this.getChild("selfNode"));
  15246. this.n9 = (this.getChild("n9"));
  15247. this.n12 = (this.getChild("n12"));
  15248. this.n13 = (this.getChild("n13"));
  15249. this.n14 = (this.getChild("n14"));
  15250. this.n39 = (this.getChild("n39"));
  15251. this.n41 = (this.getChild("n41"));
  15252. this.n42 = (this.getChild("n42"));
  15253. this.n45 = (this.getChild("n45"));
  15254. this.changeBtn = (this.getChild("changeBtn"));
  15255. this.closeBtn = (this.getChild("closeBtn"));
  15256. this.t0 = this.getTransition("t0");
  15257. }
  15258. }
  15259. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15260. class ui_RankItem extends fgui.GComponent {
  15261. static createInstance() {
  15262. return (fgui.UIPackage.createObject("game", "RankItem"));
  15263. }
  15264. onConstruct() {
  15265. this.n10 = (this.getChild("n10"));
  15266. this.n11 = (this.getChild("n11"));
  15267. this.rankTxt = (this.getChild("rankTxt"));
  15268. this.headNode = (this.getChild("headNode"));
  15269. this.nameTxt = (this.getChild("nameTxt"));
  15270. this.n19 = (this.getChild("n19"));
  15271. this.valueTxt = (this.getChild("valueTxt"));
  15272. this.img1 = (this.getChild("img1"));
  15273. this.img2 = (this.getChild("img2"));
  15274. this.img3 = (this.getChild("img3"));
  15275. }
  15276. }
  15277. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15278. class ui_ranking_com9 extends fgui.GComponent {
  15279. static createInstance() {
  15280. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15281. }
  15282. onConstruct() {
  15283. this.c1 = this.getController("c1");
  15284. this.n27 = (this.getChild("n27"));
  15285. this.n28 = (this.getChild("n28"));
  15286. this.headNode = (this.getChild("headNode"));
  15287. this.rankTxt = (this.getChild("rankTxt"));
  15288. this.nameTxt = (this.getChild("nameTxt"));
  15289. this.n34 = (this.getChild("n34"));
  15290. this.valueTxt = (this.getChild("valueTxt"));
  15291. this.n36 = (this.getChild("n36"));
  15292. this.n37 = (this.getChild("n37"));
  15293. this.n38 = (this.getChild("n38"));
  15294. this.n39 = (this.getChild("n39"));
  15295. this.n40 = (this.getChild("n40"));
  15296. }
  15297. }
  15298. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15299. class ui_ranking_com10 extends fgui.GComponent {
  15300. static createInstance() {
  15301. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15302. }
  15303. onConstruct() {
  15304. this.n23 = (this.getChild("n23"));
  15305. this.n24 = (this.getChild("n24"));
  15306. }
  15307. }
  15308. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15309. class ui_ranking_com11 extends fgui.GComponent {
  15310. static createInstance() {
  15311. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15312. }
  15313. onConstruct() {
  15314. this.n24 = (this.getChild("n24"));
  15315. this.n25 = (this.getChild("n25"));
  15316. this.t0 = this.getTransition("t0");
  15317. }
  15318. }
  15319. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15320. class ui_ranking_com13 extends fgui.GButton {
  15321. static createInstance() {
  15322. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15323. }
  15324. onConstruct() {
  15325. this.c1 = this.getController("c1");
  15326. this.n44 = (this.getChild("n44"));
  15327. this.n45 = (this.getChild("n45"));
  15328. this.n46 = (this.getChild("n46"));
  15329. }
  15330. }
  15331. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15332. class ui_Component_dl_zc extends fgui.GButton {
  15333. static createInstance() {
  15334. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15335. }
  15336. onConstruct() {
  15337. this.c1 = this.getController("c1");
  15338. this.n0 = (this.getChild("n0"));
  15339. }
  15340. }
  15341. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15342. class ui_Component122 extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "Component122"));
  15345. }
  15346. onConstruct() {
  15347. this.gameNode3 = (this.getChild("gameNode3"));
  15348. }
  15349. }
  15350. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15351. class ui_skillItem extends fgui.GComponent {
  15352. static createInstance() {
  15353. return (fgui.UIPackage.createObject("game", "skillItem"));
  15354. }
  15355. onConstruct() {
  15356. this.c1 = this.getController("c1");
  15357. this.n31 = (this.getChild("n31"));
  15358. this.n6 = (this.getChild("n6"));
  15359. this.skillImg = (this.getChild("skillImg"));
  15360. this.nameTxt = (this.getChild("nameTxt"));
  15361. this.levelTxt = (this.getChild("levelTxt"));
  15362. this.n28 = (this.getChild("n28"));
  15363. this.describeTxt = (this.getChild("describeTxt"));
  15364. this.n32 = (this.getChild("n32"));
  15365. this.mutiBtn = (this.getChild("mutiBtn"));
  15366. this.tryNode = (this.getChild("tryNode"));
  15367. this.normalBtn = (this.getChild("normalBtn"));
  15368. this.startBtn = (this.getChild("startBtn"));
  15369. this.n42 = (this.getChild("n42"));
  15370. this.n43 = (this.getChild("n43"));
  15371. this.n44 = (this.getChild("n44"));
  15372. }
  15373. }
  15374. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15375. class ui_Component26 extends fgui.GButton {
  15376. static createInstance() {
  15377. return (fgui.UIPackage.createObject("game", "Component26"));
  15378. }
  15379. onConstruct() {
  15380. this.n11 = (this.getChild("n11"));
  15381. this.n30 = (this.getChild("n30"));
  15382. this.n34 = (this.getChild("n34"));
  15383. }
  15384. }
  15385. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15386. class ui_Component28 extends fgui.GButton {
  15387. static createInstance() {
  15388. return (fgui.UIPackage.createObject("game", "Component28"));
  15389. }
  15390. onConstruct() {
  15391. this.n12 = (this.getChild("n12"));
  15392. this.n31 = (this.getChild("n31"));
  15393. this.curTxt = (this.getChild("curTxt"));
  15394. this.n33 = (this.getChild("n33"));
  15395. }
  15396. }
  15397. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15398. class ui_Component1302 extends fgui.GComponent {
  15399. static createInstance() {
  15400. return (fgui.UIPackage.createObject("game", "Component1302"));
  15401. }
  15402. onConstruct() {
  15403. this.n2 = (this.getChild("n2"));
  15404. this.n3 = (this.getChild("n3"));
  15405. }
  15406. }
  15407. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15408. class ui_Component113 extends fgui.GComponent {
  15409. static createInstance() {
  15410. return (fgui.UIPackage.createObject("game", "Component113"));
  15411. }
  15412. onConstruct() {
  15413. this.n85 = (this.getChild("n85"));
  15414. this.n86 = (this.getChild("n86"));
  15415. this.n77 = (this.getChild("n77"));
  15416. this.n79 = (this.getChild("n79"));
  15417. this.n80 = (this.getChild("n80"));
  15418. this.n81 = (this.getChild("n81"));
  15419. this.n82 = (this.getChild("n82"));
  15420. this.n84 = (this.getChild("n84"));
  15421. this.n87 = (this.getChild("n87"));
  15422. this.t0 = this.getTransition("t0");
  15423. }
  15424. }
  15425. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15426. class ui_Component114 extends fgui.GComponent {
  15427. static createInstance() {
  15428. return (fgui.UIPackage.createObject("game", "Component114"));
  15429. }
  15430. onConstruct() {
  15431. this.n77 = (this.getChild("n77"));
  15432. this.t0 = this.getTransition("t0");
  15433. }
  15434. }
  15435. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15436. class ui_Component115 extends fgui.GComponent {
  15437. static createInstance() {
  15438. return (fgui.UIPackage.createObject("game", "Component115"));
  15439. }
  15440. onConstruct() {
  15441. this.n83 = (this.getChild("n83"));
  15442. this.fingerNode = (this.getChild("fingerNode"));
  15443. this.n84 = (this.getChild("n84"));
  15444. }
  15445. }
  15446. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15447. class ui_Component117 extends fgui.GComponent {
  15448. static createInstance() {
  15449. return (fgui.UIPackage.createObject("game", "Component117"));
  15450. }
  15451. onConstruct() {
  15452. this.n87 = (this.getChild("n87"));
  15453. this.n88 = (this.getChild("n88"));
  15454. this.n84 = (this.getChild("n84"));
  15455. this.n85 = (this.getChild("n85"));
  15456. this.n86 = (this.getChild("n86"));
  15457. this.t0 = this.getTransition("t0");
  15458. }
  15459. }
  15460. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15461. class ui_Component98_1 extends fgui.GButton {
  15462. static createInstance() {
  15463. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15464. }
  15465. onConstruct() {
  15466. this.c1 = this.getController("c1");
  15467. this.n8 = (this.getChild("n8"));
  15468. this.n41 = (this.getChild("n41"));
  15469. this.n40 = (this.getChild("n40"));
  15470. }
  15471. }
  15472. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15473. class ui_Component61 extends fgui.GComponent {
  15474. static createInstance() {
  15475. return (fgui.UIPackage.createObject("game", "Component61"));
  15476. }
  15477. onConstruct() {
  15478. this.n14 = (this.getChild("n14"));
  15479. this.n6 = (this.getChild("n6"));
  15480. this.t0 = this.getTransition("t0");
  15481. }
  15482. }
  15483. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15484. class ui_Component62 extends fgui.GComponent {
  15485. static createInstance() {
  15486. return (fgui.UIPackage.createObject("game", "Component62"));
  15487. }
  15488. onConstruct() {
  15489. this.n66 = (this.getChild("n66"));
  15490. this.n56 = (this.getChild("n56"));
  15491. this.n63 = (this.getChild("n63"));
  15492. this.n65 = (this.getChild("n65"));
  15493. this.t0 = this.getTransition("t0");
  15494. }
  15495. }
  15496. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15497. class ui_d3Root extends fgui.GComponent {
  15498. static createInstance() {
  15499. return (fgui.UIPackage.createObject("game", "d3Root"));
  15500. }
  15501. onConstruct() {
  15502. }
  15503. }
  15504. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15505. class ui_d2Root extends fgui.GComponent {
  15506. static createInstance() {
  15507. return (fgui.UIPackage.createObject("game", "d2Root"));
  15508. }
  15509. onConstruct() {
  15510. }
  15511. }
  15512. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15513. class ui_ballNode extends fgui.GComponent {
  15514. static createInstance() {
  15515. return (fgui.UIPackage.createObject("game", "ballNode"));
  15516. }
  15517. onConstruct() {
  15518. }
  15519. }
  15520. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15521. class ui_border extends fgui.GComponent {
  15522. static createInstance() {
  15523. return (fgui.UIPackage.createObject("game", "border"));
  15524. }
  15525. onConstruct() {
  15526. this.bar1 = (this.getChild("bar1"));
  15527. this.bar2 = (this.getChild("bar2"));
  15528. this.bar3 = (this.getChild("bar3"));
  15529. this.bar4 = (this.getChild("bar4"));
  15530. this.bar5 = (this.getChild("bar5"));
  15531. this.bar6 = (this.getChild("bar6"));
  15532. this.circle1 = (this.getChild("circle1"));
  15533. this.circle2 = (this.getChild("circle2"));
  15534. this.circle3 = (this.getChild("circle3"));
  15535. this.circle4 = (this.getChild("circle4"));
  15536. this.circle5 = (this.getChild("circle5"));
  15537. this.circle6 = (this.getChild("circle6"));
  15538. this.n28 = (this.getChild("n28"));
  15539. }
  15540. }
  15541. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15542. class ui_btn_buy extends fgui.GButton {
  15543. static createInstance() {
  15544. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15545. }
  15546. onConstruct() {
  15547. this.button = this.getController("button");
  15548. this.n0 = (this.getChild("n0"));
  15549. this.n1 = (this.getChild("n1"));
  15550. this.n2 = (this.getChild("n2"));
  15551. }
  15552. }
  15553. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15554. class ui_Component41_2 extends fgui.GComponent {
  15555. static createInstance() {
  15556. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15557. }
  15558. onConstruct() {
  15559. this.c1 = this.getController("c1");
  15560. this.n0 = (this.getChild("n0"));
  15561. this.n2 = (this.getChild("n2"));
  15562. this.n19 = (this.getChild("n19"));
  15563. this.cancelBtn = (this.getChild("cancelBtn"));
  15564. this.videoBtn = (this.getChild("videoBtn"));
  15565. this.n9 = (this.getChild("n9"));
  15566. this.n22 = (this.getChild("n22"));
  15567. this.tipsTxt = (this.getChild("tipsTxt"));
  15568. this.n23 = (this.getChild("n23"));
  15569. this.n24 = (this.getChild("n24"));
  15570. this.n26 = (this.getChild("n26"));
  15571. this.n27 = (this.getChild("n27"));
  15572. this.titleTxt = (this.getChild("titleTxt"));
  15573. }
  15574. }
  15575. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15576. class ui_Component41_1 extends fgui.GComponent {
  15577. static createInstance() {
  15578. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15579. }
  15580. onConstruct() {
  15581. this.c1 = this.getController("c1");
  15582. this.n0 = (this.getChild("n0"));
  15583. this.n2 = (this.getChild("n2"));
  15584. this.cancelBtn = (this.getChild("cancelBtn"));
  15585. this.videoBtn = (this.getChild("videoBtn"));
  15586. this.n27 = (this.getChild("n27"));
  15587. this.n30 = (this.getChild("n30"));
  15588. this.n31 = (this.getChild("n31"));
  15589. this.n32 = (this.getChild("n32"));
  15590. this.n33 = (this.getChild("n33"));
  15591. this.n34 = (this.getChild("n34"));
  15592. this.n35 = (this.getChild("n35"));
  15593. this.n36 = (this.getChild("n36"));
  15594. this.n1 = (this.getChild("n1"));
  15595. this.n37 = (this.getChild("n37"));
  15596. this.t0 = this.getTransition("t0");
  15597. this.t1 = this.getTransition("t1");
  15598. this.t2 = this.getTransition("t2");
  15599. this.t3 = this.getTransition("t3");
  15600. }
  15601. }
  15602. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15603. class ui_againBtn extends fgui.GButton {
  15604. static createInstance() {
  15605. return (fgui.UIPackage.createObject("game", "againBtn"));
  15606. }
  15607. onConstruct() {
  15608. this.n2 = (this.getChild("n2"));
  15609. this.n1 = (this.getChild("n1"));
  15610. this.n5 = (this.getChild("n5"));
  15611. }
  15612. }
  15613. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15614. class ui_Component118 extends fgui.GButton {
  15615. static createInstance() {
  15616. return (fgui.UIPackage.createObject("game", "Component118"));
  15617. }
  15618. onConstruct() {
  15619. this.c1 = this.getController("c1");
  15620. this.n14 = (this.getChild("n14"));
  15621. this.n9 = (this.getChild("n9"));
  15622. this.n10 = (this.getChild("n10"));
  15623. this.diamondTxt = (this.getChild("diamondTxt"));
  15624. this.n13 = (this.getChild("n13"));
  15625. this.n15 = (this.getChild("n15"));
  15626. }
  15627. }
  15628. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15629. class ui_Component119 extends fgui.GComponent {
  15630. static createInstance() {
  15631. return (fgui.UIPackage.createObject("game", "Component119"));
  15632. }
  15633. onConstruct() {
  15634. this.n1 = (this.getChild("n1"));
  15635. this.n2 = (this.getChild("n2"));
  15636. this.n13 = (this.getChild("n13"));
  15637. this.n6 = (this.getChild("n6"));
  15638. this.screenNode = (this.getChild("screenNode"));
  15639. this.n15 = (this.getChild("n15"));
  15640. this.closeBtn = (this.getChild("closeBtn"));
  15641. this.share2Btn = (this.getChild("share2Btn"));
  15642. this.shareBtn = (this.getChild("shareBtn"));
  15643. this.tipsNode = (this.getChild("tipsNode"));
  15644. this.awardNode = (this.getChild("awardNode"));
  15645. }
  15646. }
  15647. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15648. class ui_daoJuDisplay extends fgui.GComponent {
  15649. static createInstance() {
  15650. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15651. }
  15652. onConstruct() {
  15653. this.n6 = (this.getChild("n6"));
  15654. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15655. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15656. this.btn_buy = (this.getChild("btn_buy"));
  15657. this.nameTxt = (this.getChild("nameTxt"));
  15658. this.zsImg = (this.getChild("zsImg"));
  15659. }
  15660. }
  15661. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15662. class ui_Component132_1 extends fgui.GComponent {
  15663. static createInstance() {
  15664. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15665. }
  15666. onConstruct() {
  15667. this.n25 = (this.getChild("n25"));
  15668. this.n26 = (this.getChild("n26"));
  15669. this.n27 = (this.getChild("n27"));
  15670. this.t0 = this.getTransition("t0");
  15671. }
  15672. }
  15673. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15674. class ui_SecretaryDisplay extends fgui.GComponent {
  15675. static createInstance() {
  15676. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15677. }
  15678. onConstruct() {
  15679. this.n2 = (this.getChild("n2"));
  15680. this.levelTxt = (this.getChild("levelTxt"));
  15681. this.n4 = (this.getChild("n4"));
  15682. this.secretary = (this.getChild("secretary"));
  15683. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15684. this.n16 = (this.getChild("n16"));
  15685. this.n37 = (this.getChild("n37"));
  15686. this.n41 = (this.getChild("n41"));
  15687. this.n14 = (this.getChild("n14"));
  15688. this.n17 = (this.getChild("n17"));
  15689. this.heightTxt = (this.getChild("heightTxt"));
  15690. this.n46 = (this.getChild("n46"));
  15691. this.n36 = (this.getChild("n36"));
  15692. this.n38 = (this.getChild("n38"));
  15693. this.foodTxt = (this.getChild("foodTxt"));
  15694. this.n47 = (this.getChild("n47"));
  15695. this.n40 = (this.getChild("n40"));
  15696. this.n42 = (this.getChild("n42"));
  15697. this.historyTxt = (this.getChild("historyTxt"));
  15698. this.n48 = (this.getChild("n48"));
  15699. this.nameImg = (this.getChild("nameImg"));
  15700. this.n12 = (this.getChild("n12"));
  15701. this.n49 = (this.getChild("n49"));
  15702. this.t0 = this.getTransition("t0");
  15703. }
  15704. }
  15705. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15706. class ui_BallRodDisplay extends fgui.GComponent {
  15707. static createInstance() {
  15708. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15709. }
  15710. onConstruct() {
  15711. this.c1 = this.getController("c1");
  15712. this.n31 = (this.getChild("n31"));
  15713. this.n6 = (this.getChild("n6"));
  15714. this.nameTxt = (this.getChild("nameTxt"));
  15715. this.rodImg = (this.getChild("rodImg"));
  15716. this.eftRod = (this.getChild("eftRod"));
  15717. this.levelNode = (this.getChild("levelNode"));
  15718. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15719. }
  15720. }
  15721. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15722. class ui_Component111_11 extends fgui.GComponent {
  15723. static createInstance() {
  15724. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15725. }
  15726. onConstruct() {
  15727. this.n68 = (this.getChild("n68"));
  15728. this.n69 = (this.getChild("n69"));
  15729. }
  15730. }
  15731. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15732. class ui_Component112 extends fgui.GComponent {
  15733. static createInstance() {
  15734. return (fgui.UIPackage.createObject("game", "Component112"));
  15735. }
  15736. onConstruct() {
  15737. this.n68 = (this.getChild("n68"));
  15738. this.n70 = (this.getChild("n70"));
  15739. this.myMask = (this.getChild("myMask"));
  15740. }
  15741. }
  15742. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15743. class ui_Component111 extends fgui.GComponent {
  15744. static createInstance() {
  15745. return (fgui.UIPackage.createObject("game", "Component111"));
  15746. }
  15747. onConstruct() {
  15748. this.n68 = (this.getChild("n68"));
  15749. this.myMask = (this.getChild("myMask"));
  15750. }
  15751. }
  15752. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15753. class ui_Component144 extends fgui.GButton {
  15754. static createInstance() {
  15755. return (fgui.UIPackage.createObject("game", "Component144"));
  15756. }
  15757. onConstruct() {
  15758. this.n8 = (this.getChild("n8"));
  15759. }
  15760. }
  15761. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15762. class ui_Sign_com2 extends fgui.GComponent {
  15763. static createInstance() {
  15764. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15765. }
  15766. onConstruct() {
  15767. this.n0 = (this.getChild("n0"));
  15768. this.n1 = (this.getChild("n1"));
  15769. this.t0 = this.getTransition("t0");
  15770. }
  15771. }
  15772. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15773. class ui_Sign_guang extends fgui.GComponent {
  15774. static createInstance() {
  15775. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15776. }
  15777. onConstruct() {
  15778. this.n1 = (this.getChild("n1"));
  15779. this.n2 = (this.getChild("n2"));
  15780. this.n3 = (this.getChild("n3"));
  15781. this.n4 = (this.getChild("n4"));
  15782. this.n5 = (this.getChild("n5"));
  15783. this.n6 = (this.getChild("n6"));
  15784. this.n8 = (this.getChild("n8"));
  15785. }
  15786. }
  15787. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15788. class ui_SignMax extends fgui.GComponent {
  15789. static createInstance() {
  15790. return (fgui.UIPackage.createObject("game", "SignMax"));
  15791. }
  15792. onConstruct() {
  15793. this.c1 = this.getController("c1");
  15794. this.n7 = (this.getChild("n7"));
  15795. this.n15 = (this.getChild("n15"));
  15796. this.n8 = (this.getChild("n8"));
  15797. this.titleTxt = (this.getChild("titleTxt"));
  15798. this.myIcon1 = (this.getChild("myIcon1"));
  15799. this.numTxt1 = (this.getChild("numTxt1"));
  15800. this.myIcon2 = (this.getChild("myIcon2"));
  15801. this.n20 = (this.getChild("n20"));
  15802. this.n17 = (this.getChild("n17"));
  15803. this.numTxt2 = (this.getChild("numTxt2"));
  15804. this.n12 = (this.getChild("n12"));
  15805. this.n13 = (this.getChild("n13"));
  15806. this.n21 = (this.getChild("n21"));
  15807. this.n14 = (this.getChild("n14"));
  15808. }
  15809. }
  15810. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15811. class ui_Sign_com2_1 extends fgui.GComponent {
  15812. static createInstance() {
  15813. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15814. }
  15815. onConstruct() {
  15816. this.n0 = (this.getChild("n0"));
  15817. this.n1 = (this.getChild("n1"));
  15818. this.t0 = this.getTransition("t0");
  15819. }
  15820. }
  15821. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15822. class ui_Sign_com5 extends fgui.GComponent {
  15823. static createInstance() {
  15824. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15825. }
  15826. onConstruct() {
  15827. this.n3 = (this.getChild("n3"));
  15828. this.n29 = (this.getChild("n29"));
  15829. this.n4 = (this.getChild("n4"));
  15830. this.day1 = (this.getChild("day1"));
  15831. this.day2 = (this.getChild("day2"));
  15832. this.day3 = (this.getChild("day3"));
  15833. this.day4 = (this.getChild("day4"));
  15834. this.day5 = (this.getChild("day5"));
  15835. this.day6 = (this.getChild("day6"));
  15836. this.day7 = (this.getChild("day7"));
  15837. this.t0 = this.getTransition("t0");
  15838. }
  15839. }
  15840. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15841. class ui_Sign_com8 extends fgui.GComponent {
  15842. static createInstance() {
  15843. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15844. }
  15845. onConstruct() {
  15846. this.n48 = (this.getChild("n48"));
  15847. this.womanTxt = (this.getChild("womanTxt"));
  15848. this.t0 = this.getTransition("t0");
  15849. }
  15850. }
  15851. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15852. class ui_Sign_com6 extends fgui.GComponent {
  15853. static createInstance() {
  15854. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15855. }
  15856. onConstruct() {
  15857. this.n2 = (this.getChild("n2"));
  15858. this.n3 = (this.getChild("n3"));
  15859. this.t0 = this.getTransition("t0");
  15860. }
  15861. }
  15862. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15863. class ui_Sign_com7 extends fgui.GComponent {
  15864. static createInstance() {
  15865. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15866. }
  15867. onConstruct() {
  15868. this.n29 = (this.getChild("n29"));
  15869. this.n2 = (this.getChild("n2"));
  15870. }
  15871. }
  15872. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15873. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15874. static createInstance() {
  15875. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15876. }
  15877. onConstruct() {
  15878. this.n5 = (this.getChild("n5"));
  15879. this.n4 = (this.getChild("n4"));
  15880. this.t0 = this.getTransition("t0");
  15881. }
  15882. }
  15883. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15884. class ui_UITurntable_com2 extends fgui.GComponent {
  15885. static createInstance() {
  15886. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15887. }
  15888. onConstruct() {
  15889. this.c1 = this.getController("c1");
  15890. this.n4 = (this.getChild("n4"));
  15891. this.n6 = (this.getChild("n6"));
  15892. this.n10 = (this.getChild("n10"));
  15893. this.n11 = (this.getChild("n11"));
  15894. this.n12 = (this.getChild("n12"));
  15895. this.n13 = (this.getChild("n13"));
  15896. this.n14 = (this.getChild("n14"));
  15897. this.n15 = (this.getChild("n15"));
  15898. this.n16 = (this.getChild("n16"));
  15899. this.n17 = (this.getChild("n17"));
  15900. this.n18 = (this.getChild("n18"));
  15901. this.n19 = (this.getChild("n19"));
  15902. this.n20 = (this.getChild("n20"));
  15903. this.n21 = (this.getChild("n21"));
  15904. this.n22 = (this.getChild("n22"));
  15905. this.n23 = (this.getChild("n23"));
  15906. this.n24 = (this.getChild("n24"));
  15907. this.n25 = (this.getChild("n25"));
  15908. this.n26 = (this.getChild("n26"));
  15909. this.n27 = (this.getChild("n27"));
  15910. this.n28 = (this.getChild("n28"));
  15911. this.n29 = (this.getChild("n29"));
  15912. this.n30 = (this.getChild("n30"));
  15913. this.n31 = (this.getChild("n31"));
  15914. this.n32 = (this.getChild("n32"));
  15915. this.n33 = (this.getChild("n33"));
  15916. }
  15917. }
  15918. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15919. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15920. static createInstance() {
  15921. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15922. }
  15923. onConstruct() {
  15924. this.n5 = (this.getChild("n5"));
  15925. this.n4 = (this.getChild("n4"));
  15926. this.t0 = this.getTransition("t0");
  15927. }
  15928. }
  15929. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15930. class ui_UITurntable_com5 extends fgui.GComponent {
  15931. static createInstance() {
  15932. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15933. }
  15934. onConstruct() {
  15935. this.flashNode = (this.getChild("flashNode"));
  15936. this.rotNode = (this.getChild("rotNode"));
  15937. this.n3 = (this.getChild("n3"));
  15938. this.n21 = (this.getChild("n21"));
  15939. this.t0 = this.getTransition("t0");
  15940. }
  15941. }
  15942. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15943. class ui_UITurntable_com7 extends fgui.GComponent {
  15944. static createInstance() {
  15945. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15946. }
  15947. onConstruct() {
  15948. this.n2 = (this.getChild("n2"));
  15949. this.n35 = (this.getChild("n35"));
  15950. this.img1 = (this.getChild("img1"));
  15951. this.img2 = (this.getChild("img2"));
  15952. this.img3 = (this.getChild("img3"));
  15953. this.img4 = (this.getChild("img4"));
  15954. this.img6 = (this.getChild("img6"));
  15955. this.img5 = (this.getChild("img5"));
  15956. this.txt1 = (this.getChild("txt1"));
  15957. this.txt2 = (this.getChild("txt2"));
  15958. this.txt3 = (this.getChild("txt3"));
  15959. this.txt4 = (this.getChild("txt4"));
  15960. this.txt5 = (this.getChild("txt5"));
  15961. this.txt6 = (this.getChild("txt6"));
  15962. }
  15963. }
  15964. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15965. class ui_UITurntable_com9 extends fgui.GComponent {
  15966. static createInstance() {
  15967. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15968. }
  15969. onConstruct() {
  15970. this.n38 = (this.getChild("n38"));
  15971. this.n39 = (this.getChild("n39"));
  15972. }
  15973. }
  15974. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15975. class ui_UITurntable_com10 extends fgui.GComponent {
  15976. static createInstance() {
  15977. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15978. }
  15979. onConstruct() {
  15980. this.n39 = (this.getChild("n39"));
  15981. this.n40 = (this.getChild("n40"));
  15982. this.t0 = this.getTransition("t0");
  15983. }
  15984. }
  15985. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15986. class ui_UITurntable_com11 extends fgui.GComponent {
  15987. static createInstance() {
  15988. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15989. }
  15990. onConstruct() {
  15991. this.n38 = (this.getChild("n38"));
  15992. this.n39 = (this.getChild("n39"));
  15993. this.n40 = (this.getChild("n40"));
  15994. this.t0 = this.getTransition("t0");
  15995. }
  15996. }
  15997. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15998. class ui_UITurntable_com12 extends fgui.GComponent {
  15999. static createInstance() {
  16000. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16001. }
  16002. onConstruct() {
  16003. this.n43 = (this.getChild("n43"));
  16004. this.barNode = (this.getChild("barNode"));
  16005. this.tipsTxt = (this.getChild("tipsTxt"));
  16006. this.n45 = (this.getChild("n45"));
  16007. this.boxBtn = (this.getChild("boxBtn"));
  16008. }
  16009. }
  16010. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16011. class ui_UITurntable_com1 extends fgui.GButton {
  16012. static createInstance() {
  16013. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16014. }
  16015. onConstruct() {
  16016. this.n41 = (this.getChild("n41"));
  16017. this.n42 = (this.getChild("n42"));
  16018. this.t0 = this.getTransition("t0");
  16019. }
  16020. }
  16021. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16022. class ui_UITurntable_com3 extends fgui.GComponent {
  16023. static createInstance() {
  16024. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16025. }
  16026. onConstruct() {
  16027. this.n48 = (this.getChild("n48"));
  16028. this.womanTxt = (this.getChild("womanTxt"));
  16029. this.t0 = this.getTransition("t0");
  16030. }
  16031. }
  16032. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16033. class ui_cancelBtn2 extends fgui.GButton {
  16034. static createInstance() {
  16035. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16036. }
  16037. onConstruct() {
  16038. this.c1 = this.getController("c1");
  16039. this.n0 = (this.getChild("n0"));
  16040. this.n1 = (this.getChild("n1"));
  16041. this.n2 = (this.getChild("n2"));
  16042. this.n3 = (this.getChild("n3"));
  16043. this.n4 = (this.getChild("n4"));
  16044. this.n5 = (this.getChild("n5"));
  16045. this.n6 = (this.getChild("n6"));
  16046. this.n7 = (this.getChild("n7"));
  16047. this.n8 = (this.getChild("n8"));
  16048. this.powerEft = (this.getChild("powerEft"));
  16049. }
  16050. }
  16051. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16052. class ui_shareBtn2 extends fgui.GButton {
  16053. static createInstance() {
  16054. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16055. }
  16056. onConstruct() {
  16057. this.c1 = this.getController("c1");
  16058. this.n2 = (this.getChild("n2"));
  16059. this.n24 = (this.getChild("n24"));
  16060. this.n1 = (this.getChild("n1"));
  16061. this.n3 = (this.getChild("n3"));
  16062. this.n23 = (this.getChild("n23"));
  16063. this.n4 = (this.getChild("n4"));
  16064. this.n5 = (this.getChild("n5"));
  16065. this.n6 = (this.getChild("n6"));
  16066. this.n20 = (this.getChild("n20"));
  16067. this.n21 = (this.getChild("n21"));
  16068. this.n22 = (this.getChild("n22"));
  16069. this.powerEft = (this.getChild("powerEft"));
  16070. }
  16071. }
  16072. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16073. class ui_UIMoney extends fgui.GComponent {
  16074. static createInstance() {
  16075. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16076. }
  16077. onConstruct() {
  16078. this.c1 = this.getController("c1");
  16079. this.n4 = (this.getChild("n4"));
  16080. this.coinImg = (this.getChild("coinImg"));
  16081. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16082. this.coinTxt = (this.getChild("coinTxt"));
  16083. this.n7 = (this.getChild("n7"));
  16084. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16085. this.diamondTxt = (this.getChild("diamondTxt"));
  16086. this.diamondImg = (this.getChild("diamondImg"));
  16087. this.n12 = (this.getChild("n12"));
  16088. this.powerImg = (this.getChild("powerImg"));
  16089. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16090. this.powerTxt = (this.getChild("powerTxt"));
  16091. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16092. }
  16093. }
  16094. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16095. class ui_backBtn extends fgui.GButton {
  16096. static createInstance() {
  16097. return (fgui.UIPackage.createObject("game", "backBtn"));
  16098. }
  16099. onConstruct() {
  16100. this.n0 = (this.getChild("n0"));
  16101. this.t0 = this.getTransition("t0");
  16102. this.t1 = this.getTransition("t1");
  16103. }
  16104. }
  16105. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16106. class ui_MoneyBtn extends fgui.GButton {
  16107. static createInstance() {
  16108. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16109. }
  16110. onConstruct() {
  16111. this.button = this.getController("button");
  16112. this.n0 = (this.getChild("n0"));
  16113. }
  16114. }
  16115. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16116. class ui_UIMoneyBtn extends fgui.GComponent {
  16117. static createInstance() {
  16118. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16119. }
  16120. onConstruct() {
  16121. this.n1 = (this.getChild("n1"));
  16122. this.closeBtn = (this.getChild("closeBtn"));
  16123. }
  16124. }
  16125. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16126. class ui_Component64 extends fgui.GComponent {
  16127. static createInstance() {
  16128. return (fgui.UIPackage.createObject("game", "Component64"));
  16129. }
  16130. onConstruct() {
  16131. this.n57 = (this.getChild("n57"));
  16132. this.n54 = (this.getChild("n54"));
  16133. this.n55 = (this.getChild("n55"));
  16134. this.n56 = (this.getChild("n56"));
  16135. this.t1 = this.getTransition("t1");
  16136. }
  16137. }
  16138. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16139. class ui_Component41_3 extends fgui.GComponent {
  16140. static createInstance() {
  16141. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16142. }
  16143. onConstruct() {
  16144. this.c1 = this.getController("c1");
  16145. this.n0 = (this.getChild("n0"));
  16146. this.n2 = (this.getChild("n2"));
  16147. this.cancelBtn = (this.getChild("cancelBtn"));
  16148. this.videoBtn = (this.getChild("videoBtn"));
  16149. this.n9 = (this.getChild("n9"));
  16150. this.n24 = (this.getChild("n24"));
  16151. this.n27 = (this.getChild("n27"));
  16152. this.titleTxt = (this.getChild("titleTxt"));
  16153. this.n28 = (this.getChild("n28"));
  16154. this.t0 = this.getTransition("t0");
  16155. }
  16156. }
  16157. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16158. class ui_dh_zs_4 extends fgui.GComponent {
  16159. static createInstance() {
  16160. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16161. }
  16162. onConstruct() {
  16163. this.n1 = (this.getChild("n1"));
  16164. this.n2 = (this.getChild("n2"));
  16165. this.n3 = (this.getChild("n3"));
  16166. this.n4 = (this.getChild("n4"));
  16167. this.n5 = (this.getChild("n5"));
  16168. this.n6 = (this.getChild("n6"));
  16169. this.n8 = (this.getChild("n8"));
  16170. this.t0 = this.getTransition("t0");
  16171. }
  16172. }
  16173. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16174. class ui_Component71_1 extends fgui.GButton {
  16175. static createInstance() {
  16176. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16177. }
  16178. onConstruct() {
  16179. this.n17 = (this.getChild("n17"));
  16180. this.t0 = this.getTransition("t0");
  16181. }
  16182. }
  16183. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16184. class ui_Component83 extends fgui.GComponent {
  16185. static createInstance() {
  16186. return (fgui.UIPackage.createObject("game", "Component83"));
  16187. }
  16188. onConstruct() {
  16189. this.c1 = this.getController("c1");
  16190. this.n17 = (this.getChild("n17"));
  16191. this.n19 = (this.getChild("n19"));
  16192. this.n20 = (this.getChild("n20"));
  16193. }
  16194. }
  16195. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16196. class ui_Component84 extends fgui.GComponent {
  16197. static createInstance() {
  16198. return (fgui.UIPackage.createObject("game", "Component84"));
  16199. }
  16200. onConstruct() {
  16201. this.c1 = this.getController("c1");
  16202. this.n4 = (this.getChild("n4"));
  16203. this.n22 = (this.getChild("n22"));
  16204. this.n23 = (this.getChild("n23"));
  16205. this.numTxt = (this.getChild("numTxt"));
  16206. this.n25 = (this.getChild("n25"));
  16207. this.n26 = (this.getChild("n26"));
  16208. }
  16209. }
  16210. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16211. class ui_Component84_1 extends fgui.GComponent {
  16212. static createInstance() {
  16213. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16214. }
  16215. onConstruct() {
  16216. this.c1 = this.getController("c1");
  16217. this.n4 = (this.getChild("n4"));
  16218. this.n22 = (this.getChild("n22"));
  16219. this.n23 = (this.getChild("n23"));
  16220. this.numTxt = (this.getChild("numTxt"));
  16221. this.n25 = (this.getChild("n25"));
  16222. this.n26 = (this.getChild("n26"));
  16223. }
  16224. }
  16225. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16226. class ui_Component85 extends fgui.GComponent {
  16227. static createInstance() {
  16228. return (fgui.UIPackage.createObject("game", "Component85"));
  16229. }
  16230. onConstruct() {
  16231. this.n1 = (this.getChild("n1"));
  16232. this.n6 = (this.getChild("n6"));
  16233. this.n2 = (this.getChild("n2"));
  16234. this.n3 = (this.getChild("n3"));
  16235. this.levelTxt = (this.getChild("levelTxt"));
  16236. this.n10 = (this.getChild("n10"));
  16237. this.n11 = (this.getChild("n11"));
  16238. this.n12 = (this.getChild("n12"));
  16239. this.n13 = (this.getChild("n13"));
  16240. this.n14 = (this.getChild("n14"));
  16241. this.modeNode = (this.getChild("modeNode"));
  16242. this.n18 = (this.getChild("n18"));
  16243. this.conditionTxt = (this.getChild("conditionTxt"));
  16244. this.diamondNode = (this.getChild("diamondNode"));
  16245. this.coinNode = (this.getChild("coinNode"));
  16246. this.startBtn = (this.getChild("startBtn"));
  16247. this.n28 = (this.getChild("n28"));
  16248. this.displayRoot = (this.getChild("displayRoot"));
  16249. this.t0 = this.getTransition("t0");
  16250. }
  16251. }
  16252. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16253. class ui_Component86 extends fgui.GButton {
  16254. static createInstance() {
  16255. return (fgui.UIPackage.createObject("game", "Component86"));
  16256. }
  16257. onConstruct() {
  16258. this.n15 = (this.getChild("n15"));
  16259. this.t0 = this.getTransition("t0");
  16260. }
  16261. }
  16262. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16263. class ui_Component87 extends fgui.GComponent {
  16264. static createInstance() {
  16265. return (fgui.UIPackage.createObject("game", "Component87"));
  16266. }
  16267. onConstruct() {
  16268. this.n66 = (this.getChild("n66"));
  16269. this.myProgress = (this.getChild("myProgress"));
  16270. this.starAni = (this.getChild("starAni"));
  16271. this.hpTxt = (this.getChild("hpTxt"));
  16272. this.n74 = (this.getChild("n74"));
  16273. this.n73 = (this.getChild("n73"));
  16274. this.ballTxt = (this.getChild("ballTxt"));
  16275. this.n76 = (this.getChild("n76"));
  16276. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16277. this.levelTxt = (this.getChild("levelTxt"));
  16278. this.star1 = (this.getChild("star1"));
  16279. this.star2 = (this.getChild("star2"));
  16280. this.star3 = (this.getChild("star3"));
  16281. }
  16282. }
  16283. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16284. class ui_Component88 extends fgui.GProgressBar {
  16285. static createInstance() {
  16286. return (fgui.UIPackage.createObject("game", "Component88"));
  16287. }
  16288. onConstruct() {
  16289. this.n68 = (this.getChild("n68"));
  16290. this.bar = (this.getChild("bar"));
  16291. }
  16292. }
  16293. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16294. class ui_Component89 extends fgui.GComponent {
  16295. static createInstance() {
  16296. return (fgui.UIPackage.createObject("game", "Component89"));
  16297. }
  16298. onConstruct() {
  16299. this.c1 = this.getController("c1");
  16300. this.n71 = (this.getChild("n71"));
  16301. this.n72 = (this.getChild("n72"));
  16302. }
  16303. }
  16304. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16305. class ui_Component90 extends fgui.GComponent {
  16306. static createInstance() {
  16307. return (fgui.UIPackage.createObject("game", "Component90"));
  16308. }
  16309. onConstruct() {
  16310. this.c1 = this.getController("c1");
  16311. this.n64 = (this.getChild("n64"));
  16312. this.n65 = (this.getChild("n65"));
  16313. this.n66 = (this.getChild("n66"));
  16314. this.t0 = this.getTransition("t0");
  16315. }
  16316. }
  16317. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16318. class ui_Component127 extends fgui.GButton {
  16319. static createInstance() {
  16320. return (fgui.UIPackage.createObject("game", "Component127"));
  16321. }
  16322. onConstruct() {
  16323. this.n5 = (this.getChild("n5"));
  16324. }
  16325. }
  16326. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16327. class gameBinder {
  16328. static bindAll() {
  16329. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16330. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16331. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16332. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16333. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16334. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16335. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16336. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16337. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16338. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16339. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16340. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16341. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16342. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16343. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16344. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16345. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16346. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16347. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16348. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16349. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16350. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16351. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16352. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16353. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16354. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16355. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16356. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16357. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16358. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16359. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16360. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16361. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16362. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16363. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16364. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16365. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16366. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16367. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16368. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16369. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16370. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16371. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16372. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16373. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16374. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16375. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16376. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16377. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16378. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16379. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16380. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16381. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16382. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16383. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16384. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16385. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16386. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16387. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16388. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16389. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16390. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16391. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16392. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16393. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16394. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16395. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16396. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16397. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16398. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16399. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16400. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16401. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16402. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16403. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16404. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16405. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16406. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16407. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16408. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16409. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16410. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16411. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16412. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16413. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16414. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16415. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16416. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16417. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16418. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16419. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16420. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16421. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16422. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16423. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16424. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16425. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16426. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16427. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16428. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16429. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16430. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16431. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16432. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16433. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16434. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16435. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16436. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16437. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16438. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16439. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16440. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16441. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16442. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16443. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16444. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16445. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16446. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16447. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16448. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16449. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16450. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16451. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16452. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16453. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16454. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16455. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16456. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16457. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16458. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16459. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16460. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16461. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16462. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16463. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16464. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16465. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16466. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16467. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16468. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16469. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16470. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16471. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16472. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16473. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16474. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16475. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16476. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16477. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16478. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16479. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16480. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16481. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16482. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16483. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16484. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16485. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16486. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16487. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16488. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16489. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16490. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16491. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16492. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16493. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16494. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16495. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16496. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16497. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16498. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16499. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16500. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16501. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16502. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16503. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16504. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16505. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16506. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16507. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16508. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16509. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16510. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16511. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16512. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16513. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16514. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16515. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16516. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16517. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16518. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16519. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16520. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16521. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16522. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16523. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16524. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16525. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16526. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16527. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16528. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16529. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16530. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16531. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16532. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16533. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16534. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16535. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16536. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16537. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16538. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16539. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16540. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16541. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16542. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16543. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16544. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16545. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16546. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16547. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16548. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16549. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16550. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16551. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16552. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16553. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16554. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16555. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16556. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16557. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16558. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16559. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16560. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16561. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16562. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16563. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16564. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16565. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16566. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16567. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16568. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16569. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16570. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16571. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16572. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16573. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16574. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16575. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16576. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16577. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16578. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16579. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16580. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16581. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16582. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16583. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16584. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16585. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16586. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16587. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16588. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16589. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16590. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16591. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16592. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16593. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16594. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16595. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16596. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16597. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16598. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16599. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16600. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16601. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16602. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16603. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16604. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16605. }
  16606. }
  16607. class ui_btn6 extends fgui.GButton {
  16608. static createInstance() {
  16609. return (fgui.UIPackage.createObject("loading", "btn6"));
  16610. }
  16611. onConstruct() {
  16612. this.n6 = (this.getChild("n6"));
  16613. this.n1 = (this.getChild("n1"));
  16614. }
  16615. }
  16616. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16617. class ui_xyItem extends fgui.GComponent {
  16618. static createInstance() {
  16619. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16620. }
  16621. onConstruct() {
  16622. this.xyItem = (this.getChild("xyItem"));
  16623. }
  16624. }
  16625. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16626. class ui_loadinfo extends fgui.GProgressBar {
  16627. static createInstance() {
  16628. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16629. }
  16630. onConstruct() {
  16631. this.bg = (this.getChild("bg"));
  16632. this.bar = (this.getChild("bar"));
  16633. this.title = (this.getChild("title"));
  16634. this.ani = (this.getChild("ani"));
  16635. }
  16636. }
  16637. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16638. class ui_xyNode extends fgui.GComponent {
  16639. static createInstance() {
  16640. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16641. }
  16642. onConstruct() {
  16643. this.n0 = (this.getChild("n0"));
  16644. this.btnYes = (this.getChild("btnYes"));
  16645. this.btnNo = (this.getChild("btnNo"));
  16646. this.btnKnown = (this.getChild("btnKnown"));
  16647. this.btnSure = (this.getChild("btnSure"));
  16648. this.txtWelcom = (this.getChild("txtWelcom"));
  16649. this.txtXy = (this.getChild("txtXy"));
  16650. this.n75 = (this.getChild("n75"));
  16651. this.btnXy1 = (this.getChild("btnXy1"));
  16652. this.btnXy3 = (this.getChild("btnXy3"));
  16653. this.btnXy2 = (this.getChild("btnXy2"));
  16654. this.n74 = (this.getChild("n74"));
  16655. this.xy1 = (this.getChild("xy1"));
  16656. this.txtTitle = (this.getChild("txtTitle"));
  16657. this.btnBack = (this.getChild("btnBack"));
  16658. this.xyList = (this.getChild("xyList"));
  16659. this.xy2 = (this.getChild("xy2"));
  16660. this.xyNode = (this.getChild("xyNode"));
  16661. }
  16662. }
  16663. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16664. class ui_ageNode extends fgui.GComponent {
  16665. static createInstance() {
  16666. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16667. }
  16668. onConstruct() {
  16669. this.n3 = (this.getChild("n3"));
  16670. this.n7 = (this.getChild("n7"));
  16671. this.n4 = (this.getChild("n4"));
  16672. this.btnAge = (this.getChild("btnAge"));
  16673. this.ageNode = (this.getChild("ageNode"));
  16674. }
  16675. }
  16676. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16677. class ui_rnNode extends fgui.GComponent {
  16678. static createInstance() {
  16679. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16680. }
  16681. onConstruct() {
  16682. this.n28 = (this.getChild("n28"));
  16683. this.n30 = (this.getChild("n30"));
  16684. this.n33 = (this.getChild("n33"));
  16685. this.rn1 = (this.getChild("rn1"));
  16686. this.n40 = (this.getChild("n40"));
  16687. this.n41 = (this.getChild("n41"));
  16688. this.rn3 = (this.getChild("rn3"));
  16689. this.n37 = (this.getChild("n37"));
  16690. this.n39 = (this.getChild("n39"));
  16691. this.rn2 = (this.getChild("rn2"));
  16692. this.n47 = (this.getChild("n47"));
  16693. this.n49 = (this.getChild("n49"));
  16694. this.n44 = (this.getChild("n44"));
  16695. this.inputCode = (this.getChild("inputCode"));
  16696. this.inputName = (this.getChild("inputName"));
  16697. this.n48 = (this.getChild("n48"));
  16698. this.n50 = (this.getChild("n50"));
  16699. this.rn4 = (this.getChild("rn4"));
  16700. this.btnCheck = (this.getChild("btnCheck"));
  16701. this.btnExit = (this.getChild("btnExit"));
  16702. this.btnDone = (this.getChild("btnDone"));
  16703. this.rnNode = (this.getChild("rnNode"));
  16704. }
  16705. }
  16706. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16707. class ui_tipNode extends fgui.GComponent {
  16708. static createInstance() {
  16709. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16710. }
  16711. onConstruct() {
  16712. this.bg = (this.getChild("bg"));
  16713. this.n55 = (this.getChild("n55"));
  16714. this.n56 = (this.getChild("n56"));
  16715. this.tipNode = (this.getChild("tipNode"));
  16716. }
  16717. }
  16718. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16719. class ui_fcmNode extends fgui.GComponent {
  16720. static createInstance() {
  16721. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16722. }
  16723. onConstruct() {
  16724. this.n63 = (this.getChild("n63"));
  16725. this.n62 = (this.getChild("n62"));
  16726. this.btnRn = (this.getChild("btnRn"));
  16727. this.n61 = (this.getChild("n61"));
  16728. this.n58 = (this.getChild("n58"));
  16729. this.fcmNode = (this.getChild("fcmNode"));
  16730. }
  16731. }
  16732. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16733. class ui_msgNode extends fgui.GComponent {
  16734. static createInstance() {
  16735. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16736. }
  16737. onConstruct() {
  16738. this.n69 = (this.getChild("n69"));
  16739. this.txtMsg = (this.getChild("txtMsg"));
  16740. this.msgNode = (this.getChild("msgNode"));
  16741. }
  16742. }
  16743. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16744. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16745. static createInstance() {
  16746. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16747. }
  16748. onConstruct() {
  16749. this.n1 = (this.getChild("n1"));
  16750. this.n13 = (this.getChild("n13"));
  16751. this.n14 = (this.getChild("n14"));
  16752. this.n15 = (this.getChild("n15"));
  16753. this.n3 = (this.getChild("n3"));
  16754. this.n4 = (this.getChild("n4"));
  16755. this.n5 = (this.getChild("n5"));
  16756. this.n6 = (this.getChild("n6"));
  16757. this.n7 = (this.getChild("n7"));
  16758. this.n8 = (this.getChild("n8"));
  16759. this.n9 = (this.getChild("n9"));
  16760. this.n10 = (this.getChild("n10"));
  16761. this.n12 = (this.getChild("n12"));
  16762. this.n11 = (this.getChild("n11"));
  16763. this.n16 = (this.getChild("n16"));
  16764. this.n17 = (this.getChild("n17"));
  16765. this.n18 = (this.getChild("n18"));
  16766. this.n20 = (this.getChild("n20"));
  16767. this.n21 = (this.getChild("n21"));
  16768. this.t0 = this.getTransition("t0");
  16769. }
  16770. }
  16771. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16772. class ui_btn5 extends fgui.GButton {
  16773. static createInstance() {
  16774. return (fgui.UIPackage.createObject("loading", "btn5"));
  16775. }
  16776. onConstruct() {
  16777. this.n9 = (this.getChild("n9"));
  16778. this.n1 = (this.getChild("n1"));
  16779. }
  16780. }
  16781. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16782. class ui_UILoading extends fgui.GComponent {
  16783. static createInstance() {
  16784. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16785. }
  16786. onConstruct() {
  16787. this.n12 = (this.getChild("n12"));
  16788. this.loadinfo = (this.getChild("loadinfo"));
  16789. this.n13 = (this.getChild("n13"));
  16790. this.txtLoad = (this.getChild("txtLoad"));
  16791. this.n18 = (this.getChild("n18"));
  16792. }
  16793. }
  16794. ui_UILoading.URL = "ui://37nctnhwphc33";
  16795. class ui_AgeItem extends fgui.GComponent {
  16796. static createInstance() {
  16797. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16798. }
  16799. onConstruct() {
  16800. this.txtAge = (this.getChild("txtAge"));
  16801. }
  16802. }
  16803. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16804. class ui_btn1 extends fgui.GButton {
  16805. static createInstance() {
  16806. return (fgui.UIPackage.createObject("loading", "btn1"));
  16807. }
  16808. onConstruct() {
  16809. this.n6 = (this.getChild("n6"));
  16810. this.n1 = (this.getChild("n1"));
  16811. }
  16812. }
  16813. ui_btn1.URL = "ui://37nctnhwxe622p";
  16814. class ui_btn3 extends fgui.GButton {
  16815. static createInstance() {
  16816. return (fgui.UIPackage.createObject("loading", "btn3"));
  16817. }
  16818. onConstruct() {
  16819. this.n9 = (this.getChild("n9"));
  16820. this.n1 = (this.getChild("n1"));
  16821. }
  16822. }
  16823. ui_btn3.URL = "ui://37nctnhwxe622s";
  16824. class ui_btn2 extends fgui.GButton {
  16825. static createInstance() {
  16826. return (fgui.UIPackage.createObject("loading", "btn2"));
  16827. }
  16828. onConstruct() {
  16829. this.n6 = (this.getChild("n6"));
  16830. this.n1 = (this.getChild("n1"));
  16831. }
  16832. }
  16833. ui_btn2.URL = "ui://37nctnhwxe622t";
  16834. class ui_btnBack extends fgui.GButton {
  16835. static createInstance() {
  16836. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16837. }
  16838. onConstruct() {
  16839. this.n6 = (this.getChild("n6"));
  16840. this.n7 = (this.getChild("n7"));
  16841. }
  16842. }
  16843. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16844. class ui_btnXy1 extends fgui.GButton {
  16845. static createInstance() {
  16846. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16847. }
  16848. onConstruct() {
  16849. this.n1 = (this.getChild("n1"));
  16850. }
  16851. }
  16852. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16853. class ui_btnXy2 extends fgui.GButton {
  16854. static createInstance() {
  16855. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16856. }
  16857. onConstruct() {
  16858. this.n1 = (this.getChild("n1"));
  16859. }
  16860. }
  16861. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16862. class ui_btnXy3 extends fgui.GButton {
  16863. static createInstance() {
  16864. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16865. }
  16866. onConstruct() {
  16867. this.n1 = (this.getChild("n1"));
  16868. }
  16869. }
  16870. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16871. class ui_btn4 extends fgui.GButton {
  16872. static createInstance() {
  16873. return (fgui.UIPackage.createObject("loading", "btn4"));
  16874. }
  16875. onConstruct() {
  16876. this.n9 = (this.getChild("n9"));
  16877. this.n1 = (this.getChild("n1"));
  16878. }
  16879. }
  16880. ui_btn4.URL = "ui://37nctnhwxe622z";
  16881. class loadingBinder {
  16882. static bindAll() {
  16883. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16884. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16885. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16886. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16887. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16888. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16889. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16890. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16891. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16892. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16893. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16894. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16895. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16896. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16897. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16898. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16899. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16900. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16901. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16902. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16903. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16904. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16905. }
  16906. }
  16907. class UIMgr {
  16908. constructor() {
  16909. this._stage = null;
  16910. this._uiList = [];
  16911. this._showList = [];
  16912. this._bindPkgList = [];
  16913. this.uiIndex = 0;
  16914. }
  16915. static get inst() {
  16916. if (UIMgr._inst == null) {
  16917. UIMgr._inst = new UIMgr();
  16918. }
  16919. return UIMgr._inst;
  16920. }
  16921. setStage(s) {
  16922. if (this._stage) {
  16923. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16924. return;
  16925. }
  16926. this._stage = s;
  16927. }
  16928. clearTempData() {
  16929. console.log('zh:clearTempData start');
  16930. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16931. console.log('zh:clearTempData end');
  16932. }
  16933. init() {
  16934. this.setStage(Laya.stage);
  16935. fairygui.UIConfig.defaultFont = "微软雅黑";
  16936. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16937. fairygui.UIConfig.packageFileExtension = "obj";
  16938. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16939. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16940. fairygui.GRoot.inst.width = Laya.stage.width;
  16941. fairygui.GRoot.inst.height = Laya.stage.height;
  16942. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16943. }
  16944. addAllUpdate() {
  16945. this.uiIndex = 0;
  16946. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16947. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16948. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16949. }
  16950. }
  16951. }
  16952. bindFUI(pkgname) {
  16953. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16954. return;
  16955. }
  16956. switch (pkgname) {
  16957. case fguiRes.loading:
  16958. fairygui.UIPackage.addPackage(pkgname);
  16959. loadingBinder.bindAll();
  16960. this._bindPkgList.push(pkgname);
  16961. break;
  16962. case fguiRes.game:
  16963. fairygui.UIPackage.addPackage(pkgname);
  16964. gameBinder.bindAll();
  16965. this._bindPkgList.push(pkgname);
  16966. break;
  16967. default:
  16968. break;
  16969. }
  16970. }
  16971. Show(cls, ...param) {
  16972. let nameStr = cls.uiName;
  16973. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16974. let temp = this._uiList[i];
  16975. let str = temp.className;
  16976. if (str == nameStr) {
  16977. if (temp.isMuti) {
  16978. if (temp.isHide) {
  16979. temp.show(...param);
  16980. this._uiList.splice(i, 1);
  16981. this._uiList.push(temp);
  16982. return temp;
  16983. }
  16984. }
  16985. else {
  16986. temp.show(...param);
  16987. this._uiList.splice(i, 1);
  16988. this._uiList.push(temp);
  16989. return temp;
  16990. }
  16991. }
  16992. }
  16993. let ui = new cls();
  16994. ui.className = nameStr;
  16995. this._showUI(ui, param);
  16996. return ui;
  16997. }
  16998. destroyUI(ui) {
  16999. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17000. let temp = this._uiList[i].className;
  17001. if (temp == ui.className) {
  17002. this._uiList.splice(i, 1);
  17003. break;
  17004. }
  17005. }
  17006. this.checkUIState();
  17007. }
  17008. _showUI(ui, param) {
  17009. this._uiList.push(ui);
  17010. ui.show(...param);
  17011. }
  17012. Hide(uiClass) {
  17013. let ui = this.getUI(uiClass);
  17014. if (ui && !ui.isHide) {
  17015. ui.hide();
  17016. }
  17017. }
  17018. getUI(ui) {
  17019. let nameStr = ui.uiName;
  17020. for (let index = 0; index < this._uiList.length; index++) {
  17021. let temp = this._uiList[index];
  17022. if (temp.className == nameStr) {
  17023. return temp;
  17024. }
  17025. }
  17026. return null;
  17027. }
  17028. isShow(cls) {
  17029. for (var i of this._uiList) {
  17030. if (i instanceof cls) {
  17031. return i.isShowing;
  17032. }
  17033. }
  17034. return false;
  17035. }
  17036. showUINum() {
  17037. let num = 0;
  17038. for (var i of this._uiList) {
  17039. if (i.isShowing) {
  17040. num++;
  17041. }
  17042. }
  17043. return num;
  17044. }
  17045. checkUIState() {
  17046. Laya.timer.clear(this, this._uiCheck);
  17047. Laya.timer.once(400, this, this._uiCheck);
  17048. }
  17049. _uiCheck() {
  17050. let showList = [];
  17051. for (var i of this._uiList) {
  17052. if (!i.isHide) {
  17053. showList.push(i);
  17054. }
  17055. }
  17056. for (let index = 0; index < showList.length; index++) {
  17057. if (index == showList.length - 1) {
  17058. showList[index].checkActive(true);
  17059. }
  17060. else {
  17061. showList[index].checkActive(false);
  17062. }
  17063. }
  17064. }
  17065. showTip(msg, time = 600, size = 30) {
  17066. }
  17067. }
  17068. class UIShowList {
  17069. }
  17070. class SoundMgr {
  17071. constructor() {
  17072. this.soundMax = 4;
  17073. this.isLoad = false;
  17074. this.soundMap = {};
  17075. this.isSound = true;
  17076. this.openShake = true;
  17077. SoundMgr._instance = this;
  17078. }
  17079. static getInstance() {
  17080. if (!this._instance) {
  17081. this._instance = new SoundMgr();
  17082. }
  17083. return this._instance;
  17084. }
  17085. init() {
  17086. console.log('zh:sm init 1');
  17087. Laya.SoundManager.autoReleaseSound = true;
  17088. Laya.SoundManager.autoStopMusic = true;
  17089. Laya.SoundManager.musicVolume = 0.3;
  17090. Laya.SoundManager.soundVolume = 0.5;
  17091. this.musicPlayed = false;
  17092. this.audioUrl = "asset/sound/ogg/";
  17093. console.log('zh:sm init 2');
  17094. console.log('zh:dev type ');
  17095. if (Laya.Browser.onAndroid) {
  17096. console.log('zh:dev type android');
  17097. this.audioUrl = "asset/sound/ogg/";
  17098. this.isLoad = true;
  17099. }
  17100. else {
  17101. console.log('zh:dev type not android');
  17102. this.audioUrl = "asset/sound/mp3/";
  17103. this.isLoad = true;
  17104. }
  17105. }
  17106. onSetting(isS) {
  17107. this.isSound = isS;
  17108. this.mute(!this.isSound);
  17109. }
  17110. clearCount() {
  17111. for (var key in this.soundMap) {
  17112. delete this.soundMap[key];
  17113. }
  17114. }
  17115. playMusic(path, loop = 0) {
  17116. console.log('zh:playMusic 1 PATH=' + path);
  17117. this.musicPath = path;
  17118. if (!this.isLoad) {
  17119. return;
  17120. }
  17121. if (!path || path == "") {
  17122. return;
  17123. }
  17124. if (!this.isSound) {
  17125. return;
  17126. }
  17127. this.musicPlayed = true;
  17128. let url = this.getUrl(path);
  17129. if (!Laya.Browser.onAndroid) {
  17130. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17131. this.play(url, loop);
  17132. }));
  17133. }
  17134. else {
  17135. this.play(url, loop);
  17136. }
  17137. }
  17138. play(url, loop) {
  17139. Laya.SoundManager.playMusic(url, loop);
  17140. }
  17141. getUrl(path) {
  17142. let url = this.audioUrl + path;
  17143. if (Laya.Browser.onAndroid) {
  17144. url += ".ogg";
  17145. }
  17146. else {
  17147. url += ".mp3";
  17148. }
  17149. return url;
  17150. }
  17151. pauseMusic(pause) {
  17152. if (pause) {
  17153. this.mute(true);
  17154. }
  17155. else if (this.isSound)
  17156. this.mute(false);
  17157. }
  17158. stopMusic() {
  17159. Laya.SoundManager.stopMusic();
  17160. if (Moyu.isNeedPlatAudio) {
  17161. Moyu.stopMusic();
  17162. }
  17163. }
  17164. mute(mute) {
  17165. if (Moyu.isNeedPlatAudio) {
  17166. Moyu.pauseMusic(mute);
  17167. }
  17168. else {
  17169. Laya.SoundManager.musicMuted = mute;
  17170. if (!mute && !this.musicPlayed && this.musicPath) {
  17171. this.playMusic(this.musicPath);
  17172. }
  17173. }
  17174. }
  17175. stopSound(path) {
  17176. let url = this.getUrl(path);
  17177. Laya.SoundManager.stopSound(url);
  17178. }
  17179. playSound(path, loop = 1, soundMax = this.soundMax) {
  17180. if (!this.isLoad)
  17181. return;
  17182. if (!this.isSound)
  17183. return;
  17184. if (!path || path == "")
  17185. return;
  17186. let url = this.getUrl(path);
  17187. if (Moyu.isNeedPlatAudio) {
  17188. Moyu.playSound(path, loop == 0);
  17189. }
  17190. else {
  17191. let count = 1;
  17192. if (this.soundMap[path])
  17193. count = this.soundMap[path] + 1;
  17194. if (count > soundMax)
  17195. return;
  17196. this.soundMap[path] = count;
  17197. Laya.SoundManager.playSound(url, loop);
  17198. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17199. }
  17200. }
  17201. removePath(path) {
  17202. if (this.soundMap[path]) {
  17203. let count = this.soundMap[path];
  17204. count--;
  17205. if (count < 1)
  17206. delete this.soundMap[path];
  17207. else
  17208. this.soundMap[path] = count;
  17209. }
  17210. }
  17211. playBtnSound() {
  17212. this.playSound("btn");
  17213. }
  17214. playGetSound() {
  17215. }
  17216. playCloseUISound() {
  17217. }
  17218. }
  17219. SoundMgr._instance = null;
  17220. var Handler$1 = Laya.Handler;
  17221. var EResType;
  17222. (function (EResType) {
  17223. EResType[EResType["none"] = 0] = "none";
  17224. EResType[EResType["nromal"] = 1] = "nromal";
  17225. EResType[EResType["td"] = 2] = "td";
  17226. EResType[EResType["sk"] = 3] = "sk";
  17227. })(EResType || (EResType = {}));
  17228. class CResLoader {
  17229. constructor(doneCall, proCall) {
  17230. this.completrCall = doneCall;
  17231. this.progressCall = proCall;
  17232. this.progressHander = new Handler$1(this, this.onProgress);
  17233. this.tdResMap = {};
  17234. }
  17235. load(resList) {
  17236. this.resCount = 0;
  17237. this.loadCount = 0;
  17238. for (let i = 0; i < resList.length; i++) {
  17239. let path = resList[i];
  17240. if (!path)
  17241. continue;
  17242. this.resCount++;
  17243. let type = this.getResType(path);
  17244. if (type == EResType.nromal)
  17245. this.loadNromal(path);
  17246. else if (type == EResType.td)
  17247. this.loadTd(path);
  17248. }
  17249. }
  17250. getRes(path) {
  17251. let type = this.getResType(path);
  17252. if (type == EResType.nromal)
  17253. return Laya.loader.getRes(path);
  17254. else if (type == EResType.td) {
  17255. let res = this.tdResMap[path];
  17256. if (res)
  17257. return res.clone();
  17258. return null;
  17259. }
  17260. }
  17261. destroy() {
  17262. this.progressHander.clear();
  17263. this.progressHander = null;
  17264. }
  17265. clearRes(path) {
  17266. let type = this.getResType(path);
  17267. if (type == EResType.nromal)
  17268. Laya.loader.clearRes(path);
  17269. else if (type == EResType.td) {
  17270. let obj = this.tdResMap[path];
  17271. if (obj)
  17272. obj.destroy();
  17273. delete this.tdResMap[path];
  17274. }
  17275. }
  17276. getResType(path) {
  17277. let exs = this.getExtension(path);
  17278. if (exs == "sk")
  17279. return EResType.sk;
  17280. if (exs == "ls" || exs == "lh" || exs == "lm")
  17281. return EResType.td;
  17282. else
  17283. return EResType.nromal;
  17284. }
  17285. getExtension(res) {
  17286. var index = res.lastIndexOf(".");
  17287. return res.substr(index + 1);
  17288. }
  17289. loadNromal(path) {
  17290. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17291. if (res) {
  17292. this.onLoad();
  17293. }
  17294. else
  17295. console.log("load res fail:" + path);
  17296. }), this.progressHander);
  17297. }
  17298. loadSk() {
  17299. }
  17300. loadTd(path) {
  17301. if (this.tdResMap[path]) {
  17302. this.onLoad();
  17303. return;
  17304. }
  17305. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17306. if (res) {
  17307. this.tdResMap[path] = res;
  17308. this.onLoad();
  17309. }
  17310. else
  17311. console.log("load res fail:" + path);
  17312. }));
  17313. }
  17314. onLoad() {
  17315. this.loadCount++;
  17316. this.onProgress(1);
  17317. if (this.loadCount >= this.resCount) {
  17318. this.completrCall.run();
  17319. }
  17320. }
  17321. onProgress(pro) {
  17322. let progress = (this.loadCount + pro) / this.resCount;
  17323. this.progressCall.runWith(progress);
  17324. }
  17325. }
  17326. var Handler$2 = Laya.Handler;
  17327. class ResInfo {
  17328. constructor() {
  17329. this.index = 0;
  17330. }
  17331. }
  17332. class ResMgr {
  17333. constructor() {
  17334. this.resList = [];
  17335. this.doneList = [];
  17336. this.resMap = {};
  17337. this.currentLoad = null;
  17338. this.completeHandler = new Handler$2(this, this.onComplete);
  17339. this.progressHandler = new Handler$2(this, this.onProgress);
  17340. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17341. }
  17342. static getInstance() {
  17343. if (ResMgr._instance == null) {
  17344. ResMgr._instance = new ResMgr();
  17345. }
  17346. return ResMgr._instance;
  17347. }
  17348. loadList(list, completeHandler, progressHandler) {
  17349. if (list.length < 1) {
  17350. completeHandler.run();
  17351. return;
  17352. }
  17353. let info = this.getResInfo();
  17354. info.resList = list;
  17355. info.completeHandler = completeHandler;
  17356. info.progressHandler = progressHandler;
  17357. this.resList.push(info);
  17358. this.startLoad();
  17359. }
  17360. loadFguiRes(list, completeHandler, progressHandler) {
  17361. Laya.loader.load(list, completeHandler, progressHandler);
  17362. }
  17363. loadAny(list, completeHandler, progressHandler) {
  17364. Laya.loader.load(list, completeHandler, progressHandler);
  17365. }
  17366. load(path, completeHandler, progressHandler) {
  17367. let count = this.resMap[path];
  17368. if (count && count > 0) {
  17369. if (completeHandler)
  17370. completeHandler.run();
  17371. }
  17372. else
  17373. this.loadList([path], completeHandler, progressHandler);
  17374. }
  17375. getRes(path) {
  17376. let res = this.resMap[path];
  17377. if (!res)
  17378. this.showLog("资源不存在:" + path);
  17379. else
  17380. return this.loader.getRes(path);
  17381. }
  17382. clearList(list, force = false) {
  17383. if (!list || list.length < 1)
  17384. return;
  17385. let cr = () => {
  17386. for (const k in list) {
  17387. let v = list[k];
  17388. if (!v)
  17389. continue;
  17390. if (force) {
  17391. this.loader.clearRes(v);
  17392. delete this.resMap[v];
  17393. }
  17394. else {
  17395. let count = this.resMap[v];
  17396. if (count && count > 1) {
  17397. count--;
  17398. this.resMap[v] = count;
  17399. }
  17400. else {
  17401. this.loader.clearRes(v);
  17402. delete this.resMap[v];
  17403. }
  17404. }
  17405. }
  17406. if (!window.hasOwnProperty("ks"))
  17407. Laya.Resource.destroyUnusedResources();
  17408. };
  17409. Laya.timer.clearAll(this);
  17410. Laya.timer.once(2000, this, cr);
  17411. }
  17412. clear3D() {
  17413. for (const k in this.loader.tdResMap) {
  17414. this.loader.clearRes(k);
  17415. if (this.resMap[k])
  17416. delete this.resMap[k];
  17417. }
  17418. if (!window.hasOwnProperty("ks"))
  17419. Laya.Resource.destroyUnusedResources();
  17420. }
  17421. clear(path, force = false) {
  17422. this.clearList([path], force);
  17423. }
  17424. getResInfo() {
  17425. if (this.doneList.length > 0)
  17426. return this.doneList.pop();
  17427. else
  17428. return new ResInfo();
  17429. }
  17430. startLoad() {
  17431. if (this.currentLoad)
  17432. return;
  17433. this.currentLoad = this.resList.pop();
  17434. if (this.currentLoad) {
  17435. this.loader.load(this.currentLoad.resList);
  17436. }
  17437. }
  17438. onComplete() {
  17439. if (!this.currentLoad)
  17440. return;
  17441. for (const k in this.currentLoad.resList) {
  17442. let v = this.currentLoad.resList[k];
  17443. let count = this.resMap[v];
  17444. if (count)
  17445. count++;
  17446. else
  17447. count = 1;
  17448. this.resMap[v] = count;
  17449. }
  17450. if (this.currentLoad.completeHandler)
  17451. this.currentLoad.completeHandler.run();
  17452. this.doneList.push(this.currentLoad);
  17453. this.currentLoad = null;
  17454. this.startLoad();
  17455. }
  17456. onProgress(pro) {
  17457. if (!this.currentLoad)
  17458. return;
  17459. if (this.currentLoad.progressHandler)
  17460. this.currentLoad.progressHandler.runWith(pro);
  17461. }
  17462. showLog(str, ...args) {
  17463. console.log("[ResLoader] " + str);
  17464. }
  17465. }
  17466. ResMgr._instance = null;
  17467. class EventMgr extends Laya.EventDispatcher {
  17468. }
  17469. let eventMgr = new EventMgr();
  17470. /*! *****************************************************************************
  17471. Copyright (c) Microsoft Corporation. All rights reserved.
  17472. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17473. this file except in compliance with the License. You may obtain a copy of the
  17474. License at http://www.apache.org/licenses/LICENSE-2.0
  17475. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17476. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17477. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17478. MERCHANTABLITY OR NON-INFRINGEMENT.
  17479. See the Apache Version 2.0 License for specific language governing permissions
  17480. and limitations under the License.
  17481. ***************************************************************************** */
  17482. /* global Reflect, Promise */
  17483. var extendStatics = function(d, b) {
  17484. extendStatics = Object.setPrototypeOf ||
  17485. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17486. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17487. return extendStatics(d, b);
  17488. };
  17489. function __extends(d, b) {
  17490. extendStatics(d, b);
  17491. function __() { this.constructor = d; }
  17492. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17493. }
  17494. var __assign = function() {
  17495. __assign = Object.assign || function __assign(t) {
  17496. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17497. s = arguments[i];
  17498. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17499. }
  17500. return t;
  17501. };
  17502. return __assign.apply(this, arguments);
  17503. };
  17504. function __rest(s, e) {
  17505. var t = {};
  17506. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17507. t[p] = s[p];
  17508. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17509. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17510. t[p[i]] = s[p[i]];
  17511. return t;
  17512. }
  17513. function __decorate(decorators, target, key, desc) {
  17514. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17515. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17516. 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;
  17517. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17518. }
  17519. function __param(paramIndex, decorator) {
  17520. return function (target, key) { decorator(target, key, paramIndex); }
  17521. }
  17522. function __metadata(metadataKey, metadataValue) {
  17523. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17524. }
  17525. function __awaiter(thisArg, _arguments, P, generator) {
  17526. return new (P || (P = Promise))(function (resolve, reject) {
  17527. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17528. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17529. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17530. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17531. });
  17532. }
  17533. function __generator(thisArg, body) {
  17534. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17535. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17536. function verb(n) { return function (v) { return step([n, v]); }; }
  17537. function step(op) {
  17538. if (f) throw new TypeError("Generator is already executing.");
  17539. while (_) try {
  17540. 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;
  17541. if (y = 0, t) op = [op[0] & 2, t.value];
  17542. switch (op[0]) {
  17543. case 0: case 1: t = op; break;
  17544. case 4: _.label++; return { value: op[1], done: false };
  17545. case 5: _.label++; y = op[1]; op = [0]; continue;
  17546. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17547. default:
  17548. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17549. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17550. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17551. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17552. if (t[2]) _.ops.pop();
  17553. _.trys.pop(); continue;
  17554. }
  17555. op = body.call(thisArg, _);
  17556. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17557. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17558. }
  17559. }
  17560. function __exportStar(m, exports) {
  17561. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17562. }
  17563. function __values(o) {
  17564. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17565. if (m) return m.call(o);
  17566. return {
  17567. next: function () {
  17568. if (o && i >= o.length) o = void 0;
  17569. return { value: o && o[i++], done: !o };
  17570. }
  17571. };
  17572. }
  17573. function __read(o, n) {
  17574. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17575. if (!m) return o;
  17576. var i = m.call(o), r, ar = [], e;
  17577. try {
  17578. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17579. }
  17580. catch (error) { e = { error: error }; }
  17581. finally {
  17582. try {
  17583. if (r && !r.done && (m = i["return"])) m.call(i);
  17584. }
  17585. finally { if (e) throw e.error; }
  17586. }
  17587. return ar;
  17588. }
  17589. function __spread() {
  17590. for (var ar = [], i = 0; i < arguments.length; i++)
  17591. ar = ar.concat(__read(arguments[i]));
  17592. return ar;
  17593. }
  17594. function __await(v) {
  17595. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17596. }
  17597. function __asyncGenerator(thisArg, _arguments, generator) {
  17598. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17599. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17600. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17601. 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); }); }; }
  17602. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17603. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17604. function fulfill(value) { resume("next", value); }
  17605. function reject(value) { resume("throw", value); }
  17606. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17607. }
  17608. function __asyncDelegator(o) {
  17609. var i, p;
  17610. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17611. 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; }
  17612. }
  17613. function __asyncValues(o) {
  17614. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17615. var m = o[Symbol.asyncIterator], i;
  17616. 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);
  17617. 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); }); }; }
  17618. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17619. }
  17620. function __makeTemplateObject(cooked, raw) {
  17621. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17622. return cooked;
  17623. };
  17624. function __importStar(mod) {
  17625. if (mod && mod.__esModule) return mod;
  17626. var result = {};
  17627. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17628. result.default = mod;
  17629. return result;
  17630. }
  17631. function __importDefault(mod) {
  17632. return (mod && mod.__esModule) ? mod : { default: mod };
  17633. }
  17634. class CustomAlert {
  17635. static show(title, content, buttons) {
  17636. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17637. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17638. return;
  17639. }
  17640. const bg = new Laya.Box();
  17641. bg.alpha = 0;
  17642. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17643. Laya.stage.addChild(bg);
  17644. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17645. const panel = new Laya.Box();
  17646. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17647. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17648. bg.addChild(panel);
  17649. const titleText = new Laya.Text();
  17650. titleText.text = title;
  17651. titleText.fontSize = 32;
  17652. titleText.color = "#333333";
  17653. titleText.bold = true;
  17654. titleText.pos(20, 20);
  17655. titleText.width = 360;
  17656. titleText.align = "center";
  17657. panel.addChild(titleText);
  17658. const contentText = new Laya.Text();
  17659. contentText.text = content;
  17660. contentText.fontSize = 21;
  17661. contentText.color = "#555555";
  17662. contentText.pos(20, 70);
  17663. contentText.width = 360;
  17664. contentText.wordWrap = true;
  17665. contentText.align = "center";
  17666. panel.addChild(contentText);
  17667. const buttonContainer = new Laya.Box();
  17668. buttonContainer.pos(20, 160);
  17669. panel.addChild(buttonContainer);
  17670. const btnWidth = 120;
  17671. const spacing = 30;
  17672. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17673. buttons.forEach((btn, index) => {
  17674. const button = new Laya.Button();
  17675. button.label = btn.label;
  17676. button.size(btnWidth, 40);
  17677. button.labelSize = 22;
  17678. button.pos(index * (btnWidth + spacing), 0);
  17679. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17680. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17681. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17682. button.alpha = 0.9;
  17683. });
  17684. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17685. button.alpha = 1;
  17686. });
  17687. button.on(Laya.Event.CLICK, this, () => {
  17688. btn.handler();
  17689. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17690. bg.removeSelf();
  17691. }));
  17692. });
  17693. buttonContainer.addChild(button);
  17694. });
  17695. buttonContainer.x = (panel.width - totalWidth) / 2;
  17696. }
  17697. }
  17698. class ConfigMgr {
  17699. constructor() {
  17700. this.httpReqCount = 4;
  17701. this.httpReqOkCount = 0;
  17702. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17703. try {
  17704. this.httpReqOkCount = 0;
  17705. let reqData = xGame.httpMgr.getReqData();
  17706. console.log('zh:第1个请求getClassicCfg');
  17707. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17708. this.classicCfg = classicCfg;
  17709. this.httpReqOkCount++;
  17710. console.log('zh:第2个请求getLevelCfg');
  17711. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17712. this.levelCfg = levelCfg;
  17713. this.httpReqOkCount++;
  17714. console.log('zh:第3个请求 getPlaceBallCfg');
  17715. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17716. this.placeBallCfg = placeBallCfg;
  17717. this.httpReqOkCount++;
  17718. console.log('zh:第4个请求 npc');
  17719. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17720. this.npcJson = npc.Data;
  17721. this.httpReqOkCount++;
  17722. console.log('zh:所有配置加载完成');
  17723. }
  17724. catch (error) {
  17725. console.error('❌请求失败:', error);
  17726. Laya.timer.once(5000, this, () => {
  17727. let retryCount = 0;
  17728. const maxRetries = 3;
  17729. const tryFetchConfig = () => {
  17730. try {
  17731. xGame.cfgMgr.getConfigFromServer();
  17732. }
  17733. catch (error) {
  17734. if (retryCount < maxRetries) {
  17735. retryCount++;
  17736. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17737. Laya.timer.once(5000, this, tryFetchConfig);
  17738. }
  17739. else {
  17740. console.error("❌ 达到最大重试次数,配置获取失败");
  17741. }
  17742. }
  17743. };
  17744. tryFetchConfig();
  17745. });
  17746. }
  17747. finally {
  17748. if (this.httpReqCount > this.httpReqOkCount) {
  17749. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17750. {
  17751. label: "Okay", handler: () => {
  17752. console.log("zh:好的知道了");
  17753. JSBridgeUtils.instance.exitAndCloseGame();
  17754. }
  17755. }
  17756. ]);
  17757. }
  17758. }
  17759. });
  17760. this.sendPostAsync = (action, reqData) => {
  17761. return new Promise((resolve, reject) => {
  17762. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17763. try {
  17764. let code = res.code;
  17765. if (code == 200) {
  17766. const parsedData = JSON.parse(res.msg);
  17767. resolve(parsedData);
  17768. }
  17769. else {
  17770. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17771. reject(new Error(`Request failed with code: ${code}`));
  17772. }
  17773. }
  17774. catch (error) {
  17775. console.error(`ERROR=${error}`);
  17776. alert("Please check your network connection.");
  17777. reject(error);
  17778. }
  17779. finally {
  17780. console.log(`zh:${action}的请求处理完毕`);
  17781. }
  17782. });
  17783. });
  17784. };
  17785. }
  17786. static getInstance() {
  17787. if (!this._instance) {
  17788. this._instance = new ConfigMgr();
  17789. }
  17790. return this._instance;
  17791. }
  17792. init() {
  17793. this.getConfigFromServer();
  17794. }
  17795. test() {
  17796. let reqData = xGame.httpMgr.getReqData();
  17797. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17798. console.log('zh:1s');
  17799. try {
  17800. let code = res.code;
  17801. let data = res.data;
  17802. if (code == 200) {
  17803. const parsedData = JSON.parse(data);
  17804. this.classicCfg = parsedData;
  17805. }
  17806. else {
  17807. console.log('zh:res = ' + JSON.stringify(res));
  17808. }
  17809. }
  17810. catch (error) {
  17811. console.log('error=' + error);
  17812. alert("Please check your network connection.");
  17813. }
  17814. finally {
  17815. console.log('zh:1');
  17816. }
  17817. });
  17818. }
  17819. getUserInfoByIndex(index) {
  17820. return this.npcJson[index];
  17821. }
  17822. getRandomUserInfo() {
  17823. let index = xGame.tools.random(0, this.npcJson.length);
  17824. let rs = this.npcJson[index];
  17825. return rs;
  17826. }
  17827. getMaxBigMoveLength() {
  17828. return Object.keys(this.levelCfg).length;
  17829. }
  17830. getBigMoveLevelByIndex(index) {
  17831. let cfg = this.levelCfg;
  17832. cfg = cfg[index];
  17833. return cfg;
  17834. }
  17835. getRandomClassicLevel() {
  17836. let cfg = this.classicCfg;
  17837. let num = Object.keys(cfg).length;
  17838. let rand = xGame.common.randomNum(1, num);
  17839. return cfg[rand];
  17840. }
  17841. getPlaceBallByLevel(level) {
  17842. return this.placeBallCfg[level];
  17843. }
  17844. getMaxPlaceBall() {
  17845. return Object.keys(this.placeBallCfg).length;
  17846. }
  17847. }
  17848. class PoolD3Mgr {
  17849. constructor() {
  17850. this.pool = {};
  17851. }
  17852. static get ins() {
  17853. return this._ins || (this._ins = new PoolD3Mgr);
  17854. }
  17855. createList(key, prefab, parent) {
  17856. if (!this.pool[key]) {
  17857. this.pool[key] = {};
  17858. this.pool[key].prefab = prefab;
  17859. this.pool[key].list = [];
  17860. this.pool[key].parent = parent;
  17861. }
  17862. }
  17863. getItem(key) {
  17864. if (!this.pool[key]) {
  17865. return;
  17866. }
  17867. let temp;
  17868. if (this.pool[key].list.length > 0) {
  17869. temp = this.pool[key].list.pop();
  17870. }
  17871. else {
  17872. temp = this.pool[key].prefab.clone();
  17873. if (this.pool[key].parent) {
  17874. this.pool[key].parent.addChild(temp);
  17875. }
  17876. }
  17877. temp.active = true;
  17878. return temp;
  17879. }
  17880. putItem(key, obj) {
  17881. if (!this.pool[key]) {
  17882. return;
  17883. }
  17884. obj.active = false;
  17885. this.pool[key].list.push(obj);
  17886. }
  17887. }
  17888. let context$1 = context;
  17889. let uiMgr = UIMgr.inst;
  17890. let soundMgr = SoundMgr.getInstance();
  17891. let resMgr = ResMgr.getInstance();
  17892. let httpMgr = HttpMgr.getInstance();
  17893. let common = Common.getInstance();
  17894. let cfgMgr = ConfigMgr.getInstance();
  17895. let poolD3Mgr = PoolD3Mgr.ins;
  17896. let d3TexUrl = "res/d3Res/";
  17897. let d3ModeUrl = "res/unityRes/";
  17898. function setStageSize(view) {
  17899. if (view.width) {
  17900. view.width = Laya.stage.width;
  17901. view.height = Laya.stage.height;
  17902. }
  17903. }
  17904. function filledBg(view) {
  17905. let wh = Laya.stage.height / Laya.stage.width;
  17906. if (wh > 16 / 9) {
  17907. view.height = Laya.stage.height;
  17908. view.width = Laya.stage.height / 1334 * 750;
  17909. }
  17910. else {
  17911. view.width = Laya.stage.width;
  17912. view.height = Laya.stage.width / 750 * 1334;
  17913. }
  17914. }
  17915. function setNotch(view) {
  17916. if (view.height) {
  17917. view.y += context$1.notchHeight;
  17918. }
  17919. }
  17920. function showTip(str) {
  17921. uiMgr.Show(UIMsg, str);
  17922. }
  17923. function log(...args) {
  17924. console.log(args);
  17925. }
  17926. let xGame = {
  17927. context: context$1,
  17928. eventMgr,
  17929. resMgr,
  17930. uiMgr,
  17931. soundMgr,
  17932. define,
  17933. tools,
  17934. httpMgr,
  17935. d3TexUrl,
  17936. d3ModeUrl,
  17937. common,
  17938. cfgMgr,
  17939. poolD3Mgr,
  17940. setStageSize,
  17941. filledBg,
  17942. setNotch,
  17943. showTip,
  17944. log,
  17945. };
  17946. window["xGame"] = xGame;
  17947. let dataName = 'tBall_';
  17948. class UserData {
  17949. constructor() {
  17950. this.userId = "";
  17951. this.isAgree = false;
  17952. this.coinNum = 0;
  17953. this.gemNum = 0;
  17954. this.sound = true;
  17955. this.vibration = true;
  17956. this.currentDate = 0;
  17957. this.createTime = 0;
  17958. this.awardTime = 0;
  17959. this.roleId = 1;
  17960. this.roleList = [];
  17961. this.roleAds = [];
  17962. this.dressId = 101;
  17963. this.itemId = 201;
  17964. this.bigSkills = [1, 1, 1, 1, 1];
  17965. this.coin = 4000;
  17966. this.diamond = 0;
  17967. this.skillSuccessTimes = 0;
  17968. this.skillGuide = 0;
  17969. this.skillAccTimes = 0;
  17970. this.placeBallData = [];
  17971. this.shareDiamondTimes = 0;
  17972. this.dailyVideoShareTimes = 0;
  17973. this.secretary = [1, 0];
  17974. this.curSecretary = 0;
  17975. this.ballRod = [1, 0, 0, 0, 0, 1];
  17976. this.curBallRod = 5;
  17977. this.signData = 0;
  17978. this.signTime = 0;
  17979. this.drawTimes = 0;
  17980. this.drawAwardTimes = 0;
  17981. this.dailyfreeDrawTimes = 1;
  17982. this.power = 5;
  17983. this.powerTime = 0;
  17984. this.challengeTimes = 0;
  17985. this.extraSign = 0;
  17986. this.classicTimes = 0;
  17987. this.guideHelpLine = 0;
  17988. this.newUser = true;
  17989. this.rootBallFoul = 0;
  17990. this.timeoutFoul = 0;
  17991. this.roleList = [1];
  17992. }
  17993. saveData() {
  17994. let data = {};
  17995. for (let k in this) {
  17996. data[k.toString()] = this[k];
  17997. }
  17998. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17999. }
  18000. getData() {
  18001. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18002. if (ld) {
  18003. let localData = JSON.parse(ld);
  18004. if (localData) {
  18005. for (let k in this) {
  18006. let key = k.toString();
  18007. let data = localData[key];
  18008. if (data != undefined) {
  18009. this[k] = data;
  18010. }
  18011. }
  18012. }
  18013. }
  18014. }
  18015. }
  18016. class ItemData {
  18017. constructor() {
  18018. this.itemList = {};
  18019. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18020. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18021. }
  18022. saveData() {
  18023. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18024. }
  18025. getData() {
  18026. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18027. if (ld) {
  18028. let localData = JSON.parse(ld);
  18029. if (localData) {
  18030. this.itemList = localData;
  18031. }
  18032. }
  18033. }
  18034. }
  18035. class GameData {
  18036. constructor() {
  18037. this.curLevel = 0;
  18038. this.gameType = 1;
  18039. this.signIdx = 0;
  18040. this.signMax = 0;
  18041. this.rotaryTime = 0;
  18042. this.rotaryCount = 0;
  18043. this.rotaryList = [];
  18044. this.diyCount = 3;
  18045. this.awardIdx = 0;
  18046. this.shareNum = 2;
  18047. this.rankWeek = 0;
  18048. this.rankScore = 0;
  18049. this.gameCount = 0;
  18050. this.trySkill = -1;
  18051. this.tryTime = 0;
  18052. }
  18053. saveData() {
  18054. let data = {};
  18055. for (let k in this) {
  18056. data[k.toString()] = this[k];
  18057. }
  18058. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18059. }
  18060. getData() {
  18061. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18062. if (ld) {
  18063. let localData = JSON.parse(ld);
  18064. if (localData) {
  18065. for (let k in this) {
  18066. let key = k.toString();
  18067. let data = localData[key];
  18068. if (data != undefined) {
  18069. this[k] = data;
  18070. }
  18071. }
  18072. }
  18073. }
  18074. }
  18075. }
  18076. class Diy2025GameData {
  18077. constructor() {
  18078. this.challengeMode_overLev = 0;
  18079. this.xszyForClassic = false;
  18080. this.xszyForChallenge = false;
  18081. }
  18082. saveData() {
  18083. let data = {};
  18084. for (let k in this) {
  18085. data[k.toString()] = this[k];
  18086. }
  18087. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18088. }
  18089. getData() {
  18090. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18091. if (ld) {
  18092. let localData = JSON.parse(ld);
  18093. if (localData) {
  18094. for (let k in this) {
  18095. let key = k.toString();
  18096. let data = localData[key];
  18097. if (data != undefined) {
  18098. this[k] = data;
  18099. }
  18100. }
  18101. }
  18102. }
  18103. }
  18104. }
  18105. class DataMgr {
  18106. static Init() {
  18107. this.userData = new UserData();
  18108. this.gameData = new GameData();
  18109. this.itemData = new ItemData();
  18110. this.diyGameData = new Diy2025GameData();
  18111. this.userData.getData();
  18112. this.gameData.getData();
  18113. this.itemData.getData();
  18114. this.diyGameData.getData();
  18115. this.roleId = this.userData.roleId;
  18116. this.resetUse();
  18117. }
  18118. static isNewDay() {
  18119. Moyu.isNewDay(this, (isnew) => {
  18120. xGame.common.isNewDay = isnew;
  18121. if (!isnew)
  18122. return;
  18123. DataMgr.setShareDiamondTimes(0, false);
  18124. DataMgr.setDailyVideoShareTimes(0, false);
  18125. DataMgr.setDailyfreeDrawTimes(1);
  18126. DataMgr.setExtraSign(0);
  18127. });
  18128. }
  18129. static deletData() {
  18130. Laya.LocalStorage.clear();
  18131. }
  18132. static upRankData() {
  18133. let num = xGame.common.getAllStarNum();
  18134. if (num > 0)
  18135. Moyu.upRankData(xGame.common.curRankID, num);
  18136. }
  18137. static addItem(id, count = 1) {
  18138. let v = this.itemData.itemList[id];
  18139. if (!v)
  18140. v = { id: id, count: count, adnum: 0, active: true };
  18141. else {
  18142. if (v.active) {
  18143. v.count += count;
  18144. }
  18145. else {
  18146. v.count = count;
  18147. v.active = true;
  18148. }
  18149. }
  18150. this.itemData.itemList[id] = v;
  18151. xGame.soundMgr.playGetSound();
  18152. this.saveItemData();
  18153. }
  18154. static hasItem(id) {
  18155. let v = this.itemData.itemList[id];
  18156. if (v && v.active)
  18157. return true;
  18158. return false;
  18159. }
  18160. static getItem(id) {
  18161. let v = this.itemData.itemList[id];
  18162. return v;
  18163. }
  18164. static getItemCount(id) {
  18165. let v = this.itemData.itemList[id];
  18166. if (v && v.active)
  18167. return v.count;
  18168. return 0;
  18169. }
  18170. static getItemAd(id) {
  18171. let v = this.itemData.itemList[id];
  18172. if (v) {
  18173. return v.adnum;
  18174. }
  18175. return 0;
  18176. }
  18177. static onItemAd(id, num = 1) {
  18178. let v = this.itemData.itemList[id];
  18179. if (!v)
  18180. v = { id: id, count: 1, adnum: num, active: false };
  18181. else
  18182. v.adnum += num;
  18183. this.itemData.itemList[id] = v;
  18184. this.saveItemData();
  18185. }
  18186. static costItem(id, count) {
  18187. let v = this.itemData.itemList[id];
  18188. if (v && v.active) {
  18189. if (v.count < count)
  18190. return false;
  18191. else {
  18192. v.count -= count;
  18193. this.itemData.itemList[id] = v;
  18194. return true;
  18195. }
  18196. }
  18197. return false;
  18198. }
  18199. static resetUse() {
  18200. this.dressId = this.userData.dressId;
  18201. this.itemId = this.userData.itemId;
  18202. }
  18203. static passLevel() {
  18204. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18205. this.gameData.curLevel++;
  18206. this.curLevel = this.gameData.curLevel;
  18207. this.saveGameData();
  18208. }
  18209. static useRole(id) {
  18210. this.roleId = id;
  18211. if (this.hasRole(id)) {
  18212. this.userData.roleId = id;
  18213. this.saveUserData();
  18214. }
  18215. }
  18216. static addRole(id) {
  18217. if (this.hasRole(id))
  18218. return;
  18219. this.userData.roleList.push(id);
  18220. this.saveUserData();
  18221. }
  18222. static hasRole(id) {
  18223. return this.userData.roleList.indexOf(id) >= 0;
  18224. }
  18225. static gemEnough(num) {
  18226. return this.userData.gemNum >= num;
  18227. }
  18228. static roleHasAd(id) {
  18229. let count = this.userData.roleAds[id];
  18230. if (count != undefined && count >= 0)
  18231. return true;
  18232. else
  18233. return false;
  18234. }
  18235. static saveUserData(time = 500, event, arg) {
  18236. if (this.userSaving)
  18237. return;
  18238. this.userSaving = true;
  18239. Laya.timer.once(time, this, () => {
  18240. this.userSaving = false;
  18241. this.userData.saveData();
  18242. if (event)
  18243. xGame.eventMgr.event(event, arg);
  18244. });
  18245. }
  18246. static updateUserNickName(loginUserName) {
  18247. let kyeStr = 'moyudata_180';
  18248. console.log('zh:################### kyeStr=' + kyeStr);
  18249. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18250. if (moyudata) {
  18251. const obj = JSON.parse(moyudata);
  18252. obj.nickName = loginUserName;
  18253. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18254. console.log('zh:################### updateUserNickName');
  18255. }
  18256. }
  18257. static saveGameData() {
  18258. if (this.gameSaving)
  18259. return;
  18260. this.gameSaving = true;
  18261. Laya.timer.once(1000, this, () => {
  18262. this.gameSaving = false;
  18263. this.gameData.saveData();
  18264. });
  18265. }
  18266. static saveItemData() {
  18267. let fun = () => {
  18268. this.itemData.saveData();
  18269. };
  18270. Laya.timer.clear(this, fun);
  18271. Laya.timer.once(500, this, fun);
  18272. }
  18273. static saveData() {
  18274. this.saveUserData();
  18275. this.saveGameData();
  18276. }
  18277. static getBigSkillList() {
  18278. return this.userData.bigSkills;
  18279. }
  18280. static getBigSkillByIndex(index) {
  18281. return this.userData.bigSkills[index];
  18282. }
  18283. static setBigSkill(index, val, addUp = true) {
  18284. if (addUp) {
  18285. this.userData.bigSkills[index] += val;
  18286. }
  18287. else {
  18288. this.userData.bigSkills[index] = val;
  18289. }
  18290. this.saveUserData();
  18291. }
  18292. static coinEnough(need) {
  18293. if (typeof need != "number") {
  18294. console.error("金币格式错误");
  18295. return;
  18296. }
  18297. return this.userData.coin >= need;
  18298. }
  18299. static setCoin(val) {
  18300. if (typeof val != "number") {
  18301. return;
  18302. }
  18303. this.userData.coin += val;
  18304. this.saveUserData();
  18305. xGame.eventMgr.event(COIN_CHANGE);
  18306. this.updateUserInfo2Server("jb");
  18307. }
  18308. static setCoinFormServer(val) {
  18309. if (typeof val != "number") {
  18310. return;
  18311. }
  18312. this.userData.coin = val;
  18313. this.saveUserData();
  18314. xGame.eventMgr.event(COIN_CHANGE);
  18315. }
  18316. static getCoin() {
  18317. return this.userData.coin;
  18318. }
  18319. static diamondEnough(need) {
  18320. if (typeof need != "number") {
  18321. console.error("金币格式错误");
  18322. return;
  18323. }
  18324. return this.userData.diamond >= need;
  18325. }
  18326. static setDiamond(val) {
  18327. if (typeof val != "number") {
  18328. return;
  18329. }
  18330. this.userData.diamond += val;
  18331. this.saveUserData();
  18332. xGame.eventMgr.event(DIAMOND_CHANGE);
  18333. this.updateUserInfo2Server("zs");
  18334. }
  18335. static setDiamondFormServer(val) {
  18336. if (typeof val != "number") {
  18337. return;
  18338. }
  18339. this.userData.diamond = val;
  18340. this.saveUserData();
  18341. xGame.eventMgr.event(DIAMOND_CHANGE);
  18342. }
  18343. static getDiamond() {
  18344. return this.userData.diamond;
  18345. }
  18346. static getSkillSuccessTimes() {
  18347. return this.userData.skillSuccessTimes;
  18348. }
  18349. static setSkillSuccessTimes(val, addUp = true) {
  18350. if (addUp)
  18351. this.userData.skillSuccessTimes += val;
  18352. else
  18353. this.userData.skillSuccessTimes = val;
  18354. this.saveUserData();
  18355. }
  18356. static getSkillAccTimes() {
  18357. return this.userData.skillAccTimes;
  18358. }
  18359. static setSkillAccTimes(val) {
  18360. this.userData.skillAccTimes += val;
  18361. this.saveUserData();
  18362. }
  18363. static getSkillGuide() {
  18364. if (!xGame.common.openGuide) {
  18365. return 1;
  18366. }
  18367. return this.userData.skillGuide;
  18368. }
  18369. static setSkillGuide(val) {
  18370. this.userData.skillGuide = val;
  18371. this.saveUserData();
  18372. }
  18373. static getPlaceBallLevelList() {
  18374. return this.userData.placeBallData;
  18375. }
  18376. static getPlaceBallLevel(level) {
  18377. let arr = this.userData.placeBallData;
  18378. let index = level - 1;
  18379. let out;
  18380. if (arr[index]) {
  18381. out = arr[index];
  18382. }
  18383. else {
  18384. let max = arr.length;
  18385. if (max == index) {
  18386. out = {
  18387. star: 0,
  18388. play: true,
  18389. isCur: true,
  18390. getAward: false
  18391. };
  18392. }
  18393. else {
  18394. out = {
  18395. star: 0,
  18396. play: false,
  18397. getAward: false
  18398. };
  18399. }
  18400. }
  18401. return out;
  18402. }
  18403. static setPlaceBallLevel(level, star) {
  18404. let arr = this.userData.placeBallData;
  18405. let index = level - 1;
  18406. if (arr[index]) {
  18407. arr[index].star = Math.max(arr[index].star, star);
  18408. }
  18409. else {
  18410. let max = arr.length;
  18411. if (max == index) {
  18412. arr.push({
  18413. star: star,
  18414. play: true,
  18415. getAward: false
  18416. });
  18417. }
  18418. else {
  18419. console.error("关卡存储出错");
  18420. }
  18421. }
  18422. this.saveUserData();
  18423. }
  18424. static setPlaceBallAward(level) {
  18425. let arr = this.userData.placeBallData;
  18426. let index = level - 1;
  18427. if (arr[index]) {
  18428. arr[index].getAward = true;
  18429. }
  18430. this.saveUserData();
  18431. }
  18432. static getShareDiamondTimes() {
  18433. return this.userData.shareDiamondTimes;
  18434. }
  18435. static setShareDiamondTimes(val, addUp = true) {
  18436. if (addUp) {
  18437. this.userData.shareDiamondTimes += val;
  18438. }
  18439. else {
  18440. this.userData.shareDiamondTimes = val;
  18441. }
  18442. this.saveUserData();
  18443. }
  18444. static getDailyVideoShareTimes() {
  18445. return this.userData.dailyVideoShareTimes;
  18446. }
  18447. static setDailyVideoShareTimes(val, addUp = true) {
  18448. if (addUp) {
  18449. this.userData.dailyVideoShareTimes += val;
  18450. }
  18451. else {
  18452. this.userData.dailyVideoShareTimes = val;
  18453. }
  18454. this.saveUserData();
  18455. }
  18456. static getSecretary(index) {
  18457. return this.userData.secretary[index];
  18458. }
  18459. static setSecretary(index, val) {
  18460. this.userData.secretary[index] = val;
  18461. this.saveUserData();
  18462. }
  18463. static getCurSecretary() {
  18464. return this.userData.curSecretary;
  18465. }
  18466. static setCurSecretary(index) {
  18467. this.userData.curSecretary = index;
  18468. this.saveUserData();
  18469. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18470. }
  18471. static getBallRod(index) {
  18472. return this.userData.ballRod[index];
  18473. }
  18474. static setBallRod(index, val) {
  18475. this.userData.ballRod[index] = val;
  18476. this.saveUserData();
  18477. }
  18478. static setBallRodFormServer(haveQiuGanJsonStr) {
  18479. if (!haveQiuGanJsonStr) {
  18480. console.log("setBallRodFormServer数据为空或未定义");
  18481. return;
  18482. }
  18483. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18484. const keys = Object.keys(haveQiuGanJsonObj);
  18485. keys.forEach(key => {
  18486. let v = haveQiuGanJsonObj[key];
  18487. let k = parseInt(key);
  18488. let idx = k - 1;
  18489. console.log('zh:更新IDX = ' + idx);
  18490. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18491. if (this.userData.ballRod[idx] === 0) {
  18492. console.log('zh: uuuuu ' + (k - 1));
  18493. this.userData.ballRod[k - 1] = 1;
  18494. this.saveUserData();
  18495. }
  18496. });
  18497. }
  18498. static getCurBallRod() {
  18499. return this.userData.curBallRod;
  18500. }
  18501. static setCurBallRod(index) {
  18502. this.userData.curBallRod = index;
  18503. this.saveUserData();
  18504. }
  18505. static setSignData(val) {
  18506. this.userData.signData = val;
  18507. this.saveUserData();
  18508. }
  18509. static getSignData() {
  18510. return this.userData.signData;
  18511. }
  18512. static setSignTime(val) {
  18513. this.userData.signTime = val;
  18514. this.saveUserData();
  18515. }
  18516. static getSignTime() {
  18517. return this.userData.signTime;
  18518. }
  18519. static getDrawTimes() {
  18520. return this.userData.drawTimes;
  18521. }
  18522. static setDrawTimes(val, addUp = true) {
  18523. if (addUp) {
  18524. this.userData.drawTimes += val;
  18525. }
  18526. else {
  18527. this.userData.drawTimes = val;
  18528. }
  18529. this.saveUserData();
  18530. }
  18531. static getDrawAwardTimes() {
  18532. return this.userData.drawAwardTimes;
  18533. }
  18534. static setDrawAwardTimes(val) {
  18535. this.userData.drawAwardTimes = val;
  18536. this.saveUserData();
  18537. }
  18538. static getDailyfreeDrawTimes() {
  18539. return this.userData.dailyfreeDrawTimes;
  18540. }
  18541. static setDailyfreeDrawTimes(val) {
  18542. this.userData.dailyfreeDrawTimes = val;
  18543. this.saveUserData();
  18544. }
  18545. static setPower(val, addUp = true) {
  18546. if (addUp)
  18547. this.userData.power += val;
  18548. else
  18549. this.userData.power = val;
  18550. if (this.userData.power >= xGame.common.maxPower) {
  18551. this.userData.power = xGame.common.maxPower;
  18552. }
  18553. xGame.eventMgr.event(POWER_CHANGE, val);
  18554. this.saveUserData();
  18555. }
  18556. static getPower() {
  18557. return this.userData.power;
  18558. }
  18559. static setPowerTime(val) {
  18560. this.userData.powerTime = val;
  18561. this.saveUserData();
  18562. }
  18563. static getPowerTime() {
  18564. return this.userData.powerTime;
  18565. }
  18566. static powerEnough() {
  18567. return this.getPower() > 0;
  18568. }
  18569. static getChallengeTimes() {
  18570. return this.userData.challengeTimes;
  18571. }
  18572. static setChallengeTimes(val) {
  18573. this.userData.challengeTimes += val;
  18574. this.saveUserData();
  18575. }
  18576. static getExtraSign() {
  18577. return this.userData.extraSign;
  18578. }
  18579. static setExtraSign(val) {
  18580. this.userData.extraSign = val;
  18581. this.saveUserData();
  18582. }
  18583. static getClassicTimes() {
  18584. return this.userData.classicTimes;
  18585. }
  18586. static setClassicTimes() {
  18587. this.userData.classicTimes += 1;
  18588. this.saveUserData();
  18589. }
  18590. static getGuideHelpLine() {
  18591. return this.userData.guideHelpLine;
  18592. }
  18593. static setGuideHelpLine() {
  18594. this.userData.guideHelpLine = 1;
  18595. this.saveUserData();
  18596. }
  18597. static getNewUser() {
  18598. return this.userData.newUser;
  18599. }
  18600. static setNewUser() {
  18601. this.userData.newUser = false;
  18602. this.saveUserData();
  18603. }
  18604. static getRootBallFoul() {
  18605. return this.userData.rootBallFoul;
  18606. }
  18607. static setRootBallFoul() {
  18608. this.userData.rootBallFoul = 1;
  18609. this.saveUserData();
  18610. }
  18611. static getTimeoutFoul() {
  18612. return this.userData.timeoutFoul;
  18613. }
  18614. static setTimeoutFoul() {
  18615. this.userData.timeoutFoul = 1;
  18616. this.saveUserData();
  18617. }
  18618. static saveDiyGameData() {
  18619. if (this.diyGameSaving)
  18620. return;
  18621. this.diyGameSaving = true;
  18622. Laya.timer.once(500, this, () => {
  18623. this.diyGameSaving = false;
  18624. this.diyGameData.saveData();
  18625. });
  18626. }
  18627. static getChallengeMode_overLev() {
  18628. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18629. return this.challengeMode_overLev;
  18630. }
  18631. static setChallengeMode_overLev(levNum) {
  18632. this.diyGameData.challengeMode_overLev = levNum;
  18633. this.saveDiyGameData();
  18634. }
  18635. static updateUserInfo2Server(type, count = 0) {
  18636. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18637. if (userInfoData == null) {
  18638. return;
  18639. }
  18640. let reqData = xGame.httpMgr.getReqData();
  18641. let rd = JSON.parse(reqData);
  18642. rd.dataType = type;
  18643. let dataValue = 0;
  18644. if (type == "zs") {
  18645. dataValue = this.getDiamond();
  18646. }
  18647. if (type == "jb") {
  18648. dataValue = this.getCoin();
  18649. }
  18650. rd.dataValue = dataValue;
  18651. reqData = JSON.stringify(rd);
  18652. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18653. try {
  18654. let code = res.code;
  18655. let data = res.data;
  18656. if (code == 401) {
  18657. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18658. console.log('zh:保存资产信息失败,请重新登录 ');
  18659. return;
  18660. }
  18661. if (code == 200) {
  18662. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18663. }
  18664. else {
  18665. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18666. }
  18667. }
  18668. catch (error) {
  18669. console.log('error=' + error);
  18670. alert("Please check your network connection.");
  18671. }
  18672. finally {
  18673. }
  18674. });
  18675. }
  18676. static getUserZiChanInfo() {
  18677. console.log('zh:开始获取用户资产信息');
  18678. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18679. if (userInfoData == null) {
  18680. return;
  18681. }
  18682. let reqData = xGame.httpMgr.getReqData();
  18683. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18684. try {
  18685. console.log('zh:buySp res = ' + JSON.stringify(res));
  18686. let code = res.code;
  18687. let msg = res.msg;
  18688. if (code == 401) {
  18689. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18690. alert(TIP_MSG_key.pleaseLoginIn);
  18691. return;
  18692. }
  18693. if (code == 200) {
  18694. let d = res.data;
  18695. let zuanShi = d.zuanShi;
  18696. let jinBi = d.jinBi;
  18697. let haveQiuGanJson = d.haveQiuGanJson;
  18698. DataMgr.setDiamondFormServer(zuanShi);
  18699. DataMgr.setCoinFormServer(jinBi);
  18700. console.log('zh:更新球杆信息');
  18701. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18702. }
  18703. else {
  18704. alert(msg);
  18705. }
  18706. }
  18707. catch (error) {
  18708. console.log('error=' + error);
  18709. alert(error);
  18710. }
  18711. finally {
  18712. }
  18713. });
  18714. }
  18715. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18716. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18717. console.log('zh:updateLocalUserData=' + userInfo);
  18718. if (userInfo != null) {
  18719. if (!userInfo.buySpids) {
  18720. userInfo.buySpids = { 1: false, 7: false };
  18721. }
  18722. else {
  18723. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18724. }
  18725. userInfo.buySpids[spid] = isBuyOk;
  18726. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18727. }
  18728. else {
  18729. }
  18730. }
  18731. }
  18732. DataMgr.isNewUser = false;
  18733. DataMgr.fristEnter = true;
  18734. DataMgr.levelType = 0;
  18735. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18736. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18737. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18738. DataMgr.challengeMode_overLev = 0;
  18739. DataMgr.xszyForClassic = false;
  18740. DataMgr.xszyForChallenge = false;
  18741. DataMgr.awardId = 0;
  18742. DataMgr.awardCoin = 0;
  18743. DataMgr.sceneId = -1;
  18744. DataMgr.tryId = 0;
  18745. DataMgr.curLevel = 1;
  18746. DataMgr.vipLevel = 0;
  18747. DataMgr.maxLevel = 0;
  18748. DataMgr.awardRatio = 1;
  18749. DataMgr.gameList = [];
  18750. DataMgr.rankList = [];
  18751. DataMgr.recoverTime = 480000;
  18752. DataMgr.minScore = 0;
  18753. DataMgr.rankDis = 0;
  18754. DataMgr.userSaving = false;
  18755. DataMgr.gameSaving = false;
  18756. DataMgr.diyGameSaving = false;
  18757. class D3Tween extends Laya.Script3D {
  18758. constructor() {
  18759. super();
  18760. this.isInited = false;
  18761. }
  18762. ;
  18763. init() {
  18764. if (this.isInited)
  18765. return;
  18766. this.isInited = true;
  18767. this.gameObj = this.owner;
  18768. this.transform = this.gameObj.transform;
  18769. }
  18770. get rotX() {
  18771. return this.transform.localRotationEulerX;
  18772. }
  18773. set rotX(v) {
  18774. this.transform.localRotationEulerX = v;
  18775. }
  18776. get rotY() {
  18777. return this.transform.localRotationEulerY;
  18778. }
  18779. set rotY(v) {
  18780. this.transform.localRotationEulerY = v;
  18781. }
  18782. get rotZ() {
  18783. return this.transform.localRotationEulerZ;
  18784. }
  18785. set rotZ(v) {
  18786. this.transform.localRotationEulerZ = v;
  18787. }
  18788. get posX() {
  18789. return this.transform.localPositionX;
  18790. }
  18791. set posX(v) {
  18792. this.transform.localPositionX = v;
  18793. }
  18794. get posY() {
  18795. return this.transform.localPositionY;
  18796. }
  18797. set posY(v) {
  18798. this.transform.localPositionY = v;
  18799. }
  18800. get posZ() {
  18801. return this.transform.localPositionZ;
  18802. }
  18803. set posZ(v) {
  18804. this.transform.localPositionZ = v;
  18805. }
  18806. get rotation() {
  18807. return this.transform.localRotation;
  18808. }
  18809. set rotation(v) {
  18810. this.transform.localRotation = v;
  18811. }
  18812. }
  18813. class D2Hole extends Laya.Script {
  18814. constructor() { super(); }
  18815. onTriggerEnter(collider) {
  18816. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18817. return;
  18818. }
  18819. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18820. if (collider.owner["mySrc"].isRunSkillAni) {
  18821. return;
  18822. }
  18823. if (collider.owner["mySrc"].number != 0) {
  18824. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18825. }
  18826. xGame.common.ballColliHole(collider);
  18827. xGame.common.recoverCameraView();
  18828. }
  18829. }
  18830. }
  18831. class Table extends Laya.Script3D {
  18832. constructor() {
  18833. super();
  18834. this.isSetBorder = false;
  18835. this.inited = false;
  18836. }
  18837. ;
  18838. onAwake() {
  18839. this.init();
  18840. }
  18841. init() {
  18842. if (this.inited)
  18843. return;
  18844. this.inited = true;
  18845. this.gameObj = this.owner;
  18846. this.border = this.gameObj.getChildByName("border");
  18847. }
  18848. setBorderPos() {
  18849. if (this.isSetBorder)
  18850. return;
  18851. this.isSetBorder = true;
  18852. let ui = xGame.common.gameUI.ui;
  18853. let bar1 = this.border.getChildByName("bar1");
  18854. let bar2 = this.border.getChildByName("bar2");
  18855. let bar3 = this.border.getChildByName("bar3");
  18856. let bar4 = this.border.getChildByName("bar4");
  18857. let bar5 = this.border.getChildByName("bar5");
  18858. let bar6 = this.border.getChildByName("bar6");
  18859. this.setInfo(bar1, ui.border.bar1, "box");
  18860. this.setInfo(bar2, ui.border.bar2, "box");
  18861. this.setInfo(bar3, ui.border.bar3, "box");
  18862. this.setInfo(bar4, ui.border.bar4, "box");
  18863. this.setInfo(bar5, ui.border.bar5, "box");
  18864. this.setInfo(bar6, ui.border.bar6, "box");
  18865. let circle1 = this.border.getChildByName("circle1");
  18866. let circle2 = this.border.getChildByName("circle2");
  18867. let circle3 = this.border.getChildByName("circle3");
  18868. let circle4 = this.border.getChildByName("circle4");
  18869. let circle5 = this.border.getChildByName("circle5");
  18870. let circle6 = this.border.getChildByName("circle6");
  18871. this.setInfo(circle1, ui.border.circle1, "circle");
  18872. this.setInfo(circle2, ui.border.circle2, "circle");
  18873. this.setInfo(circle3, ui.border.circle3, "circle");
  18874. this.setInfo(circle4, ui.border.circle4, "circle");
  18875. this.setInfo(circle5, ui.border.circle5, "circle");
  18876. this.setInfo(circle6, ui.border.circle6, "circle");
  18877. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18878. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18879. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18880. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18881. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18882. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18883. let arr = xGame.common.gameMgr.holePosList;
  18884. xGame.common.gameMgr.posObj = {
  18885. "1": arr[0],
  18886. "3": arr[2],
  18887. "4": arr[3],
  18888. "6": arr[5]
  18889. };
  18890. }
  18891. initHolePos(x, y) {
  18892. if (x < 300)
  18893. x += 25;
  18894. else if (x > 1000)
  18895. x -= 25;
  18896. else if (y > 200)
  18897. y -= 10;
  18898. else
  18899. y += 10;
  18900. if (y < 200)
  18901. y += 30;
  18902. else if (y > 500)
  18903. y -= 30;
  18904. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18905. }
  18906. setInfo(d3Obj, d2Obj, type) {
  18907. let ui = xGame.common.gameUI.ui;
  18908. let sprite = new Laya.Sprite();
  18909. ui.border.displayObject.addChild(sprite);
  18910. let colli = xGame.common.getCollider(type);
  18911. sprite.addComponentIntance(colli);
  18912. let rigy = xGame.common.getRigbody();
  18913. rigy.type = "static";
  18914. sprite.addComponentIntance(rigy);
  18915. let d3Pos = d3Obj.transform.position;
  18916. xGame.common.pos3to2Convert(d3Pos);
  18917. let scaleX = d3Obj.transform.localScaleX;
  18918. let scaleZ = d3Obj.transform.localScaleZ;
  18919. let width = xGame.common.scale3to2Convert(scaleZ);
  18920. let height = xGame.common.scale3to2Convert(scaleX);
  18921. sprite.pivotX = width / 2;
  18922. sprite.pivotY = height / 2;
  18923. sprite.x = d3Pos.x;
  18924. sprite.y = d3Pos.y;
  18925. sprite.width = width;
  18926. sprite.height = height;
  18927. d2Obj.x = d3Pos.x;
  18928. d2Obj.y = d3Pos.y;
  18929. d2Obj.width = width;
  18930. d2Obj.height = height;
  18931. if (type == "box") {
  18932. colli.width = width;
  18933. colli.height = height;
  18934. colli.isSensor = false;
  18935. colli.label = "border";
  18936. }
  18937. else {
  18938. colli.radius = width / 2;
  18939. colli.isSensor = true;
  18940. colli.label = "hole";
  18941. sprite.addComponent(D2Hole);
  18942. }
  18943. }
  18944. }
  18945. class D3World extends Laya.Script3D {
  18946. constructor() {
  18947. super();
  18948. this.loadNum = 0;
  18949. this.setLoadNum = 7;
  18950. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18951. }
  18952. onAwake() {
  18953. }
  18954. loadScene() {
  18955. this.scene = this.owner;
  18956. let url = `res/unityRes/root.lh`;
  18957. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18958. this.scene.addChild(prefab);
  18959. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18960. this.putCameraInfo();
  18961. this.camera.enableHDR = false;
  18962. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18963. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18964. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18965. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18966. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18967. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18968. this.knife.active = false;
  18969. this.loadD3Obj();
  18970. }));
  18971. }
  18972. putCameraInfo() {
  18973. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18974. this.cameraObj = new cameraType();
  18975. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18976. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18977. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18978. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18979. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18980. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18981. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18982. this.visitAngleChild.init();
  18983. this.visitRootObj.posX = this.visitAngleChild.posX;
  18984. this.visitRootObj.posY = this.visitAngleChild.posY;
  18985. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18986. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18987. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18988. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18989. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18990. xGame.common.showOneCamera("mainCamera");
  18991. }
  18992. loadD3Obj() {
  18993. this.loadTable();
  18994. this.loadRoom();
  18995. this.loadInHoleParticial();
  18996. this.loadIceParticial();
  18997. this.loadHitParticial();
  18998. this.loadFireworksParticial();
  18999. this.loadBall();
  19000. }
  19001. loadInHoleParticial() {
  19002. this.loadD3Res("inHoleEft", "", (prefab) => {
  19003. prefab.addComponent(Partical);
  19004. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19005. });
  19006. }
  19007. loadIceParticial() {
  19008. this.loadD3Res("iceEft", "", (prefab) => {
  19009. prefab.addComponent(Partical);
  19010. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19011. });
  19012. }
  19013. loadHitParticial() {
  19014. this.loadD3Res("hitEft", "", (prefab) => {
  19015. prefab.addComponent(Partical);
  19016. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19017. });
  19018. }
  19019. loadFireworksParticial() {
  19020. this.loadD3Res("fireworksEft", "", (prefab) => {
  19021. prefab.addComponent(Partical);
  19022. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19023. });
  19024. }
  19025. loadBall(index = 1) {
  19026. this.loadD3Res("ball", index, (prefab) => {
  19027. this.ballPrefab = prefab;
  19028. this.ballPrefab.addComponent(Ball);
  19029. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19030. });
  19031. }
  19032. loadTable(index = 1) {
  19033. this.loadD3Res("table", index, (prefab) => {
  19034. this.tableSrc = prefab.addComponent(Table);
  19035. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19036. this.d3Hand.init();
  19037. this.tableRoot.addChild(prefab);
  19038. });
  19039. }
  19040. loadRoom(index = 1) {
  19041. this.loadD3Res("room", index, (prefab) => {
  19042. this.roomRoot.addChild(prefab);
  19043. });
  19044. }
  19045. loadD3Res(type, index, callback) {
  19046. let url = `res/unityRes/${type}${index}.lh`;
  19047. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19048. callback && callback(prefab);
  19049. this.checkResLoad();
  19050. }));
  19051. }
  19052. checkResLoad() {
  19053. this.loadNum++;
  19054. if (this.loadNum >= this.setLoadNum) {
  19055. xGame.eventMgr.event(D3RES_LOADED);
  19056. }
  19057. }
  19058. prePlayEft() {
  19059. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19060. eft.transform.localPositionX = 0;
  19061. eft.transform.localPositionY = -5;
  19062. eft.transform.localPositionZ = 0;
  19063. eft.active = true;
  19064. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19065. ice.transform.localPositionX = 0;
  19066. ice.transform.localPositionY = -5;
  19067. ice.transform.localPositionZ = 0;
  19068. ice.active = true;
  19069. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19070. hit.transform.localPositionX = 0;
  19071. hit.transform.localPositionY = -5;
  19072. hit.transform.localPositionZ = 0;
  19073. hit.active = true;
  19074. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19075. fireworks.transform.localPositionX = 0;
  19076. fireworks.transform.localPositionY = -5;
  19077. fireworks.transform.localPositionZ = 0;
  19078. fireworks.active = true;
  19079. }
  19080. }
  19081. class cameraType {
  19082. }
  19083. class MoyuMgr$1 {
  19084. static initMoyu() {
  19085. this.moyuView = new MoyuView$1();
  19086. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19087. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19088. this.moyuView.ui.displayObject.zOrder = 1000;
  19089. this.moyuView.init();
  19090. this.moyuView.showTip(true);
  19091. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19092. window['XApk'] = this;
  19093. }
  19094. static showAge(show) {
  19095. if (this.moyuView)
  19096. this.moyuView.showAge(show);
  19097. }
  19098. static onPlatMsg(idx) {
  19099. if (!MoyuMgr$1.moyuView)
  19100. return;
  19101. if (idx == '0') {
  19102. MoyuMgr$1.moyuView.showTip(false);
  19103. }
  19104. }
  19105. static showAgree(call) {
  19106. if (this.moyuView)
  19107. this.moyuView.showAgree(call);
  19108. else
  19109. call && call();
  19110. }
  19111. static showXy(type = 1) {
  19112. if (this.moyuView)
  19113. this.moyuView.showXy(type);
  19114. }
  19115. }
  19116. MoyuMgr$1.isAdvise = false;
  19117. class MoyuView$1 {
  19118. constructor() {
  19119. this.ysxyNum = 1;
  19120. this.ysJson = null;
  19121. this.ui = ui_UIMoyu.createInstance();
  19122. }
  19123. init() {
  19124. this.ui.mainBg.visible = false;
  19125. this.ui.xyNode.visible = false;
  19126. this.ui.ageNode.visible = false;
  19127. this.ui.tipNode.visible = false;
  19128. this.ui.rnNode.visible = false;
  19129. this.ui.fcmNode.visible = false;
  19130. this.ui.ageTip.visible = false;
  19131. this.ui.msgNode.visible = false;
  19132. this.ui.visible = false;
  19133. this.ui.xyNode.xyList.setVirtual();
  19134. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19135. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19136. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19137. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19138. this.ui.xyNode.btnKnown.visible = false;
  19139. this.ui.xyNode.xy1.visible = false;
  19140. this.ui.xyNode.xy2.visible = false;
  19141. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19142. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19143. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19144. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19145. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19146. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19147. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19148. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19149. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19150. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19151. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19152. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19153. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19154. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19155. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19156. this.ysxyNum = 2;
  19157. }
  19158. }
  19159. onClick(obj) {
  19160. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19161. switch (obj) {
  19162. case this.ui.ageTip:
  19163. if (Moyu.isTTApk) {
  19164. this.ui.ageNode.visible = true;
  19165. this.ui.mainBg.visible = true;
  19166. }
  19167. break;
  19168. case this.ui.tipNode:
  19169. this.showTip(false);
  19170. break;
  19171. case this.ui.ageNode.btnAge:
  19172. this.ui.ageNode.visible = false;
  19173. this.ui.mainBg.visible = false;
  19174. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19175. this.ui.visible = false;
  19176. break;
  19177. case this.ui.xyNode.btnXy3:
  19178. case this.ui.xyNode.btnXy1:
  19179. this.loadXy(1);
  19180. break;
  19181. case this.ui.xyNode.btnXy2:
  19182. this.loadXy(2);
  19183. break;
  19184. case this.ui.xyNode.btnBack:
  19185. this.ui.xyNode.xy1.visible = true;
  19186. this.ui.xyNode.xy2.visible = false;
  19187. break;
  19188. case this.ui.xyNode.btnKnown:
  19189. this.ui.xyNode.visible = false;
  19190. this.ui.mainBg.visible = false;
  19191. this.ui.visible = false;
  19192. break;
  19193. case this.ui.rnNode.btnCheck:
  19194. this.check();
  19195. break;
  19196. case this.ui.rnNode.btnExit:
  19197. case this.ui.xyNode.btnNo:
  19198. this.ysxyNum--;
  19199. if (this.ysxyNum > 0)
  19200. this.showMsg("Refuse to quit the game once again");
  19201. else {
  19202. Moyu.userAgree(false);
  19203. Moyu.exit();
  19204. }
  19205. break;
  19206. case this.ui.xyNode.btnSure:
  19207. case this.ui.xyNode.btnYes:
  19208. DataMgr.userData.isAgree = true;
  19209. DataMgr.saveUserData();
  19210. this.onAgree();
  19211. break;
  19212. case this.ui.rnNode.btnDone:
  19213. this.ui.rnNode.visible = false;
  19214. this.ui.visible = false;
  19215. break;
  19216. case this.ui.fcmNode.btnRn:
  19217. this.showRn();
  19218. break;
  19219. }
  19220. }
  19221. showTip(show) {
  19222. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19223. return;
  19224. if (show) {
  19225. MoyuMgr$1.isAdvise = true;
  19226. this.ui.visible = true;
  19227. this.ui.tipNode.visible = true;
  19228. this.ui.tipNode.alpha = 1;
  19229. Laya.timer.once(1000, this, this.showTip, [false]);
  19230. }
  19231. else {
  19232. this.ui.tipNode.alpha = 1;
  19233. this.ui.tipNode.visible = true;
  19234. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19235. this.ui.tipNode.visible = false;
  19236. MoyuMgr$1.isAdvise = false;
  19237. }), 1000);
  19238. }
  19239. }
  19240. showAge(show, px = 0, py = 0) {
  19241. if (Moyu.platType > 10 && !Moyu.isIos) {
  19242. this.ui.ageTip.x = px;
  19243. this.ui.ageTip.y = py;
  19244. this.ui.ageTip.visible = show;
  19245. if (show)
  19246. this.ui.visible = true;
  19247. }
  19248. }
  19249. showAgree(call) {
  19250. this.agreeCall = call;
  19251. this.onAgree();
  19252. return;
  19253. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19254. this.showXy(0);
  19255. }
  19256. else
  19257. this.onAgree();
  19258. }
  19259. onAgree() {
  19260. if (!this.ui.ageNode.visible)
  19261. this.ui.visible = false;
  19262. this.ui.xyNode.visible = false;
  19263. Moyu.userAgree(true);
  19264. this.showAge(false);
  19265. this.agreeCall && this.agreeCall();
  19266. this.showRn();
  19267. }
  19268. showMsg(txt) {
  19269. this.ui.msgNode.txtMsg.text = txt;
  19270. this.ui.msgNode.visible = true;
  19271. this.ui.msgNode.alpha = 1;
  19272. this.ui.visible = true;
  19273. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19274. this.ui.msgNode.visible = false;
  19275. }), 2500, true);
  19276. }
  19277. showRn() {
  19278. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19279. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19280. this.ui.rnNode.rn1.visible = true;
  19281. this.ui.rnNode.rn2.visible = false;
  19282. this.ui.rnNode.rn3.visible = false;
  19283. this.ui.rnNode.rn4.visible = false;
  19284. this.ui.rnNode.visible = true;
  19285. this.ui.mainBg.visible = true;
  19286. this.ui.rnNode.btnDone.visible = false;
  19287. this.ui.rnNode.btnExit.visible = true;
  19288. this.ui.rnNode.btnCheck.visible = true;
  19289. this.ui.fcmNode.visible = false;
  19290. this.ui.visible = true;
  19291. return;
  19292. }
  19293. }
  19294. this.showFcm();
  19295. }
  19296. showFcm() {
  19297. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19298. Moyu.initFCM(true);
  19299. if (Moyu.gameTime < 1)
  19300. this.fcmLoop();
  19301. else if (Moyu.gameTime < 999)
  19302. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19303. }
  19304. }
  19305. fcmLoop() {
  19306. if (Moyu.gameTime < 1) {
  19307. this.ui.rnNode.visible = false;
  19308. this.ui.fcmNode.visible = true;
  19309. this.ui.mainBg.visible = true;
  19310. this.ui.visible = true;
  19311. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19312. Laya.timer.clear(this.ui, this.fcmLoop);
  19313. }
  19314. }
  19315. check() {
  19316. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19317. this.ui.rnNode.rn1.visible = false;
  19318. this.ui.rnNode.rn2.visible = false;
  19319. this.ui.rnNode.rn4.visible = true;
  19320. }
  19321. else if (this.ui.rnNode.rn4.visible) {
  19322. let name = this.ui.rnNode.inputName.text;
  19323. let code = this.ui.rnNode.inputCode.text;
  19324. if (code && code.length == 18) {
  19325. this.ui.rnNode.rn1.visible = false;
  19326. this.ui.rnNode.rn4.visible = false;
  19327. Moyu.authenticate(name, code, (res) => {
  19328. this.ui.rnNode.rn2.visible = !res;
  19329. this.ui.rnNode.rn3.visible = res;
  19330. this.ui.rnNode.btnDone.visible = res;
  19331. this.ui.rnNode.btnExit.visible = !res;
  19332. this.ui.rnNode.btnCheck.visible = !res;
  19333. if (res)
  19334. this.showFcm();
  19335. });
  19336. }
  19337. else
  19338. this.showMsg("信息填写不完整");
  19339. }
  19340. }
  19341. loadXy(type = 0) {
  19342. this.ui.xyNode.xy1.visible = false;
  19343. this.ui.xyNode.xy2.visible = true;
  19344. this.ui.xyNode.xyList.scrollToView(0);
  19345. if (type == 1) {
  19346. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19347. }
  19348. else if (type == 2) {
  19349. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19350. }
  19351. }
  19352. showXy(type = 0) {
  19353. this.xyBtn();
  19354. if (type == 0) {
  19355. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19356. this.ui.xyNode.btnSure.visible = true;
  19357. }
  19358. else {
  19359. this.ui.xyNode.btnYes.visible = true;
  19360. this.ui.xyNode.btnNo.visible = true;
  19361. }
  19362. }
  19363. else {
  19364. this.ui.xyNode.btnKnown.visible = true;
  19365. this.ui.mainBg.visible = true;
  19366. }
  19367. this.ui.xyNode.xy1.visible = true;
  19368. this.ui.xyNode.xy2.visible = false;
  19369. this.ui.xyNode.visible = true;
  19370. this.ui.visible = true;
  19371. }
  19372. xyBtn() {
  19373. this.ui.xyNode.btnSure.visible = false;
  19374. this.ui.xyNode.btnYes.visible = false;
  19375. this.ui.xyNode.btnNo.visible = false;
  19376. this.ui.xyNode.btnKnown.visible = false;
  19377. {
  19378. this.ui.xyNode.btnXy3.visible = false;
  19379. this.ui.xyNode.btnXy2.visible = true;
  19380. this.ui.xyNode.btnXy1.visible = true;
  19381. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19382. }
  19383. }
  19384. createXY(json) {
  19385. this.ysJson = json.content;
  19386. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19387. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19388. this.ui.xyNode.xy2.visible = true;
  19389. }
  19390. renderListItem(idx, cell) {
  19391. let xy = this.ysJson[idx];
  19392. cell.height = xy.line * 30;
  19393. cell.xyItem.text = xy.text;
  19394. }
  19395. onDestroy() {
  19396. this.agreeCall = null;
  19397. }
  19398. }
  19399. class UILoading extends UIBase {
  19400. constructor() {
  19401. super();
  19402. this.accTime = 0;
  19403. this.curNum = 0;
  19404. this.rate = 1;
  19405. this.loadSubOk = false;
  19406. this.loadResOK = false;
  19407. this.openLoading = true;
  19408. this.beginLoadRes = false;
  19409. this.finishD2 = false;
  19410. this.finishD3 = false;
  19411. }
  19412. onConstructor() {
  19413. this.ui = ui_UILoading.createInstance();
  19414. this.contentPane = this.ui;
  19415. this.isEject = false;
  19416. this._initUI();
  19417. this._addEvent();
  19418. }
  19419. _initUI() {
  19420. MoyuMgr$1.initMoyu();
  19421. }
  19422. _addEvent() {
  19423. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19424. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19425. }
  19426. show() {
  19427. super.show();
  19428. console.log('zh:加载分包资源');
  19429. loadSubRes(this.subResProgress.bind(this));
  19430. this.ui.txtLoad.text = "Loading...";
  19431. }
  19432. subResProgress(pro, finish) {
  19433. this.curNum = pro;
  19434. if (finish) {
  19435. this.curNum = 1;
  19436. this.loadSubOk = true;
  19437. }
  19438. }
  19439. laodD3Res() {
  19440. let scene3D = new Laya.Scene3D();
  19441. xGame.common.d3Scene = scene3D;
  19442. xGame.common.d3World = scene3D.addComponent(D3World);
  19443. xGame.common.d3World.loadScene();
  19444. }
  19445. loadD2Res() {
  19446. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19447. this.finishD2 = true;
  19448. this.checkLoadAll();
  19449. this.curNum = 1;
  19450. }), Laya.Handler.create(this, (pro) => {
  19451. this.curNum = pro;
  19452. }, null, false));
  19453. }
  19454. d3ResFinish() {
  19455. this.finishD3 = true;
  19456. this.checkLoadAll();
  19457. }
  19458. checkLoadAll() {
  19459. if (this.finishD2 && this.finishD3) {
  19460. this.loadResOK = true;
  19461. }
  19462. }
  19463. loadRes() {
  19464. this.laodD3Res();
  19465. this.loadD2Res();
  19466. }
  19467. myUpdate(dt) {
  19468. if (!this.openLoading)
  19469. return;
  19470. this.accTime += dt * this.rate;
  19471. if (this.accTime >= this.curNum)
  19472. this.accTime = this.curNum;
  19473. this.ui.loadinfo.value = this.accTime * 100;
  19474. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19475. if (!this.beginLoadRes) {
  19476. this.beginLoadRes = true;
  19477. this.ui.txtLoad.text = "Loading...";
  19478. this.curNum = 0;
  19479. this.accTime = 0;
  19480. this.loadRes();
  19481. }
  19482. if (this.loadResOK) {
  19483. this.openLoading = false;
  19484. Laya.timer.once(300, this, () => {
  19485. xGame.common.d3Scene.active = false;
  19486. MoyuMgr$1.showAgree(enterGame);
  19487. });
  19488. }
  19489. }
  19490. }
  19491. release() {
  19492. }
  19493. hide() {
  19494. super.hide();
  19495. this.release();
  19496. }
  19497. onClose() {
  19498. this.hide();
  19499. }
  19500. }
  19501. UILoading.uiName = "UILoading";
  19502. class UIRepentProp$1 extends UIBase {
  19503. constructor() {
  19504. super();
  19505. this.viewType = 0;
  19506. this.regretType = 0;
  19507. }
  19508. onConstructor() {
  19509. this.ui = ui_UIRepentProp.createInstance();
  19510. this.contentPane = this.ui;
  19511. this.isEject = false;
  19512. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19513. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19514. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19515. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19516. }
  19517. show(viewType, regretType, callback) {
  19518. PlatMgr.showInsert(true);
  19519. this.viewType = viewType;
  19520. this.regretType = regretType;
  19521. this.callback = callback;
  19522. super.show();
  19523. this.ui.t0.play();
  19524. this.ui.c1.selectedIndex = this.viewType;
  19525. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19526. if (this.viewType == 0) {
  19527. let guide = DataMgr.getGuideHelpLine();
  19528. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19529. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19530. }
  19531. xGame.common.gameMgr.gamePause = true;
  19532. }
  19533. hideSelf() {
  19534. xGame.common.gameMgr.gamePause = false;
  19535. this.callback && this.callback(false);
  19536. this.hide();
  19537. }
  19538. videoRegret() {
  19539. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19540. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19541. }
  19542. else {
  19543. console.log('zh:AD 失败,直接发放奖励');
  19544. this.qjff_AD_for_UIrepentProp_videoRegret();
  19545. }
  19546. }
  19547. qjff_AD_for_UIrepentProp_videoRegret() {
  19548. this.callback && this.callback(true);
  19549. this.hideSelf();
  19550. }
  19551. videoAddHelpLine() {
  19552. let guide = DataMgr.getGuideHelpLine();
  19553. if (guide == 0) {
  19554. this.callback && this.callback(true);
  19555. this.hideSelf();
  19556. DataMgr.setGuideHelpLine();
  19557. xGame.common.gameUI.ui.guideNode.visible = false;
  19558. }
  19559. else {
  19560. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19561. if (Laya.Browser.onAndroid) {
  19562. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19563. if (!boo) {
  19564. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19565. return;
  19566. }
  19567. }
  19568. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19569. }
  19570. else {
  19571. console.log('zh:AD 失败,直接发放奖励');
  19572. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19573. }
  19574. }
  19575. }
  19576. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19577. this.callback && this.callback(true);
  19578. this.hideSelf();
  19579. }
  19580. }
  19581. UIRepentProp$1.uiName = "UIRepentProp";
  19582. class UIRodMethod$1 extends UIBase {
  19583. constructor() {
  19584. super();
  19585. this.isPressd = false;
  19586. }
  19587. onConstructor() {
  19588. this.ui = ui_UIRodMethod.createInstance();
  19589. this.contentPane = this.ui;
  19590. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19591. this.moveDir = new Laya.Vector2();
  19592. this.moveDest = new Laya.Vector2();
  19593. this.centerPos = new Laya.Vector2();
  19594. xGame.common.uiRodMethod = this;
  19595. }
  19596. show() {
  19597. super.show();
  19598. xGame.common.gameMgr.gamePause = true;
  19599. this.openPressDotEvent();
  19600. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19601. this.centerPos.x = this.ui.white.x;
  19602. this.centerPos.y = this.ui.white.y;
  19603. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19604. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19605. this.setDot();
  19606. }
  19607. setDot() {
  19608. this.ui.dot.x = this.moveDest.x;
  19609. this.ui.dot.y = this.moveDest.y;
  19610. }
  19611. closeSelf() {
  19612. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19613. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19614. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19615. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19616. xGame.common.gameMgr.gamePause = false;
  19617. this.hide();
  19618. }
  19619. openPressDotEvent() {
  19620. this.closePressDotEvent();
  19621. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19622. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19623. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19624. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19625. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19626. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19627. }
  19628. closePressDotEvent() {
  19629. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19630. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19631. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19632. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19633. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19634. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19635. }
  19636. onDown(e) {
  19637. if (e.type == Laya.Event.MOUSE_DOWN)
  19638. this.isPressd = true;
  19639. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19640. this.isPressd = false;
  19641. if (!this.isPressd)
  19642. return;
  19643. this.moveDest.x = e.stageX;
  19644. this.moveDest.y = e.stageY;
  19645. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19646. if (dis > 6724) {
  19647. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19648. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19649. }
  19650. this.setDot();
  19651. }
  19652. resetRod() {
  19653. this.ui.dot.x = this.ui.white.x;
  19654. this.ui.dot.y = this.ui.white.y;
  19655. this.gameRod.dot.x = this.gameRod.bg.x;
  19656. this.gameRod.dot.y = this.gameRod.bg.y;
  19657. xGame.common.rodOffest.x = 0;
  19658. xGame.common.rodOffest.y = 0;
  19659. }
  19660. }
  19661. UIRodMethod$1.uiName = "UIRodMethod";
  19662. class UIMsg$1 extends UIBase {
  19663. constructor() {
  19664. super();
  19665. }
  19666. onConstructor() {
  19667. this.ui = ui_UIMsg.createInstance();
  19668. this.contentPane = this.ui;
  19669. this.isEject = false;
  19670. this.isMuti = true;
  19671. }
  19672. show(msg, callback) {
  19673. super.show();
  19674. this.ui.tipsNode.msgTxt.text = msg;
  19675. this.ui.alpha = 1;
  19676. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19677. this.hide();
  19678. callback && callback();
  19679. }), 1000);
  19680. }
  19681. }
  19682. UIMsg$1.uiName = "UIMsg";
  19683. class UITips$1 extends UIBase {
  19684. constructor() {
  19685. super();
  19686. this.type = 0;
  19687. }
  19688. onConstructor() {
  19689. this.ui = ui_UITips.createInstance();
  19690. this.contentPane = this.ui;
  19691. this.isEject = false;
  19692. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19693. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19694. }
  19695. show(tipsTxt, womanTxt, type) {
  19696. super.show();
  19697. this.ui.t0.play();
  19698. this.ui.myNode.tipsTxt.text = tipsTxt;
  19699. this.ui.myNode.womanTxt.text = womanTxt;
  19700. PlatMgr.showInsert(true);
  19701. this.ui.myNode.c1.selectedIndex = type;
  19702. this.type = type;
  19703. switch (this.type) {
  19704. case TipsType.exitGame:
  19705. xGame.common.gameMgr.gamePause = true;
  19706. break;
  19707. case TipsType.foul:
  19708. Laya.timer.once(200, this, () => {
  19709. xGame.common.gameMgr.gamePause = true;
  19710. });
  19711. break;
  19712. default:
  19713. break;
  19714. }
  19715. }
  19716. clickLeftBtn() {
  19717. this.hide();
  19718. xGame.common.gameMgr.gamePause = false;
  19719. switch (this.type) {
  19720. case TipsType.exitGame:
  19721. break;
  19722. case TipsType.foul:
  19723. break;
  19724. default:
  19725. break;
  19726. }
  19727. }
  19728. clickRightBtn() {
  19729. this.hide();
  19730. switch (this.type) {
  19731. case TipsType.exitGame:
  19732. xGame.eventMgr.event(RESET_GAME);
  19733. xGame.uiMgr.Show(UIMain$1);
  19734. Moyu.recordEnd(this, null);
  19735. xGame.common.longHelpLine = false;
  19736. break;
  19737. case TipsType.foul:
  19738. xGame.common.gameMgr.gamePause = false;
  19739. Laya.timer.clearAll(this);
  19740. break;
  19741. default:
  19742. break;
  19743. }
  19744. }
  19745. }
  19746. UITips$1.uiName = "UITips";
  19747. class UIGame$1 extends UIBase {
  19748. constructor() {
  19749. super();
  19750. this.powerNum = 0;
  19751. this.isD3Inited = false;
  19752. this.isPrePlay = false;
  19753. this.isMoveRod = false;
  19754. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19755. this.rulerDis = 20;
  19756. this.rulerOffset = 0;
  19757. }
  19758. onConstructor() {
  19759. this.ui = ui_UIGame.createInstance();
  19760. this.contentPane = this.ui;
  19761. this.ui.x += xGame.common.sysOffestNum;
  19762. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19763. this.isEject = false;
  19764. xGame.common.gameUI = this;
  19765. this.initSelf();
  19766. }
  19767. isTurnSelf() {
  19768. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19769. return true;
  19770. }
  19771. }
  19772. initSelf() {
  19773. let topUI = this.ui.topNode;
  19774. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19775. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19776. this.barInfo = {};
  19777. this.barInfo.curY = 0;
  19778. this.barInfo.height = this.ui.powerNode.height;
  19779. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19780. this.barInfo.powerStartY = this.ui.powerNode.y;
  19781. xGame.common.aiPlayer = new AIPlayer();
  19782. xGame.common.gameMgr = new GameMgr();
  19783. xGame.common.skillMgr = new SkillMgr();
  19784. xGame.common.wordsMgr = new WordsMgr();
  19785. xGame.common.talkMgr = new TalkMgr();
  19786. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19787. console.log("加载经典模式表情文件chenggon !");
  19788. });
  19789. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19790. console.log("挑战模式奖励模式spine加载成功!");
  19791. });
  19792. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19793. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19794. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19795. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19796. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19797. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19798. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19799. }
  19800. getGanZiImg() {
  19801. let index = DataMgr.getCurBallRod();
  19802. let data = cfgTable.ballrodData[index + 1];
  19803. let gan_url = xGame.common.getGameIconUrl(data.img);
  19804. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19805. this.ui.powerNode.showImg.url = gan_url;
  19806. console.log('zh:修改杆子图标O K');
  19807. }
  19808. returnHome() {
  19809. let tips = "Are you sure to exit the game?";
  19810. let woman = "Boss, why don't you play for a while longer?";
  19811. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19812. }
  19813. addRodMethodClick() {
  19814. if (this.isTurnSelf()) {
  19815. xGame.uiMgr.Show(UIRodMethod$1);
  19816. }
  19817. }
  19818. clickHelpLineBtn(force = false) {
  19819. if (!this.isTurnSelf())
  19820. return;
  19821. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19822. if (success) {
  19823. xGame.common.longHelpLine = true;
  19824. xGame.common.d2World.getHelpLine();
  19825. Moyu.sendDataEvent("guideNum");
  19826. }
  19827. else {
  19828. }
  19829. });
  19830. }
  19831. renderSelfDisplayBalls(index, target) {
  19832. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19833. target.myImg.url = xGame.common.getGameIconUrl(str);
  19834. }
  19835. renderAIDisplayBalls(index, target) {
  19836. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19837. target.myImg.url = xGame.common.getGameIconUrl(str);
  19838. ;
  19839. }
  19840. updateMode() {
  19841. if (xGame.common.gameMode == GameMode.classic) {
  19842. this.ui.topNode.scoreNode.visible = false;
  19843. }
  19844. else if (xGame.common.gameMode == GameMode.bigMove) {
  19845. this.ui.topNode.scoreNode.visible = true;
  19846. }
  19847. }
  19848. show() {
  19849. super.show();
  19850. console.log("zh:uigame show AADD");
  19851. this.ui.alpha = 0;
  19852. this.updateSelf();
  19853. xGame.common.gameMgr.gamePause = false;
  19854. xGame.common.gameUI.ui.blackAni.visible = false;
  19855. xGame.common.gameUI.ui.whiteAni.visible = false;
  19856. this.ui.powerEft.visible = false;
  19857. this.ui.colorNode.visible = false;
  19858. this.updateHead();
  19859. let curUse = DataMgr.getCurBallRod();
  19860. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19861. this.getGanZiImg();
  19862. }
  19863. updateSelf() {
  19864. if (xGame.common.gameMode == GameMode.classic) {
  19865. this.ui.c1.selectedIndex = 0;
  19866. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19867. this.ui.topNode.middleNode.visible = true;
  19868. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19869. }
  19870. else if (xGame.common.gameMode == GameMode.bigMove) {
  19871. this.ui.c1.selectedIndex = 0;
  19872. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19873. this.ui.topNode.middleNode.visible = false;
  19874. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19875. let rand = xGame.common.randomNum(1, max);
  19876. let guide = DataMgr.getSkillGuide();
  19877. if (guide == 0)
  19878. rand = 1;
  19879. xGame.common.bigMoveLevelIndex = rand;
  19880. }
  19881. else if (xGame.common.gameMode == GameMode.placeBall) {
  19882. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19883. this.ui.c1.selectedIndex = 1 + data.type;
  19884. this.ui.alpha = 1;
  19885. this.startGame();
  19886. }
  19887. this.updateMode();
  19888. this.initD3world();
  19889. this.initD2world();
  19890. }
  19891. startGame() {
  19892. this.ui.snowNode.visible = Math.random() <= 0.1;
  19893. this.ui.d2Node.visible = false;
  19894. xGame.common.d3World.d3Hand.gameObj.active = false;
  19895. xGame.common.d3World.tableSrc.init();
  19896. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19897. this.cameraViewChange(() => {
  19898. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19899. switch (xGame.common.gameMode) {
  19900. case GameMode.classic:
  19901. xGame.common.d3World.d3Hand.gameObj.active = true;
  19902. this.playPutBallD3Ani();
  19903. break;
  19904. case GameMode.bigMove:
  19905. this.enterGame();
  19906. Laya.timer.once(500, this, () => {
  19907. this.ui.topNode.middleNode.visible = true;
  19908. this.ui.topNode.middleNode.t0.play();
  19909. });
  19910. break;
  19911. case GameMode.placeBall:
  19912. this.enterGame();
  19913. break;
  19914. default:
  19915. break;
  19916. }
  19917. });
  19918. PlatMgr.showBanner(false);
  19919. }
  19920. enterGame() {
  19921. this.ui.d2Node.visible = true;
  19922. xGame.common.d3World.d3Hand.gameObj.active = false;
  19923. xGame.common.showOneCamera("mainCamera");
  19924. Moyu.recordGame(30, true);
  19925. if (!this.isPrePlay) {
  19926. this.isPrePlay = true;
  19927. xGame.common.d3World.prePlayEft();
  19928. }
  19929. xGame.common.gameMgr.gameReady();
  19930. this.openAllEvent();
  19931. this.ui.snowNode.visible = false;
  19932. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19933. this.ui.helpBtn.visible = condition;
  19934. }
  19935. showHelpLineGuide() {
  19936. let longGuide = DataMgr.getGuideHelpLine();
  19937. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19938. this.ui.helpBtn.visible = true;
  19939. this.ui.guideNode.visible = true;
  19940. }
  19941. }
  19942. setTurnAlpha(alpha) {
  19943. this.ui.keduNode.alpha = alpha;
  19944. this.ui.ganNode.alpha = alpha;
  19945. this.ui.rodMethodNode.alpha = alpha;
  19946. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19947. }
  19948. cameraViewChange(callback) {
  19949. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19950. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19951. xGame.common.showOneCamera("visitAngle");
  19952. cameraSrc.localRotationEulerY = 180;
  19953. cameraSrc.localRotationEulerZ = 0;
  19954. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19955. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19956. callback && callback();
  19957. }));
  19958. }));
  19959. }
  19960. playPutBallD3Ani() {
  19961. xGame.common.showOneCamera("mainCamera");
  19962. let handSrc = xGame.common.d3World.d3Hand;
  19963. handSrc.gameObj.active = true;
  19964. handSrc.transform.localPositionZ = 3;
  19965. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19966. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19967. handSrc.gameObj.active = false;
  19968. this.enterGame();
  19969. }), 400);
  19970. }));
  19971. }
  19972. updateHead() {
  19973. let user = Moyu.getUserInfo();
  19974. this.ui.topNode.selfNameTxt.text = user.nickName;
  19975. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19976. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19977. if (DataMgr.getSkillGuide() < 1) {
  19978. this.ui.topNode.aiNameTxt.text = 'billiards';
  19979. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19980. }
  19981. else {
  19982. this.ui.topNode.aiNameTxt.text = aiData.name;
  19983. let randNo = Math.floor(Math.random() * 10) + 1;
  19984. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19985. }
  19986. }
  19987. initD2world() {
  19988. let node = this.ui.d2Root.displayObject;
  19989. let src = node.getComponent(D2World);
  19990. if (!src) {
  19991. xGame.common.d2World = node.addComponent(D2World);
  19992. }
  19993. xGame.common.d2World.initSelf();
  19994. }
  19995. initD3world() {
  19996. if (this.isD3Inited)
  19997. return;
  19998. this.isD3Inited = true;
  19999. let scene3D = xGame.common.d3Scene;
  20000. this.ui.d3Root.displayObject.addChild(scene3D);
  20001. scene3D.active = true;
  20002. xGame.common.d3World.tableSrc.setBorderPos();
  20003. }
  20004. onRootMove(e) {
  20005. let rootBall = xGame.common.d2World.rootBall;
  20006. this.ui.moveNode.x = e.x;
  20007. this.ui.moveNode.y = e.y;
  20008. rootBall.gameObj.x = e.x;
  20009. rootBall.gameObj.y = e.y;
  20010. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20011. }
  20012. aiRootMove(move) {
  20013. if (move)
  20014. this.hideBallUI();
  20015. else {
  20016. this.showBallUI();
  20017. xGame.common.d2World.getHelpLine();
  20018. }
  20019. }
  20020. aiForce(type, force = 0) {
  20021. this.pressTarget = PressType.powerNode;
  20022. if (type == 1)
  20023. this.onEventUp({ force: true });
  20024. else if (type == 2)
  20025. this.onEventMove({ stageY: force, force: true });
  20026. }
  20027. onEventPress(e) {
  20028. if (e.stopPropagation)
  20029. e.stopPropagation();
  20030. if (!this.isTurnSelf())
  20031. return;
  20032. let target = e.target;
  20033. switch (target) {
  20034. case this.ui.myPowerNode.displayObject:
  20035. this.pressTarget = PressType.powerNode;
  20036. this.barInfo.curY = e.stageY;
  20037. this.updateBarInfo();
  20038. break;
  20039. case this.ui.moveNode.displayObject:
  20040. this.pressTarget = PressType.moveNode;
  20041. this.hideBallUI();
  20042. this.eventObj.curX = this.ui.moveNode.x;
  20043. this.eventObj.curY = this.ui.moveNode.y;
  20044. this.ui.moveNode.finger.visible = false;
  20045. this.eventObj.lastX = e.stageX;
  20046. this.eventObj.lastY = e.stageY;
  20047. break;
  20048. case this.ui.rulerClickNode.displayObject:
  20049. this.pressTarget = PressType.rulerNode;
  20050. this.eventObj.lastY = e.stageY;
  20051. break;
  20052. case this.ui.d2Root.displayObject:
  20053. this.pressTarget = PressType.d2Root;
  20054. this.eventObj.lastX = e.stageX;
  20055. this.eventObj.lastY = e.stageY;
  20056. this.eventObj.starX = e.stageX;
  20057. this.eventObj.starY = e.stageY;
  20058. this.eventObj.curX = 0;
  20059. this.eventObj.curY = 0;
  20060. xGame.common.d2World.d2Gan.setGanLastInfo();
  20061. this.rulerOffset = 0;
  20062. break;
  20063. default:
  20064. break;
  20065. }
  20066. }
  20067. onEventMove(e) {
  20068. if (e.stopPropagation)
  20069. e.stopPropagation();
  20070. if (e && e.force) {
  20071. }
  20072. else {
  20073. if (!this.isTurnSelf())
  20074. return;
  20075. }
  20076. switch (this.pressTarget) {
  20077. case PressType.powerNode:
  20078. this.barInfo.curY = e.stageY;
  20079. this.updateBarInfo();
  20080. this.isMoveRod = true;
  20081. break;
  20082. case PressType.moveNode:
  20083. let rootBall = xGame.common.d2World.rootBall;
  20084. let radius = rootBall.gameObj.width / 2;
  20085. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20086. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20087. let border = xGame.common.d2World.borderRect;
  20088. if (curX <= border.x + radius)
  20089. curX = border.x + radius;
  20090. else if (curX >= border.x + border.width - radius)
  20091. curX = border.x + border.width - radius;
  20092. if (curY <= border.y + radius)
  20093. curY = border.y + radius;
  20094. else if (curY >= border.y + border.height - radius)
  20095. curY = border.y + border.height - radius;
  20096. if (xGame.common.gameMgr.isOpenBall) {
  20097. if (curX >= border.x + border.openBallW - radius)
  20098. curX = border.x + border.openBallW - radius;
  20099. }
  20100. this.ui.moveNode.x = curX;
  20101. this.ui.moveNode.y = curY;
  20102. rootBall.gameObj.x = curX;
  20103. rootBall.gameObj.y = curY;
  20104. rootBall.d3BallSrc.setTransPos(curX, curY);
  20105. this.isMoveRod = true;
  20106. break;
  20107. case PressType.rulerNode:
  20108. let yy = e.stageY - this.eventObj.lastY;
  20109. this.eventObj.lastY = e.stageY;
  20110. let ruler1 = this.ui.rulerNode.img1;
  20111. let ruler2 = this.ui.rulerNode.img2;
  20112. ruler1.y += yy;
  20113. ruler2.y += yy;
  20114. this.rulerOffset += yy;
  20115. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20116. this.rulerOffset = 0;
  20117. xGame.soundMgr.playSound("inch", 1, 10);
  20118. }
  20119. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20120. let h = ruler1.height;
  20121. this.checkGuide();
  20122. this.isMoveRod = true;
  20123. if (ruler1.y >= h) {
  20124. ruler1.y = -h;
  20125. ruler2.y = 0;
  20126. return;
  20127. }
  20128. else if (ruler1.y <= -h) {
  20129. ruler1.y = h;
  20130. ruler2.y = 0;
  20131. return;
  20132. }
  20133. if (ruler2.y >= h) {
  20134. ruler2.y = -h;
  20135. ruler1.y = 0;
  20136. return;
  20137. }
  20138. else if (ruler2.y <= -h) {
  20139. ruler2.y = h;
  20140. ruler1.y = 0;
  20141. return;
  20142. }
  20143. break;
  20144. case PressType.d2Root:
  20145. this.eventObj.curX = e.stageX;
  20146. this.eventObj.curY = e.stageY;
  20147. let offset = this.checkRodMoveDir();
  20148. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20149. this.eventObj.lastX = e.stageX;
  20150. this.eventObj.lastY = e.stageY;
  20151. break;
  20152. default:
  20153. break;
  20154. }
  20155. }
  20156. onEventUp(e) {
  20157. if (e.stopPropagation)
  20158. e.stopPropagation();
  20159. if (e && e.force) {
  20160. }
  20161. else {
  20162. if (!this.isTurnSelf())
  20163. return;
  20164. }
  20165. switch (this.pressTarget) {
  20166. case PressType.powerNode:
  20167. this.ui.powerNode.value = 0;
  20168. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20169. this.ui.powerTxt.text = "";
  20170. if (this.powerNum > 0) {
  20171. xGame.eventMgr.event(BALL_SHOOT);
  20172. xGame.common.d2World.shoot(this.powerNum);
  20173. xGame.common.d2World.d2Gan.shoot();
  20174. xGame.common.d2World.d2HelpLine.shoot();
  20175. this.finishGuide();
  20176. this.ui.powerEft.visible = false;
  20177. this.ui.colorNode.visible = false;
  20178. let ganStr = "";
  20179. if (this.powerNum <= 30) {
  20180. ganStr = "gan_30";
  20181. }
  20182. else if (this.powerNum <= 60) {
  20183. ganStr = "gan_50";
  20184. }
  20185. else {
  20186. ganStr = "gan_80";
  20187. }
  20188. xGame.soundMgr.playSound(ganStr);
  20189. }
  20190. break;
  20191. case PressType.moveNode:
  20192. let rootBall = xGame.common.d2World.rootBall;
  20193. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20194. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20195. let isIntersect = this.judgeBallIntersect();
  20196. if (isIntersect) {
  20197. this.ui.moveNode.x = lastX;
  20198. this.ui.moveNode.y = lastY;
  20199. rootBall.gameObj.x = lastX;
  20200. rootBall.gameObj.y = lastY;
  20201. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20202. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20203. }
  20204. else {
  20205. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20206. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20207. }
  20208. this.showBallUI();
  20209. this.ui.moveNode.finger.visible = true;
  20210. xGame.common.d2World.getHelpLine();
  20211. break;
  20212. case PressType.rulerNode:
  20213. break;
  20214. case PressType.d2Root:
  20215. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20216. if (dis <= 25) {
  20217. this.moveToClickDot(e);
  20218. }
  20219. break;
  20220. default:
  20221. break;
  20222. }
  20223. this.pressTarget = -1;
  20224. }
  20225. checkGuide() {
  20226. let guide = DataMgr.getSkillGuide();
  20227. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20228. xGame.common.guideStep++;
  20229. xGame.common.gameUI.ui.guide2.visible = false;
  20230. xGame.common.gameUI.ui.guide3.visible = true;
  20231. }
  20232. }
  20233. finishGuide() {
  20234. let guide = DataMgr.getSkillGuide();
  20235. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20236. xGame.common.guideStep = 10;
  20237. this.closeAllGuide();
  20238. console.log('zh: 新手引导完毕');
  20239. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20240. }
  20241. }
  20242. closeAllGuide() {
  20243. xGame.common.gameUI.ui.guide1.visible = false;
  20244. xGame.common.gameUI.ui.guide2.visible = false;
  20245. xGame.common.gameUI.ui.guide3.visible = false;
  20246. }
  20247. updateBarInfo() {
  20248. let star = this.ui.powerNode.y;
  20249. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20250. if (rate >= 1)
  20251. rate = 1;
  20252. if (rate <= 0)
  20253. rate = 0;
  20254. this.powerNum = Math.ceil(rate * 100);
  20255. this.ui.powerNode.value = this.powerNum;
  20256. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20257. this.ui.colorNode.value = this.powerNum;
  20258. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20259. this.ui.powerEft.visible = this.powerNum != 0;
  20260. this.ui.colorNode.visible = this.powerNum != 0;
  20261. this.ui.powerTxt.text = this.powerNum + "";
  20262. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20263. }
  20264. forceCancel() {
  20265. this.ui.powerNode.value = 0;
  20266. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20267. this.ui.powerTxt.text = "";
  20268. }
  20269. checkRodMoveDir() {
  20270. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20271. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20272. if (tempX >= 0 && tempY <= 0) {
  20273. return this.checkDir();
  20274. }
  20275. else if (tempX < 0 && tempY < 0) {
  20276. return this.checkDir(1, -1);
  20277. }
  20278. else if (tempX < 0 && tempY > 0) {
  20279. return this.checkDir(-1, -1);
  20280. }
  20281. else {
  20282. return this.checkDir(-1, 1);
  20283. }
  20284. }
  20285. checkDir(flagX = 1, flagY = 1) {
  20286. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20287. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20288. if (offsetY == 0) {
  20289. return offsetX * flagX;
  20290. }
  20291. if (offsetX == 0) {
  20292. return offsetY * flagY;
  20293. }
  20294. let angle = offsetY / offsetX;
  20295. if (Math.abs(angle) >= 1) {
  20296. return offsetY * flagY;
  20297. }
  20298. else {
  20299. return offsetX * flagX;
  20300. }
  20301. }
  20302. judgeBallIntersect() {
  20303. let rootBall = xGame.common.d2World.rootBall;
  20304. let ballArr = xGame.common.d2World.ballArr;
  20305. let radius = rootBall.gameObj.width / 2;
  20306. let temp;
  20307. let isIntersect = false;
  20308. for (let index = 0; index < ballArr.length; index++) {
  20309. temp = ballArr[index];
  20310. if (temp.number == rootBall.number)
  20311. continue;
  20312. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20313. if (isIntersect) {
  20314. break;
  20315. }
  20316. }
  20317. return isIntersect;
  20318. }
  20319. hideBallUI() {
  20320. let d2Gan = xGame.common.d2World.d2Gan;
  20321. if (!d2Gan.ui.isDisposed)
  20322. d2Gan.ui.visible = false;
  20323. let d2Help = xGame.common.d2World.d2HelpLine;
  20324. if (!d2Help.ui.isDisposed)
  20325. d2Help.ui.visible = false;
  20326. let rootBall = xGame.common.d2World.rootBall;
  20327. if (!rootBall.destroyed) {
  20328. rootBall.gameObj.active = false;
  20329. }
  20330. }
  20331. showBallUI() {
  20332. let d2Gan = xGame.common.d2World.d2Gan;
  20333. if (!d2Gan.ui.isDisposed)
  20334. d2Gan.ui.visible = true;
  20335. let d2Help = xGame.common.d2World.d2HelpLine;
  20336. if (!d2Help.ui.isDisposed)
  20337. d2Help.ui.visible = true;
  20338. let rootBall = xGame.common.d2World.rootBall;
  20339. if (!rootBall.destroyed) {
  20340. rootBall.gameObj.active = true;
  20341. }
  20342. }
  20343. moveToClickDot(e) {
  20344. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20345. let root = xGame.common.d2World.rootBall.gameObj;
  20346. let xx = e.stageX - xGame.common.sysOffestNum;
  20347. let yy = e.stageY;
  20348. let x = xx - root.x;
  20349. let y = yy - root.y;
  20350. let angle = xGame.common.getfguiRotation(x, y);
  20351. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20352. xGame.common.d2World.getHelpLine();
  20353. }
  20354. this.isMoveRod = false;
  20355. xGame.common.clickedBall = false;
  20356. }
  20357. openAllEvent() {
  20358. this.closeAllEvent();
  20359. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20360. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20361. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20362. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20363. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20364. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20365. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20366. }
  20367. closeAllEvent() {
  20368. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20369. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20370. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20371. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20372. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20373. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20374. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20375. }
  20376. resetGame() {
  20377. this.closeAllEvent();
  20378. this.hideBallUI();
  20379. xGame.common.gameMgr.gamePause = true;
  20380. }
  20381. }
  20382. UIGame$1.uiName = "UIGame";
  20383. class UIAddCoin$1 extends UIBase {
  20384. constructor() {
  20385. super();
  20386. this.coinNum = 2000;
  20387. }
  20388. onConstructor() {
  20389. this.ui = ui_UIAddCoin.createInstance();
  20390. this.contentPane = this.ui;
  20391. this.isEject = false;
  20392. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20393. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20394. }
  20395. show() {
  20396. super.show();
  20397. this.ui.t0.play();
  20398. }
  20399. videoAddCoin() {
  20400. console.log('zh:qjff_AD_for_UIAddCoin');
  20401. if (Laya.Browser.onAndroid) {
  20402. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20403. if (!boo) {
  20404. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20405. return;
  20406. }
  20407. }
  20408. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20409. }
  20410. else {
  20411. console.log('zh:AD 失败,直接发放奖励');
  20412. this.qjff_AD_for_UIAddCoin();
  20413. }
  20414. }
  20415. qjff_AD_for_UIAddCoin() {
  20416. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20417. this.hide();
  20418. }
  20419. }
  20420. UIAddCoin$1.uiName = "UIAddCoin";
  20421. class UIInvitation$1 extends UIBase {
  20422. constructor() {
  20423. super();
  20424. }
  20425. onConstructor() {
  20426. this.ui = ui_UIInvitation.createInstance();
  20427. this.contentPane = this.ui;
  20428. this.isEject = false;
  20429. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20430. }
  20431. show() {
  20432. super.show();
  20433. }
  20434. enterGame() {
  20435. xGame.common.gameMode = GameMode.classic;
  20436. DataMgr.setChallengeTimes(1);
  20437. xGame.common.passAwardCoin = 2000;
  20438. let need = xGame.common.classicNiceNeddCoin;
  20439. if (DataMgr.coinEnough(need)) {
  20440. DataMgr.setCoin(-need);
  20441. xGame.eventMgr.event(RESTART_GAME, true);
  20442. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20443. }
  20444. else {
  20445. xGame.eventMgr.event(RESTART_GAME, true);
  20446. }
  20447. this.hide();
  20448. }
  20449. hide() {
  20450. super.hide();
  20451. }
  20452. }
  20453. UIInvitation$1.uiName = "UIInvitation";
  20454. class UIPower$1 extends UIBase {
  20455. constructor() {
  20456. super();
  20457. }
  20458. onConstructor() {
  20459. this.ui = ui_UIPower.createInstance();
  20460. this.contentPane = this.ui;
  20461. this.isEject = false;
  20462. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20463. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20464. }
  20465. show() {
  20466. super.show();
  20467. this.ui.t0.play();
  20468. }
  20469. videoGetPower() {
  20470. console.log('zh:qjff_AD_for_uipower');
  20471. if (Laya.Browser.onAndroid) {
  20472. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20473. if (!boo) {
  20474. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20475. return;
  20476. }
  20477. }
  20478. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20479. }
  20480. else {
  20481. console.log('zh:AD 失败,直接发放奖励');
  20482. this.qjff_AD_for_uipower();
  20483. }
  20484. }
  20485. qjff_AD_for_uipower() {
  20486. DataMgr.setPower(xGame.common.videoPower, true);
  20487. xGame.eventMgr.event(POWER_TIME);
  20488. this.hide();
  20489. }
  20490. }
  20491. UIPower$1.uiName = "UIPower";
  20492. class UIGameEnd$1 extends UIBase {
  20493. constructor() {
  20494. super();
  20495. this.success = false;
  20496. this.awardCoinNum = 1000;
  20497. this.awardDiamondNum = 10;
  20498. }
  20499. onConstructor() {
  20500. this.ui = ui_UIGameEnd.createInstance();
  20501. this.contentPane = this.ui;
  20502. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20503. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20504. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20505. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20506. this.ui.talkNode.visible = false;
  20507. if (Moyu.isKs)
  20508. this.ui.closeNode.closeBtn.x += 100;
  20509. }
  20510. updateType() {
  20511. switch (xGame.common.gameMode) {
  20512. case GameMode.classic:
  20513. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20514. this.ui.coinNode.visible = this.success;
  20515. if (!this.success) {
  20516. Laya.timer.once(500, this, () => {
  20517. xGame.uiMgr.Show(UIAddCoin$1);
  20518. });
  20519. }
  20520. else {
  20521. this.logEventForClassic_win();
  20522. }
  20523. this.logEventForClassic_complete();
  20524. this.ui.isGetAward.visible = false;
  20525. this.ui.leftBtn.c1.selectedIndex = 3;
  20526. this.ui.rightBtn.c1.selectedIndex = 0;
  20527. this.moneyNode.ui.c1.selectedIndex = 1;
  20528. break;
  20529. case GameMode.bigMove:
  20530. console.log('zh:招法模式 aaaaaa bigMove');
  20531. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20532. this.ui.coinNode.visible = this.success;
  20533. if (xGame.common.gameMode == GameMode.bigMove) {
  20534. if (this.success) {
  20535. DataMgr.setSkillSuccessTimes(1, true);
  20536. DataMgr.setSkillAccTimes(1);
  20537. }
  20538. else {
  20539. DataMgr.setSkillSuccessTimes(0, false);
  20540. }
  20541. }
  20542. this.logEventForRod_complete_N();
  20543. if (!this.success) {
  20544. Laya.timer.once(500, this, () => {
  20545. xGame.uiMgr.Show(UIAddCoin$1);
  20546. });
  20547. }
  20548. else {
  20549. this.logEventForRod_win();
  20550. }
  20551. this.ui.isGetAward.visible = false;
  20552. this.ui.leftBtn.c1.selectedIndex = 3;
  20553. this.ui.rightBtn.c1.selectedIndex = 0;
  20554. this.moneyNode.ui.c1.selectedIndex = 1;
  20555. break;
  20556. case GameMode.placeBall:
  20557. this.ui.coinNode.visible = false;
  20558. if (this.success) {
  20559. if (xGame.common.placeBallStarNum == 3) {
  20560. this.ui.c1.selectedIndex = 2;
  20561. }
  20562. else {
  20563. this.ui.c1.selectedIndex = 3;
  20564. }
  20565. let level = xGame.common.placeBallCurLevel;
  20566. if (level > 59) {
  20567. this.logEventForChallenge_level_complete(level);
  20568. }
  20569. else {
  20570. this.logEventForChallenge_level_N(level);
  20571. }
  20572. }
  20573. else {
  20574. this.ui.c1.selectedIndex = 4;
  20575. }
  20576. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20577. if (cfg.type == PlaceBallType.challenge) {
  20578. this.ui.c1.selectedIndex = 2;
  20579. }
  20580. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20581. this.updatePlaceBallBtn();
  20582. this.updatePlaceBallStarNum();
  20583. this.updatePlaceBallAwardState();
  20584. this.moneyNode.ui.c1.selectedIndex = 2;
  20585. this.moneyNode.checkPowerTime();
  20586. this.moneyNode.powerChange();
  20587. DataMgr.upRankData();
  20588. break;
  20589. default:
  20590. break;
  20591. }
  20592. }
  20593. logEventForRod_complete_N() {
  20594. let gfmsIdx = xGame.common.curPlayerSkillType;
  20595. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20596. let gfmc = 'Skyfall Shot';
  20597. if (gfmsIdx == 0) {
  20598. gfmc = 'Skyfall Shot';
  20599. }
  20600. if (gfmsIdx == 1) {
  20601. gfmc = 'Surging break';
  20602. }
  20603. if (gfmsIdx == 2) {
  20604. gfmc = 'Frost Lock';
  20605. }
  20606. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20607. console.log('zh:logEventForRod_complete_N level = ' + level);
  20608. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20609. let jsonStr = {
  20610. "count": 0,
  20611. "name": gfmc
  20612. };
  20613. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20614. const d = LocalStorageManager.getItem(keyStr);
  20615. jsonStr.count = d.count + 1;
  20616. LocalStorageManager.setItem(keyStr, jsonStr);
  20617. }
  20618. else {
  20619. LocalStorageManager.setItem(keyStr, jsonStr);
  20620. }
  20621. const d2 = LocalStorageManager.getItem(keyStr);
  20622. let count = d2.count;
  20623. console.log('zh:logEventForRod_complete_N count = ' + count);
  20624. if (count % 5 == 0) {
  20625. const reqStr = JSON.stringify(jsonStr);
  20626. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20627. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20628. }
  20629. }
  20630. logEventForRod_win() {
  20631. console.log('zh:logEventForRod_win,胜利');
  20632. let gfmsIdx = xGame.common.curPlayerSkillType;
  20633. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20634. let gfmc = 'Skyfall Shot';
  20635. if (gfmsIdx == 0) {
  20636. gfmc = 'Skyfall Shot';
  20637. }
  20638. if (gfmsIdx == 1) {
  20639. gfmc = 'Surging break';
  20640. }
  20641. if (gfmsIdx == 2) {
  20642. gfmc = 'Frost Lock';
  20643. }
  20644. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20645. console.log('zh:logEventForRod_win level = ' + level);
  20646. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20647. let jsonStr = {
  20648. "count": 1,
  20649. "name": gfmc + ' Lev' + level
  20650. };
  20651. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20652. const d = LocalStorageManager.getItem(keyStr);
  20653. jsonStr.count = d.count + 1;
  20654. LocalStorageManager.setItem(keyStr, jsonStr);
  20655. }
  20656. else {
  20657. LocalStorageManager.setItem(keyStr, jsonStr);
  20658. }
  20659. const reqStr = JSON.stringify(jsonStr);
  20660. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20661. }
  20662. logEventForClassic_win() {
  20663. console.log('zh:logEventForClassic_win,胜利');
  20664. let rtype = xGame.common.classicRoomType;
  20665. let msmc = '';
  20666. if (rtype == 1) {
  20667. msmc = 'beginner';
  20668. }
  20669. if (rtype == 2) {
  20670. msmc = 'expert';
  20671. }
  20672. if (rtype == 3) {
  20673. msmc = 'master';
  20674. }
  20675. let keyStr = 'sjmd_classic_win_' + rtype;
  20676. let jsonStr = {
  20677. "difficulty": msmc,
  20678. "classic_count": 1,
  20679. "difficulty_count": 1
  20680. };
  20681. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20682. const d = LocalStorageManager.getItem(keyStr);
  20683. jsonStr.classic_count = d.classic_count + 1;
  20684. jsonStr.difficulty_count = d.difficulty_count + 1;
  20685. LocalStorageManager.setItem(keyStr, jsonStr);
  20686. }
  20687. else {
  20688. LocalStorageManager.setItem(keyStr, jsonStr);
  20689. }
  20690. const reqStr = JSON.stringify(jsonStr);
  20691. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20692. }
  20693. logEventForClassic_complete() {
  20694. console.log('zh:logEventForClassic_complete,胜利');
  20695. let rtype = xGame.common.classicRoomType;
  20696. let msmc = '';
  20697. if (rtype == 1) {
  20698. msmc = 'beginner';
  20699. }
  20700. if (rtype == 2) {
  20701. msmc = 'expert';
  20702. }
  20703. if (rtype == 3) {
  20704. msmc = 'master';
  20705. }
  20706. let keyStr = 'sjmd_classic_complete_' + rtype;
  20707. let jsonStr = {
  20708. "msmc": msmc,
  20709. "count": 0
  20710. };
  20711. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20712. const d = LocalStorageManager.getItem(keyStr);
  20713. jsonStr.count = d.count + 1;
  20714. LocalStorageManager.setItem(keyStr, jsonStr);
  20715. }
  20716. else {
  20717. LocalStorageManager.setItem(keyStr, jsonStr);
  20718. }
  20719. if (jsonStr.count % 5 == 0) {
  20720. const reqStr = JSON.stringify(jsonStr);
  20721. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20722. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20723. }
  20724. }
  20725. updatePlaceBallBtn() {
  20726. this.ui.leftBtn.c1.selectedIndex = 5;
  20727. if (this.success) {
  20728. this.ui.rightBtn.c1.selectedIndex = 14;
  20729. }
  20730. else {
  20731. if (xGame.common.placeBallStarNum == 3) {
  20732. this.ui.rightBtn.c1.selectedIndex = 14;
  20733. }
  20734. else {
  20735. this.ui.rightBtn.c1.selectedIndex = 1;
  20736. }
  20737. }
  20738. }
  20739. updatePlaceBallStarNum() {
  20740. let starNum = xGame.common.placeBallStarNum;
  20741. if (starNum == 0)
  20742. this.ui.starNumNode.c1.selectedIndex = 3;
  20743. else {
  20744. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20745. }
  20746. }
  20747. updatePlaceBallAwardState() {
  20748. let level = xGame.common.placeBallCurLevel;
  20749. let starNum = xGame.common.placeBallStarNum;
  20750. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20751. let data = cfgTable.placeballData[level].award;
  20752. let cfg = cfgTable.placeballData[level];
  20753. this.awardDiamondNum = data[1];
  20754. this.awardCoinNum = data[0];
  20755. if (cfg.type == PlaceBallType.challenge) {
  20756. this.awardDiamondNum = 0;
  20757. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20758. }
  20759. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20760. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20761. if (cfg.type == PlaceBallType.challenge) {
  20762. this.ui.awardNode.coinNode.visible = true;
  20763. }
  20764. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20765. this.ui.awardNode.diamondNode.x = 265;
  20766. this.ui.awardNode.coinNode.x = 354;
  20767. }
  20768. else {
  20769. this.ui.awardNode.diamondNode.x = 291;
  20770. this.ui.awardNode.coinNode.x = 291;
  20771. }
  20772. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20773. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20774. if (this.awardCoinNum == 0) {
  20775. this.ui.awardNode.coinNode.numTxt.text = "";
  20776. }
  20777. if (getAward) {
  20778. this.ui.isGetAward.visible = true;
  20779. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20780. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20781. }
  20782. else {
  20783. this.ui.isGetAward.visible = false;
  20784. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20785. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20786. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20787. }
  20788. else {
  20789. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20790. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20791. }
  20792. }
  20793. }
  20794. show(success) {
  20795. super.show();
  20796. xGame.eventMgr.event(RESET_GAME);
  20797. this.success = success;
  20798. Laya.timer.clearAll(this);
  20799. this.playSecretaryAni();
  20800. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20801. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20802. offsetTime = Math.floor(offsetTime / 1000);
  20803. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20804. this.updateType();
  20805. Laya.timer.once(200, this, () => {
  20806. this.addAward(() => {
  20807. this.updateType();
  20808. Laya.timer.once(500, this, () => {
  20809. this.showChallengeLevel();
  20810. });
  20811. });
  20812. });
  20813. if (this.success) {
  20814. JSBridgeUtils.instance.showInternAd('gameend_success');
  20815. console.log('zh:game end 成功');
  20816. xGame.soundMgr.playSound('slots_roll01');
  20817. xGame.soundMgr.playSound("s_win");
  20818. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20819. this.diyGameDataUtilForGameWin();
  20820. }
  20821. else {
  20822. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20823. console.log('zh:game end失败');
  20824. xGame.soundMgr.playSound('matchwin01');
  20825. xGame.soundMgr.playSound("s_lose");
  20826. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20827. }
  20828. let challengeNum = DataMgr.getChallengeTimes();
  20829. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20830. DataMgr.setChallengeTimes(1);
  20831. }
  20832. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20833. DataMgr.setClassicTimes();
  20834. }
  20835. }
  20836. diyGameDataUtilForGameWin() {
  20837. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20838. switch (xGame.common.gameMode) {
  20839. case GameMode.classic:
  20840. console.log('zh:DiyGameDataUtilForGameWin 111');
  20841. case GameMode.bigMove:
  20842. console.log('zh:DiyGameDataUtilForGameWin 222');
  20843. this.restartGame();
  20844. break;
  20845. case GameMode.placeBall:
  20846. console.log('zh:DiyGameDataUtilForGameWin 333');
  20847. var level = xGame.common.placeBallCurLevel;
  20848. console.log('zh:练习模式 联系了多少LEV=' + level);
  20849. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20850. if (level > db_over_lev) {
  20851. DataMgr.setChallengeMode_overLev(level);
  20852. }
  20853. break;
  20854. default:
  20855. console.log('zh:DiyGameDataUtilForGameWin 444');
  20856. break;
  20857. }
  20858. }
  20859. showChallengeLevel() {
  20860. if (DataMgr.getChallengeTimes() != 0)
  20861. return;
  20862. let skill = DataMgr.getSkillAccTimes();
  20863. let put = DataMgr.getPlaceBallLevelList().length;
  20864. if (skill >= 3 || put >= 5) {
  20865. xGame.uiMgr.Show(UIInvitation$1);
  20866. this.hide();
  20867. }
  20868. }
  20869. addAward(callback) {
  20870. if (!this.success) {
  20871. callback && callback();
  20872. return;
  20873. }
  20874. switch (xGame.common.gameMode) {
  20875. case GameMode.classic:
  20876. this.awardCoinNum = xGame.common.passAwardCoin;
  20877. this.awardDiamondNum = 0;
  20878. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20879. break;
  20880. case GameMode.bigMove:
  20881. this.awardCoinNum = xGame.common.passAwardCoin;
  20882. this.awardDiamondNum = 0;
  20883. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20884. callback && callback();
  20885. break;
  20886. case GameMode.placeBall:
  20887. let level = xGame.common.placeBallCurLevel;
  20888. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20889. if (xGame.common.placeBallStarNum != 3) {
  20890. callback && callback();
  20891. return;
  20892. }
  20893. else {
  20894. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20895. if (getAward) {
  20896. callback && callback();
  20897. return;
  20898. }
  20899. }
  20900. let cfg = cfgTable.placeballData[level];
  20901. let data = cfgTable.placeballData[level].award;
  20902. this.awardCoinNum = data[0];
  20903. this.awardDiamondNum = data[1];
  20904. if (cfg.type == PlaceBallType.challenge) {
  20905. this.awardDiamondNum = 0;
  20906. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20907. }
  20908. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20909. let diamondAward;
  20910. if (this.awardDiamondNum > 0) {
  20911. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20912. xGame.common.getAward([diamondAward, coinAward], callback);
  20913. }
  20914. else {
  20915. xGame.common.getAward([coinAward], callback);
  20916. }
  20917. if (cfg.type == PlaceBallType.normal) {
  20918. DataMgr.setPlaceBallAward(level);
  20919. }
  20920. break;
  20921. default:
  20922. break;
  20923. }
  20924. }
  20925. playSecretaryAni_old() {
  20926. let parent = this.ui.secretary.displayObject;
  20927. parent.destroyChildren();
  20928. let xx = this.ui.secretary.width / 2;
  20929. let yy = this.ui.secretary.height;
  20930. let scale = xGame.common.getSecretaryScale();
  20931. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20932. if (this.success) {
  20933. let rand = Math.random() <= 0.5 ? 2 : 3;
  20934. xGame.common.secretary.play(data, rand, false, parent, () => {
  20935. xGame.common.secretary.play(data, 1, true, parent);
  20936. });
  20937. }
  20938. else {
  20939. xGame.common.secretary.play(data, 0, true, parent);
  20940. }
  20941. }
  20942. playSecretaryAni() {
  20943. let parent = this.ui.secretary.displayObject;
  20944. parent.destroyChildren();
  20945. let xx = this.ui.secretary.width / 2;
  20946. let yy = this.ui.secretary.height;
  20947. let scale = xGame.common.getSecretaryScale();
  20948. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20949. if (this.success) {
  20950. let rand = 0;
  20951. xGame.common.secretary.play(data, 0, true, parent);
  20952. }
  20953. else {
  20954. xGame.common.secretary.play(data, 0, true, parent);
  20955. }
  20956. }
  20957. restartGame() {
  20958. switch (xGame.common.gameMode) {
  20959. case GameMode.classic:
  20960. xGame.eventMgr.event(RESTART_GAME);
  20961. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20962. break;
  20963. case GameMode.bigMove:
  20964. this.hide();
  20965. xGame.eventMgr.event(RESTART_GAME);
  20966. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20967. break;
  20968. default:
  20969. break;
  20970. }
  20971. }
  20972. hide() {
  20973. super.hide();
  20974. xGame.common.stopGirlPop(this.ui.talkNode);
  20975. PlatMgr.showBanner(false);
  20976. }
  20977. returnHome() {
  20978. this.hide();
  20979. let showFailWords = !this.success;
  20980. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20981. }
  20982. clickLeftBtn() {
  20983. switch (xGame.common.gameMode) {
  20984. case GameMode.classic:
  20985. case GameMode.bigMove:
  20986. this.returnHome();
  20987. break;
  20988. case GameMode.placeBall:
  20989. let level = xGame.common.placeBallCurLevel;
  20990. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20991. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20992. break;
  20993. default:
  20994. break;
  20995. }
  20996. }
  20997. powerStartPlaceBallLevel(level, btn) {
  20998. if (DataMgr.powerEnough()) {
  20999. btn.touchable = false;
  21000. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21001. btn.touchable = true;
  21002. DataMgr.setPower(-1);
  21003. xGame.eventMgr.event(POWER_TIME);
  21004. this.startPlaceBallLevel(level);
  21005. this.logEventForChallenge_level_start(level);
  21006. }));
  21007. }
  21008. else {
  21009. xGame.uiMgr.Show(UIPower$1, 0);
  21010. }
  21011. }
  21012. clickRightBtn() {
  21013. switch (xGame.common.gameMode) {
  21014. case GameMode.classic:
  21015. console.log('zh:clickRightBtn 111');
  21016. case GameMode.bigMove:
  21017. console.log('zh:clickRightBtn 222');
  21018. this.restartGame();
  21019. break;
  21020. case GameMode.placeBall:
  21021. console.log('zh:clickRightBtn 333');
  21022. let level = xGame.common.placeBallCurLevel;
  21023. let data = DataMgr.getPlaceBallLevel(level);
  21024. let curPss = data.play && !data.isCur;
  21025. if (curPss) {
  21026. console.log('zh:clickRightBtn 333-111');
  21027. console.log('zh:当前LV=' + level);
  21028. if (level == 60) {
  21029. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21030. Laya.timer.once(3000, this, () => {
  21031. this.returnHome();
  21032. });
  21033. }
  21034. else {
  21035. let lev = level + 1;
  21036. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21037. }
  21038. }
  21039. else {
  21040. console.log('zh:clickRightBtn 333-000');
  21041. Moyu.sendDataEvent("placeBallNextLevel");
  21042. console.log('zh:qjff_AD_for_uiGameEnd');
  21043. if (Laya.Browser.onAndroid) {
  21044. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21045. if (!boo) {
  21046. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21047. return;
  21048. }
  21049. }
  21050. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21051. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21052. }
  21053. else {
  21054. console.log('zh:AD 失败,直接发放奖励');
  21055. this.qjff_AD_for_uiGameEnd(level);
  21056. }
  21057. }
  21058. break;
  21059. default:
  21060. console.log('zh:clickRightBtn 444');
  21061. break;
  21062. }
  21063. }
  21064. logEventForChallenge_level_start(level) {
  21065. let keyStr = 'sjmd_challenge_level_start';
  21066. let jsonStr = {
  21067. "count": 0,
  21068. "gold_balance ": DataMgr.getCoin(),
  21069. "level": level,
  21070. "diamond_balance ": DataMgr.getDiamond()
  21071. };
  21072. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21073. const d = LocalStorageManager.getItem(keyStr);
  21074. if (level > d.level) {
  21075. jsonStr.count = d.count + 1;
  21076. LocalStorageManager.setItem(keyStr, jsonStr);
  21077. }
  21078. else {
  21079. }
  21080. }
  21081. else {
  21082. LocalStorageManager.setItem(keyStr, jsonStr);
  21083. }
  21084. const reqStr = JSON.stringify(jsonStr);
  21085. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21086. }
  21087. qjff_AD_for_uiGameEnd(level) {
  21088. DataMgr.setPlaceBallLevel(level, 1);
  21089. this.startPlaceBallLevel(level + 1);
  21090. }
  21091. startPlaceBallLevel(level) {
  21092. xGame.common.gameMode = GameMode.placeBall;
  21093. xGame.common.placeBallCurLevel = level;
  21094. xGame.uiMgr.Show(UIGame$1);
  21095. this.hide();
  21096. }
  21097. logEventForChallenge_level_complete(level) {
  21098. let keyStr = 'sjmd_challenge_level_complete';
  21099. let jsonStr = {
  21100. "count": 1,
  21101. "gold_balance ": DataMgr.getCoin(),
  21102. "level": level,
  21103. "diamond_balance ": DataMgr.getDiamond()
  21104. };
  21105. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21106. const d = LocalStorageManager.getItem(keyStr);
  21107. jsonStr.count = d.count + 1;
  21108. LocalStorageManager.setItem(keyStr, jsonStr);
  21109. }
  21110. else {
  21111. LocalStorageManager.setItem(keyStr, jsonStr);
  21112. }
  21113. const reqStr = JSON.stringify(jsonStr);
  21114. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21115. }
  21116. logEventForChallenge_level_N(level) {
  21117. console.log('zh:logEventForChallenge_level_N ' + level);
  21118. let keyStr = 'sjmd_challenge_level_N';
  21119. if (LocalStorageManager.hasKey(keyStr)) {
  21120. let lev = LocalStorageManager.getItem(keyStr);
  21121. if (level > lev) {
  21122. LocalStorageManager.setItem(keyStr, level);
  21123. }
  21124. if ((level) % 5 == 0) {
  21125. console.log('zh:每5关上报1次');
  21126. let sjmc = 'challenge_level_' + level;
  21127. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21128. let sjmcForFirebase = 'challenge_level_' + level;
  21129. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21130. }
  21131. else {
  21132. console.log('zh:5 no 上报');
  21133. }
  21134. }
  21135. else {
  21136. LocalStorageManager.setItem(keyStr, level);
  21137. }
  21138. }
  21139. }
  21140. UIGameEnd$1.uiName = "UIGameEnd";
  21141. class ShowItem$1 {
  21142. constructor() {
  21143. this.ui = ui_ShowItem.createInstance();
  21144. }
  21145. destroySelf() {
  21146. if (!this.ui.isDisposed) {
  21147. this.ui.removeFromParent();
  21148. this.ui.dispose();
  21149. }
  21150. }
  21151. setParent(parent) {
  21152. parent.addChild(this.ui);
  21153. }
  21154. setPos(x, y) {
  21155. this.ui.x = x;
  21156. this.ui.y = y;
  21157. }
  21158. setUrl(index) {
  21159. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21160. }
  21161. }
  21162. class UILevelProp$1 extends UIBase {
  21163. constructor() {
  21164. super();
  21165. this.firstPos = 385;
  21166. this.secondPos = 467;
  21167. this.showItemArr = [];
  21168. }
  21169. onFontLoaded() {
  21170. try {
  21171. this.ui.myNode.conditionTxt.font = "arial";
  21172. console.log("zh: onFontLoaded 设置arial字体成功");
  21173. }
  21174. catch (error) {
  21175. console.log("zh: constructor onFontLoaded加载arial字体失败");
  21176. }
  21177. }
  21178. onConstructor() {
  21179. this.ui = ui_UILevelProp.createInstance();
  21180. this.contentPane = this.ui;
  21181. this.isEject = false;
  21182. this.addUIClick(this.ui.closeBtn, this.hide);
  21183. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21184. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21185. }
  21186. show(level) {
  21187. super.show();
  21188. this.ui.t1.play();
  21189. this.level = level;
  21190. this.data = cfgTable.placeballData[this.level];
  21191. this.updateSelf();
  21192. this.showPreView();
  21193. this.moneyNode.ui.c1.selectedIndex = 2;
  21194. this.moneyNode.checkPowerTime();
  21195. this.moneyNode.powerChange();
  21196. }
  21197. showPreView() {
  21198. let item;
  21199. let data;
  21200. for (let index = 0; index < this.showItemArr.length; index++) {
  21201. item = this.showItemArr[index];
  21202. item.destroySelf();
  21203. }
  21204. this.showItemArr = [];
  21205. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21206. for (const key in cfgData) {
  21207. data = cfgData[key];
  21208. item = new ShowItem$1();
  21209. item.setParent(this.ui.myNode.displayRoot);
  21210. item.setPos(data.x, data.y);
  21211. item.setUrl(data.value);
  21212. this.showItemArr.push(item);
  21213. }
  21214. }
  21215. updateSelf() {
  21216. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21217. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21218. if (this.data.ball == -1) {
  21219. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21220. }
  21221. else {
  21222. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21223. }
  21224. let localData = DataMgr.getPlaceBallLevel(this.level);
  21225. let getAward = localData.getAward;
  21226. let cfg = cfgTable.placeballData[this.level];
  21227. let coin = this.data.award[0];
  21228. let diamond = this.data.award[1];
  21229. if (cfg.type == PlaceBallType.challenge) {
  21230. diamond = 0;
  21231. coin = 100;
  21232. }
  21233. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21234. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21235. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21236. if (cfg.type == PlaceBallType.challenge) {
  21237. this.ui.myNode.coinNode.numTxt.text = "";
  21238. }
  21239. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21240. if (coin > 0 && diamond > 0) {
  21241. this.ui.myNode.diamondNode.x = 385;
  21242. this.ui.myNode.coinNode.x = 467;
  21243. }
  21244. else {
  21245. this.ui.myNode.diamondNode.x = 385;
  21246. this.ui.myNode.coinNode.x = 385;
  21247. }
  21248. if (!getAward) {
  21249. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21250. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21251. }
  21252. else {
  21253. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21254. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21255. }
  21256. }
  21257. startGame() {
  21258. if (DataMgr.powerEnough()) {
  21259. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21260. this.ui.myNode.startBtn.touchable = false;
  21261. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21262. console.log('zh:startGame ');
  21263. this.ui.myNode.startBtn.touchable = true;
  21264. DataMgr.setPower(-1);
  21265. xGame.eventMgr.event(POWER_TIME);
  21266. xGame.common.gameMode = GameMode.placeBall;
  21267. xGame.common.placeBallCurLevel = this.level;
  21268. xGame.uiMgr.Show(UIGame$1);
  21269. this.logEventForChallenge_level_start(this.level);
  21270. xGame.uiMgr.Hide(UILevelDisplay$1);
  21271. xGame.uiMgr.Hide(UIMain$1);
  21272. this.hide();
  21273. }));
  21274. }
  21275. else {
  21276. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21277. xGame.uiMgr.Show(UIPower$1);
  21278. }
  21279. }
  21280. logEventForChallenge_level_start(level) {
  21281. let keyStr = 'sjmd_challenge_level_start';
  21282. let jsonStr = {
  21283. "count": 1,
  21284. "gold_balance ": DataMgr.getCoin(),
  21285. "level": level,
  21286. "diamond_balance ": DataMgr.getDiamond()
  21287. };
  21288. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21289. const d = LocalStorageManager.getItem(keyStr);
  21290. if (level > d.level) {
  21291. jsonStr.count = d.count + 1;
  21292. LocalStorageManager.setItem(keyStr, jsonStr);
  21293. }
  21294. else {
  21295. }
  21296. }
  21297. else {
  21298. LocalStorageManager.setItem(keyStr, jsonStr);
  21299. }
  21300. const reqStr = JSON.stringify(jsonStr);
  21301. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21302. }
  21303. hide() {
  21304. super.hide();
  21305. }
  21306. }
  21307. UILevelProp$1.uiName = "UILevelProp";
  21308. class PutBallLevelDisplay$1 {
  21309. constructor(ui, index) {
  21310. this.index = 0;
  21311. this.ui = ui;
  21312. this.index = index;
  21313. this.ui.onClick(this, this.clickSelf);
  21314. this.updateSelf();
  21315. this.ui.levelTxt.text = (this.index + 1) + "";
  21316. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21317. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21318. }
  21319. updateSelf() {
  21320. let level = this.index + 1;
  21321. this.data = DataMgr.getPlaceBallLevel(level);
  21322. this.ui.starNode.c1.selectedIndex = this.data.star;
  21323. let isChallenge = cfgTable.placeballData[level].type;
  21324. if (this.data.isCur) {
  21325. if (isChallenge) {
  21326. this.ui.c1.selectedIndex = 5;
  21327. }
  21328. else {
  21329. this.ui.c1.selectedIndex = 2;
  21330. }
  21331. }
  21332. else {
  21333. if (this.data.play) {
  21334. if (this.data.star == 3) {
  21335. this.ui.c1.selectedIndex = 0;
  21336. }
  21337. else {
  21338. this.ui.c1.selectedIndex = 1;
  21339. }
  21340. }
  21341. else {
  21342. if (isChallenge) {
  21343. this.ui.c1.selectedIndex = 4;
  21344. }
  21345. else {
  21346. this.ui.c1.selectedIndex = 3;
  21347. }
  21348. }
  21349. }
  21350. }
  21351. clickSelf() {
  21352. if (!this.data.play)
  21353. return;
  21354. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21355. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21356. }
  21357. }
  21358. class UILevelDisplay$1 extends UIBase {
  21359. constructor() {
  21360. super();
  21361. }
  21362. onConstructor() {
  21363. this.ui = ui_UILevelDisplay.createInstance();
  21364. this.contentPane = this.ui;
  21365. this.isEject = false;
  21366. this.myList = this.ui.myNode.myList;
  21367. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21368. this.levelItemArr = [];
  21369. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21370. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21371. this.myList.numItems = levelNum;
  21372. if (Moyu.isKs)
  21373. this.ui.closeNode.closeBtn.x += 100;
  21374. }
  21375. levelItemRender(index, target) {
  21376. let item = new PutBallLevelDisplay$1(target, index);
  21377. this.levelItemArr.push(item);
  21378. }
  21379. show() {
  21380. super.show();
  21381. this.updateLevel();
  21382. this.scrollToPlace();
  21383. }
  21384. updateLevel() {
  21385. let temp;
  21386. for (let index = 0; index < this.levelItemArr.length; index++) {
  21387. temp = this.levelItemArr[index];
  21388. temp.updateSelf();
  21389. }
  21390. }
  21391. scrollToPlace() {
  21392. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21393. let passArr = DataMgr.getPlaceBallLevelList();
  21394. let offest = passArr.length;
  21395. if (offest >= maxNum - 1)
  21396. offest = maxNum - 1;
  21397. this.myList.scrollToView(offest, true, true);
  21398. }
  21399. hide() {
  21400. super.hide();
  21401. }
  21402. }
  21403. UILevelDisplay$1.uiName = "UILevelDisplay";
  21404. class UIMatching$1 extends UIBase {
  21405. constructor() {
  21406. super();
  21407. }
  21408. onConstructor() {
  21409. this.ui = ui_UIMatching.createInstance();
  21410. this.contentPane = this.ui;
  21411. this.isEject = false;
  21412. }
  21413. show(callback) {
  21414. super.show();
  21415. PlatMgr.showBanner(true);
  21416. this.callback = callback;
  21417. let user = Moyu.getUserInfo();
  21418. if (!this.selfPot) {
  21419. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21420. }
  21421. if (!this.aiPot) {
  21422. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21423. }
  21424. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21425. this.ui.selfHead.nameTxt.text = user.nickName;
  21426. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21427. this.ui.aiHead.nameTxt.text = "???";
  21428. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21429. this.ui.selfHead.c1.selectedIndex = 0;
  21430. this.ui.aiHead.c1.selectedIndex = 0;
  21431. this.ui.selfHead.x = this.selfPot.x;
  21432. this.ui.selfHead.y = this.selfPot.y;
  21433. this.ui.aiHead.x = this.aiPot.x;
  21434. this.ui.aiHead.y = this.aiPot.y;
  21435. switch (xGame.common.gameMode) {
  21436. case GameMode.classic:
  21437. break;
  21438. case GameMode.bigMove:
  21439. this.initSkillData();
  21440. break;
  21441. default:
  21442. break;
  21443. }
  21444. this.ui.t1.play(Laya.Handler.create(this, () => {
  21445. this.ui.t2.play(Laya.Handler.create(this, () => {
  21446. switch (xGame.common.gameMode) {
  21447. case GameMode.classic:
  21448. this.waitingPeople();
  21449. break;
  21450. case GameMode.bigMove:
  21451. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21452. break;
  21453. default:
  21454. break;
  21455. }
  21456. }));
  21457. }));
  21458. }
  21459. initSkillData() {
  21460. this.skillSelectData = [];
  21461. let skillUrl = xGame.common.skillIconList;
  21462. let skillName = xGame.common.skillNameList;
  21463. let skillLevel = DataMgr.getBigSkillList();
  21464. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21465. for (let index = 0; index < 5; index++) {
  21466. let obj = {};
  21467. obj.skillImg = skillUrl[index];
  21468. obj.skillName = skillName[index];
  21469. obj.skillType = skillType[index];
  21470. obj.skillLevel = skillLevel[index];
  21471. this.skillSelectData.push(obj);
  21472. }
  21473. }
  21474. getAISkillLevel(myLevel) {
  21475. let video = xGame.common.upSkillLevel;
  21476. let aiLevel;
  21477. let temp;
  21478. if (video) {
  21479. temp = xGame.common.randomNum(-2, -1);
  21480. }
  21481. else {
  21482. if (myLevel <= 5) {
  21483. temp = xGame.common.randomNum(1, 3);
  21484. }
  21485. else if (myLevel <= 9) {
  21486. temp = xGame.common.randomNum(-2, 1);
  21487. }
  21488. else {
  21489. temp = xGame.common.randomNum(-4, 0);
  21490. }
  21491. }
  21492. aiLevel = temp + myLevel;
  21493. if (aiLevel <= 1)
  21494. aiLevel = 1;
  21495. if (aiLevel >= 10)
  21496. aiLevel = 10;
  21497. return aiLevel;
  21498. }
  21499. getAISkillType() {
  21500. return xGame.common.randomNum(1, 4);
  21501. let successTimes = DataMgr.getSkillSuccessTimes();
  21502. let info = cfgTable.aiskillData[successTimes];
  21503. if (!info) {
  21504. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21505. info = cfgTable.aiskillData[max];
  21506. }
  21507. let dataArr = info.skillselect;
  21508. let myCfg = {};
  21509. for (let index = 0; index < dataArr.length; index++) {
  21510. let temp = dataArr[index].split('-');
  21511. myCfg[temp[0]] = {};
  21512. myCfg[temp[0]].id = parseInt(temp[0]);
  21513. myCfg[temp[0]].weight = parseInt(temp[1]);
  21514. }
  21515. let aiCfg = xGame.common.initWeight(myCfg);
  21516. let curData = xGame.common.getRandomWeightData(aiCfg);
  21517. return parseInt(curData.id);
  21518. }
  21519. getAISkillData(index) {
  21520. let myLevel = this.skillSelectData[index].skillLevel;
  21521. let aiLevel = this.getAISkillLevel(myLevel);
  21522. let aiType = this.getAISkillType() - 1;
  21523. return { aiLevel, aiType } = { aiLevel, aiType };
  21524. }
  21525. skillSelectFinish(index) {
  21526. let aiInfo = this.getAISkillData(index);
  21527. xGame.common.gameMgr.selfCurSkill = index;
  21528. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21529. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21530. this.ui.selfHead.c1.selectedIndex = 1;
  21531. this.ui.aiHead.c1.selectedIndex = 1;
  21532. let myData = this.skillSelectData[index];
  21533. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21534. let guide = DataMgr.getSkillGuide();
  21535. if (guide == 0) {
  21536. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21537. }
  21538. else {
  21539. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21540. }
  21541. let aiData = this.skillSelectData[aiInfo.aiType];
  21542. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21543. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21544. this.waitingPeople();
  21545. }
  21546. waitingPeople() {
  21547. let time = xGame.common.randomNum(1000, 3000);
  21548. time += 1000;
  21549. Laya.timer.once(time, this, () => {
  21550. this.matchingSuccess();
  21551. });
  21552. }
  21553. matchingSuccess() {
  21554. let gameUI = xGame.common.gameUI;
  21555. let name = gameUI.ui.topNode.aiNameTxt.text;
  21556. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21557. this.ui.aiHead.nameTxt.text = name;
  21558. this.ui.aiHead.headImg.url = url;
  21559. name = gameUI.ui.topNode.selfNameTxt.text;
  21560. url = gameUI.ui.topNode.selfHeadLoader.url;
  21561. this.ui.selfHead.nameTxt.text = name;
  21562. this.ui.selfHead.headImg.url = url;
  21563. this.ui.t3.play(Laya.Handler.create(this, () => {
  21564. this.callback && this.callback();
  21565. this.ui.t4.play(Laya.Handler.create(this, () => {
  21566. this.destroySelf();
  21567. }));
  21568. }));
  21569. }
  21570. destroySelf() {
  21571. this.callback = null;
  21572. this.skillSelectData = null;
  21573. this.selfPot = null;
  21574. this.aiPot = null;
  21575. if (!this.ui.isDisposed) {
  21576. this.ui.removeFromParent();
  21577. this.ui.dispose();
  21578. }
  21579. xGame.uiMgr.destroyUI(this);
  21580. }
  21581. }
  21582. UIMatching$1.uiName = "UIMatching";
  21583. class SkillDisplay$1 {
  21584. constructor(ui, data, uiIndex) {
  21585. this.starX = 0;
  21586. this.starY = 0;
  21587. this.index = 0;
  21588. this.ui = ui;
  21589. this.data = data;
  21590. this.index = uiIndex;
  21591. this.initSelf();
  21592. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21593. }
  21594. initSelf() {
  21595. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21596. this.ui.nameTxt.text = this.data.name;
  21597. this.ui.describeTxt.text = this.data.describe;
  21598. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21599. this.ui.startBtn.onClick(this, this.startGame);
  21600. this.updateSelf();
  21601. }
  21602. updateSelf() {
  21603. this.checkTry();
  21604. let level = DataMgr.getBigSkillByIndex(this.index);
  21605. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21606. }
  21607. checkTry() {
  21608. let index = this.index;
  21609. let level = DataMgr.getBigSkillByIndex(index);
  21610. if (level == null) {
  21611. DataMgr.setBigSkill(index, 1, false);
  21612. level = 1;
  21613. }
  21614. this.ui.levelTxt.text = "LV." + level;
  21615. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21616. this.ui.tryNode.visible = true;
  21617. else
  21618. this.ui.tryNode.visible = false;
  21619. }
  21620. clickAddLevel() {
  21621. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21622. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21623. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21624. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21625. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21626. }
  21627. else {
  21628. console.log('zh:AD 失败,直接发放奖励');
  21629. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21630. }
  21631. }
  21632. qjff_AD_for_skilldisplay_clickAddLevel() {
  21633. DataMgr.setBigSkill(this.data.index, 1);
  21634. this.updateSelf();
  21635. xGame.common.upSkillLevel = true;
  21636. }
  21637. startGame() {
  21638. console.log('zh:rod skill startgame');
  21639. if (this.data.index == 3) {
  21640. alert('Coming soon!');
  21641. return;
  21642. }
  21643. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21644. let needCoin = xGame.common.bigMoveNeedCoin;
  21645. xGame.common.passAwardCoin = 2000;
  21646. let guide = DataMgr.getSkillGuide();
  21647. console.log('zh:startGame guide=' + guide);
  21648. xGame.common.temSelfLevel = 0;
  21649. if (guide == 0) {
  21650. needCoin = 0;
  21651. xGame.common.temSelfLevel = 100;
  21652. }
  21653. if (DataMgr.coinEnough(needCoin)) {
  21654. DataMgr.setCoin(-needCoin);
  21655. xGame.common.curPlayerSkillType = this.index;
  21656. if (guide == 0)
  21657. xGame.common.curPlayerSkillType = 0;
  21658. console.log('zh: skilldisplay 1');
  21659. xGame.uiMgr.Show(UIGame$1);
  21660. xGame.uiMgr.Hide(UIMain$1);
  21661. xGame.uiMgr.Show(UIMatching$1, () => {
  21662. xGame.common.gameUI.ui.alpha = 1;
  21663. xGame.common.gameUI.startGame();
  21664. xGame.uiMgr.Hide(UISkill$1);
  21665. });
  21666. this.logEventForRod_start();
  21667. }
  21668. else {
  21669. console.log('zh: skilldisplay 2');
  21670. xGame.uiMgr.Show(UIAddProp$1, 0);
  21671. Moyu.sendDataEvent("AddCoinVideo");
  21672. }
  21673. }
  21674. logEventForRod_start() {
  21675. let gfmsIdx = xGame.common.curPlayerSkillType;
  21676. console.log('zh:选择的技能=' + gfmsIdx);
  21677. let gfmc = 'Skyfall Shot';
  21678. if (gfmsIdx == 0) {
  21679. gfmc = 'Skyfall Shot';
  21680. }
  21681. if (gfmsIdx == 1) {
  21682. gfmc = 'Surging break';
  21683. }
  21684. if (gfmsIdx == 2) {
  21685. gfmc = 'Frost Lock';
  21686. }
  21687. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21688. let jsonStr = {
  21689. "count": 0,
  21690. "name": gfmc
  21691. };
  21692. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21693. const d = LocalStorageManager.getItem(keyStr);
  21694. jsonStr.count = d.count + 1;
  21695. LocalStorageManager.setItem(keyStr, jsonStr);
  21696. }
  21697. else {
  21698. LocalStorageManager.setItem(keyStr, jsonStr);
  21699. }
  21700. const reqStr = JSON.stringify(jsonStr);
  21701. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21702. }
  21703. }
  21704. class UISkill$1 extends UIBase {
  21705. constructor() {
  21706. super();
  21707. this.skillData = [];
  21708. }
  21709. onConstructor() {
  21710. this.ui = ui_UISkill.createInstance();
  21711. this.contentPane = this.ui;
  21712. this.isEject = false;
  21713. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21714. this.initSkillData();
  21715. console.log('zh:aaaaaa1111111111');
  21716. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21717. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21718. console.log('zh:aaaaaa22222222');
  21719. this.displayList = [];
  21720. this.ui.skillNode.skillList.numItems = 3;
  21721. this.addUIClick(this.ui, this.interuptSecretary);
  21722. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21723. this.ui.talkNode.visible = false;
  21724. if (Moyu.isKs)
  21725. this.ui.closeNode.closeBtn.x += 100;
  21726. }
  21727. show() {
  21728. super.show();
  21729. this.playSecretaryIdle();
  21730. this.moneyNode.ui.c1.selectedIndex = 1;
  21731. Laya.timer.clearAll(this);
  21732. xGame.soundMgr.playSound("s_start");
  21733. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21734. let guide = DataMgr.getSkillGuide();
  21735. this.ui.guideNode.visible = guide == 0;
  21736. let item = this.getSkillItemByUIIndex(0);
  21737. if (guide == 0) {
  21738. item.ui.c1.selectedIndex = 1;
  21739. }
  21740. else {
  21741. item.ui.c1.selectedIndex = 0;
  21742. }
  21743. this.ui.guideNode.guideBtn.visible = guide == 0;
  21744. for (let index = 0; index < this.displayList.length; index++) {
  21745. this.displayList[index].checkTry();
  21746. }
  21747. }
  21748. getSkillItemByUIIndex(cur) {
  21749. for (let index = 0; index < this.displayList.length; index++) {
  21750. if (this.displayList[index].index == cur) {
  21751. return this.displayList[index];
  21752. }
  21753. }
  21754. }
  21755. enterGuideLevel() {
  21756. let item = this.getSkillItemByUIIndex(0);
  21757. item.startGame();
  21758. if (DataMgr.getNewUser())
  21759. Moyu.sendDataEvent("gameStart1");
  21760. }
  21761. initSkillData() {
  21762. this.skillData = [];
  21763. let nameList = xGame.common.skillNameList;
  21764. let iconList = xGame.common.skillIconList;
  21765. let describeList = [
  21766. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21767. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21768. "The power of frost descends—freezing the flow and taking full control of the game!"
  21769. ];
  21770. console.log('zh:initSkillData 111111111');
  21771. let data;
  21772. for (let index = 0; index < nameList.length; index++) {
  21773. data = {};
  21774. data.name = nameList[index];
  21775. data.icon = iconList[index];
  21776. data.describe = describeList[index];
  21777. data.index = index;
  21778. this.skillData.push(data);
  21779. }
  21780. }
  21781. updateSkillItem(index, target) {
  21782. if (this.displayList[index] == null) {
  21783. let uiIndex;
  21784. switch (index) {
  21785. case 0:
  21786. uiIndex = 1;
  21787. break;
  21788. case 1:
  21789. uiIndex = 0;
  21790. break;
  21791. case 2:
  21792. uiIndex = 2;
  21793. break;
  21794. case 3:
  21795. uiIndex = 3;
  21796. break;
  21797. default:
  21798. break;
  21799. }
  21800. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21801. this.displayList.push(temp);
  21802. }
  21803. }
  21804. playSecretaryIdle() {
  21805. let parent = this.ui.secretary.displayObject;
  21806. parent.destroyChildren();
  21807. let xx = this.ui.secretary.width / 2;
  21808. let yy = this.ui.secretary.height;
  21809. let scale = xGame.common.getSecretaryScale();
  21810. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21811. xGame.common.secretary.play(data, 0, true, parent);
  21812. }
  21813. returnUIMain() {
  21814. this.hide();
  21815. xGame.common.stopGirlPop(this.ui.talkNode);
  21816. xGame.uiMgr.Show(UIMain$1);
  21817. }
  21818. interuptSecretary() {
  21819. Laya.timer.clearAll(this);
  21820. this.playSecretaryRandomSound();
  21821. }
  21822. playSecretaryRandomSound() {
  21823. if (this.isHide)
  21824. return;
  21825. let time = xGame.common.randomNum(45000, 60000);
  21826. Laya.timer.once(time, this, () => {
  21827. if (this.isHide)
  21828. return;
  21829. let index = xGame.common.randomNum(4, 7);
  21830. xGame.soundMgr.playSound("s_main0" + index);
  21831. let words = 1;
  21832. switch (index) {
  21833. case 4:
  21834. words = 5;
  21835. break;
  21836. case 5:
  21837. words = 3;
  21838. break;
  21839. case 6:
  21840. words = 6;
  21841. break;
  21842. case 7:
  21843. words = 7;
  21844. break;
  21845. default:
  21846. break;
  21847. }
  21848. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21849. this.playSecretaryRandomSound();
  21850. });
  21851. }
  21852. }
  21853. UISkill$1.uiName = "UISkill";
  21854. class UIAddProp$1 extends UIBase {
  21855. constructor() {
  21856. super();
  21857. this.curType = "";
  21858. }
  21859. onConstructor() {
  21860. this.ui = ui_UIAddProp.createInstance();
  21861. this.contentPane = this.ui;
  21862. this.isEject = false;
  21863. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21864. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21865. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21866. this.updateUI();
  21867. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21868. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21869. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21870. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21871. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21872. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21873. }
  21874. show(type) {
  21875. super.show();
  21876. this.curType = type == 0 ? "coin" : "diamond";
  21877. this.switchBtn("");
  21878. this.ui.t0.play();
  21879. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21880. PlatMgr.showInsert(true);
  21881. }
  21882. closeSelf() {
  21883. this.hide();
  21884. }
  21885. updateUI() {
  21886. let data = cfgTable.moneyData;
  21887. let temp;
  21888. let obj;
  21889. for (const key in data) {
  21890. temp = data[key];
  21891. obj = this.ui.myNode["node" + key];
  21892. if (parseInt(key) <= 2) {
  21893. obj.diamondTxt.text = "+" + temp.num;
  21894. }
  21895. else {
  21896. obj.coinTxt.text = temp.num;
  21897. obj.diamondTxt.text = temp.get.split('_')[1];
  21898. }
  21899. }
  21900. this.updateDiamondShare();
  21901. }
  21902. updateDiamondShare() {
  21903. let data = DataMgr.getShareDiamondTimes();
  21904. if (data >= xGame.common.maxShareDiamondTimes) {
  21905. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21906. this.ui.myNode.node1.touchable = false;
  21907. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21908. }
  21909. else {
  21910. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21911. this.ui.myNode.node1.touchable = true;
  21912. }
  21913. }
  21914. switchBtn(type) {
  21915. if (type == "")
  21916. type = this.curType;
  21917. else {
  21918. if (this.curType == type) {
  21919. return;
  21920. }
  21921. else {
  21922. this.curType = type;
  21923. }
  21924. }
  21925. if (type == "coin") {
  21926. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21927. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21928. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21929. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21930. this.ui.myNode.c1.selectedIndex = 0;
  21931. }
  21932. else {
  21933. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21934. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21935. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21936. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21937. this.ui.myNode.c1.selectedIndex = 1;
  21938. }
  21939. }
  21940. convertCoin(index) {
  21941. let data = cfgTable.moneyData[index];
  21942. let coinNum = data.num;
  21943. let str = data.get.split('_')[1];
  21944. let needDiamond = parseInt(str);
  21945. if (DataMgr.diamondEnough(needDiamond)) {
  21946. DataMgr.setDiamond(-needDiamond);
  21947. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21948. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21949. }
  21950. else {
  21951. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21952. this.switchBtn("diamond");
  21953. }
  21954. }
  21955. videoGetDiamond() {
  21956. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21957. if (Laya.Browser.onAndroid) {
  21958. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21959. if (!boo) {
  21960. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21961. return;
  21962. }
  21963. }
  21964. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21965. }
  21966. else {
  21967. console.log('zh:AD 失败,直接发放奖励');
  21968. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21969. }
  21970. }
  21971. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21972. let num = cfgTable.moneyData[2].num;
  21973. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21974. this.closeSelf();
  21975. }
  21976. videoGetCoin() {
  21977. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21978. if (Laya.Browser.onAndroid) {
  21979. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21980. if (!boo) {
  21981. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21982. return;
  21983. }
  21984. }
  21985. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21986. }
  21987. else {
  21988. console.log('zh:AD 失败,直接发放奖励');
  21989. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21990. }
  21991. }
  21992. qjff_AD_for_uiAddProp_videoGetCoin() {
  21993. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21994. this.closeSelf();
  21995. }
  21996. shareGetDiamond() {
  21997. let times = DataMgr.getShareDiamondTimes();
  21998. if (times >= xGame.common.maxShareDiamondTimes) {
  21999. console.log('zh: 233333333333 maxShareDiamondTimes');
  22000. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22001. }
  22002. else {
  22003. console.log('zh:33333333333333ad');
  22004. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22005. if (Laya.Browser.onAndroid) {
  22006. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22007. if (!boo) {
  22008. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22009. return;
  22010. }
  22011. }
  22012. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22013. }
  22014. else {
  22015. console.log('zh:AD 失败,直接发放奖励');
  22016. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22017. }
  22018. }
  22019. }
  22020. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22021. let diamond = xGame.common.randomNum(50, 100);
  22022. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22023. DataMgr.setShareDiamondTimes(1);
  22024. this.updateDiamondShare();
  22025. }
  22026. openPutBallView() {
  22027. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22028. let skill = xGame.uiMgr.getUI(UISkill$1);
  22029. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22030. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22031. if (end && !end.isHide) {
  22032. xGame.uiMgr.Hide(UIGameEnd$1);
  22033. xGame.uiMgr.Show(UIMain$1);
  22034. }
  22035. if (skill && !skill.isHide)
  22036. xGame.uiMgr.Hide(UISkill$1);
  22037. if (uigame && !uigame.isHide)
  22038. xGame.uiMgr.Hide(UIGame$1);
  22039. if (level && !level.isHide) {
  22040. }
  22041. else {
  22042. xGame.uiMgr.Show(UILevelDisplay$1);
  22043. }
  22044. this.closeSelf();
  22045. }
  22046. }
  22047. UIAddProp$1.uiName = "UIAddProp";
  22048. class MoneyNode$1 {
  22049. constructor(ui) {
  22050. this.leftTime = 0;
  22051. this.ui = ui;
  22052. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22053. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22054. this.ui.addPowerBtn.onClick(this, this.addPower);
  22055. this.ui.c1.selectedIndex = 1;
  22056. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22057. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22058. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22059. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22060. this.coinChange();
  22061. this.diamondChange();
  22062. this.powerChange();
  22063. }
  22064. addPower() {
  22065. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22066. xGame.uiMgr.Show(UIPower$1);
  22067. }
  22068. powerChange() {
  22069. let powerNum = DataMgr.getPower();
  22070. this.ui.powerTxt.text = powerNum + "";
  22071. }
  22072. checkPowerTime() {
  22073. let cur = new Date().getTime();
  22074. let last = DataMgr.getPowerTime();
  22075. if (last == 0) {
  22076. last = cur;
  22077. DataMgr.setPowerTime(cur);
  22078. }
  22079. let power = DataMgr.getPower();
  22080. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22081. Laya.timer.clearAll(this);
  22082. if (power >= xGame.common.natureMaxPower) {
  22083. this.ui.powerTimeTxt.text = "";
  22084. DataMgr.setPowerTime(cur);
  22085. return;
  22086. }
  22087. if (power + offset >= xGame.common.natureMaxPower) {
  22088. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22089. this.ui.powerTimeTxt.text = "";
  22090. DataMgr.setPowerTime(cur);
  22091. }
  22092. else {
  22093. if (offset > 0) {
  22094. DataMgr.setPower(offset);
  22095. DataMgr.setPowerTime(cur);
  22096. }
  22097. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22098. this.leftTime = xGame.common.powerRecoverNum - time;
  22099. if (this.leftTime <= 0)
  22100. this.leftTime = 0;
  22101. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22102. Laya.timer.loop(1000, this, this.updatePowerTime);
  22103. }
  22104. }
  22105. updatePowerTime() {
  22106. this.leftTime -= 1;
  22107. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22108. if (this.leftTime <= 0) {
  22109. this.checkPowerTime();
  22110. }
  22111. }
  22112. coinChange() {
  22113. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22114. }
  22115. diamondChange() {
  22116. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22117. }
  22118. addCoin() {
  22119. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22120. Moyu.sendDataEvent("AddCoinBtn");
  22121. xGame.uiMgr.Show(UIAddProp$1, 0);
  22122. }
  22123. addDiamond() {
  22124. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22125. Moyu.sendDataEvent("AddDiamondBtn");
  22126. xGame.uiMgr.Show(UIAddProp$1, 1);
  22127. }
  22128. }
  22129. class SettingNode$1 {
  22130. constructor(ui) {
  22131. this.showSetting = false;
  22132. this.openSound = true;
  22133. this.openShake = true;
  22134. this.ui = ui;
  22135. this.ui.soundBtn.onClick(this, this.switchSound);
  22136. this.ui.shakeBtn.onClick(this, this.switchShake);
  22137. this.ui.xyBtn.onClick(this, this.onXy);
  22138. this.ui.clickNode.onClick(this, this.changeSetting);
  22139. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22140. this.ui.xyBtn.visible = false;
  22141. this.ui.shakeBtn.visible = false;
  22142. }
  22143. changeSetting() {
  22144. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22145. this.showSetting = !this.showSetting;
  22146. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22147. }
  22148. switchSound() {
  22149. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22150. this.openSound = !this.openSound;
  22151. Moyu.onSetting(this.openSound, this.openShake);
  22152. xGame.soundMgr.onSetting(this.openSound);
  22153. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22154. }
  22155. switchShake() {
  22156. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22157. this.openShake = !this.openShake;
  22158. Moyu.onSetting(this.openSound, this.openShake);
  22159. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22160. }
  22161. onXy() {
  22162. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22163. MoyuMgr$1.showXy(1);
  22164. }
  22165. }
  22166. class UIDraw$1 extends UIBase {
  22167. constructor() {
  22168. super();
  22169. this.curKey = 0;
  22170. }
  22171. onConstructor() {
  22172. this.ui = ui_UIDraw.createInstance();
  22173. this.contentPane = this.ui;
  22174. this.isEject = false;
  22175. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22176. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22177. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22178. this.initDraw();
  22179. this.initUI();
  22180. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22181. if (Moyu.isKs)
  22182. this.ui.closeNode.closeBtn.x += 100;
  22183. }
  22184. show() {
  22185. super.show();
  22186. this.ui.t0.play();
  22187. this.playSecretaryIdle();
  22188. this.updateDraw();
  22189. this.checkFree();
  22190. if (PlatMgr.bannerDelay > 0) {
  22191. this.ui.closeNode.closeBtn.visible = false;
  22192. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22193. this.ui.closeNode.closeBtn.visible = true;
  22194. });
  22195. }
  22196. PlatMgr.showRateBanner();
  22197. }
  22198. hide() {
  22199. Laya.timer.clearAll(this);
  22200. super.hide();
  22201. }
  22202. checkFree() {
  22203. let isFree = DataMgr.getDailyfreeDrawTimes();
  22204. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22205. }
  22206. initDraw() {
  22207. this.drawObj = [];
  22208. let data = cfgTable.drawData;
  22209. let temp;
  22210. let weight = 0;
  22211. for (const key in data) {
  22212. temp = data[key];
  22213. weight += temp.weight;
  22214. this.drawObj.push(weight);
  22215. }
  22216. this.allWeight = weight;
  22217. }
  22218. initUI() {
  22219. let data = cfgTable.drawData;
  22220. let temp;
  22221. let img;
  22222. let txt;
  22223. for (const key in data) {
  22224. temp = data[key];
  22225. img = this.ui.myNode.rotNode["img" + key];
  22226. txt = this.ui.myNode.rotNode["txt" + key];
  22227. img.url = xGame.common.getGameIconUrl(temp.icon);
  22228. txt.visible = true;
  22229. if (temp.award > 2) {
  22230. img.rotation = 0;
  22231. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22232. }
  22233. else {
  22234. img.rotation = temp.rotation;
  22235. txt.text = temp.num;
  22236. }
  22237. }
  22238. }
  22239. getCurkey() {
  22240. let rand = Math.random() * this.allWeight;
  22241. let temp;
  22242. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22243. temp = this.drawObj[index];
  22244. if (index == 0) {
  22245. if (rand < temp) {
  22246. return index + 1;
  22247. }
  22248. }
  22249. else {
  22250. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22251. return index + 1;
  22252. }
  22253. }
  22254. }
  22255. return 2;
  22256. }
  22257. startDraw() {
  22258. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22259. if (freeTimes > 0) {
  22260. this.beginDraw();
  22261. DataMgr.setDailyfreeDrawTimes(0);
  22262. this.checkFree();
  22263. }
  22264. else {
  22265. if (Laya.Browser.onAndroid) {
  22266. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22267. if (!boo) {
  22268. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22269. return;
  22270. }
  22271. }
  22272. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22273. }
  22274. else {
  22275. console.log('zh:AD 失败,直接发放奖励');
  22276. this.qjff_chouJiang();
  22277. }
  22278. }
  22279. }
  22280. qjff_chouJiang() {
  22281. this.beginDraw();
  22282. }
  22283. beginDraw() {
  22284. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22285. this.ui.drawBtn.touchable = false;
  22286. this.curKey = this.getCurkey();
  22287. console.log("当前key", this.curKey);
  22288. let cell = 60;
  22289. let lap = 3;
  22290. let angle = cell * (this.curKey - 1) + lap * 360;
  22291. let target = this.ui.myNode.rotNode;
  22292. target.rotation = 0;
  22293. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22294. console.log("旋转完成");
  22295. this.ui.drawBtn.touchable = true;
  22296. this.getAward();
  22297. }));
  22298. }
  22299. getAward() {
  22300. let data = cfgTable.drawData[this.curKey];
  22301. let temp = new AwardType();
  22302. temp.type = data.award;
  22303. temp.num = data.num;
  22304. xGame.common.getAward([temp], () => {
  22305. DataMgr.setDrawTimes(1);
  22306. this.updateDraw();
  22307. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22308. });
  22309. }
  22310. updateDraw() {
  22311. let drawTimes = DataMgr.getDrawTimes();
  22312. let awardTimes = DataMgr.getDrawAwardTimes();
  22313. if (Math.floor(drawTimes / 3) > awardTimes) {
  22314. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22315. this.ui.extraNode.boxBtn.touchable = true;
  22316. this.ui.extraNode.tipsTxt.text = "3/3";
  22317. this.ui.extraNode.barNode.width = 265;
  22318. this.getExtraAward();
  22319. }
  22320. else {
  22321. this.ui.extraNode.boxBtn.t0.stop();
  22322. this.ui.extraNode.boxBtn.touchable = false;
  22323. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22324. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22325. }
  22326. let data = cfgTable.drawData[1];
  22327. if (awardTimes == 0) {
  22328. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22329. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22330. this.ui.myNode.rotNode.img1.rotation = 0;
  22331. }
  22332. else {
  22333. let award = data.nextid;
  22334. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22335. this.ui.myNode.rotNode.txt1.text = award[1];
  22336. this.ui.myNode.rotNode.img1.rotation = 0;
  22337. }
  22338. }
  22339. getExtraAward() {
  22340. let drawTimes = DataMgr.getDrawTimes();
  22341. let awardTimes = DataMgr.getDrawAwardTimes();
  22342. let data = cfgTable.drawData[1];
  22343. let award = new AwardType();
  22344. if (awardTimes == 0) {
  22345. award.num = data.num;
  22346. award.type = data.award;
  22347. xGame.common.getAward([award], () => {
  22348. let all = Math.floor(drawTimes / 3);
  22349. DataMgr.setDrawAwardTimes(all);
  22350. this.updateDraw();
  22351. });
  22352. }
  22353. else {
  22354. award.num = parseInt(data.nextid[1]);
  22355. award.type = parseInt(data.nextid[0]);
  22356. xGame.common.getAward([award], () => {
  22357. let all = Math.floor(drawTimes / 3);
  22358. DataMgr.setDrawAwardTimes(all);
  22359. this.updateDraw();
  22360. });
  22361. }
  22362. }
  22363. closeSelf() {
  22364. this.hide();
  22365. }
  22366. playSecretaryIdle() {
  22367. let parent = this.ui.secretary.displayObject;
  22368. parent.destroyChildren();
  22369. let xx = this.ui.secretary.width / 2;
  22370. let yy = this.ui.secretary.height;
  22371. let scale = xGame.common.getSecretaryScale();
  22372. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22373. xGame.common.secretary.play(data, 0, true, parent);
  22374. }
  22375. }
  22376. UIDraw$1.uiName = "UIDraw";
  22377. class UIRanking$1 extends UIBase {
  22378. constructor() {
  22379. super();
  22380. this.showSelf = true;
  22381. this.rankType = 1;
  22382. this.rankList = [];
  22383. this.topX = 10;
  22384. this.myIndex = this.topX + 1;
  22385. this.myStar = 0;
  22386. }
  22387. onConstructor() {
  22388. this.ui = ui_UIRanking.createInstance();
  22389. this.contentPane = this.ui;
  22390. this.isEject = false;
  22391. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22392. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22393. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22394. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22395. this.ui.myNode.myList.setVirtual();
  22396. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22397. }
  22398. show() {
  22399. super.show();
  22400. this.getPaiHangBangDataFormJosnFile();
  22401. this.updateSelf();
  22402. let self = Moyu.getUserInfo();
  22403. if (!self.isAuth) {
  22404. Moyu.initUser(this, () => {
  22405. DataMgr.upRankData();
  22406. });
  22407. }
  22408. }
  22409. getPaiHangBangDataFormJosnFile() {
  22410. const rankingList = cfgTable.paiHangBangData.list;
  22411. this.updateItemData(rankingList);
  22412. }
  22413. updateSelfItem() {
  22414. console.log('zh:Moyu.platType =' + Moyu.platType);
  22415. let self = Moyu.getUserInfo();
  22416. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22417. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22418. if (this.myIndex > this.topX) {
  22419. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22420. }
  22421. else {
  22422. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22423. }
  22424. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22425. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22426. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22427. }
  22428. updateItemData(data) {
  22429. this.myStar = xGame.common.getAllStarNum();
  22430. if (this.rankList.length < 2) {
  22431. this.rankList = data;
  22432. let self = Moyu.getUserInfo();
  22433. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22434. self.headIcon = self.headIcon;
  22435. for (let i = 0; i < data.length; i++) {
  22436. let data = this.rankList[i];
  22437. if (data.userId == self.userId) {
  22438. this.rankList.splice(i, 1);
  22439. break;
  22440. }
  22441. }
  22442. for (let i = 0; i < data.length; i++) {
  22443. let data = this.rankList[i];
  22444. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22445. this.myIndex = i + 1;
  22446. let user = { headIcon: self.headIcon, nickName: "myself" };
  22447. let ud = { user: user, data: {} };
  22448. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22449. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22450. if (Moyu.platType < 11) {
  22451. user.headIcon = self.headIcon;
  22452. user.nickName = self.nickName;
  22453. }
  22454. this.rankList.splice(i, 0, md);
  22455. break;
  22456. }
  22457. }
  22458. }
  22459. this.updateSelfItem();
  22460. this.ui.myNode.myList.numItems = this.rankList.length;
  22461. }
  22462. updateItemUI(index, obj) {
  22463. let data = this.rankList[index];
  22464. let userData = JSON.parse(data.userData).user;
  22465. obj.nameTxt.text = userData.nickName.toString();
  22466. obj.valueTxt.text = data.rankScore;
  22467. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22468. obj.rankTxt.text = index + 1;
  22469. switch (index) {
  22470. case 0:
  22471. this.setImg(obj, 1, 0, 0);
  22472. obj.rankTxt.color = "#FFC047";
  22473. break;
  22474. case 1:
  22475. this.setImg(obj, 0, 1, 0);
  22476. obj.rankTxt.color = "#ACACAC";
  22477. break;
  22478. case 2:
  22479. this.setImg(obj, 0, 0, 1);
  22480. obj.rankTxt.color = "#D09672";
  22481. break;
  22482. default:
  22483. this.setImg(obj, 0, 0, 0);
  22484. obj.rankTxt.color = "#496FAB";
  22485. break;
  22486. }
  22487. }
  22488. setImg(obj, a, b, c) {
  22489. obj.img1.visible = a ? true : false;
  22490. obj.img2.visible = b ? true : false;
  22491. obj.img3.visible = c ? true : false;
  22492. }
  22493. changeList(type) {
  22494. this.rankType = type;
  22495. this.updateSelf();
  22496. }
  22497. changeSelfNode() {
  22498. this.showSelf = !this.showSelf;
  22499. this.updateSelf();
  22500. }
  22501. updateSelf() {
  22502. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22503. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22504. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22505. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22506. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22507. }
  22508. }
  22509. UIRanking$1.uiName = "UIRanking";
  22510. class UISecretary$1 extends UIBase {
  22511. constructor() {
  22512. super();
  22513. this.curIndex = 1;
  22514. }
  22515. onConstructor() {
  22516. this.ui = ui_UISecretary.createInstance();
  22517. this.contentPane = this.ui;
  22518. this.isEject = false;
  22519. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22520. this.nodeObj = { left: null, right: null, cur: null };
  22521. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22522. }
  22523. show() {
  22524. super.show();
  22525. this.ui.t0.play();
  22526. this.updateData();
  22527. }
  22528. addSecretarySpine(node, spineName) {
  22529. if (spineName == "mishu") {
  22530. if (this.secretarySpine1) {
  22531. node.displayObject.destroyChildren();
  22532. this.playWoman(this.secretarySpine1, node.displayObject);
  22533. }
  22534. else {
  22535. let spine1 = new SpineMgr("mishu", () => {
  22536. this.secretarySpine1 = spine1;
  22537. this.playWoman(this.secretarySpine1, node.displayObject);
  22538. });
  22539. }
  22540. }
  22541. else {
  22542. if (this.secretarySpine2) {
  22543. node.displayObject.destroyChildren();
  22544. this.playWoman(this.secretarySpine2, node.displayObject);
  22545. }
  22546. else {
  22547. let spine2 = new SpineMgr("xiaomishu2", () => {
  22548. this.secretarySpine2 = spine2;
  22549. this.playWoman(this.secretarySpine2, node.displayObject);
  22550. });
  22551. }
  22552. }
  22553. }
  22554. playWoman(node, parent) {
  22555. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22556. let yy = this.ui.myNode.gameNode3.secretary.height;
  22557. let scale = 1.5;
  22558. if (node == this.secretarySpine2) {
  22559. scale = 1.2;
  22560. }
  22561. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22562. node.play(data, 0, true, parent);
  22563. }
  22564. turnLeft() {
  22565. this.curIndex--;
  22566. if (this.curIndex < 1) {
  22567. this.curIndex = 2;
  22568. }
  22569. let left = this.nodeObj.left;
  22570. let right = this.nodeObj.right;
  22571. let cur = this.nodeObj.cur;
  22572. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22573. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22574. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22575. this.updateData();
  22576. }));
  22577. this.ui.myNode.setChildIndex(right, 2);
  22578. this.nodeObj.left = cur;
  22579. this.nodeObj.right = left;
  22580. this.nodeObj.cur = right;
  22581. }
  22582. turnRight() {
  22583. this.curIndex++;
  22584. if (this.curIndex > 2) {
  22585. this.curIndex = 1;
  22586. }
  22587. let left = this.nodeObj.left;
  22588. let right = this.nodeObj.right;
  22589. let cur = this.nodeObj.cur;
  22590. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22591. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22592. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22593. this.updateData();
  22594. }));
  22595. this.ui.myNode.setChildIndex(left, 2);
  22596. this.nodeObj.left = right;
  22597. this.nodeObj.right = cur;
  22598. this.nodeObj.cur = left;
  22599. }
  22600. updateData() {
  22601. console.log('zh: updateData FFFFFFFFFF');
  22602. let data = cfgTable.secretaryshopData;
  22603. let children = this.ui.myNode._children;
  22604. let temp;
  22605. let curData;
  22606. for (let index = 0; index < children.length; index++) {
  22607. temp = children[index];
  22608. curData = data[1];
  22609. temp.heightTxt.text = curData.height;
  22610. temp.foodTxt.text = curData.food;
  22611. temp.historyTxt.text = curData.history;
  22612. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22613. this.addSecretarySpine(temp.secretary, curData.spine);
  22614. let womanIndex = curData.id - 1;
  22615. let getWoman = DataMgr.getSecretary(womanIndex);
  22616. let curUse = DataMgr.getCurSecretary();
  22617. if (getWoman) {
  22618. if (curUse == womanIndex) {
  22619. temp.purchaseBtn.c1.selectedIndex = 1;
  22620. }
  22621. else {
  22622. temp.purchaseBtn.c1.selectedIndex = 2;
  22623. }
  22624. }
  22625. else {
  22626. temp.purchaseBtn.c1.selectedIndex = 0;
  22627. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22628. }
  22629. temp.purchaseBtn.visible = false;
  22630. }
  22631. }
  22632. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22633. console.log('zh: 点击了clickSecretary ');
  22634. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22635. if (getWoman) {
  22636. if (curUse != womanIndex) {
  22637. console.log();
  22638. DataMgr.setCurSecretary(womanIndex);
  22639. this.updateData();
  22640. }
  22641. }
  22642. else {
  22643. console.log('zh:点击购买了');
  22644. let need = needDiamond;
  22645. if (DataMgr.diamondEnough(need)) {
  22646. DataMgr.setDiamond(-need);
  22647. DataMgr.setSecretary(womanIndex, 1);
  22648. DataMgr.setCurSecretary(womanIndex);
  22649. this.updateData();
  22650. }
  22651. else {
  22652. xGame.uiMgr.Show(UIAddProp$1, 1);
  22653. }
  22654. }
  22655. }
  22656. closeSelf() {
  22657. this.hide();
  22658. }
  22659. }
  22660. UISecretary$1.uiName = "UISecretary";
  22661. class BallRodDisplay$1 {
  22662. constructor(ui, index) {
  22663. this.index = 0;
  22664. this.uiIndex = 0;
  22665. this.ui = ui;
  22666. this.index = index;
  22667. this.initData();
  22668. }
  22669. initData() {
  22670. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22671. let data = cfgTable.ballrodData[this.index + 1];
  22672. this.ui.nameTxt.text = data.name;
  22673. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22674. this.ui.levelNode.c1.selectedIndex = data.quality;
  22675. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22676. if (data.spine) {
  22677. this.mySpine = new SpineMgr(data.spine, () => {
  22678. let xx = 150;
  22679. let yy = 70;
  22680. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22681. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22682. });
  22683. }
  22684. }
  22685. updateSelf() {
  22686. console.log('zh:updateSelf -------------- ');
  22687. let get = DataMgr.getBallRod(this.index);
  22688. if (get == null)
  22689. get = 1;
  22690. let curUse = DataMgr.getCurBallRod();
  22691. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22692. if (get) {
  22693. if (curUse == this.index) {
  22694. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22695. }
  22696. else {
  22697. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22698. }
  22699. }
  22700. else {
  22701. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22702. }
  22703. }
  22704. buyBallRod() {
  22705. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22706. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22707. switch (selectedIndex) {
  22708. case 0:
  22709. break;
  22710. case 1:
  22711. console.log('zh:点击了 USE THIS');
  22712. DataMgr.setCurBallRod(this.index);
  22713. let curUse = DataMgr.getCurBallRod();
  22714. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22715. let ui = xGame.uiMgr.getUI(UIShop$1);
  22716. ui.updateBallRod();
  22717. break;
  22718. case 2:
  22719. let data = cfgTable.ballrodData[this.index + 1];
  22720. let need = data.price;
  22721. if (DataMgr.diamondEnough(need)) {
  22722. this.buyQiuGan(data);
  22723. DataMgr.setDiamond(-need);
  22724. DataMgr.setBallRod(this.index, 1);
  22725. DataMgr.setCurBallRod(this.index);
  22726. let ui = xGame.uiMgr.getUI(UIShop$1);
  22727. ui.updateBallRod();
  22728. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22729. }
  22730. else {
  22731. xGame.uiMgr.Show(UIAddProp$1, 1);
  22732. }
  22733. break;
  22734. default:
  22735. break;
  22736. }
  22737. }
  22738. buyQiuGan(qgItem) {
  22739. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22740. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22741. if (userInfo == null) {
  22742. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22743. return;
  22744. }
  22745. let reqData = xGame.httpMgr.getReqData();
  22746. let pd = JSON.parse(reqData);
  22747. pd.qiuGanData = qgItem;
  22748. reqData = JSON.stringify(pd);
  22749. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22750. try {
  22751. console.log('zh:buySp res = ' + JSON.stringify(res));
  22752. let code = res.code;
  22753. let msg = res.msg;
  22754. if (code == 401) {
  22755. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22756. alert(TIP_MSG_key.loginTimeOut);
  22757. xGame.uiMgr.Show(UIMsg$1, msg);
  22758. return;
  22759. }
  22760. if (code == 200) {
  22761. xGame.uiMgr.Show(UIMsg$1, msg);
  22762. DataMgr.getUserZiChanInfo();
  22763. }
  22764. else {
  22765. xGame.uiMgr.Show(UIMsg$1, msg);
  22766. }
  22767. }
  22768. catch (error) {
  22769. console.log('error=' + error);
  22770. alert(error);
  22771. }
  22772. finally {
  22773. }
  22774. });
  22775. }
  22776. logEventForGouMaiGan(qiuGanName) {
  22777. const ev = {
  22778. value: qiuGanName
  22779. };
  22780. const jsonStr = JSON.stringify(ev);
  22781. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22782. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22783. }
  22784. }
  22785. class DaoJuDisplay$1 {
  22786. constructor(ui, index) {
  22787. this.index = 0;
  22788. this.uiIndex = 0;
  22789. this.ggSpid = "";
  22790. this.spid = 0;
  22791. this.ui = ui;
  22792. this.index = index;
  22793. this.initData();
  22794. }
  22795. initData() {
  22796. this.ui.btn_buy.onClick(this, this.gotoBuy);
  22797. let data = cfgTable.daoJuData[this.index + 1];
  22798. console.log('zh:' + JSON.stringify(data));
  22799. this.ui.nameTxt.text = data.spbt;
  22800. this.ui.n_jiaGe.text = data.spjg + "";
  22801. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22802. this.ggSpid = data.ggSpid;
  22803. this.spid = data.spid;
  22804. let baseUrl = "asset/sound/ogg/";
  22805. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22806. }
  22807. gotoBuy() {
  22808. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22809. if (userInfo != null) {
  22810. let token = userInfo.token;
  22811. let ggSpid = this.ggSpid;
  22812. let spid = this.spid;
  22813. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  22814. console.log('zh:gotoBuy1 spid =' + spid);
  22815. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  22816. return;
  22817. }
  22818. else {
  22819. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22820. }
  22821. }
  22822. gotoBuy1() {
  22823. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22824. let djItem = cfgTable.daoJuData[this.index + 1];
  22825. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22826. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22827. if (userInfo == null) {
  22828. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22829. return;
  22830. }
  22831. let reqData = xGame.httpMgr.getReqData();
  22832. let pd = JSON.parse(reqData);
  22833. pd.spItem = djItem;
  22834. reqData = JSON.stringify(pd);
  22835. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22836. try {
  22837. console.log('zh:buySp res = ' + JSON.stringify(res));
  22838. let code = res.code;
  22839. let msg = res.msg;
  22840. if (code == 401) {
  22841. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22842. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22843. return;
  22844. }
  22845. if (code == 200) {
  22846. xGame.uiMgr.Show(UIMsg$1, msg);
  22847. DataMgr.getUserZiChanInfo();
  22848. }
  22849. else {
  22850. xGame.uiMgr.Show(UIMsg$1, msg);
  22851. }
  22852. }
  22853. catch (error) {
  22854. console.log('error=' + error);
  22855. alert(error);
  22856. }
  22857. finally {
  22858. }
  22859. });
  22860. }
  22861. }
  22862. class UIShop$1 extends UIBase {
  22863. constructor() {
  22864. super();
  22865. this.itemNums = 0;
  22866. this.itemNumsForDj = 0;
  22867. this.curType = "";
  22868. }
  22869. onConstructor() {
  22870. this.ui = ui_UIShop.createInstance();
  22871. this.contentPane = this.ui;
  22872. this.isEject = false;
  22873. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22874. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22875. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22876. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22877. this.addUIClick(this.ui, this.interuptSecretary);
  22878. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22879. this.ballRodArr = [];
  22880. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22881. this.ui.myNode.myList.numItems = this.itemNums;
  22882. this.loadDjdata_old();
  22883. }
  22884. loadDjdata_old() {
  22885. let fff = cfgTable.daoJuData;
  22886. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22887. this.daoJuArr = [];
  22888. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22889. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22890. }
  22891. getProductList() {
  22892. let reqData = xGame.httpMgr.getReqData();
  22893. let pd = JSON.parse(reqData);
  22894. pd.splx = "Consumable";
  22895. reqData = JSON.stringify(pd);
  22896. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22897. try {
  22898. let code = res.code;
  22899. let msg = res.msg;
  22900. if (code == 401) {
  22901. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22902. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  22903. return;
  22904. }
  22905. if (code == 200) {
  22906. let data = res.data;
  22907. for (let index = 0; index < data.length; index++) {
  22908. let element = data[index];
  22909. cfgTable.daoJuData[element.spid] = element;
  22910. }
  22911. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22912. }
  22913. else {
  22914. xGame.uiMgr.Show(UIMsg, msg);
  22915. }
  22916. }
  22917. catch (error) {
  22918. console.log('error=' + error);
  22919. alert(error);
  22920. }
  22921. finally {
  22922. }
  22923. });
  22924. }
  22925. show(type) {
  22926. super.show();
  22927. this.curType = type == 0 ? "qiugan" : "daoju";
  22928. this.switchBtn("qiugan");
  22929. this.playSecretaryIdle();
  22930. this.updateBallRod();
  22931. }
  22932. test123() {
  22933. console.log('zh:test123 ');
  22934. }
  22935. switchBtn(type) {
  22936. console.log('zh:1111切換 sel type=' + type);
  22937. if (type == "") {
  22938. type = this.curType;
  22939. }
  22940. else {
  22941. if (this.curType == type) {
  22942. return;
  22943. }
  22944. else {
  22945. this.curType = type;
  22946. }
  22947. }
  22948. if (type == "qiugan") {
  22949. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22950. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22951. this.ui.myNode.c1.selectedIndex = 0;
  22952. this.ui.myNode.myList.visible = true;
  22953. this.ui.myNode.djList.visible = false;
  22954. }
  22955. else {
  22956. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22957. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22958. this.ui.myNode.c1.selectedIndex = 1;
  22959. this.ui.myNode.myList.visible = false;
  22960. this.ui.myNode.djList.visible = true;
  22961. }
  22962. }
  22963. updateBallRod() {
  22964. for (let index = 0; index < this.ballRodArr.length; index++) {
  22965. this.ballRodArr[index].updateSelf();
  22966. }
  22967. }
  22968. renderBallRod(sort, obj) {
  22969. let index = this.getIndexBySort(sort + 1) - 1;
  22970. let ballRod = new BallRodDisplay$1(obj, index);
  22971. this.ballRodArr.push(ballRod);
  22972. }
  22973. renderDaoJu(idx, obj) {
  22974. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22975. let b = new DaoJuDisplay$1(obj, index);
  22976. this.daoJuArr.push(b);
  22977. }
  22978. getIndexBySort(sort) {
  22979. let object = cfgTable.ballrodData;
  22980. for (const key in object) {
  22981. if (object[key].sort == sort) {
  22982. return parseInt(key);
  22983. }
  22984. }
  22985. }
  22986. getIndexBySortForDj(idx) {
  22987. let object = cfgTable.daoJuData;
  22988. for (const key in object) {
  22989. if (object[key].idx == idx) {
  22990. return parseInt(key);
  22991. }
  22992. }
  22993. }
  22994. playSecretaryIdle() {
  22995. let parent = this.ui.secretary.displayObject;
  22996. parent.destroyChildren();
  22997. let xx = this.ui.secretary.width / 2;
  22998. let yy = this.ui.secretary.height;
  22999. let scale = xGame.common.getSecretaryScale();
  23000. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23001. xGame.common.secretary.play(data, 0, true, parent);
  23002. }
  23003. interuptSecretary() {
  23004. Laya.timer.clearAll(this);
  23005. this.playSecretaryRandomSound();
  23006. }
  23007. playSecretaryRandomSound() {
  23008. if (this.isHide)
  23009. return;
  23010. let time = xGame.common.randomNum(45000, 60000);
  23011. Laya.timer.once(time, this, () => {
  23012. if (this.isHide)
  23013. return;
  23014. let index = xGame.common.randomNum(4, 7);
  23015. xGame.soundMgr.playSound("s_main0" + index);
  23016. let words = 1;
  23017. switch (index) {
  23018. case 4:
  23019. words = 5;
  23020. break;
  23021. case 5:
  23022. words = 3;
  23023. break;
  23024. case 6:
  23025. words = 6;
  23026. break;
  23027. case 7:
  23028. words = 7;
  23029. break;
  23030. default:
  23031. break;
  23032. }
  23033. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23034. this.playSecretaryRandomSound();
  23035. });
  23036. }
  23037. closeSelf() {
  23038. this.hide();
  23039. }
  23040. }
  23041. UIShop$1.uiName = "UIShop";
  23042. class SignMax$1 {
  23043. constructor(ui) {
  23044. this.ui = ui;
  23045. }
  23046. updateSelf(index, sameDay, curDayIndex) {
  23047. let data = cfgTable.signData[index + 1];
  23048. this.ui.titleTxt.text = data.title;
  23049. let arr1 = data.award[0].split('-');
  23050. let arr2 = data.award[1].split('-');
  23051. let num1 = parseInt(arr1[1]);
  23052. let num2 = parseInt(arr2[1]);
  23053. this.ui.numTxt1.text = num1 + "";
  23054. this.ui.numTxt2.text = num2 + "";
  23055. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23056. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23057. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23058. this.ui.numTxt1.visible = false;
  23059. }
  23060. else {
  23061. this.ui.numTxt1.visible = true;
  23062. }
  23063. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23064. this.ui.numTxt2.visible = false;
  23065. }
  23066. else {
  23067. this.ui.numTxt2.visible = true;
  23068. }
  23069. if (index < curDayIndex) {
  23070. this.ui.c1.selectedIndex = 1;
  23071. }
  23072. else if (index == curDayIndex) {
  23073. if (sameDay) {
  23074. this.ui.c1.selectedIndex = 2;
  23075. }
  23076. else {
  23077. this.ui.c1.selectedIndex = 2;
  23078. }
  23079. }
  23080. else {
  23081. this.ui.c1.selectedIndex = 0;
  23082. }
  23083. }
  23084. }
  23085. class SignNormal$1 {
  23086. constructor(ui) {
  23087. this.ui = ui;
  23088. }
  23089. updateSelf(index, sameDay, curDayIndex) {
  23090. let data = cfgTable.signData[index + 1];
  23091. this.ui.titleTxt.text = data.title;
  23092. let arr = data.award[0].split('-');
  23093. let type = parseInt(arr[0]);
  23094. let num = parseInt(arr[1]);
  23095. this.ui.numTxt.text = num + "";
  23096. if (type > 2) {
  23097. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23098. this.ui.myIcon.rotation = 0;
  23099. }
  23100. else {
  23101. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23102. this.ui.myIcon.rotation = 0;
  23103. }
  23104. if (xGame.common.signAwardContainsRod(data.award)) {
  23105. this.ui.numTxt.visible = false;
  23106. }
  23107. else {
  23108. this.ui.numTxt.visible = true;
  23109. }
  23110. if (index < curDayIndex) {
  23111. this.ui.c1.selectedIndex = 1;
  23112. }
  23113. else if (index == curDayIndex) {
  23114. if (sameDay) {
  23115. this.ui.c1.selectedIndex = 2;
  23116. }
  23117. else {
  23118. this.ui.c1.selectedIndex = 2;
  23119. }
  23120. }
  23121. else {
  23122. this.ui.c1.selectedIndex = 0;
  23123. }
  23124. }
  23125. }
  23126. class UISign$1 extends UIBase {
  23127. constructor() {
  23128. super();
  23129. this.curDayIndex = 0;
  23130. this.starX = 0;
  23131. }
  23132. onConstructor() {
  23133. this.ui = ui_UISign.createInstance();
  23134. this.contentPane = this.ui;
  23135. this.isEject = false;
  23136. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23137. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23138. this.initSignItem();
  23139. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23140. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23141. }
  23142. show() {
  23143. super.show();
  23144. this.ui.t0.play();
  23145. this.playSecretaryIdle();
  23146. this.updateSign();
  23147. }
  23148. initSignItem() {
  23149. this.signArr = [];
  23150. for (let index = 0; index < 6; index++) {
  23151. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23152. this.signArr.push(temp);
  23153. }
  23154. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23155. if (Moyu.isKs)
  23156. this.ui.closeNode.closeBtn.x += 100;
  23157. }
  23158. updateSign() {
  23159. let sameDay = xGame.common.judgeSameDay();
  23160. let max = 7;
  23161. this.curDayIndex = DataMgr.getSignData();
  23162. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23163. this.curDayIndex = 0;
  23164. if (!sameDay) {
  23165. this.ui.normalBtn.visible = true;
  23166. this.ui.tipsNode.visible = false;
  23167. this.ui.againBtn.visible = false;
  23168. }
  23169. else {
  23170. this.ui.normalBtn.visible = false;
  23171. let again = DataMgr.getExtraSign();
  23172. let isCurrency = false;
  23173. let index = this.curDayIndex;
  23174. if (index == 0)
  23175. index = 7;
  23176. let award = cfgTable.signData[index].award;
  23177. let num = award[0].split("-")[0];
  23178. if (num == "1" || num == "2")
  23179. isCurrency = true;
  23180. let showAgain = again == 0 && isCurrency;
  23181. this.ui.againBtn.visible = showAgain;
  23182. this.ui.tipsNode.visible = !showAgain;
  23183. }
  23184. for (let index = 0; index < this.signArr.length; index++) {
  23185. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23186. }
  23187. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23188. }
  23189. playSecretaryIdle() {
  23190. let parent = this.ui.secretary.displayObject;
  23191. parent.destroyChildren();
  23192. let xx = this.ui.secretary.width / 2;
  23193. let yy = this.ui.secretary.height;
  23194. let scale = xGame.common.getSecretaryScale();
  23195. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23196. xGame.common.secretary.play(data, 0, true, parent);
  23197. }
  23198. closeSelf() {
  23199. this.hide();
  23200. }
  23201. normalGetAward() {
  23202. let sameDay = xGame.common.judgeSameDay();
  23203. if (!sameDay) {
  23204. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23205. let temp;
  23206. let type;
  23207. let num;
  23208. let arr = [];
  23209. for (let index = 0; index < award.length; index++) {
  23210. temp = award[index].split("-");
  23211. type = parseInt(temp[0]);
  23212. num = parseInt(temp[1]);
  23213. let awardType = new AwardType();
  23214. awardType.num = num;
  23215. awardType.type = type;
  23216. arr.push(awardType);
  23217. }
  23218. xGame.common.getAward(arr, (watchVideo) => {
  23219. this.curDayIndex++;
  23220. if (this.curDayIndex > 7)
  23221. this.curDayIndex = 0;
  23222. DataMgr.setSignData(this.curDayIndex);
  23223. DataMgr.setSignTime(new Date().getTime());
  23224. if (watchVideo) {
  23225. DataMgr.setExtraSign(1);
  23226. Moyu.sendDataEvent("signIn1");
  23227. }
  23228. this.updateSign();
  23229. });
  23230. }
  23231. }
  23232. againGetAward() {
  23233. Moyu.sendDataEvent("signIn2");
  23234. console.log('zh:qjff_AD_for_uisign');
  23235. if (Laya.Browser.onAndroid) {
  23236. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23237. if (!boo) {
  23238. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23239. return;
  23240. }
  23241. }
  23242. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23243. }
  23244. else {
  23245. console.log('zh:AD 失败,直接发放奖励');
  23246. this.qjff_AD_for_uisign();
  23247. }
  23248. }
  23249. qjff_AD_for_uisign() {
  23250. let index = this.curDayIndex;
  23251. if (index == 0)
  23252. index = 7;
  23253. let award = cfgTable.signData[index].award;
  23254. let temp;
  23255. let type;
  23256. let num;
  23257. for (let index = 0; index < award.length; index++) {
  23258. temp = award[index].split("-");
  23259. type = parseInt(temp[0]);
  23260. num = parseInt(temp[1]) * 3;
  23261. xGame.common.playObjFlyAnim(num, type);
  23262. }
  23263. DataMgr.setExtraSign(1);
  23264. this.updateSign();
  23265. }
  23266. }
  23267. UISign$1.uiName = "UISign";
  23268. class UIModeSelection$1 extends UIBase {
  23269. constructor() {
  23270. super();
  23271. }
  23272. onConstructor() {
  23273. this.ui = ui_UIModeSelection.createInstance();
  23274. this.contentPane = this.ui;
  23275. this.isEject = false;
  23276. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23277. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23278. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23279. this.addUIClick(this.ui.closeBtn, this.hide);
  23280. this.peopleArr = [65, 990, 580];
  23281. this.peopleOffest = [5, 10, 10];
  23282. }
  23283. show(callback) {
  23284. this.updateSelf();
  23285. super.show();
  23286. this.ui.t0.play();
  23287. this.callback = callback;
  23288. }
  23289. updateSelf() {
  23290. let cfg = cfgTable.modeselectData;
  23291. for (let index = 1; index <= 3; index++) {
  23292. let node = this.ui.myNode["type" + index];
  23293. node.need.text = cfg[index].need;
  23294. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23295. node.peopleTxt.text = this.getRandPeople(index - 1);
  23296. }
  23297. }
  23298. enterGame(type) {
  23299. console.log('zh: 进入经典模式 type: ' + type);
  23300. xGame.common.classicRoomType = type;
  23301. let cfg = cfgTable.modeselectData[type];
  23302. let need = cfg.need;
  23303. xGame.common.passAwardCoin = cfg.award;
  23304. if (DataMgr.coinEnough(need)) {
  23305. DataMgr.setCoin(-need);
  23306. this.ui.myNode["type" + type].t0.play();
  23307. Laya.timer.once(200, this, () => {
  23308. this.callback && this.callback();
  23309. });
  23310. this.logEventForClassic_start();
  23311. }
  23312. else {
  23313. Moyu.sendDataEvent("AddCoinVideo");
  23314. xGame.uiMgr.Show(UIAddProp$1, 0);
  23315. }
  23316. }
  23317. getRandPeople(index) {
  23318. let rand = this.peopleOffest[index];
  23319. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23320. }
  23321. logEventForClassic_start() {
  23322. let rtype = xGame.common.classicRoomType;
  23323. let msmc = '';
  23324. if (rtype == 1) {
  23325. msmc = 'beginner';
  23326. }
  23327. if (rtype == 2) {
  23328. msmc = 'expert';
  23329. }
  23330. if (rtype == 3) {
  23331. msmc = 'master';
  23332. }
  23333. let keyStr = 'sjmd_classic_start_' + rtype;
  23334. let jsonStr = {
  23335. "difficulty": msmc,
  23336. "classic_count": 1,
  23337. "difficulty_count": 1
  23338. };
  23339. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23340. const d = LocalStorageManager.getItem(keyStr);
  23341. jsonStr.classic_count = d.classic_count + 1;
  23342. jsonStr.difficulty_count = d.difficulty_count + 1;
  23343. LocalStorageManager.setItem(keyStr, jsonStr);
  23344. }
  23345. else {
  23346. LocalStorageManager.setItem(keyStr, jsonStr);
  23347. }
  23348. const reqStr = JSON.stringify(jsonStr);
  23349. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23350. }
  23351. }
  23352. UIModeSelection$1.uiName = "UIModeSelection";
  23353. class UILogin$1 extends UIBase {
  23354. constructor() {
  23355. super();
  23356. }
  23357. onConstructor() {
  23358. this.ui = ui_UILogin.createInstance();
  23359. this.contentPane = this.ui;
  23360. this.isEject = false;
  23361. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23362. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23363. this.addUIClick(this.ui.btn_login, this.userLogin);
  23364. }
  23365. show() {
  23366. super.show();
  23367. this.x = (Laya.stage.width - this.width) / 2;
  23368. this.y = (Laya.stage.height - this.height) / 2;
  23369. }
  23370. closeSelf() {
  23371. this.hide();
  23372. }
  23373. userLogin() {
  23374. let ua = this.ui.txt_ua.text;
  23375. let up = this.ui.txt_up.text;
  23376. if (ua && up) {
  23377. let reqData = JSON.stringify({
  23378. username: ua.trim(),
  23379. password: up.trim(),
  23380. fromMark: 'app_game'
  23381. });
  23382. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23383. try {
  23384. console.log('zh:res = ' + JSON.stringify(res));
  23385. let code = res.code;
  23386. let msg = res.msg;
  23387. if (code == 200) {
  23388. let keyStr = keyForLoginInfo;
  23389. let jsonStr = {
  23390. "username": res.username,
  23391. "token": res.token,
  23392. "buySpids": { 1: false, 7: false }
  23393. };
  23394. LocalStorageManager.setItem(keyStr, jsonStr);
  23395. let myu = Moyu.getUserInfo();
  23396. console.log('zh:myu = ' + JSON.stringify(myu));
  23397. DataMgr.updateUserNickName(res.username);
  23398. Moyu.updateUserInfo(res.username);
  23399. xGame.uiMgr.Show(UIMsg$1, msg);
  23400. DataMgr.getUserZiChanInfo();
  23401. xGame.eventMgr.event(LOGIN_IN);
  23402. this.closeSelf();
  23403. }
  23404. else {
  23405. xGame.uiMgr.Show(UIMsg$1, msg);
  23406. }
  23407. }
  23408. catch (error) {
  23409. console.log('error=' + error);
  23410. alert(error);
  23411. }
  23412. finally {
  23413. }
  23414. });
  23415. }
  23416. else {
  23417. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23418. }
  23419. }
  23420. gotoRegPage() {
  23421. this.closeSelf();
  23422. xGame.uiMgr.Show(UIReg$1);
  23423. }
  23424. }
  23425. UILogin$1.uiName = "UILogin";
  23426. class UIReg$1 extends UIBase {
  23427. constructor() {
  23428. super();
  23429. }
  23430. onConstructor() {
  23431. this.ui = ui_UIReg.createInstance();
  23432. this.contentPane = this.ui;
  23433. this.isEject = false;
  23434. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23435. this.addUIClick(this.ui.btn_reg, this.regUser);
  23436. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23437. }
  23438. show() {
  23439. super.show();
  23440. this.x = (Laya.stage.width - this.width) / 2;
  23441. this.y = (Laya.stage.height - this.height) / 2;
  23442. }
  23443. closeSelf() {
  23444. this.hide();
  23445. }
  23446. regUser() {
  23447. this.ui.lab_tip.visible = false;
  23448. let ua = this.ui.txt_ua.text;
  23449. let up1 = this.ui.txt_up1.text;
  23450. let up2 = this.ui.txt_up2.text;
  23451. if (ua && up1 && up2 && up1 == up2) {
  23452. let reqData = JSON.stringify({
  23453. username: ua.trim(),
  23454. password: up1.trim(),
  23455. fromMark: 'app_game'
  23456. });
  23457. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23458. try {
  23459. console.log('zh:res = ' + JSON.stringify(res));
  23460. let code = res.code;
  23461. let msg = res.msg;
  23462. xGame.uiMgr.Show(UIMsg$1, msg);
  23463. if (code == 200) {
  23464. this.ui.lab_tip.color = "#FFFFFF";
  23465. xGame.uiMgr.Show(UIMsg$1, msg);
  23466. this.closeSelf();
  23467. }
  23468. else {
  23469. this.ui.lab_tip.color = "#FF0000";
  23470. xGame.uiMgr.Show(UIMsg$1, msg);
  23471. }
  23472. }
  23473. catch (error) {
  23474. console.log('error=' + error);
  23475. alert(error);
  23476. }
  23477. finally {
  23478. }
  23479. });
  23480. }
  23481. else {
  23482. if (up1 != up2) {
  23483. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23484. }
  23485. else {
  23486. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23487. }
  23488. }
  23489. }
  23490. gotoLogin() {
  23491. this.closeSelf();
  23492. xGame.uiMgr.Show(UILogin$1);
  23493. }
  23494. }
  23495. UIReg$1.uiName = "UIReg";
  23496. class UIFuli1$1 extends UIBase {
  23497. constructor() {
  23498. super();
  23499. }
  23500. onConstructor() {
  23501. this.ui = ui_UIFuli1.createInstance();
  23502. this.contentPane = this.ui;
  23503. this.isEject = false;
  23504. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23505. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23506. }
  23507. show() {
  23508. super.show();
  23509. this.x = (Laya.stage.width - this.width) / 2;
  23510. this.y = (Laya.stage.height - this.height) / 2;
  23511. }
  23512. closeSelf() {
  23513. this.hide();
  23514. }
  23515. gotoBuy() {
  23516. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23517. if (userInfo != null) {
  23518. let token = userInfo.token;
  23519. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23520. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23521. return;
  23522. }
  23523. else {
  23524. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23525. }
  23526. }
  23527. gotoBuy2() {
  23528. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23529. if (userInfo == null) {
  23530. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23531. return;
  23532. }
  23533. let reqData = xGame.httpMgr.getReqData();
  23534. let pd = JSON.parse(reqData);
  23535. pd.productId = 1;
  23536. reqData = JSON.stringify(pd);
  23537. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23538. try {
  23539. console.log('zh:buySp res = ' + JSON.stringify(res));
  23540. let code = res.code;
  23541. let msg = res.msg;
  23542. if (code == 401) {
  23543. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23544. alert(TIP_MSG_key.loginTimeOut);
  23545. xGame.uiMgr.Show(UIMsg$1, msg);
  23546. return;
  23547. }
  23548. if (code == 200) {
  23549. xGame.uiMgr.Show(UIMsg$1, msg);
  23550. DataMgr.getUserZiChanInfo();
  23551. this.closeSelf();
  23552. }
  23553. else {
  23554. xGame.uiMgr.Show(UIMsg$1, msg);
  23555. }
  23556. }
  23557. catch (error) {
  23558. console.log('error=' + error);
  23559. alert(error);
  23560. }
  23561. finally {
  23562. }
  23563. });
  23564. }
  23565. }
  23566. UIFuli1$1.uiName = "UIFuli1";
  23567. class UIFuli2$1 extends UIBase {
  23568. constructor() {
  23569. super();
  23570. }
  23571. onConstructor() {
  23572. this.ui = ui_UIFuli2.createInstance();
  23573. this.contentPane = this.ui;
  23574. this.isEject = false;
  23575. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23576. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23577. }
  23578. show() {
  23579. super.show();
  23580. this.x = (Laya.stage.width - this.width) / 2;
  23581. this.y = (Laya.stage.height - this.height) / 2;
  23582. }
  23583. closeSelf() {
  23584. this.hide();
  23585. }
  23586. gotoBuy() {
  23587. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23588. if (userInfo != null) {
  23589. let token = userInfo.token;
  23590. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23591. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23592. return;
  23593. }
  23594. else {
  23595. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23596. }
  23597. }
  23598. gotoBuy1() {
  23599. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23600. if (userInfo == null) {
  23601. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23602. return;
  23603. }
  23604. let reqData = xGame.httpMgr.getReqData();
  23605. let pd = JSON.parse(reqData);
  23606. pd.productId = 2;
  23607. reqData = JSON.stringify(pd);
  23608. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23609. try {
  23610. console.log('zh:buySp res = ' + JSON.stringify(res));
  23611. let code = res.code;
  23612. let msg = res.msg;
  23613. if (code == 401) {
  23614. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23615. alert(TIP_MSG_key.loginTimeOut);
  23616. xGame.uiMgr.Show(UIMsg$1, msg);
  23617. return;
  23618. }
  23619. if (code == 200) {
  23620. xGame.uiMgr.Show(UIMsg$1, msg);
  23621. DataMgr.getUserZiChanInfo();
  23622. this.closeSelf();
  23623. }
  23624. else {
  23625. xGame.uiMgr.Show(UIMsg$1, msg);
  23626. }
  23627. }
  23628. catch (error) {
  23629. console.log('error=' + error);
  23630. alert(error);
  23631. }
  23632. finally {
  23633. }
  23634. });
  23635. }
  23636. }
  23637. UIFuli2$1.uiName = "UIFuli2";
  23638. class UITry$1 extends UIBase {
  23639. constructor() {
  23640. super();
  23641. this.closeTime = 0;
  23642. this.closeNum = 0;
  23643. this.skillUrl = xGame.common.skillIconList;
  23644. }
  23645. onConstructor() {
  23646. this.ui = ui_UITry.createInstance();
  23647. this.contentPane = this.ui;
  23648. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23649. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23650. }
  23651. show() {
  23652. super.show();
  23653. this.closeNum = 0;
  23654. this.closeTime = 15;
  23655. this.ui.t0.play();
  23656. PlatMgr.showRateBanner();
  23657. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23658. Laya.timer.loop(1000, this, this.updateTime);
  23659. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23660. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23661. xGame.common.gameMgr.gamePause = true;
  23662. }
  23663. updateTime() {
  23664. if (this.closeTime > 1) {
  23665. this.closeTime--;
  23666. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23667. }
  23668. else
  23669. this.hide();
  23670. }
  23671. hide() {
  23672. Laya.timer.clearAll(this);
  23673. Moyu.showBannerAd(false);
  23674. super.hide();
  23675. xGame.common.gameMgr.gamePause = false;
  23676. }
  23677. onTry() {
  23678. console.log('zh:qjff_AD_for_uitry');
  23679. if (Laya.Browser.onAndroid) {
  23680. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23681. if (!boo) {
  23682. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23683. return;
  23684. }
  23685. }
  23686. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23687. }
  23688. else {
  23689. console.log('zh:AD 失败,直接发放奖励');
  23690. this.qjff_AD_for_uitry();
  23691. }
  23692. }
  23693. qjff_AD_for_uitry() {
  23694. let select = xGame.common.curPlayerSkillType;
  23695. DataMgr.gameData.trySkill = select;
  23696. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23697. DataMgr.saveGameData();
  23698. DataMgr.setBigSkill(select, 1);
  23699. xGame.showTip("Trial Successful");
  23700. this.hide();
  23701. }
  23702. onCancel() {
  23703. if (this.closeNum > 0) {
  23704. this.closeNum--;
  23705. if (this.closeNum < 2)
  23706. this.hide();
  23707. return;
  23708. }
  23709. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23710. this.onTry();
  23711. }
  23712. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23713. this.closeNum = 3;
  23714. }
  23715. else
  23716. this.hide();
  23717. }
  23718. }
  23719. UITry$1.uiName = "UITry";
  23720. class UIGetAward$1 extends UIBase {
  23721. constructor() {
  23722. super();
  23723. this.showTriple = true;
  23724. }
  23725. onConstructor() {
  23726. this.ui = ui_UIGetAward.createInstance();
  23727. this.contentPane = this.ui;
  23728. this.isEject = false;
  23729. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23730. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23731. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23732. }
  23733. show(arr, showTriple, callback) {
  23734. super.show();
  23735. this.ui.t0.play();
  23736. this.ui.eftNode.visible = true;
  23737. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23738. this.ui.eftNode.visible = false;
  23739. }), 1, 0, 0, 0.9);
  23740. this.awardArr = arr;
  23741. this.showTriple = showTriple;
  23742. this.callback = callback;
  23743. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23744. this.ui.myList.numItems = arr.length;
  23745. xGame.soundMgr.playSound("getaward");
  23746. }
  23747. updateSelf(index, obj) {
  23748. let temp = this.awardArr[index];
  23749. let icon = this.getIcon(temp.type);
  23750. let str = icon;
  23751. if (temp.type > 2) {
  23752. str = "s" + icon;
  23753. }
  23754. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23755. obj.myIcon.rotation = 0;
  23756. obj.numTxt.text = temp.num + "";
  23757. obj.numTxt.visible = temp.type > 2 ? false : true;
  23758. obj.nameTxt.text = this.getNameStr(temp.type);
  23759. }
  23760. renderItem(index, obj) {
  23761. this.updateSelf(index, obj);
  23762. }
  23763. tripleGetAward() {
  23764. console.log('zh:qjff_AD_for_uigetAward');
  23765. if (Laya.Browser.onAndroid) {
  23766. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23767. if (!boo) {
  23768. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23769. return;
  23770. }
  23771. }
  23772. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23773. }
  23774. else {
  23775. console.log('zh:AD 失败,直接发放奖励');
  23776. this.qjff_AD_for_uigetAward();
  23777. }
  23778. }
  23779. qjff_AD_for_uigetAward() {
  23780. this.getAward(3);
  23781. }
  23782. normalGetAward() {
  23783. if (PlatMgr.isMisVideo())
  23784. this.tripleGetAward();
  23785. else
  23786. this.getAward();
  23787. }
  23788. getAward(times = 1) {
  23789. this.hide();
  23790. for (let index = 0; index < this.awardArr.length; index++) {
  23791. this.awardArr[index].num *= times;
  23792. }
  23793. this.callback && this.callback(times != 1);
  23794. }
  23795. getIcon(type) {
  23796. switch (type) {
  23797. case Prop.diamond:
  23798. return "ty_zs";
  23799. case Prop.coin:
  23800. return "ty_jb";
  23801. case Prop.gan1:
  23802. return "qg1";
  23803. case Prop.gan2:
  23804. return "qg2";
  23805. case Prop.gan3:
  23806. return "qg3";
  23807. case Prop.gan4:
  23808. return "qg4";
  23809. default:
  23810. break;
  23811. }
  23812. }
  23813. getNameStr(type) {
  23814. switch (type) {
  23815. case Prop.diamond:
  23816. return "Diamond";
  23817. case Prop.coin:
  23818. return "Coins";
  23819. case Prop.gan1:
  23820. case Prop.gan2:
  23821. case Prop.gan3:
  23822. case Prop.gan4:
  23823. return cfgTable.ballrodData[type - 1].name;
  23824. default:
  23825. break;
  23826. }
  23827. }
  23828. }
  23829. UIGetAward$1.uiName = "UIGetAward";
  23830. class UIBox$1 extends UIBase {
  23831. constructor() {
  23832. super();
  23833. this.boxNum = 0;
  23834. this.boxMax = 10;
  23835. this.inAd = false;
  23836. this.isClose = false;
  23837. }
  23838. onConstructor() {
  23839. this.ui = ui_UIBox.createInstance();
  23840. this.contentPane = this.ui;
  23841. this.isEject = false;
  23842. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23843. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23844. Laya.timer.loop(1000, this, this.update);
  23845. }
  23846. update() {
  23847. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23848. this.boxNum -= 1;
  23849. this.upBar();
  23850. }
  23851. }
  23852. upBar() {
  23853. if (this.boxNum > this.boxMax)
  23854. this.boxNum = this.boxMax;
  23855. this.ui.bar.value = this.boxNum * 10;
  23856. }
  23857. show() {
  23858. super.show();
  23859. this.isClose = false;
  23860. this.boxNum = 0;
  23861. this.inAd = false;
  23862. this.upBar();
  23863. this.ui.t0.play();
  23864. this.ui.closeBtn.visible = false;
  23865. Laya.timer.once(3000, this, () => {
  23866. this.ui.closeBtn.visible = true;
  23867. this.ui.bar.alpha = 1;
  23868. });
  23869. Laya.timer.once(500, this, () => {
  23870. this.ui.t1.play();
  23871. });
  23872. }
  23873. hide() {
  23874. Laya.timer.clearAll(this);
  23875. Moyu.showBannerAd(false);
  23876. super.hide();
  23877. }
  23878. onOpenBox() {
  23879. this.boxNum++;
  23880. if (this.boxNum < this.boxMax) {
  23881. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23882. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23883. }
  23884. }
  23885. else if (this.boxNum == this.boxMax) {
  23886. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23887. this.ui.openBtn.c1.selectedIndex = 13;
  23888. this.inAd = true;
  23889. }
  23890. else
  23891. this.getAward();
  23892. }
  23893. else if (this.inAd) {
  23894. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23895. if (Laya.Browser.onAndroid) {
  23896. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23897. if (!boo) {
  23898. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23899. return;
  23900. }
  23901. }
  23902. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23903. }
  23904. else {
  23905. console.log('zh:AD 失败,直接发放奖励');
  23906. this.qjff_AD_for_UIBOX_onOpenBox();
  23907. }
  23908. }
  23909. this.upBar();
  23910. }
  23911. qjff_AD_for_UIBOX_onOpenBox() {
  23912. this.getAward();
  23913. }
  23914. onCloseBox() {
  23915. if (this.isClose)
  23916. this.hide();
  23917. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23918. this.isClose = true;
  23919. PlatMgr.showBanner(true, 0, 3000);
  23920. }
  23921. else
  23922. this.hide();
  23923. }
  23924. getAward() {
  23925. let str = "";
  23926. if (Math.random() < 0.5) {
  23927. let max = Moyu.isLegal ? 500 : 2500;
  23928. let num = xGame.tools.random(max, 500 + max);
  23929. DataMgr.setCoin(num);
  23930. str = "金币x" + num;
  23931. }
  23932. else {
  23933. let max = Moyu.isLegal ? 10 : 30;
  23934. let num = xGame.tools.random(max, 30 + max);
  23935. DataMgr.setDiamond(num);
  23936. str = "钻石x" + num;
  23937. }
  23938. xGame.showTip("恭喜获得-" + str);
  23939. this.hide();
  23940. }
  23941. }
  23942. UIBox$1.uiName = "UIBox";
  23943. class UIMain$1 extends UIBase {
  23944. constructor() {
  23945. super();
  23946. this.firstEnter = true;
  23947. }
  23948. nativeCallJs(msg) {
  23949. let t = msg;
  23950. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23951. switch (t) {
  23952. case 'qjff_chouJiang':
  23953. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23954. dui.qjff_chouJiang();
  23955. break;
  23956. case 'qjff_AD_for_uisign':
  23957. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23958. dui2.qjff_AD_for_uisign();
  23959. break;
  23960. case 'qjff_AD_for_uitry':
  23961. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23962. dui3.qjff_AD_for_uitry();
  23963. break;
  23964. case 'qjff_AD_for_uipower':
  23965. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23966. dui4.qjff_AD_for_uipower();
  23967. break;
  23968. case 'qjff_AD_for_uigetAward':
  23969. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23970. dui5.qjff_AD_for_uigetAward();
  23971. break;
  23972. case 'qjff_AD_for_uiGameEnd':
  23973. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23974. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23975. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23976. break;
  23977. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23978. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23979. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23980. break;
  23981. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23982. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23983. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23984. break;
  23985. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23986. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23987. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23988. break;
  23989. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23990. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23991. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23992. break;
  23993. case 'qjff_AD_for_UIBOX_onOpenBox':
  23994. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23995. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23996. break;
  23997. case 'qjff_AD_for_UIAddCoin':
  23998. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23999. dui12.qjff_AD_for_UIAddCoin();
  24000. break;
  24001. case '111a':
  24002. let dui14 = xGame.uiMgr.getUI(UISign$1);
  24003. dui14.qjff_AD_for_uisign();
  24004. break;
  24005. case '222a':
  24006. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24007. dui15.qjff_AD_for_uisign();
  24008. break;
  24009. case '333a':
  24010. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24011. dui16.qjff_AD_for_uisign();
  24012. break;
  24013. default:
  24014. console.log('zh:未知的方法名字' + t);
  24015. break;
  24016. }
  24017. }
  24018. onConstructor() {
  24019. console.log('zh: UIMain onConstructor');
  24020. this.ui = ui_UIMain.createInstance();
  24021. this.contentPane = this.ui;
  24022. this.isEject = false;
  24023. this.addEvent();
  24024. this.addClickSpine();
  24025. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24026. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24027. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24028. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24029. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24030. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24031. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24032. let curUse = DataMgr.getCurSecretary();
  24033. this.changeSecretary(curUse);
  24034. this.ui.talkNode.visible = false;
  24035. let guide = DataMgr.getSkillGuide();
  24036. if (xGame.common.isNewDay && guide == 1) {
  24037. xGame.common.isNewDay = false;
  24038. xGame.soundMgr.playSound("s_main01");
  24039. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24040. console.log("zh:播放小秘书每天语音");
  24041. }
  24042. this.onGetUserInfo();
  24043. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24044. DataMgr.getUserZiChanInfo();
  24045. }
  24046. this.ui.n83.visible = false;
  24047. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24048. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24049. let ua = d.username;
  24050. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24051. }
  24052. this.c_btn_for_user();
  24053. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24054. this.loadUserSpOrderForAd();
  24055. this.ui.n_fuli.visible = false;
  24056. }
  24057. Logout() {
  24058. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24059. LocalStorageManager.removeItem(keyForLoginInfo);
  24060. this.freshUser();
  24061. }
  24062. JSBridgeUtils.instance.loginOutForApp();
  24063. this.setUserDefaultNickname();
  24064. }
  24065. setUserDefaultNickname() {
  24066. let defUsername = "player";
  24067. this.ui.headNode.nameTxt.text = defUsername;
  24068. DataMgr.updateUserNickName(defUsername);
  24069. Moyu.updateUserInfo(defUsername);
  24070. }
  24071. gotoLogin() {
  24072. xGame.uiMgr.Show(UILogin$1);
  24073. }
  24074. gotoRegUser() {
  24075. xGame.uiMgr.Show(UIReg$1);
  24076. }
  24077. showFuLiSp1() {
  24078. console.log('zh:福利1');
  24079. this.checkForShowFuLi17(1);
  24080. }
  24081. showFuLiSp7() {
  24082. console.log('zh:福利7');
  24083. this.checkForShowFuLi17(7);
  24084. }
  24085. loadUserSpOrderForAd() {
  24086. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24087. if (userInfo == null) {
  24088. return;
  24089. }
  24090. let reqData = xGame.httpMgr.getReqData();
  24091. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  24092. try {
  24093. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  24094. let code = res.code;
  24095. let msg = res.msg;
  24096. if (code == 401) {
  24097. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24098. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24099. return;
  24100. }
  24101. if (code == 200) {
  24102. let data = res.data;
  24103. let buy_spid1 = false;
  24104. let buy_spid7 = false;
  24105. for (let index = 0; index < data.length; index++) {
  24106. let element = data[index];
  24107. console.log('zh:list element.spid = ' + element.spid);
  24108. if (element.spid == 1) {
  24109. buy_spid1 = true;
  24110. }
  24111. if (element.spid == 7) {
  24112. buy_spid7 = true;
  24113. }
  24114. }
  24115. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  24116. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  24117. }
  24118. else {
  24119. xGame.uiMgr.Show(UIMsg$1, msg);
  24120. }
  24121. }
  24122. catch (error) {
  24123. console.log('error=' + error);
  24124. alert(error);
  24125. }
  24126. finally {
  24127. }
  24128. });
  24129. }
  24130. checkForShowFuLi17(spid) {
  24131. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24132. if (userInfo == null) {
  24133. if (spid === 1) {
  24134. xGame.uiMgr.Show(UIFuli1$1);
  24135. }
  24136. if (spid === 7) {
  24137. xGame.uiMgr.Show(UIFuli2$1);
  24138. }
  24139. return;
  24140. }
  24141. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24142. let reqData = xGame.httpMgr.getReqData();
  24143. let pd = JSON.parse(reqData);
  24144. pd.productId = spid;
  24145. reqData = JSON.stringify(pd);
  24146. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24147. try {
  24148. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24149. let code = res.code;
  24150. let msg = res.msg;
  24151. if (code == 401) {
  24152. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24153. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24154. return;
  24155. }
  24156. if (code == 200) {
  24157. let isBuyOk = res.data;
  24158. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24159. if (isBuyOk === false) {
  24160. if (spid === 1) {
  24161. xGame.uiMgr.Show(UIFuli1$1);
  24162. }
  24163. if (spid === 7) {
  24164. xGame.uiMgr.Show(UIFuli2$1);
  24165. }
  24166. }
  24167. else {
  24168. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24169. }
  24170. }
  24171. else {
  24172. xGame.uiMgr.Show(UIMsg$1, msg);
  24173. }
  24174. }
  24175. catch (error) {
  24176. console.log('error=' + error);
  24177. alert(error);
  24178. }
  24179. finally {
  24180. }
  24181. });
  24182. }
  24183. c_btn_for_user() {
  24184. this.ui.n_Logout.visible = false;
  24185. this.ui.n_dengLu.visible = false;
  24186. this.ui.n_zhuCe.visible = false;
  24187. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24188. this.ui.n_Logout.visible = true;
  24189. }
  24190. else {
  24191. this.ui.n_dengLu.visible = true;
  24192. }
  24193. }
  24194. changeSecretary(curUse) {
  24195. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24196. xGame.common.secretary && xGame.common.secretary.dispose();
  24197. this.addSecretarySpine(name);
  24198. }
  24199. addSecretarySpine(name) {
  24200. let spine = new SpineMgr(name, () => {
  24201. this.playSecretaryIdle();
  24202. });
  24203. xGame.common.secretary = spine;
  24204. }
  24205. addClickSpine() {
  24206. let clickSpine = new SpineMgr("dianji", () => {
  24207. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24208. let parent = Laya.stage;
  24209. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24210. clickSpine.play(data, 0, false, parent, (spine) => {
  24211. spine.destroy(true);
  24212. });
  24213. });
  24214. });
  24215. }
  24216. addEvent() {
  24217. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24218. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24219. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  24220. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24221. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24222. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24223. this.addUIClick(this.ui, this.interuptSecretary);
  24224. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24225. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24226. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24227. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24228. this.addUIClick(this.ui.signBtn, this.openSignView);
  24229. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24230. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24231. this.addUIClick(this.ui.n_Logout, this.Logout);
  24232. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24233. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  24234. this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
  24235. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24236. }
  24237. show(showFailWords) {
  24238. super.show();
  24239. this.loadUserSpOrderForAd();
  24240. this.moneyNode.ui.c1.selectedIndex = 1;
  24241. this.playSecretaryIdle();
  24242. xGame.soundMgr.playMusic("caromhall01", 0);
  24243. Laya.timer.clearAll(this);
  24244. this.playSecretaryRandomSound();
  24245. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24246. if (showFailWords) {
  24247. console.log('zh:uimain.ts ');
  24248. setTimeout(() => {
  24249. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24250. let words = -1;
  24251. if (str == "s_main02") {
  24252. words = 2;
  24253. }
  24254. else {
  24255. words = 3;
  24256. }
  24257. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24258. xGame.soundMgr.playSound(str);
  24259. }, 300);
  24260. }
  24261. this.showGuide();
  24262. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24263. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24264. let guide = DataMgr.getSkillGuide();
  24265. if (guide == 1) {
  24266. let randTime = xGame.common.randomNum(300, 800);
  24267. if (this.firstEnter) {
  24268. console.log("zh: firstEnter");
  24269. this.firstEnter = false;
  24270. randTime += 900;
  24271. }
  24272. else {
  24273. console.log("zh: no firstEnter");
  24274. }
  24275. Laya.timer.once(randTime, this, () => {
  24276. });
  24277. Laya.timer.once(1000, this, () => {
  24278. console.log('zh: 1秒后 showFuLiSp1');
  24279. this.showFuLiSp1();
  24280. });
  24281. Laya.timer.once(10000, this, () => {
  24282. console.log('zh: 10秒后 showFuLiSp1');
  24283. this.showFuLiSp7();
  24284. });
  24285. }
  24286. }
  24287. checkActive(show) {
  24288. }
  24289. showGuide() {
  24290. let guide = DataMgr.getSkillGuide();
  24291. this.ui.guideBtn.visible = guide == 0;
  24292. this.ui.enterGuide.visible = false;
  24293. this.ui.secretaryGuide.visible = guide == 0;
  24294. if (guide == 0) {
  24295. console.log("zh:显示引导");
  24296. xGame.soundMgr.playSound("s_guide");
  24297. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24298. }
  24299. else {
  24300. console.log("zh:不需要显示引导");
  24301. }
  24302. }
  24303. ensureSecretary() {
  24304. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  24305. this.ui.secretaryGuide.visible = false;
  24306. this.ui.enterGuide.visible = true;
  24307. this.ui.wordsNode.t0.play();
  24308. if (DataMgr.getNewUser())
  24309. Moyu.sendDataEvent("gameReady");
  24310. }
  24311. playSecretaryIdle() {
  24312. let parent = this.ui.secretary.displayObject;
  24313. parent.destroyChildren();
  24314. let xx = this.ui.secretary.width / 2;
  24315. let yy = this.ui.secretary.height;
  24316. let scale = xGame.common.getSecretaryScale();
  24317. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24318. xGame.common.secretary.play(data, 0, true, parent);
  24319. }
  24320. startGame(type) {
  24321. if (!this.isReadyForLoadNetSource()) {
  24322. return;
  24323. }
  24324. xGame.common.gameMode = type;
  24325. Moyu.sendDataEvent("PlayGame", { type: type });
  24326. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  24327. switch (xGame.common.gameMode) {
  24328. case GameMode.classic:
  24329. console.log('zh:进入经典模式111111111');
  24330. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24331. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24332. console.log('zh:classic db_over_lev=', db_over_lev);
  24333. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24334. console.log('zh:判断是否可以玩该模式classic =NO');
  24335. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24336. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24337. return;
  24338. }
  24339. else {
  24340. console.log('zh:可以玩该模式classic 66666666666666');
  24341. this.beginGame();
  24342. }
  24343. }
  24344. else {
  24345. console.log('zh:不需要判断是否可以玩该classic');
  24346. let challengeTimes = DataMgr.getChallengeTimes();
  24347. if (challengeTimes == 0) {
  24348. xGame.uiMgr.Show(UIInvitation$1);
  24349. }
  24350. else {
  24351. this.beginGame();
  24352. }
  24353. break;
  24354. }
  24355. case GameMode.bigMove:
  24356. console.error('zh:bigMove check');
  24357. let guide = DataMgr.getSkillGuide();
  24358. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24359. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24360. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24361. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24362. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24363. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24364. return;
  24365. }
  24366. else {
  24367. console.log('zh:可以玩该模式 bigMove');
  24368. this.beginGame();
  24369. if (DataMgr.getNewUser())
  24370. Moyu.sendDataEvent("gameStart0");
  24371. }
  24372. }
  24373. else {
  24374. this.beginGame();
  24375. if (DataMgr.getNewUser())
  24376. Moyu.sendDataEvent("gameStart0");
  24377. }
  24378. break;
  24379. default:
  24380. console.error('zh:未知错误!!!!');
  24381. break;
  24382. }
  24383. }
  24384. beginGame(isNice = false) {
  24385. console.log('zh:beginGame ');
  24386. let guide = DataMgr.getSkillGuide();
  24387. if (guide == 1) {
  24388. console.log('zh:非新手引导,showInternAd ');
  24389. JSBridgeUtils.instance.showInternAd('beginGame');
  24390. }
  24391. else {
  24392. console.log('zh:新手引导,不显示AD ');
  24393. }
  24394. console.log('zh:beginGame 2 go');
  24395. if (xGame.common.gameMode == GameMode.classic) {
  24396. if (isNice) {
  24397. this.enterClassic();
  24398. }
  24399. else {
  24400. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24401. console.log('zh:BBBBBBBBBBBBBBB');
  24402. this.enterClassic();
  24403. });
  24404. }
  24405. }
  24406. else if (xGame.common.gameMode == GameMode.bigMove) {
  24407. this.ui.enterGuide.visible = false;
  24408. xGame.uiMgr.Show(UISkill$1);
  24409. }
  24410. }
  24411. enterClassic() {
  24412. xGame.uiMgr.Show(UIGame$1);
  24413. xGame.uiMgr.Show(UIMatching$1, () => {
  24414. if (!this.isHide)
  24415. this.hide();
  24416. xGame.common.gameUI.ui.alpha = 1;
  24417. xGame.common.gameUI.startGame();
  24418. xGame.uiMgr.Hide(UIGameEnd$1);
  24419. });
  24420. }
  24421. start_debug_for_moni_payOk() {
  24422. console.log('zh:start_debug_for_moni_payOk');
  24423. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24424. if (userInfo != null) {
  24425. let token = userInfo.token;
  24426. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24427. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24428. alert('模拟支付OK');
  24429. return;
  24430. }
  24431. else {
  24432. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24433. }
  24434. }
  24435. startGlobal() {
  24436. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24437. }
  24438. startWeekly() {
  24439. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24440. }
  24441. zhouSaiMonth() {
  24442. console.log('zh: zhouSaiMonth 被调用');
  24443. }
  24444. isReadyForLoadNetSource() {
  24445. let reqCount = xGame.cfgMgr.httpReqCount;
  24446. let ok = xGame.cfgMgr.httpReqOkCount;
  24447. if (reqCount > ok) {
  24448. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24449. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24450. Laya.timer.once(5000, this, () => {
  24451. let retryCount = 0;
  24452. const maxRetries = 3;
  24453. const tryFetchConfig = () => {
  24454. try {
  24455. xGame.cfgMgr.getConfigFromServer();
  24456. }
  24457. catch (error) {
  24458. if (retryCount < maxRetries) {
  24459. retryCount++;
  24460. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24461. Laya.timer.once(5000, this, tryFetchConfig);
  24462. }
  24463. else {
  24464. console.error("❌ 达到最大重试次数,配置获取失败");
  24465. }
  24466. }
  24467. };
  24468. tryFetchConfig();
  24469. });
  24470. return false;
  24471. }
  24472. return true;
  24473. }
  24474. startPlaceBall() {
  24475. if (!this.isReadyForLoadNetSource()) {
  24476. return;
  24477. }
  24478. xGame.uiMgr.Show(UILevelDisplay$1);
  24479. }
  24480. hide() {
  24481. console.log('zh:uimain hide ...');
  24482. super.hide();
  24483. xGame.common.stopGirlPop(this.ui.talkNode);
  24484. }
  24485. onGetUserInfo(force = false) {
  24486. if (Moyu.isWx) {
  24487. let info = Moyu.getSystemInfo();
  24488. if (info)
  24489. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24490. }
  24491. else {
  24492. Moyu.initUser(this, this.freshUser, force);
  24493. }
  24494. this.freshUser();
  24495. }
  24496. event_login_in() {
  24497. console.log("zh:event_login_in被触发");
  24498. this.freshUser();
  24499. }
  24500. freshUser() {
  24501. let user = Moyu.getUserInfo();
  24502. if (!user.isAuth) {
  24503. user.headIcon = 'res/ty_touxiang.png';
  24504. }
  24505. else {
  24506. DataMgr.upRankData();
  24507. }
  24508. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24509. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24510. let keyStr = keyForLoginInfo;
  24511. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24512. const d = LocalStorageManager.getItem(keyStr);
  24513. let ua = d.username;
  24514. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24515. }
  24516. else {
  24517. }
  24518. this.c_btn_for_user();
  24519. }
  24520. interuptSecretary() {
  24521. Laya.timer.clearAll(this);
  24522. this.playSecretaryRandomSound();
  24523. }
  24524. playSecretaryRandomSound() {
  24525. if (this.isHide)
  24526. return;
  24527. let time = xGame.common.randomNum(45000, 60000);
  24528. Laya.timer.once(time, this, () => {
  24529. if (this.isHide)
  24530. return;
  24531. let index = xGame.common.randomNum(4, 7);
  24532. xGame.soundMgr.playSound("s_main0" + index);
  24533. let words = 1;
  24534. switch (index) {
  24535. case 4:
  24536. words = 5;
  24537. break;
  24538. case 5:
  24539. words = 3;
  24540. break;
  24541. case 6:
  24542. words = 6;
  24543. break;
  24544. case 7:
  24545. words = 7;
  24546. break;
  24547. default:
  24548. break;
  24549. }
  24550. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24551. this.playSecretaryRandomSound();
  24552. });
  24553. }
  24554. openSecretaryView() {
  24555. xGame.uiMgr.Show(UISecretary$1);
  24556. Moyu.sendDataEvent("secretary");
  24557. }
  24558. openShopView() {
  24559. xGame.uiMgr.Show(UIShop$1, 0);
  24560. }
  24561. openSignView() {
  24562. xGame.uiMgr.Show(UISign$1);
  24563. }
  24564. openDrawView() {
  24565. xGame.uiMgr.Show(UIDraw$1);
  24566. }
  24567. openRanking() {
  24568. console.log('zh:phb openRanking');
  24569. xGame.uiMgr.Show(UIRanking$1);
  24570. Moyu.sendDataEvent("rankingList");
  24571. }
  24572. }
  24573. UIMain$1.uiName = "UIMain";
  24574. function InitShader() {
  24575. }
  24576. function appInit() {
  24577. xGame.context.init(getLoadingResList(), initCallback);
  24578. }
  24579. function getLoadingResList() {
  24580. return [
  24581. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24582. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24583. ];
  24584. }
  24585. function getGameResList() {
  24586. return [
  24587. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24588. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24589. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24590. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24591. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24592. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24593. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24594. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24595. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24596. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24597. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24598. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24599. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24600. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24601. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24602. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24603. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24604. ];
  24605. }
  24606. function initCallback() {
  24607. window["DataMgr"] = DataMgr;
  24608. DataMgr.Init();
  24609. Moyu.init(getPlat(), this, () => {
  24610. DataMgr.isNewDay();
  24611. PlatMgr.initConfig();
  24612. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24613. }, true);
  24614. console.log('zh:开始sm init1 start');
  24615. xGame.soundMgr.init();
  24616. console.log('zh:开始sm init1 end');
  24617. xGame.uiMgr.init();
  24618. xGame.uiMgr.clearTempData();
  24619. xGame.uiMgr.bindFUI(fguiRes.loading);
  24620. xGame.uiMgr.Show(UILoading);
  24621. }
  24622. function loadSubRes(callback) {
  24623. var tab = ["asset", "res", "spine"];
  24624. let subDone = 0;
  24625. for (var i = 0; i < tab.length; i++) {
  24626. let sub = tab[i];
  24627. Moyu.loadSubRes(sub, (pro) => {
  24628. callback && callback(pro, false);
  24629. }).then(() => {
  24630. subDone++;
  24631. if (subDone >= tab.length)
  24632. callback && callback(1, true);
  24633. });
  24634. }
  24635. }
  24636. function enterGame() {
  24637. xGame.cfgMgr.init();
  24638. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24639. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24640. xGame.uiMgr.Hide(UILoading);
  24641. fgui.UIPackage.removePackage(fguiRes.loading);
  24642. xGame.uiMgr.bindFUI(fguiRes.game);
  24643. xGame.uiMgr.Show(UIMain$1);
  24644. if (DataMgr.getNewUser())
  24645. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24646. }
  24647. function getPlat() {
  24648. let cfg = new MoyuCfg();
  24649. cfg.plat = MoyuPlat.web;
  24650. cfg.myId = 180;
  24651. cfg.myKey = '8848a885774230a4';
  24652. cfg.version = 0;
  24653. if (window.hasOwnProperty("gamebox")) {
  24654. cfg.plat = MoyuPlat.f399;
  24655. cfg.version = 0;
  24656. }
  24657. else if (window.hasOwnProperty("ks")) {
  24658. cfg.plat = MoyuPlat.ks;
  24659. cfg.version = 0;
  24660. cfg.ads.ksVideoId = '2300002254_01';
  24661. cfg.ads.ksInsertId = '2300002254_02';
  24662. }
  24663. else if (Laya.Browser.onTTMiniGame) {
  24664. cfg.plat = MoyuPlat.tt;
  24665. cfg.version = 0;
  24666. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24667. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24668. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24669. }
  24670. else if (Laya.Browser.onMiniGame) {
  24671. cfg.plat = MoyuPlat.wx;
  24672. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24673. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24674. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24675. }
  24676. else if (Laya.Browser.onQQMiniGame) {
  24677. cfg.plat = MoyuPlat.qq;
  24678. }
  24679. else if (Laya.Browser.onQGMiniGame) {
  24680. cfg.plat = MoyuPlat.op;
  24681. cfg.ads.opVideoId = '455502';
  24682. cfg.ads.opBannerId = '455507';
  24683. }
  24684. else if (Laya.Browser.onVVMiniGame) {
  24685. cfg.plat = MoyuPlat.vv;
  24686. cfg.version = 0;
  24687. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24688. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24689. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24690. }
  24691. else if (Laya.Browser.onHWMiniGame) {
  24692. cfg.plat = MoyuPlat.hw;
  24693. }
  24694. else if (window["mz"]) {
  24695. cfg.plat = MoyuPlat.mz;
  24696. }
  24697. else {
  24698. let cfg = window['conchConfig'];
  24699. if (cfg) {
  24700. var os = cfg.getOS();
  24701. if (os == "Conch-ios") {
  24702. cfg.plat = MoyuPlat.ios;
  24703. }
  24704. else if (os == "Conch-android") {
  24705. }
  24706. }
  24707. }
  24708. return cfg;
  24709. }
  24710. class Main {
  24711. constructor() {
  24712. if (window["Laya3D"])
  24713. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24714. else {
  24715. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24716. this.initMain();
  24717. }
  24718. }
  24719. initMain() {
  24720. Laya["Physics"] && Laya["Physics"].enable();
  24721. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24722. Laya.stage.scaleMode = GameConfig.scaleMode;
  24723. Laya.stage.screenMode = GameConfig.screenMode;
  24724. Laya.stage.alignV = GameConfig.alignV;
  24725. Laya.stage.alignH = GameConfig.alignH;
  24726. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24727. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24728. Laya.enableDebugPanel();
  24729. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24730. Laya["PhysicsDebugDraw"].enable();
  24731. if (GameConfig.stat)
  24732. Laya.Stat.show();
  24733. Laya.alertGlobalError(true);
  24734. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24735. }
  24736. onVersionLoaded() {
  24737. appInit();
  24738. }
  24739. }
  24740. new Main();
  24741. }());
  24742. //# sourceMappingURL=bundle.js.map