1
0

bundle.js 1000 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. console.log('zh:TEST环境');
  893. }
  894. else {
  895. console.log('zh:SC环境');
  896. }
  897. let url = urlMid + reqUrl;
  898. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  899. if (isDev) {
  900. url = urlTop + reqUrl;
  901. }
  902. else {
  903. url = urlTop + "prod-api/" + reqUrl;
  904. }
  905. }
  906. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  907. if (reqUrl.indexOf("/api/game/") >= 0) {
  908. }
  909. const keyForLoginInfo = "userInfo";
  910. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  911. if (userInfoData != null) {
  912. try {
  913. let bb = JSON.parse(userInfoData);
  914. if (bb) {
  915. let token = bb.token;
  916. headers.push("Authorization");
  917. headers.push(`Bearer ${token}`);
  918. }
  919. }
  920. catch (e) {
  921. }
  922. }
  923. let httpObj = new Laya.HttpRequest();
  924. httpObj.http.timeout = 5000;
  925. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  926. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  927. httpObj.send(url, data, 'post', 'text', headers);
  928. function errorHandler(error) {
  929. if (call) {
  930. call("{'msg':'Network exception','code':500}");
  931. }
  932. else {
  933. alert("Tip:Please check your network connection.");
  934. }
  935. }
  936. function completeHandler(data) {
  937. if (data && data.length > 0) {
  938. let jsonData = JSON.parse(data);
  939. if (call)
  940. call(jsonData);
  941. }
  942. }
  943. }
  944. sendGet(url, call) {
  945. let httpObj = new Laya.HttpRequest();
  946. httpObj.http.timeout = 5000;
  947. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  948. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  949. httpObj.send(url, '', 'get');
  950. function errorHandler(error) {
  951. console.log("errorHandler:" + error);
  952. }
  953. function completeHandler(data) {
  954. if (data && data.length > 0) {
  955. if (call)
  956. call(data);
  957. }
  958. }
  959. }
  960. }
  961. HttpMgr._instance = null;
  962. class LightShader extends Laya.Sprite {
  963. constructor() {
  964. super();
  965. this._time = 0;
  966. this._sin = 0;
  967. this.initShader();
  968. }
  969. initShader() {
  970. var vs = `
  971. #define FSHIGHPRECISION
  972. attribute vec4 posuv;
  973. uniform vec2 size;
  974. varying vec4 v_texcoord;
  975. void main() {
  976. vec4 pos = vec4(posuv.xy,0.,1.);
  977. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  978. gl_Position=pos1;
  979. v_texcoord.xy = posuv.xy;
  980. }
  981. `;
  982. var ps = `
  983. #define FSHIGHPRECISION
  984. precision highp float;
  985. varying vec4 v_texcoord;
  986. uniform vec2 size;
  987. uniform sampler2D texture;
  988. uniform float u_Time;
  989. void main() {
  990. vec4 color= texture2D(texture, v_texcoord.xy);
  991. float width = 0.2;
  992. float start = u_Time;
  993. float offset = 1.0;
  994. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  995. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  996. {
  997. color.r=1.1;
  998. color.g=1.1;
  999. color.b=1.1;
  1000. gl_FragColor = color;
  1001. } else {
  1002. gl_FragColor = color;
  1003. }
  1004. }
  1005. `;
  1006. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1007. this.customRenderEnable = true;
  1008. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1009. }
  1010. customRender(context, x, y) {
  1011. this.onUpdate();
  1012. if (!this.texture)
  1013. return;
  1014. let xx = x - this.pivotX;
  1015. let yy = y - this.pivotY;
  1016. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1017. }
  1018. onUpdate() {
  1019. this._time += 2 * Laya.timer.delta * 0.001;
  1020. this._sin = Math.sin(this._time);
  1021. if (this._sin > 0.99) {
  1022. this._sin = 0;
  1023. this._time = 0;
  1024. }
  1025. this.shaderValue['u_Time'] = this._sin;
  1026. }
  1027. }
  1028. LightShader.DissolveSurfaceSaveName = 9997;
  1029. class UIBase extends fairygui.Window {
  1030. constructor() {
  1031. super();
  1032. this.isEject = true;
  1033. this.isHide = true;
  1034. this.showbanner = true;
  1035. this.className = "";
  1036. this.isMuti = false;
  1037. this.showbanner = false;
  1038. this.onConstructor();
  1039. }
  1040. checkActive(show) {
  1041. }
  1042. getUIName() {
  1043. return UIBase.uiName;
  1044. }
  1045. onConstructor() {
  1046. try {
  1047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoadedForBase));
  1048. console.log("zh: base加载arial字体成功");
  1049. }
  1050. catch (error) {
  1051. console.log("zh: base加载arial字体失败");
  1052. }
  1053. }
  1054. onFontLoadedForBase() {
  1055. try {
  1056. Laya.Text.defaultFont = "arial";
  1057. console.log("zh: base 设置arial字体成功");
  1058. }
  1059. catch (error) {
  1060. console.log("zh: base 设置arial字体失败");
  1061. }
  1062. }
  1063. onInit() {
  1064. if (!!this.contentPane) {
  1065. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1066. }
  1067. this.setPivot(0.5, 0.5, false);
  1068. }
  1069. doShowAnimation() {
  1070. if (!this.isEject)
  1071. return;
  1072. super.doShowAnimation();
  1073. Laya.Tween.clearTween(this);
  1074. this.scaleX = this.scaleY = 0.8;
  1075. let tweenFunc1 = (func) => {
  1076. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1077. };
  1078. let tweenFunc2 = (func) => {
  1079. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1080. };
  1081. tweenFunc1(tweenFunc2);
  1082. }
  1083. show(...args) {
  1084. super.show();
  1085. this._openParam = args;
  1086. this.isHide = false;
  1087. xGame.uiMgr.checkUIState();
  1088. }
  1089. moveBannerButton() {
  1090. }
  1091. showBannerButton() {
  1092. this.bannerButton.visible = true;
  1093. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1094. this.bannerButton.touchable = true;
  1095. }));
  1096. }
  1097. hide() {
  1098. super.hide();
  1099. this.isHide = true;
  1100. xGame.uiMgr.checkUIState();
  1101. }
  1102. Dispose() {
  1103. super.dispose();
  1104. }
  1105. myUpdate(delay) {
  1106. }
  1107. refresh() { }
  1108. setGlobalFont(root) {
  1109. try {
  1110. console.log('zh: setGlobalFont start');
  1111. let fontName = "arial";
  1112. const setFont = (obj) => {
  1113. if (obj instanceof fairygui.GTextField) {
  1114. obj.font = fontName;
  1115. }
  1116. if (obj instanceof fairygui.GComponent) {
  1117. for (let i = 0; i < obj.numChildren; i++) {
  1118. setFont(obj.getChildAt(i));
  1119. }
  1120. }
  1121. };
  1122. const rootNode = root || this.contentPane;
  1123. if (rootNode) {
  1124. setFont(rootNode);
  1125. }
  1126. }
  1127. catch (error) {
  1128. console.log('zh: setGlobalFont error=' + error);
  1129. }
  1130. finally {
  1131. console.log('zh: setGlobalFont end');
  1132. }
  1133. }
  1134. addUIClick(obj, func, arr = null) {
  1135. obj.onClick(this, func, arr);
  1136. obj.onClick(this, this.playBtnSound);
  1137. }
  1138. offUIClick(obj, func) {
  1139. obj.offClick(this, func);
  1140. }
  1141. playBtnSound() {
  1142. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1143. }
  1144. }
  1145. UIBase.lastShowBanner = 0;
  1146. UIBase.showBannerNum = 0;
  1147. UIBase.uiName = "";
  1148. class ui_UIDraw extends fgui.GComponent {
  1149. static createInstance() {
  1150. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1151. }
  1152. onConstruct() {
  1153. this.n_bj = (this.getChild("n_bj"));
  1154. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1155. this.myNode = (this.getChild("myNode"));
  1156. this.extraNode = (this.getChild("extraNode"));
  1157. this.closeNode = (this.getChild("closeNode"));
  1158. this.moneyNode = (this.getChild("moneyNode"));
  1159. this.n38 = (this.getChild("n38"));
  1160. this.talkNode = (this.getChild("talkNode"));
  1161. this.secretary = (this.getChild("secretary"));
  1162. this.drawBtn = (this.getChild("drawBtn"));
  1163. this.t0 = this.getTransition("t0");
  1164. }
  1165. }
  1166. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1167. class ui_UIBox extends fgui.GComponent {
  1168. static createInstance() {
  1169. return (fgui.UIPackage.createObject("game", "UIBox"));
  1170. }
  1171. onConstruct() {
  1172. this.n0 = (this.getChild("n0"));
  1173. this.n12 = (this.getChild("n12"));
  1174. this.n1 = (this.getChild("n1"));
  1175. this.n2 = (this.getChild("n2"));
  1176. this.bar = (this.getChild("bar"));
  1177. this.closeBtn = (this.getChild("closeBtn"));
  1178. this.openBtn = (this.getChild("openBtn"));
  1179. this.t0 = this.getTransition("t0");
  1180. this.t1 = this.getTransition("t1");
  1181. }
  1182. }
  1183. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1184. class LocalStorageManager {
  1185. test1() {
  1186. LocalStorageManager.setItem("playerName", "Tom");
  1187. LocalStorageManager.setItem("playerLevel", 5);
  1188. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1189. const name = LocalStorageManager.getItem("playerName");
  1190. const level = LocalStorageManager.getItem("playerLevel");
  1191. const data = LocalStorageManager.getItem("playerData");
  1192. console.log(name);
  1193. console.log(level);
  1194. console.log(data);
  1195. LocalStorageManager.removeItem("playerLevel");
  1196. }
  1197. static setItem(key, value) {
  1198. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1199. }
  1200. static getItem(key) {
  1201. const data = Laya.LocalStorage.getItem(key);
  1202. if (data === null)
  1203. return null;
  1204. try {
  1205. return JSON.parse(data);
  1206. }
  1207. catch (e) {
  1208. return data;
  1209. }
  1210. }
  1211. static removeItem(key) {
  1212. Laya.LocalStorage.removeItem(key);
  1213. }
  1214. static clear() {
  1215. Laya.LocalStorage.clear();
  1216. }
  1217. static hasJosnKey(key) {
  1218. var value = Laya.LocalStorage.getJSON(key);
  1219. if (value != null) {
  1220. return true;
  1221. }
  1222. else {
  1223. return false;
  1224. }
  1225. }
  1226. static hasKey(key) {
  1227. return Laya.LocalStorage.getItem(key) !== null;
  1228. }
  1229. }
  1230. class GlobalManager {
  1231. constructor() {
  1232. }
  1233. registerMethod(name, method) {
  1234. console.log('zh: 注册全局方法', name);
  1235. this[name] = method;
  1236. }
  1237. callMethod(name, ...args) {
  1238. console.log('zh: 调用全局方法', name);
  1239. if (this[name]) {
  1240. return this[name](...args);
  1241. }
  1242. else {
  1243. console.error(`zh: 全局方法 Method ${name} not found`);
  1244. }
  1245. }
  1246. }
  1247. GlobalManager.instance = new GlobalManager();
  1248. class JSBridgeUtils {
  1249. constructor() { }
  1250. static get instance() {
  1251. if (!this._instance) {
  1252. this._instance = new JSBridgeUtils();
  1253. }
  1254. return this._instance;
  1255. }
  1256. initBridge() {
  1257. if (!Laya.Browser.onAndroid) {
  1258. console.log('zh:非android dev');
  1259. return;
  1260. }
  1261. let cfg = window['conchConfig'];
  1262. if (cfg) {
  1263. var os = cfg.getOS();
  1264. if (os == "Conch-android") {
  1265. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1266. if (this.bridge) {
  1267. return true;
  1268. }
  1269. else {
  1270. return false;
  1271. }
  1272. }
  1273. else {
  1274. return false;
  1275. }
  1276. }
  1277. else {
  1278. return false;
  1279. }
  1280. }
  1281. testAd1() {
  1282. if (!Laya.Browser.onAndroid) {
  1283. console.log('zh:非android dev');
  1284. return;
  1285. }
  1286. if (!this.initBridge()) {
  1287. return;
  1288. }
  1289. let rs = this.bridge.call("testString", "hello");
  1290. console.log('zh:testString rs=' + rs);
  1291. }
  1292. testAdCallBack() {
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log("zh:testAdCallBack start");
  1297. const defaultObj = { code: 200, msg: "req update Ui" };
  1298. const reqObj = { code: 300, msg: "hello java ui" };
  1299. this.bridge.callWithBack((rsStr) => {
  1300. const rsObj = JSON.parse(rsStr);
  1301. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1302. }, "testAsyncCallback", JSON.stringify(reqObj));
  1303. }
  1304. showInternAd(mark) {
  1305. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1306. if (boo1) {
  1307. console.log('zh: VIP SPID = 1,免除插页AD');
  1308. return false;
  1309. }
  1310. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1311. if (boo7) {
  1312. console.log('zh: VIP SPID = 7,免除任何AD');
  1313. return false;
  1314. }
  1315. console.log('zh:showInternAd start');
  1316. if (!Laya.Browser.onAndroid) {
  1317. console.log('zh:showInternAd 非android dev');
  1318. return false;
  1319. }
  1320. if (!this.initBridge()) {
  1321. return false;
  1322. }
  1323. let rs = this.bridge.call("showInternAd", mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:showInternAd OK");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:showInternAd FAILL:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. exitAndCloseGame() {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. console.log('zh:开始关闭游戏-');
  1348. this.bridge.call("exitAndCloseGame");
  1349. }
  1350. checkAdForUserOrderForSpid17(spid) {
  1351. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1352. if (userInfo != null) {
  1353. if (!userInfo.buySpids) {
  1354. userInfo.buySpids = { 1: false, 7: false };
  1355. }
  1356. else {
  1357. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1358. }
  1359. let boo = userInfo.buySpids[spid];
  1360. if (!boo) {
  1361. console.log('zh:刷新一下用户的AD权利');
  1362. DataMgr.loadUserSpOrderForAd();
  1363. }
  1364. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1365. return boo;
  1366. }
  1367. return false;
  1368. }
  1369. showRewardAd(mark) {
  1370. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1371. if (boo7) {
  1372. console.log('zh: VIP SPID = 7,免除任何AD');
  1373. return false;
  1374. }
  1375. if (!Laya.Browser.onAndroid) {
  1376. return false;
  1377. }
  1378. if (!this.initBridge()) {
  1379. return false;
  1380. }
  1381. let rs = this.bridge.call("showRewardAd", mark);
  1382. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1383. try {
  1384. const result = JSON.parse(rs);
  1385. if (result.code === 200) {
  1386. console.log("zh:广告显示成功");
  1387. return true;
  1388. }
  1389. else {
  1390. console.warn("zh:广告显示失败:", result.msg);
  1391. return false;
  1392. }
  1393. }
  1394. catch (e) {
  1395. console.error("zh:解析桥接返回值失败:", e);
  1396. return false;
  1397. }
  1398. }
  1399. logEventForAdNoParams(eventName) {
  1400. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1401. if (!Laya.Browser.onAndroid) {
  1402. return;
  1403. }
  1404. if (!this.initBridge()) {
  1405. return;
  1406. }
  1407. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1408. this.bridge.call("logEventForAdNoParams", eventName);
  1409. }
  1410. logEventForAdHaveParams(eventName, jsonStr) {
  1411. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1419. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1420. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1421. }
  1422. logEventForFirebase(eventName, jsonStr) {
  1423. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1424. if (!Laya.Browser.onAndroid) {
  1425. return;
  1426. }
  1427. if (!this.initBridge()) {
  1428. return;
  1429. }
  1430. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1431. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1432. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1433. }
  1434. testNetTip() {
  1435. if (Laya.Browser.onAndroid) {
  1436. let boo = this.getNetworkAvailable();
  1437. this.showToast2("Network error, reward unavailable");
  1438. return;
  1439. }
  1440. }
  1441. getNetworkAvailable() {
  1442. if (!Laya.Browser.onAndroid) {
  1443. return;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. console.log("zh:getNetworkAvailable boo=" + boo);
  1450. return boo;
  1451. }
  1452. showToast2(msg) {
  1453. if (!Laya.Browser.onAndroid) {
  1454. return;
  1455. }
  1456. if (!this.initBridge()) {
  1457. return;
  1458. }
  1459. this.bridge.call("showToast2", msg);
  1460. }
  1461. showConfirmationDialogForExit(title, msg) {
  1462. if (!Laya.Browser.onAndroid) {
  1463. return;
  1464. }
  1465. if (!this.initBridge()) {
  1466. return;
  1467. }
  1468. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1469. }
  1470. loginOutForApp() {
  1471. if (!Laya.Browser.onAndroid) {
  1472. return;
  1473. }
  1474. if (!this.initBridge()) {
  1475. return;
  1476. }
  1477. this.bridge.call("loginOutForApp");
  1478. }
  1479. startGgPay(token, ggSpid, spid) {
  1480. if (!Laya.Browser.onAndroid) {
  1481. return;
  1482. }
  1483. if (!this.initBridge()) {
  1484. return;
  1485. }
  1486. let jsonObj = {
  1487. token: token,
  1488. ggSpid: ggSpid,
  1489. spid: spid,
  1490. spsl: 1
  1491. };
  1492. let reqData = JSON.stringify(jsonObj);
  1493. console.log("zh:startGgPay ts reqData=" + reqData);
  1494. this.bridge.call("startGgPay", reqData);
  1495. }
  1496. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1497. if (!Laya.Browser.onAndroid) {
  1498. return;
  1499. }
  1500. if (!this.initBridge()) {
  1501. return;
  1502. }
  1503. let jsonObj = {
  1504. token: token,
  1505. ggSpid: ggSpid,
  1506. spid: spid,
  1507. spsl: 1
  1508. };
  1509. let reqData = JSON.stringify(jsonObj);
  1510. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1511. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1512. }
  1513. nativeCallJs(msg) {
  1514. console.log("zh:nativeCallJs received data: 1111", msg);
  1515. if (msg === 'Ad1') {
  1516. GlobalManager.instance.callMethod('Ad1');
  1517. console.log("zh: Ad1 奖励发送成功");
  1518. }
  1519. else if (msg === 'Ad2') {
  1520. GlobalManager.instance.callMethod('Ad2');
  1521. console.log("zh: Ad2 奖励发送成功");
  1522. }
  1523. else if (msg === 'Ad3') {
  1524. GlobalManager.instance.callMethod('Ad3');
  1525. console.log("zh: Ad3 奖励发送成功");
  1526. }
  1527. else if (msg === 'Ad4') {
  1528. GlobalManager.instance.callMethod('Ad4');
  1529. console.log("zh: Ad4 奖励发送成功");
  1530. }
  1531. else if (msg === 'Ad5') {
  1532. console.log("zh: Ad5 奖励发送成功");
  1533. GlobalManager.instance.callMethod('Ad5');
  1534. }
  1535. }
  1536. }
  1537. class UIBox extends UIBase {
  1538. constructor() {
  1539. super();
  1540. this.boxNum = 0;
  1541. this.boxMax = 10;
  1542. this.inAd = false;
  1543. this.isClose = false;
  1544. }
  1545. onConstructor() {
  1546. this.ui = ui_UIBox.createInstance();
  1547. this.contentPane = this.ui;
  1548. this.isEject = false;
  1549. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1550. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1551. Laya.timer.loop(1000, this, this.update);
  1552. }
  1553. update() {
  1554. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1555. this.boxNum -= 1;
  1556. this.upBar();
  1557. }
  1558. }
  1559. upBar() {
  1560. if (this.boxNum > this.boxMax)
  1561. this.boxNum = this.boxMax;
  1562. this.ui.bar.value = this.boxNum * 10;
  1563. }
  1564. show() {
  1565. super.show();
  1566. this.isClose = false;
  1567. this.boxNum = 0;
  1568. this.inAd = false;
  1569. this.upBar();
  1570. this.ui.t0.play();
  1571. this.ui.closeBtn.visible = false;
  1572. Laya.timer.once(3000, this, () => {
  1573. this.ui.closeBtn.visible = true;
  1574. this.ui.bar.alpha = 1;
  1575. });
  1576. Laya.timer.once(500, this, () => {
  1577. this.ui.t1.play();
  1578. });
  1579. this.setGlobalFont(this.ui);
  1580. }
  1581. hide() {
  1582. Laya.timer.clearAll(this);
  1583. Moyu.showBannerAd(false);
  1584. super.hide();
  1585. }
  1586. onOpenBox() {
  1587. this.boxNum++;
  1588. if (this.boxNum < this.boxMax) {
  1589. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1590. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1591. }
  1592. }
  1593. else if (this.boxNum == this.boxMax) {
  1594. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1595. this.ui.openBtn.c1.selectedIndex = 13;
  1596. this.inAd = true;
  1597. }
  1598. else
  1599. this.getAward();
  1600. }
  1601. else if (this.inAd) {
  1602. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1603. if (Laya.Browser.onAndroid) {
  1604. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1605. if (!boo) {
  1606. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1607. return;
  1608. }
  1609. }
  1610. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1611. }
  1612. else {
  1613. console.log('zh:AD 失败,直接发放奖励');
  1614. this.qjff_AD_for_UIBOX_onOpenBox();
  1615. }
  1616. }
  1617. this.upBar();
  1618. }
  1619. qjff_AD_for_UIBOX_onOpenBox() {
  1620. this.getAward();
  1621. }
  1622. onCloseBox() {
  1623. if (this.isClose)
  1624. this.hide();
  1625. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1626. this.isClose = true;
  1627. PlatMgr.showBanner(true, 0, 3000);
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. getAward() {
  1633. let str = "";
  1634. if (Math.random() < 0.5) {
  1635. let max = Moyu.isLegal ? 500 : 2500;
  1636. let num = xGame.tools.random(max, 500 + max);
  1637. DataMgr.setCoin(num);
  1638. str = "金币x" + num;
  1639. }
  1640. else {
  1641. let max = Moyu.isLegal ? 10 : 30;
  1642. let num = xGame.tools.random(max, 30 + max);
  1643. DataMgr.setDiamond(num);
  1644. str = "钻石x" + num;
  1645. }
  1646. xGame.showTip("恭喜获得-" + str);
  1647. this.hide();
  1648. }
  1649. }
  1650. UIBox.uiName = "UIBox";
  1651. class ui_UITry extends fgui.GComponent {
  1652. static createInstance() {
  1653. return (fgui.UIPackage.createObject("game", "UITry"));
  1654. }
  1655. onConstruct() {
  1656. this.n11 = (this.getChild("n11"));
  1657. this.myNode = (this.getChild("myNode"));
  1658. this.t0 = this.getTransition("t0");
  1659. }
  1660. }
  1661. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1662. class UITry extends UIBase {
  1663. constructor() {
  1664. super();
  1665. this.closeTime = 0;
  1666. this.closeNum = 0;
  1667. this.skillUrl = xGame.common.skillIconList;
  1668. }
  1669. onConstructor() {
  1670. this.ui = ui_UITry.createInstance();
  1671. this.contentPane = this.ui;
  1672. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1673. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1674. }
  1675. show() {
  1676. super.show();
  1677. this.closeNum = 0;
  1678. this.closeTime = 15;
  1679. this.ui.t0.play();
  1680. PlatMgr.showRateBanner();
  1681. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1682. Laya.timer.loop(1000, this, this.updateTime);
  1683. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1684. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1685. xGame.common.gameMgr.gamePause = true;
  1686. this.setGlobalFont(this.ui);
  1687. }
  1688. updateTime() {
  1689. if (this.closeTime > 1) {
  1690. this.closeTime--;
  1691. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1692. }
  1693. else
  1694. this.hide();
  1695. }
  1696. hide() {
  1697. Laya.timer.clearAll(this);
  1698. Moyu.showBannerAd(false);
  1699. super.hide();
  1700. xGame.common.gameMgr.gamePause = false;
  1701. }
  1702. onTry() {
  1703. console.log('zh:qjff_AD_for_uitry');
  1704. if (Laya.Browser.onAndroid) {
  1705. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1706. if (!boo) {
  1707. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1708. return;
  1709. }
  1710. }
  1711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1712. }
  1713. else {
  1714. console.log('zh:AD 失败,直接发放奖励');
  1715. this.qjff_AD_for_uitry();
  1716. }
  1717. }
  1718. qjff_AD_for_uitry() {
  1719. let select = xGame.common.curPlayerSkillType;
  1720. DataMgr.gameData.trySkill = select;
  1721. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1722. DataMgr.saveGameData();
  1723. DataMgr.setBigSkill(select, 1);
  1724. xGame.showTip("Trial Successful");
  1725. this.hide();
  1726. }
  1727. onCancel() {
  1728. if (this.closeNum > 0) {
  1729. this.closeNum--;
  1730. if (this.closeNum < 2)
  1731. this.hide();
  1732. return;
  1733. }
  1734. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1735. this.onTry();
  1736. }
  1737. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1738. this.closeNum = 3;
  1739. }
  1740. else
  1741. this.hide();
  1742. }
  1743. }
  1744. UITry.uiName = "UITry";
  1745. class PlatMgr {
  1746. static initConfig() {
  1747. this.lastVt = 0;
  1748. if (!Moyu.platConfig)
  1749. return;
  1750. for (let k in Moyu.platConfig) {
  1751. let pd = this[k];
  1752. let pc = Moyu.platConfig[k];
  1753. if (pd != undefined && pc != undefined)
  1754. this[k] = pc;
  1755. }
  1756. Moyu.setBannerPos(0.5, 1);
  1757. }
  1758. static rand100(num) {
  1759. return xGame.tools.random(0, 100) < num;
  1760. }
  1761. static isMisVideo() {
  1762. let dt = Laya.timer.currTimer - this.lastVt;
  1763. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1764. this.lastVt = Laya.timer.currTimer;
  1765. return true;
  1766. }
  1767. else {
  1768. if (this.rand100(this.fullVideoRate)) {
  1769. console.log('zh:插屏 ad start');
  1770. JSBridgeUtils.instance.showInternAd('platMgr');
  1771. }
  1772. return false;
  1773. }
  1774. }
  1775. static showVideo(call, type) {
  1776. Moyu.showVideoAd(() => {
  1777. this.lastVt = Laya.timer.currTimer;
  1778. call && call();
  1779. }, type);
  1780. }
  1781. static showInsert(delay = false) {
  1782. if (this.getRand() < this.insertRate) {
  1783. let dt = delay ? this.insertDelay : 0;
  1784. console.log('zh:插屏 ad start');
  1785. JSBridgeUtils.instance.showInternAd('gameInsert');
  1786. }
  1787. }
  1788. static gameInsert() {
  1789. let t = this.getRand();
  1790. let r = this.gameInsertRate;
  1791. if (t < r) {
  1792. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1793. }
  1794. }
  1795. static showRateBanner() {
  1796. if (this.getRand() < this.bannerRate)
  1797. this.showBanner(true, this.bannerDelay, 3000);
  1798. }
  1799. static showBanner(show, delay = 0, hide = 0) {
  1800. if (2 > 1) {
  1801. console.log('zh:显示showBanner广告 直接返回');
  1802. return;
  1803. }
  1804. if (!show)
  1805. Moyu.showBannerAd(false);
  1806. else {
  1807. Laya.timer.clear(this, this.bannerShow);
  1808. if (delay > 0)
  1809. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1810. else
  1811. this.bannerShow(true);
  1812. if (hide > 0)
  1813. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1814. }
  1815. }
  1816. static bannerShow(show) {
  1817. if (2 > 1) {
  1818. console.log('zh:显示showBanner广告 直接返回');
  1819. return;
  1820. }
  1821. Moyu.showBannerAd(show);
  1822. console.log("showBanner" + show);
  1823. }
  1824. static getRand() {
  1825. return xGame.tools.random(0, 100);
  1826. }
  1827. static openBox() {
  1828. if (this.getRand() < this.boxRate)
  1829. xGame.uiMgr.Show(UIBox);
  1830. }
  1831. static openTry() {
  1832. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1833. return;
  1834. if (this.getRand() < this.tryRate)
  1835. xGame.uiMgr.Show(UITry);
  1836. else if (DataMgr.gameData.gameCount == 1)
  1837. xGame.uiMgr.Show(UITry);
  1838. }
  1839. }
  1840. PlatMgr.forceShare = 0;
  1841. PlatMgr.signAdRate = 0;
  1842. PlatMgr.forceVideoRate = 0;
  1843. PlatMgr.forceVideoGap = 0;
  1844. PlatMgr.fullVideoRate = 0;
  1845. PlatMgr.gameInsertRate = 0;
  1846. PlatMgr.insertGap = 0;
  1847. PlatMgr.insertDelay = 0;
  1848. PlatMgr.insertRate = 0;
  1849. PlatMgr.boxRate = 0;
  1850. PlatMgr.boxVideoRate = 0;
  1851. PlatMgr.boxInsertRate = 0;
  1852. PlatMgr.boxBannerRate = 0;
  1853. PlatMgr.tryRate = 0;
  1854. PlatMgr.tryClose3Rate = 0;
  1855. PlatMgr.tryVideoRate = 0;
  1856. PlatMgr.bannerRate = 0;
  1857. PlatMgr.lastVt = 0;
  1858. class ui_UIAddProp extends fgui.GComponent {
  1859. static createInstance() {
  1860. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1861. }
  1862. onConstruct() {
  1863. this.n11 = (this.getChild("n11"));
  1864. this.myNode = (this.getChild("myNode"));
  1865. this.closeBtn = (this.getChild("closeBtn"));
  1866. this.t0 = this.getTransition("t0");
  1867. }
  1868. }
  1869. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1870. class SpineMgr {
  1871. constructor(name, loadCb = null) {
  1872. this.loaded = false;
  1873. this.spineName = '';
  1874. this.loadedCallback = loadCb;
  1875. this.templet = new Laya.Templet();
  1876. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1877. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1878. if (name === 'mishu') {
  1879. this.templet.loadAni('spine/nvmishu.sk');
  1880. }
  1881. else {
  1882. this.templet.loadAni(`spine/${name}.sk`);
  1883. }
  1884. this.templet.lock = true;
  1885. this.spineName = name;
  1886. }
  1887. onError() {
  1888. console.log("zh:spine加载出错");
  1889. }
  1890. parseComplete() {
  1891. this.loaded = true;
  1892. this.loadedCallback && this.loadedCallback();
  1893. }
  1894. dispose() {
  1895. if (this.templet && !this.templet.destroyed) {
  1896. this.templet.destroy();
  1897. }
  1898. this.templet = null;
  1899. }
  1900. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1901. if (!this.loaded) {
  1902. return;
  1903. }
  1904. let spine;
  1905. if (mySpine) {
  1906. spine = mySpine;
  1907. }
  1908. else {
  1909. spine = this.createSpine(data, parent);
  1910. }
  1911. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1912. if (!isLoop) {
  1913. spine.on(Laya.Event.STOPPED, this, () => {
  1914. spine.offAll(Laya.Event.STOPPED);
  1915. callback && callback(spine);
  1916. });
  1917. }
  1918. return spine;
  1919. }
  1920. createSpine(data, parent, type = 1) {
  1921. let spine;
  1922. spine = this.templet.buildArmature(type);
  1923. spine.showSkinByIndex(0);
  1924. parent.addChild(spine);
  1925. spine.pos(data.x, data.y);
  1926. spine.scale(data.scaleX, data.scaleY, true);
  1927. return spine;
  1928. }
  1929. }
  1930. var AIState;
  1931. (function (AIState) {
  1932. AIState[AIState["none"] = 0] = "none";
  1933. AIState[AIState["idle"] = 1] = "idle";
  1934. AIState[AIState["reset"] = 2] = "reset";
  1935. AIState[AIState["move"] = 3] = "move";
  1936. AIState[AIState["wait"] = 4] = "wait";
  1937. AIState[AIState["select"] = 5] = "select";
  1938. AIState[AIState["turn"] = 6] = "turn";
  1939. AIState[AIState["shoot"] = 7] = "shoot";
  1940. AIState[AIState["leave"] = 8] = "leave";
  1941. })(AIState || (AIState = {}));
  1942. class AIPlayer {
  1943. constructor() {
  1944. this.dtime = 30;
  1945. this.awayTime = 0;
  1946. this.awayNum = 0;
  1947. this.hideTime = 0;
  1948. this.rootMoveTime = 0;
  1949. this.isGuide = false;
  1950. this.state = AIState.none;
  1951. this.waitTime = 0;
  1952. this.forceNum = 0;
  1953. this.forceMax = 0;
  1954. this.ballSize = 33;
  1955. this.selectNum = 0;
  1956. this.destRot = 0;
  1957. this.aiLv = 10;
  1958. this.kickBall = [];
  1959. this.lineBall = [];
  1960. this.scoreBall = [];
  1961. this.holeBall = [];
  1962. this.turnNum = 0;
  1963. this.setNum = 0;
  1964. this.setMax = 0;
  1965. this.setRate = 0;
  1966. this.rectL = 0;
  1967. this.rectR = 0;
  1968. this.rectT = 0;
  1969. this.rectB = 0;
  1970. this.rootPos = { x: 0, y: 0 };
  1971. this.bestForce = 0;
  1972. this.bestAngle = 180;
  1973. this.bestPos = { x: 0, y: 0 };
  1974. this.bestKick = { x: 0, y: 0 };
  1975. this.posList = [];
  1976. this.posIdx = 0;
  1977. this.chatTime = 3000;
  1978. this.tempDir1 = new Laya.Vector2();
  1979. this.tempDir2 = new Laya.Vector2();
  1980. this.tempDir3 = new Laya.Vector2();
  1981. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1982. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1983. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1984. this.gameSrc = xGame.common.gameUI;
  1985. this.hideTime = Laya.timer.currTimer;
  1986. Moyu.setOnTipCall((id) => {
  1987. if (id == 20012)
  1988. this.hideTime = Laya.timer.currTimer;
  1989. else
  1990. (id == 20011);
  1991. {
  1992. let dt = Laya.timer.currTimer - this.hideTime;
  1993. console.log("onshow" + dt);
  1994. if (dt > 30000 && this.state > AIState.none)
  1995. xGame.common.gameMgr.aiGameEnd(false);
  1996. }
  1997. }, this);
  1998. }
  1999. init() {
  2000. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2001. this.awayTime = xGame.tools.random(5000, 10000);
  2002. this.awayNum = 0;
  2003. this.hideTime = Laya.timer.currTimer;
  2004. let rect = xGame.common.d2World.borderRect;
  2005. this.rectL = Math.ceil(rect.x) + 17;
  2006. this.rectT = Math.ceil(rect.y) + 17;
  2007. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2008. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2009. this.wBall = xGame.common.d2World.rootBall;
  2010. this.ballSize = this.wBall.gameObj.width - 1;
  2011. if (this.posList.length < 1) {
  2012. let dp = 40;
  2013. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2014. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2015. let dx = i < this.rectR ? i : this.rectR;
  2016. let dy = j < this.rectB ? j : this.rectB;
  2017. let order = xGame.tools.random(0, 1000);
  2018. this.posList.push({ x: dx, y: dy, order: order });
  2019. }
  2020. }
  2021. this.posList.sort(function (a, b) {
  2022. return a.order - b.order;
  2023. });
  2024. this.setMax = this.posList.length;
  2025. }
  2026. this.state = AIState.idle;
  2027. }
  2028. setAiLevel(num) {
  2029. this.aiLv = num;
  2030. }
  2031. initBall() {
  2032. this.rootPos.x = this.wBall.gameObj.x;
  2033. this.rootPos.y = this.wBall.gameObj.y;
  2034. this.initHoleBall();
  2035. }
  2036. initHoleBall() {
  2037. this.kickBall = [];
  2038. this.lineBall = [];
  2039. this.scoreBall = [];
  2040. this.holeBall = [];
  2041. this.selectNum = 0;
  2042. this.forceNum = 0;
  2043. this.forceMax = 0;
  2044. this.turnNum = 0;
  2045. let list = xGame.common.d2World.ballArr;
  2046. if (list.length < 20 && !this.isGuide) {
  2047. let holes = xGame.common.gameMgr.holePosList;
  2048. for (let i = 0; i < list.length; i++) {
  2049. let obj = list[i];
  2050. if (!obj)
  2051. continue;
  2052. obj.kickPos.x = 0;
  2053. obj.kickPos.y = 0;
  2054. obj.poleAngle = 0;
  2055. obj.hard = 0;
  2056. obj.borderDis = 0;
  2057. obj.kickAngle = 180;
  2058. if (obj.number == 0)
  2059. continue;
  2060. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2061. continue;
  2062. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2063. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2064. continue;
  2065. }
  2066. let b = obj.gameObj;
  2067. let wbp = this.rootPos;
  2068. let bx = wbp.x - b.x;
  2069. let by = wbp.y - b.y;
  2070. obj.borderDis = xGame.tools.random(0, 100);
  2071. this.kickBall.push(obj);
  2072. if (!this.isLine(wbp, obj))
  2073. continue;
  2074. obj.kickAngle = xGame.tools.random(90, 180);
  2075. obj.kickPos.x = b.x;
  2076. obj.kickPos.y = b.y;
  2077. this.lineBall.push(obj);
  2078. let minDis = 999999;
  2079. let hole = false;
  2080. for (let j = 0; j < holes.length; j++) {
  2081. let hp = holes[j];
  2082. if (bx >= 0 && hp.x > b.x + 100)
  2083. continue;
  2084. if (bx <= 0 && hp.x < b.x - 100)
  2085. continue;
  2086. if (by < -10 && hp.y < wbp.y)
  2087. continue;
  2088. if (by > 10 && hp.y > wbp.y)
  2089. continue;
  2090. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2091. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2092. if (dis < minDis) {
  2093. let dx = b.x - this.tempDir1.x * this.ballSize;
  2094. let dy = b.y - this.tempDir1.y * this.ballSize;
  2095. this.tempDir3.x = this.tempDir1.x;
  2096. this.tempDir3.y = this.tempDir1.y;
  2097. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2098. obj.kickPos.x = dx;
  2099. obj.kickPos.y = dy;
  2100. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2101. if (num > 1)
  2102. num = 1;
  2103. obj.kickAngle = Math.acos(num) * 57.3;
  2104. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2105. dis = dis * 2;
  2106. if (Math.abs(hp.x - 600) < 100)
  2107. dis += 50;
  2108. obj.hard = dis + obj.kickAngle * 3;
  2109. hole = true;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. if (hole) {
  2115. this.scoreBall.push(obj);
  2116. this.holeBall.push(obj);
  2117. }
  2118. }
  2119. this.scoreBall.sort(function (a, b) {
  2120. return a.hard - b.hard;
  2121. });
  2122. this.holeBall.sort(function (a, b) {
  2123. return a.kickAngle - b.kickAngle;
  2124. });
  2125. this.kickBall.sort(function (a, b) {
  2126. return a.borderDis - b.borderDis;
  2127. });
  2128. }
  2129. else {
  2130. let max = list.length - 1;
  2131. let i = xGame.tools.random(0, max);
  2132. for (i; i <= max; i++) {
  2133. let idx = i >= max ? i -= max : i;
  2134. let obj = list[idx];
  2135. if (obj && obj.number != 0) {
  2136. obj.kickAngle = xGame.tools.random(90, 180);
  2137. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2138. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2139. this.lineBall.push(obj);
  2140. break;
  2141. }
  2142. }
  2143. }
  2144. }
  2145. selectBall() {
  2146. let ball = null;
  2147. this.destRot = 0;
  2148. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2149. let ai = 110 - this.aiLv * 10;
  2150. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2151. let score = false;
  2152. if (this.scoreBall.length < 1) {
  2153. if (this.lineBall.length < 1) {
  2154. for (let i = 0; i < this.kickBall.length; i++) {
  2155. let list = [];
  2156. let bo = this.kickBall[i];
  2157. let bobj = bo.gameObj;
  2158. let rect = xGame.common.d2World.borderRect;
  2159. let mobj = this.wBall.gameObj;
  2160. let minb = bobj.y - rect.y - 20;
  2161. let minw = mobj.y - rect.y - 50;
  2162. if (minb > 0 && minw > 0) {
  2163. let dlenx = 0;
  2164. let dleny = mobj.y - rect.y;
  2165. let spx = mobj.x;
  2166. let spy = rect.y - dleny;
  2167. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2168. }
  2169. minb = rect.y + rect.height - bobj.y - 20;
  2170. minw = rect.y + rect.height - mobj.y - 50;
  2171. if (minb > 0 && minw > 0) {
  2172. let dlenx = 0;
  2173. let dleny = rect.y + rect.height - mobj.y;
  2174. let spx = mobj.x;
  2175. let spy = rect.y + rect.height + dleny;
  2176. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2177. }
  2178. minb = bobj.x - rect.x - 20;
  2179. minw = mobj.x - rect.x - 50;
  2180. if (minb > 0 && minw > 0) {
  2181. let dlenx = mobj.x - rect.x;
  2182. let dleny = 0;
  2183. let spx = rect.x - dlenx;
  2184. let spy = mobj.y;
  2185. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2186. }
  2187. minb = rect.x + rect.width - bobj.x - 20;
  2188. minw = rect.x + rect.width - mobj.x - 50;
  2189. if (minb > 0 && minw > 0) {
  2190. let dlenx = rect.x + rect.width - mobj.x;
  2191. let dleny = 0;
  2192. let spx = rect.x + rect.width + dlenx;
  2193. let spy = mobj.y;
  2194. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2195. }
  2196. list.sort(function (a, b) {
  2197. return a.order - b.order;
  2198. });
  2199. for (let i = 0; i < list.length; i++) {
  2200. let data = list[i];
  2201. let mx = mobj.x - bobj.x;
  2202. let my = mobj.y - bobj.y;
  2203. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2204. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2205. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2206. if (num > 1)
  2207. num = 1;
  2208. let cos = Math.acos(num);
  2209. if (cos > 1.57)
  2210. cos = 1.57;
  2211. else if (cos < 0.01)
  2212. cos = 0.01;
  2213. let tan = Math.tan(cos);
  2214. let dx = tan * data.dleny;
  2215. let dy = tan * data.dlenx;
  2216. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2217. if (Math.abs(bx - 667) < 40)
  2218. continue;
  2219. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2220. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2221. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2222. this.forceMax = dis * 0.08;
  2223. this.destRot += mis * 0.1;
  2224. this.setKick(bx, by);
  2225. return true;
  2226. }
  2227. }
  2228. }
  2229. }
  2230. else {
  2231. ball = xGame.common.getRandArrEle(this.lineBall);
  2232. }
  2233. }
  2234. else {
  2235. for (let i = 0; i < this.scoreBall.length; i++) {
  2236. if (i < this.scoreBall.length - 1) {
  2237. let rand = 70 + this.aiLv * 10 + i * 10;
  2238. if (xGame.tools.random(0, 100) < rand) {
  2239. ball = this.scoreBall[i];
  2240. break;
  2241. }
  2242. }
  2243. else {
  2244. ball = this.scoreBall[i];
  2245. break;
  2246. }
  2247. }
  2248. score = true;
  2249. this.selectNum++;
  2250. }
  2251. if (!ball)
  2252. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2253. if (this.selectNum >= max) {
  2254. console.log('zh:jian kong bug1');
  2255. if (ball && ball.gameObj) {
  2256. }
  2257. else {
  2258. console.log('zh:jian kong bug2 如果到这里应该能看到一个alert弹框报错');
  2259. }
  2260. let dx = ball.gameObj.x;
  2261. let dy = ball.gameObj.y;
  2262. let kickAngle = 0;
  2263. if (score) {
  2264. dx = ball.kickPos.x;
  2265. dy = ball.kickPos.y;
  2266. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2267. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2268. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2269. if (adot > 1)
  2270. adot = 1;
  2271. kickAngle = Math.acos(adot) * 57.3;
  2272. if (kickAngle > 45) {
  2273. let kdx = ball.kickPos.x - ball.gameObj.x;
  2274. let kdy = ball.kickPos.y - ball.gameObj.y;
  2275. dx = ball.kickPos.x - kdx * mis * 0.3;
  2276. dy = ball.kickPos.y - kdy * mis * 0.3;
  2277. }
  2278. else
  2279. this.destRot += mis;
  2280. }
  2281. else if (ball.poleAngle != 0) {
  2282. this.destRot += ball.poleAngle;
  2283. }
  2284. if (xGame.common.gameMode == 0) {
  2285. let af = kickAngle * 0.08;
  2286. this.forceMax = ball.hard * 0.1 + af * af;
  2287. }
  2288. this.setKick(dx, dy);
  2289. }
  2290. else {
  2291. let rand = this.aiLv * 5 + 40;
  2292. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2293. ball = xGame.common.getRandArrEle(this.scoreBall);
  2294. else
  2295. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2296. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2297. if (xGame.tools.random(0, 100) > rand) {
  2298. this.selectNum = max;
  2299. }
  2300. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2301. this.selectNum++;
  2302. }
  2303. ball.onClick(0, true);
  2304. }
  2305. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2306. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2307. let balls = xGame.common.d2World.ballArr;
  2308. let max = xGame.tools.getDis(hx, hy, bx, by);
  2309. for (let index = 0; index < balls.length; index++) {
  2310. let obj = balls[index];
  2311. if (obj.number == 0)
  2312. continue;
  2313. if (obj.number == bn || obj.number == dn)
  2314. continue;
  2315. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2316. if (dis * dis > max)
  2317. continue;
  2318. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2319. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2320. if (num > 1)
  2321. num = 1;
  2322. if (num < 0)
  2323. continue;
  2324. let gap = Math.sin(Math.acos(num)) * dis;
  2325. if (gap < this.ballSize)
  2326. return true;
  2327. }
  2328. return false;
  2329. }
  2330. isLine(xy, ball) {
  2331. let bx = xy.x;
  2332. let by = xy.y;
  2333. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2334. let dis = ball.getDestDis(xy);
  2335. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2336. let sin = Math.sin(angle);
  2337. let cos = Math.cos(angle);
  2338. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2339. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2340. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2341. let dx = bx + this.tempDir2.x * dis;
  2342. let dy = by + this.tempDir2.y * dis;
  2343. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2344. sin = Math.sin(-angle);
  2345. cos = Math.cos(-angle);
  2346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2348. dx = bx + this.tempDir2.x * dis;
  2349. dy = by + this.tempDir2.y * dis;
  2350. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2351. if (isr && isl)
  2352. return false;
  2353. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2354. }
  2355. return true;
  2356. }
  2357. turnPole() {
  2358. this.turnNum++;
  2359. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2360. let dr = rot - this.destRot;
  2361. let abs = Math.abs(dr) % 360;
  2362. if (abs > 180) {
  2363. if (rot > 180)
  2364. rot -= 360;
  2365. if (this.destRot > 180)
  2366. this.destRot -= 360;
  2367. }
  2368. let max = this.turnNum * 5 + this.aiLv * 5;
  2369. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2370. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2371. let at = xGame.tools.random(1000, 2000);
  2372. if (!this.onAway(3))
  2373. at += xGame.tools.random(10000, 15000);
  2374. this.setState(AIState.shoot, at);
  2375. }
  2376. else {
  2377. let mr = 0;
  2378. if (abs > 3)
  2379. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2380. else if (Math.random() > 0.6)
  2381. mr = xGame.tools.random(1, 10) * 0.1;
  2382. mr = dr > 0 ? -mr : mr;
  2383. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2384. }
  2385. }
  2386. setKick(dx, dy) {
  2387. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2388. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2389. this.tempDir1.x = 0;
  2390. this.tempDir1.y = 1;
  2391. this.tempDir2.y = -this.tempDir2.y;
  2392. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2393. if (num > 1)
  2394. num = 1;
  2395. let rot = Math.acos(num) * 57.3;
  2396. if (this.tempDir2.x < 0)
  2397. rot = 360 - rot;
  2398. this.destRot += rot;
  2399. if (!xGame.common.gameMgr.finishOneShoot) {
  2400. this.forceMax += xGame.tools.random(10, 50);
  2401. this.forceMax -= this.aiLv * 2;
  2402. if (this.forceMax < 20)
  2403. this.forceMax = 20;
  2404. }
  2405. if (this.forceMax > 100)
  2406. this.forceMax = 101;
  2407. else if (this.forceMax < 10)
  2408. this.forceMax += xGame.tools.random(0, 10);
  2409. if (xGame.common.gameMode == 1)
  2410. this.forceMax = xGame.tools.random(80, 100);
  2411. else
  2412. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2413. let max = 2000 - this.aiLv * 100;
  2414. if (Math.random() > 0.8)
  2415. max += xGame.tools.random(100, 2000);
  2416. this.setState(AIState.turn, xGame.tools.random(500, max));
  2417. }
  2418. shoot() {
  2419. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2420. if (Math.random() > 0.8) {
  2421. this.gameSrc.aiForce(1);
  2422. this.setState(AIState.wait);
  2423. }
  2424. }
  2425. else {
  2426. let df = xGame.tools.random(3, 8);
  2427. if (this.forceNum < this.forceMax)
  2428. this.forceNum += df;
  2429. else
  2430. this.forceNum -= df;
  2431. let startY = this.gameSrc.ui.powerNode.y;
  2432. let height = this.gameSrc.ui.powerNode.height;
  2433. let force = startY + height * this.forceNum * 0.01;
  2434. this.gameSrc.aiForce(2, force);
  2435. }
  2436. }
  2437. reset() {
  2438. for (let i = 0; i < 4; i++) {
  2439. this.setRate--;
  2440. this.setNum++;
  2441. let pos = this.posList[this.posIdx];
  2442. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2443. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2444. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2445. this.rootPos.x = 387;
  2446. if (this.rootPos.x < this.rectL)
  2447. this.rootPos.x = this.rectL;
  2448. else if (this.rootPos.x > this.rectR)
  2449. this.rootPos.x = this.rectR;
  2450. if (this.rootPos.y < this.rectT)
  2451. this.rootPos.y = this.rectT;
  2452. else if (this.rootPos.y > this.rectB)
  2453. this.rootPos.y = this.rectB;
  2454. this.posIdx++;
  2455. let max = this.posList.length;
  2456. if (this.posIdx >= max)
  2457. this.posIdx -= max;
  2458. this.initHoleBall();
  2459. let ball = null;
  2460. if (this.scoreBall.length > 0)
  2461. ball = this.scoreBall[0];
  2462. else if (this.lineBall.length > 0)
  2463. ball = xGame.common.getRandArrEle(this.lineBall);
  2464. if (ball && ball.kickAngle < this.bestAngle) {
  2465. this.bestAngle = ball.kickAngle;
  2466. this.bestKick.x = ball.kickPos.x;
  2467. this.bestKick.y = ball.kickPos.y;
  2468. this.bestPos.x = this.rootPos.x;
  2469. this.bestPos.y = this.rootPos.y;
  2470. this.bestForce = ball.hard * 0.08;
  2471. }
  2472. }
  2473. if (this.setNum >= this.setMax)
  2474. this.setMax = 0;
  2475. if (this.setRate < 1) {
  2476. this.setState(AIState.move, 0);
  2477. this.rootMoveTime = Laya.timer.currTimer;
  2478. this.gameSrc.aiRootMove(true);
  2479. }
  2480. }
  2481. delayLine() {
  2482. this.gameSrc.aiRootMove(false);
  2483. }
  2484. move() {
  2485. if (this.bestPos.x < 1)
  2486. this.bestPos = this.rootPos;
  2487. let wObj = this.wBall.gameObj;
  2488. let destx = wObj.x;
  2489. let desty = wObj.y;
  2490. let dx = Math.abs(destx - this.bestPos.x);
  2491. let dy = Math.abs(desty - this.bestPos.y);
  2492. let mx = 3 + dx * 0.03;
  2493. let my = 3 + dy * 0.03;
  2494. if (dx < 4 && dy < 4) {
  2495. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2496. dt = dt < 1000 ? 1000 - dt : 0;
  2497. if (this.setMax > 0) {
  2498. let min = this.setMax * 0.3 + this.aiLv * 5;
  2499. this.setRate = xGame.tools.random(min, this.setMax);
  2500. this.setState(AIState.reset, 0);
  2501. }
  2502. else {
  2503. this.destRot = 0;
  2504. this.forceMax = this.bestForce;
  2505. this.setKick(this.bestKick.x, this.bestKick.y);
  2506. }
  2507. if (dt > 100) {
  2508. Laya.timer.clear(this, this.delayLine);
  2509. Laya.timer.once(dt, this, this.delayLine);
  2510. }
  2511. else
  2512. this.gameSrc.aiRootMove(false);
  2513. }
  2514. else {
  2515. if (dx > 4)
  2516. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2517. if (dy > 4)
  2518. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2519. this.gameSrc.onRootMove({ x: destx, y: desty });
  2520. }
  2521. }
  2522. resetRoot() {
  2523. this.bestAngle = 180;
  2524. this.bestForce = 0;
  2525. this.setMax = this.posList.length;
  2526. this.posIdx = xGame.tools.random(0, this.setMax);
  2527. let min = this.setMax * 0.3 + this.aiLv * 5;
  2528. this.setRate = xGame.tools.random(min, this.setMax);
  2529. let max = 2000 - this.aiLv * 100;
  2530. if (Math.random() > 0.8)
  2531. max += xGame.tools.random(100, 1000);
  2532. if (this.isGuide)
  2533. this.setState(AIState.select, 500);
  2534. else if (this.onAway(2))
  2535. this.setState(AIState.reset, xGame.tools.random(400, max));
  2536. else
  2537. this.setState(AIState.none);
  2538. if (xGame.common.gameMgr.finishOneShoot)
  2539. this.chat();
  2540. }
  2541. runAI() {
  2542. if (this.state > AIState.idle)
  2543. return;
  2544. this.initBall();
  2545. this.onGame(2500);
  2546. if (Math.random() > 0.6)
  2547. this.chat();
  2548. }
  2549. stopRun() {
  2550. this.setState(AIState.idle);
  2551. }
  2552. onGame(base) {
  2553. let max = base - this.aiLv * 100;
  2554. if (Math.random() > 0.8)
  2555. max += xGame.tools.random(100, 1000);
  2556. if (this.onAway(2))
  2557. this.setState(AIState.select, xGame.tools.random(500, max));
  2558. else
  2559. this.setState(AIState.none);
  2560. }
  2561. setState(sta, wt = 0) {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.state = sta;
  2565. this.waitTime = wt;
  2566. }
  2567. onUpdate() {
  2568. if (this.state == AIState.none)
  2569. return;
  2570. this.awayTime -= this.dtime;
  2571. if (this.awayTime < 1) {
  2572. this.awayTime = xGame.tools.random(6000, 10000);
  2573. this.awayNum += (11 - this.aiLv);
  2574. this.onAway(1);
  2575. }
  2576. if (this.waitTime >= 0) {
  2577. this.waitTime -= this.dtime;
  2578. return;
  2579. }
  2580. switch (this.state) {
  2581. case AIState.idle:
  2582. this.chat();
  2583. break;
  2584. case AIState.reset:
  2585. this.reset();
  2586. break;
  2587. case AIState.move:
  2588. this.move();
  2589. break;
  2590. case AIState.leave:
  2591. this.state = AIState.none;
  2592. xGame.common.gameMgr.aiGameEnd(true);
  2593. break;
  2594. case AIState.select:
  2595. this.selectBall();
  2596. break;
  2597. case AIState.turn:
  2598. this.turnPole();
  2599. break;
  2600. case AIState.shoot:
  2601. this.shoot();
  2602. break;
  2603. }
  2604. }
  2605. onAway(type) {
  2606. if (type == 1) {
  2607. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2608. let num = this.awayNum + db * 20;
  2609. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2610. xGame.common.gameMgr.aiLeave();
  2611. this.setState(AIState.leave, 6666);
  2612. }
  2613. }
  2614. else if (type == 2) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 30;
  2617. if (xGame.tools.random(0, 10000) < num)
  2618. return false;
  2619. }
  2620. else if (type == 3) {
  2621. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2622. let num = this.awayNum + db * 10;
  2623. if (xGame.tools.random(0, 4000) < num)
  2624. return false;
  2625. }
  2626. return true;
  2627. }
  2628. chat() {
  2629. if (this.chatTime > 0) {
  2630. this.chatTime -= this.dtime;
  2631. return;
  2632. }
  2633. this.chatTime = xGame.tools.random(2000, 10000);
  2634. let rand = xGame.tools.random(0, 100);
  2635. if (rand < 15)
  2636. this.talk();
  2637. else if (rand < 35)
  2638. this.emotion();
  2639. }
  2640. talk() {
  2641. xGame.common.talkMgr.showAITalk(0);
  2642. }
  2643. emotion() {
  2644. xGame.common.talkMgr.showAIEmotion(0);
  2645. }
  2646. resetAI() {
  2647. this.stopRun();
  2648. this.state = AIState.none;
  2649. }
  2650. }
  2651. class Partical extends Laya.Script3D {
  2652. constructor() {
  2653. super();
  2654. this.duration = 2000;
  2655. }
  2656. ;
  2657. onAwake() {
  2658. this.gameObj = this.owner;
  2659. }
  2660. onEnable() {
  2661. this.openTimer();
  2662. }
  2663. openTimer() {
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. setCallback(obj, callback) {
  2667. this.obj = obj;
  2668. this.callback = callback;
  2669. Laya.timer.clearAll(this);
  2670. Laya.timer.once(this.duration, this, this.disappear);
  2671. }
  2672. disappear() {
  2673. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2674. this.callback && this.callback(this.obj);
  2675. }
  2676. }
  2677. class Ball extends Laya.Script3D {
  2678. constructor() {
  2679. super();
  2680. this.posV3 = new Laya.Vector3();
  2681. this.rotRate = 2.1;
  2682. this.rotSpeed = new Laya.Vector3();
  2683. this.myIndex = 0;
  2684. }
  2685. onAwake() {
  2686. this.gameObj = this.owner;
  2687. this.transform = this.gameObj.transform;
  2688. this.ballNode = this.gameObj.getChildByName("Ball");
  2689. this.shadowNode = this.gameObj.getChildByName("shadow");
  2690. }
  2691. initSelf(index, x, y, owner) {
  2692. this.d2BallSrc = owner;
  2693. this.myIndex = index;
  2694. this.setAlbedoTexture();
  2695. this.setTransPos(x, y);
  2696. this.setScale();
  2697. this.ballNode.transform.localRotationEulerX = 90;
  2698. if (index == 0) {
  2699. }
  2700. }
  2701. setAlbedoTexture(isIce = false) {
  2702. let url;
  2703. if (isIce) {
  2704. url = `res/d3Res/ballTexture/ice.jpg`;
  2705. }
  2706. else {
  2707. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2708. }
  2709. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2710. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2711. }));
  2712. }
  2713. runFireworks(obj, delay, callback) {
  2714. Laya.timer.clearAll(this);
  2715. Laya.timer.once(delay + 1, this, () => {
  2716. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2717. fire.transform.localPositionX = this.transform.localPositionX;
  2718. fire.transform.localPositionY = this.transform.localPositionY;
  2719. fire.transform.localPositionZ = this.transform.localPositionZ;
  2720. let src = fire.getComponent(Partical);
  2721. src.duration = 1000;
  2722. src.setCallback(obj, callback);
  2723. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2724. eft.transform.localPositionX = this.transform.localPositionX;
  2725. eft.transform.localPositionY = this.transform.localPositionY;
  2726. eft.transform.localPositionZ = this.transform.localPositionZ;
  2727. });
  2728. }
  2729. setTransPos(x, y) {
  2730. this.setRotation();
  2731. xGame.common.pos2to3Convert(x, y, this.posV3);
  2732. this.transform.localPositionX = this.posV3.x;
  2733. this.transform.localPositionY = 0;
  2734. this.transform.localPositionZ = this.posV3.z;
  2735. this.transform.localRotationEulerX = 0;
  2736. this.transform.localRotationEulerY = 0;
  2737. this.transform.localRotationEulerZ = 0;
  2738. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2739. this.shadowNode.transform.localPositionY = 0.1;
  2740. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2741. }
  2742. setRotation() {
  2743. if (this.d2BallSrc.canRot) {
  2744. let speed = this.d2BallSrc.rigy.linearVelocity;
  2745. this.rotSpeed.x = speed.x * this.rotRate;
  2746. this.rotSpeed.z = speed.y * this.rotRate;
  2747. this.rotSpeed.y = this.d2BallSrc.rotY;
  2748. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2749. }
  2750. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2751. this.rotSpeed.x = this.rotSpeed.y = 0;
  2752. this.rotSpeed.y = this.d2BallSrc.rotY;
  2753. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2754. }
  2755. }
  2756. setScale() {
  2757. let radius = xGame.common.d2World.rootBall.ui.width;
  2758. let scale = xGame.common.scale2to3Convert(radius);
  2759. this.transform.localScaleX = scale;
  2760. this.transform.localScaleY = scale;
  2761. this.transform.localScaleZ = scale;
  2762. }
  2763. playInHoleEft() {
  2764. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2765. eft.transform.position = this.transform.position;
  2766. }
  2767. playIceEft() {
  2768. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2769. eft.transform.position = this.transform.position;
  2770. }
  2771. get scaleXYZ() {
  2772. return this.transform.localScaleX;
  2773. }
  2774. set scaleXYZ(val) {
  2775. this.transform.localScaleX = val;
  2776. this.transform.localScaleY = val;
  2777. this.transform.localScaleZ = val;
  2778. }
  2779. get posX() {
  2780. return this.transform.localPositionX;
  2781. }
  2782. set posX(val) {
  2783. this.transform.localPositionX = val;
  2784. }
  2785. get posY() {
  2786. return this.transform.localPositionY;
  2787. }
  2788. set posY(val) {
  2789. this.transform.localPositionY = val;
  2790. }
  2791. get posZ() {
  2792. return this.transform.localPositionZ;
  2793. }
  2794. set posZ(val) {
  2795. this.transform.localPositionZ = val;
  2796. }
  2797. destroySelf() {
  2798. this.posV3 = null;
  2799. this.rotSpeed = null;
  2800. this.d2BallSrc = null;
  2801. this.ballNode = null;
  2802. this.gameObj.destroy(true);
  2803. this.transform = null;
  2804. this.destroy();
  2805. }
  2806. }
  2807. class ui_D2Ball extends fgui.GComponent {
  2808. static createInstance() {
  2809. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2810. }
  2811. onConstruct() {
  2812. this.myIcon = (this.getChild("myIcon"));
  2813. this.inner = (this.getChild("inner"));
  2814. this.n8 = (this.getChild("n8"));
  2815. this.n4 = (this.getChild("n4"));
  2816. this.wrongTips = (this.getChild("wrongTips"));
  2817. this.rightTips = (this.getChild("rightTips"));
  2818. this.breathAni = this.getTransition("breathAni");
  2819. }
  2820. }
  2821. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2822. class D2BallSrc extends Laya.Script {
  2823. constructor() {
  2824. super();
  2825. this.number = 0;
  2826. this.startX = 0;
  2827. this.startY = 0;
  2828. this.angleV2 = new Laya.Vector2();
  2829. this.isRootBall = false;
  2830. this.isBlackBall = false;
  2831. this.ballType = "";
  2832. this.canRot = true;
  2833. this.rotY = 0;
  2834. this.poleAngle = 0;
  2835. this.kickPos = { x: 0, y: 0 };
  2836. this.hard = 0;
  2837. this.kickAngle = 0;
  2838. this.borderDis = 0;
  2839. this.speedP10 = 5.6;
  2840. this.lastSpeed = { x: 0, y: 0 };
  2841. this.stillSpeed = 0.12;
  2842. this.ballFunc = "normal";
  2843. this.isRunSkillAni = false;
  2844. this.isInHole = false;
  2845. this.iceOwner = "";
  2846. this.forceRun = false;
  2847. this.myUNID = "";
  2848. this.rectL = 0;
  2849. this.rectR = 0;
  2850. this.rectT = 0;
  2851. this.rectB = 0;
  2852. this.forceVec = new Laya.Vector2();
  2853. this.lastDis = 0;
  2854. this.helpOut = { type: "", x: 0, y: 0 };
  2855. }
  2856. initSelf(number, x, y, d3Ball) {
  2857. if (!this.gameObj)
  2858. this.gameObj = this.owner;
  2859. this.number = number;
  2860. this.startX = x;
  2861. this.startY = y;
  2862. this.d3Ball = d3Ball;
  2863. this.isRootBall = false;
  2864. this.isBlackBall = false;
  2865. this.ballType = "";
  2866. if (number == 0) {
  2867. this.isRootBall = true;
  2868. }
  2869. else if (number == 8) {
  2870. this.isBlackBall = true;
  2871. }
  2872. else {
  2873. if (number <= 7) {
  2874. this.ballType = ballCamp.full;
  2875. }
  2876. else {
  2877. this.ballType = ballCamp.flower;
  2878. }
  2879. }
  2880. this.setInfo();
  2881. this.setD3Ball();
  2882. this.owner["mySrc"] = this;
  2883. this.rigy.linearDamping = 1;
  2884. D2BallSrc._unid++;
  2885. this.myUNID = "d2ball" + D2BallSrc._unid;
  2886. let rect = xGame.common.d2World.borderRect;
  2887. this.rectL = Math.ceil(rect.x) + 20;
  2888. this.rectT = Math.ceil(rect.y) + 20;
  2889. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2890. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2891. }
  2892. setInfo() {
  2893. this.gameObj.x = this.startX;
  2894. this.gameObj.y = this.startY;
  2895. let radius = this.ui.width / 2;
  2896. this.gameObj.width = radius * 2;
  2897. this.gameObj.height = radius * 2;
  2898. if (xGame.common.showDebug) {
  2899. this.ui.myIcon.alpha = 1;
  2900. this.ui.inner.alpha = 1;
  2901. }
  2902. else {
  2903. this.ui.myIcon.alpha = 0;
  2904. this.ui.inner.alpha = 0;
  2905. }
  2906. }
  2907. setD3Ball() {
  2908. this.d3Ball = this.d3Ball;
  2909. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2910. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2911. }
  2912. onUpdate() {
  2913. if (xGame.common.gameMgr.gamePause)
  2914. return;
  2915. if (this.isInHole)
  2916. return;
  2917. if (!xGame.common.d2World.openCheckStill)
  2918. return;
  2919. this.runBall();
  2920. }
  2921. runBall() {
  2922. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2923. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2924. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2925. this.judgeBorder();
  2926. }
  2927. getDestDis(dest) {
  2928. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2929. }
  2930. setmyXY(x, y) {
  2931. this.d3BallSrc.setTransPos(x, y);
  2932. }
  2933. getSpeed() {
  2934. let speed = this.rigy.linearVelocity;
  2935. return speed.x * speed.x + speed.y * speed.y;
  2936. }
  2937. onTriggerEnter(collider) {
  2938. if (!collider || !collider.owner)
  2939. return;
  2940. let coll = "collide";
  2941. let speed = this.getSpeed();
  2942. let sv2 = this.speedP10 * this.speedP10;
  2943. if (collider.label == "ball") {
  2944. if (speed < 9 && this.number != 0)
  2945. coll = "";
  2946. else if (speed < sv2)
  2947. coll = "collide_4";
  2948. else if (speed < sv2 * 6.2)
  2949. coll = "collide_3";
  2950. else if (speed < sv2 * 25)
  2951. coll = "collide_2";
  2952. else if (speed < sv2 * 56)
  2953. coll = "collide_1";
  2954. xGame.soundMgr.playSound(coll);
  2955. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2956. if (collider.owner) {
  2957. let rig = collider.owner.getComponent(D2BallSrc);
  2958. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2959. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2960. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2961. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2962. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2963. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2964. let rx = 0;
  2965. let ry = 0;
  2966. if (this.gameObj.x < this.rectL)
  2967. rx = vx;
  2968. else if (this.gameObj.x > this.rectR)
  2969. rx = -vx;
  2970. else if (this.gameObj.y < this.rectT)
  2971. ry = vy;
  2972. else if (this.gameObj.y > this.rectB)
  2973. ry = -vy;
  2974. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2975. }
  2976. }
  2977. if (this.number != 0) {
  2978. return;
  2979. }
  2980. else {
  2981. if (this.forceRun) {
  2982. console.log("randon force");
  2983. this.applyForce(collider);
  2984. }
  2985. }
  2986. if (xGame.common.d2World.isOnSameLine) {
  2987. xGame.common.d2World.isOnSameLine = false;
  2988. this.rigy.linearVelocity = { x: 0, y: 0 };
  2989. }
  2990. if (xGame.common.gameMgr.firstColliObj == null) {
  2991. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2992. xGame.common.gameMgr.isTouchedBall = true;
  2993. }
  2994. }
  2995. else {
  2996. xGame.common.recoverCameraView();
  2997. let wallStr = "";
  2998. if (speed < 9) { }
  2999. else if (speed < sv2) { }
  3000. else if (speed < sv2 * 6.2)
  3001. wallStr = "wall_30";
  3002. else if (speed < sv2 * 25)
  3003. wallStr = "wall_50";
  3004. else if (speed < sv2 * 56)
  3005. wallStr = "wall_80";
  3006. xGame.soundMgr.playSound(wallStr);
  3007. }
  3008. }
  3009. applyForce(collider) {
  3010. let src = collider.owner.mySrc;
  3011. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3012. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3013. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3014. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3015. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3016. }
  3017. checkWrongBall(playEft = true) {
  3018. if (this.isInHole)
  3019. return;
  3020. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3021. if (this.number != 0 && playEft)
  3022. this.d3BallSrc.playInHoleEft();
  3023. let coll = "inpocket_1";
  3024. let speed = this.getSpeed();
  3025. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3026. if (speed < 9 && this.number != 0)
  3027. coll = "";
  3028. else if (speed < sv2 * 6.2)
  3029. coll = "inpocket_4";
  3030. else if (speed < sv2 * 25)
  3031. coll = "collide_3";
  3032. else if (speed < sv2 * 56)
  3033. coll = "collide_2";
  3034. xGame.soundMgr.playSound(coll);
  3035. this.isInHole = true;
  3036. if (this.number == 0) {
  3037. console.log("白球进了。。");
  3038. this.reset();
  3039. this.rigy.linearVelocity = { x: 0, y: 0 };
  3040. this.hideSelf();
  3041. xGame.common.gameUI.ui.whiteAni.visible = true;
  3042. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3043. xGame.common.gameUI.ui.whiteAni.visible = false;
  3044. }));
  3045. }
  3046. else {
  3047. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3048. xGame.common.d2World.removeOneBall(this);
  3049. this.destroySelf();
  3050. xGame.common.playHappySound(this.number);
  3051. this.runFlyEft();
  3052. }
  3053. }
  3054. runFlyEft() {
  3055. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3056. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3057. }
  3058. }
  3059. hideSelf() {
  3060. if (this.d3Ball)
  3061. this.d3Ball.active = false;
  3062. }
  3063. showSelf() {
  3064. this.isInHole = false;
  3065. if (this.d3Ball && !this.d3Ball.active)
  3066. this.d3Ball.active = true;
  3067. }
  3068. isStill() {
  3069. let speed = this.rigy.linearVelocity;
  3070. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3071. this.rigy.linearVelocity = { x: 0, y: 0 };
  3072. return true;
  3073. }
  3074. return false;
  3075. }
  3076. reset() {
  3077. }
  3078. destroySelf() {
  3079. this.d3BallSrc.destroySelf();
  3080. if (!this.ui.isDisposed) {
  3081. this.ui.removeFromParent();
  3082. this.ui.dispose();
  3083. this.ui = null;
  3084. }
  3085. this.outColli = null;
  3086. this.innerColli = null;
  3087. this.rigy = null;
  3088. this.d3Ball = null;
  3089. this.d3BallSrc = null;
  3090. this.angleV2 = null;
  3091. this.gameObj.destroy(true);
  3092. this.destroy();
  3093. }
  3094. judgeBorder() {
  3095. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3096. return;
  3097. }
  3098. if (this.destroyed)
  3099. return;
  3100. if (xGame.common.gameMode == GameMode.classic)
  3101. return;
  3102. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3103. if (isOver) {
  3104. this.checkWrongBall();
  3105. }
  3106. }
  3107. onClick(e, force = false) {
  3108. if (this.number == 0)
  3109. return;
  3110. if (force) {
  3111. }
  3112. else {
  3113. if (xGame.common.d2World.openCheckStill)
  3114. return;
  3115. if (!xGame.common.gameMgr.selfTurn) {
  3116. return;
  3117. }
  3118. }
  3119. if (!xGame.common.gameMgr.finishOneShoot)
  3120. return;
  3121. let root = xGame.common.d2World.rootBall.gameObj;
  3122. let x = this.gameObj.x - root.x;
  3123. let y = this.gameObj.y - root.y;
  3124. let angle = xGame.common.getfguiRotation(x, y);
  3125. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3126. xGame.common.d2World.getHelpLine();
  3127. xGame.common.clickedBall = true;
  3128. console.log('zh:点击之后=判断引导');
  3129. if (DataMgr.getGuideDefaultModel() === 1) {
  3130. this.checkGuideForLianXi();
  3131. }
  3132. else {
  3133. this.checkGuide();
  3134. }
  3135. }
  3136. checkGuide() {
  3137. let guide = DataMgr.getSkillGuide();
  3138. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3139. xGame.common.guideStep++;
  3140. xGame.common.gameUI.ui.guide1.visible = false;
  3141. xGame.common.gameUI.ui.guide2.visible = true;
  3142. }
  3143. }
  3144. checkGuideForLianXi() {
  3145. let guide_lianxi = DataMgr.getLianXiGuide();
  3146. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 0) {
  3147. xGame.common.guideStepForLianXi = 1;
  3148. xGame.common.gameUI.ui.n_lxms_yd1.visible = true;
  3149. return;
  3150. }
  3151. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 1) {
  3152. xGame.common.guideStepForLianXi = 2;
  3153. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  3154. xGame.common.gameUI.ui.n_lxms_yd2.visible = true;
  3155. }
  3156. else {
  3157. console.log('zh: xGame.common.guideStepForLianXi=' + xGame.common.guideStepForLianXi);
  3158. }
  3159. }
  3160. checkDistance(disX, disY, angle) {
  3161. let diameter = this.gameObj.width - 1;
  3162. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3163. if (!this.lastDis)
  3164. this.lastDis = dis;
  3165. else {
  3166. if (dis > this.lastDis) {
  3167. this.helpOut.type = "remove";
  3168. return this.helpOut;
  3169. }
  3170. }
  3171. if (dis <= Math.pow(diameter, 2)) {
  3172. let del = 0.01;
  3173. let offest = 0;
  3174. let realX = disX - this.gameObj.x;
  3175. let realY = disY - this.gameObj.y;
  3176. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3177. offest += del;
  3178. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3179. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3180. }
  3181. this.helpOut.type = "ok";
  3182. this.helpOut.x = realX + this.gameObj.x;
  3183. this.helpOut.y = realY + this.gameObj.y;
  3184. return this.helpOut;
  3185. }
  3186. else {
  3187. this.helpOut.type = "no";
  3188. return this.helpOut;
  3189. }
  3190. }
  3191. clearBallEft() {
  3192. this.clearBallRightEft();
  3193. this.clearBallWrongEft();
  3194. }
  3195. clearBallRightEft() {
  3196. this.ui.breathAni.stop();
  3197. this.ui.rightTips.visible = false;
  3198. }
  3199. clearBallWrongEft() {
  3200. this.ui.wrongTips.visible = false;
  3201. }
  3202. showWrongEft() {
  3203. if (!xGame.common.gameMgr.selfTurn)
  3204. return;
  3205. this.ui.wrongTips.visible = true;
  3206. }
  3207. showRightEft() {
  3208. if (!xGame.common.gameMgr.selfTurn)
  3209. return;
  3210. this.ui.rightTips.visible = true;
  3211. this.ui.rightTips.scaleX = 1;
  3212. this.ui.rightTips.scaleY = 1;
  3213. this.ui.breathAni.play();
  3214. }
  3215. setBallFunc(type, owner) {
  3216. if (type == "ice") {
  3217. this.ballFunc = type;
  3218. this.d3BallSrc.setAlbedoTexture(true);
  3219. this.rigy.type = "static";
  3220. this.iceOwner = owner;
  3221. }
  3222. else {
  3223. if (owner == this.iceOwner) {
  3224. this.ballFunc = type;
  3225. this.d3BallSrc.setAlbedoTexture(false);
  3226. this.rigy.type = "dynamic";
  3227. }
  3228. }
  3229. }
  3230. }
  3231. D2BallSrc._unid = 0;
  3232. class D2RootBallSrc extends D2BallSrc {
  3233. constructor() {
  3234. super();
  3235. this.maxSpeed = 0;
  3236. this.classicMaxSpeed = 2.2;
  3237. this.bigSkillMaxSpeed = 4;
  3238. this.angle = 0;
  3239. this.allPercent = 0;
  3240. this.linearPercent = 0;
  3241. this.anglePercent = 0;
  3242. this.maxAngleRate = 0.6;
  3243. this.baseRot = 7;
  3244. this.angleMax = 0;
  3245. this.speed = new Laya.Vector2();
  3246. this.rotSpeed = new Laya.Vector2();
  3247. }
  3248. isStill() {
  3249. let speed = this.rigy.linearVelocity;
  3250. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3251. if (this.anglePercent <= 0.1) {
  3252. this.rigy.linearVelocity = { x: 0, y: 0 };
  3253. return true;
  3254. }
  3255. }
  3256. return false;
  3257. }
  3258. reset() {
  3259. this.linearPercent = 0;
  3260. this.anglePercent = 0;
  3261. }
  3262. setSpeed(percent, angle) {
  3263. this.allPercent = percent;
  3264. this.angle = angle;
  3265. this.setAngleSpeed();
  3266. this.setLinearSpeed();
  3267. let hit = "hit";
  3268. if (percent < 25)
  3269. hit = "hit03";
  3270. else if (percent < 50)
  3271. hit = "hit02";
  3272. else if (percent < 75)
  3273. hit = "hit01";
  3274. xGame.soundMgr.playSound(hit);
  3275. }
  3276. setAngleSpeed() {
  3277. let offest = xGame.common.rodOffest;
  3278. let radius = 82;
  3279. let rate = Math.abs(offest.y / radius) * 0.5;
  3280. if (offest.y > 0)
  3281. this.angleMax = -this.baseRot * 2;
  3282. else
  3283. this.angleMax = this.baseRot;
  3284. this.rotY = -offest.x / radius * 100;
  3285. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3286. this.linearPercent = this.allPercent - this.anglePercent;
  3287. }
  3288. setLinearSpeed() {
  3289. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3290. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3291. if (!xGame.common.longHelpLine) {
  3292. let offset = -150 + xGame.common.randomNum(0, 300);
  3293. offset /= 100;
  3294. this.angle += offset;
  3295. }
  3296. }
  3297. }
  3298. let sin = Math.sin(this.angle * Math.PI / 180);
  3299. let cos = Math.cos(this.angle * Math.PI / 180);
  3300. switch (xGame.common.gameMode) {
  3301. case GameMode.classic:
  3302. this.maxSpeed = this.classicMaxSpeed;
  3303. break;
  3304. case GameMode.bigMove:
  3305. this.maxSpeed = this.bigSkillMaxSpeed;
  3306. break;
  3307. case GameMode.placeBall:
  3308. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3309. if (data.type == 1) {
  3310. this.maxSpeed = this.bigSkillMaxSpeed;
  3311. }
  3312. else {
  3313. this.maxSpeed = this.classicMaxSpeed;
  3314. }
  3315. break;
  3316. default:
  3317. break;
  3318. }
  3319. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3320. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3321. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3322. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3323. this.rigy.applyLinearImpulseToCenter(this.speed);
  3324. }
  3325. onUpdate() {
  3326. if (this.anglePercent > 0.1) {
  3327. this.anglePercent *= 0.97;
  3328. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3329. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3330. this.rigy.applyForceToCenter(this.rotSpeed);
  3331. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3332. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3333. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3334. if (num > 0.9)
  3335. this.canRot = true;
  3336. }
  3337. else
  3338. this.canRot = true;
  3339. if (Math.abs(this.rotY) > 0.1)
  3340. this.rotY *= 0.98;
  3341. super.onUpdate();
  3342. }
  3343. destroySelf() {
  3344. super.destroySelf();
  3345. this.speed = null;
  3346. }
  3347. }
  3348. class D2Ball extends Laya.Sprite {
  3349. constructor(isRootBall = false) {
  3350. super();
  3351. this.ui = ui_D2Ball.createInstance();
  3352. this.pivotX = this.ui.width / 2;
  3353. this.pivotY = this.ui.width / 2;
  3354. this.x = 0;
  3355. this.y = 0;
  3356. this.addChild(this.ui.displayObject);
  3357. this.ui.displayObject.x += this.ui.width / 2;
  3358. this.ui.displayObject.y += this.ui.width / 2;
  3359. if (isRootBall) {
  3360. this.d2Src = this.addComponent(D2RootBallSrc);
  3361. }
  3362. else {
  3363. this.d2Src = this.addComponent(D2BallSrc);
  3364. }
  3365. this.d2Src.ui = this.ui;
  3366. this.addCircleCollider();
  3367. this.addInnerCircleCollider();
  3368. this.addRigyBody();
  3369. }
  3370. addCircleCollider() {
  3371. let colli = xGame.common.getCollider("circle");
  3372. colli.radius = this.ui.width / 2;
  3373. this.addComponentIntance(colli);
  3374. this.d2Src.outColli = colli;
  3375. colli.label = "ball";
  3376. }
  3377. addInnerCircleCollider() {
  3378. let colli = xGame.common.getCollider("circle");
  3379. colli.radius = this.ui.inner.width / 2;
  3380. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3381. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3382. this.addComponentIntance(colli);
  3383. this.d2Src.innerColli = colli;
  3384. colli.label = "inner";
  3385. }
  3386. addRigyBody() {
  3387. let rigy = xGame.common.getRigbody();
  3388. rigy.type = "dynamic";
  3389. this.addComponentIntance(rigy);
  3390. this.d2Src.rigy = rigy;
  3391. }
  3392. disposeSelf() {
  3393. if (!this.ui.isDisposed) {
  3394. this.ui.dispose();
  3395. this.ui.removeFromParent();
  3396. this.ui = null;
  3397. }
  3398. }
  3399. }
  3400. class ui_D2Gan extends fgui.GComponent {
  3401. static createInstance() {
  3402. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3403. }
  3404. onConstruct() {
  3405. this.myIcon = (this.getChild("myIcon"));
  3406. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3407. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3408. this.self = (this.getChild("self"));
  3409. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3410. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3411. this.ai = (this.getChild("ai"));
  3412. }
  3413. }
  3414. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3415. class D2Gan {
  3416. constructor() {
  3417. this.offset = 0.15;
  3418. this.cell = 1.5;
  3419. this.onBallCell = 0.4;
  3420. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3421. this.moveNum = 70;
  3422. this.rulerRate = 0.1;
  3423. this.ui = ui_D2Gan.createInstance();
  3424. this.changeSelfRod();
  3425. this.changeAIRod();
  3426. }
  3427. changeSelfRod() {
  3428. let index = DataMgr.getCurBallRod();
  3429. let data = cfgTable.ballrodData[index + 1];
  3430. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3431. this.selfMySpine && this.selfMySpine.dispose();
  3432. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3433. if (data.spine) {
  3434. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3435. this.selfMySpine = new SpineMgr(data.spine, () => {
  3436. let xx = this.ui.selfEftRoot.width / 2;
  3437. let yy = this.ui.selfEftRoot.height / 2;
  3438. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3439. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3440. outSpine.rotation = -90;
  3441. });
  3442. }
  3443. }
  3444. changeAIRod() {
  3445. let length = Object.keys(cfgTable.ballrodData).length;
  3446. let rand = Math.floor(length * Math.random()) + 1;
  3447. let data = cfgTable.ballrodData[rand];
  3448. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3449. this.aiMySpine && this.aiMySpine.dispose();
  3450. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3451. if (data.spine) {
  3452. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3453. this.aiMySpine = new SpineMgr(data.spine, () => {
  3454. let xx = this.ui.aiEftRoot.width / 2;
  3455. let yy = this.ui.aiEftRoot.height / 2;
  3456. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3457. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3458. outSpine.rotation = -90;
  3459. });
  3460. }
  3461. }
  3462. setGanLastInfo() {
  3463. this.lastInfo.rotation = this.ui.rotation;
  3464. this.lastInfo.x = this.ui.x;
  3465. this.lastInfo.y = this.ui.y;
  3466. }
  3467. rotateSelf(flag, isRuler = false) {
  3468. let angle;
  3469. flag = flag * this.offset;
  3470. if (xGame.common.d2World.isHelpLineOnBall) {
  3471. angle = flag * this.onBallCell;
  3472. }
  3473. else {
  3474. angle = flag * this.cell;
  3475. }
  3476. if (isRuler) {
  3477. angle *= this.rulerRate;
  3478. }
  3479. this.ui.rotation += angle;
  3480. xGame.common.d2World.getHelpLine();
  3481. }
  3482. checkDistance() {
  3483. let target = xGame.common.d2World.targetBall;
  3484. let root = xGame.common.d2World.rootBall;
  3485. if (target == null) {
  3486. return 1;
  3487. }
  3488. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3489. if (dis <= 2500) {
  3490. return 5;
  3491. }
  3492. return 1;
  3493. }
  3494. rotDest(rot) {
  3495. this.ui.rotation = rot;
  3496. xGame.common.d2World.getHelpLine();
  3497. }
  3498. storagePower(powerNum) {
  3499. let pos = (powerNum / 100) * this.moveNum;
  3500. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3501. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3502. this.ui.x = this.lastInfo.x + xx;
  3503. this.ui.y = this.lastInfo.y + yy;
  3504. }
  3505. shoot() {
  3506. this.storagePower(0);
  3507. this.ui.visible = false;
  3508. }
  3509. destroySelf() {
  3510. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3511. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3512. this.selfMySpine && this.selfMySpine.dispose();
  3513. this.aiMySpine && this.aiMySpine.dispose();
  3514. this.lastInfo = null;
  3515. if (!this.ui.isDisposed) {
  3516. this.ui.removeFromParent();
  3517. this.ui.dispose();
  3518. }
  3519. }
  3520. }
  3521. class ui_HelpLine extends fgui.GComponent {
  3522. static createInstance() {
  3523. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3524. }
  3525. onConstruct() {
  3526. this.n10 = (this.getChild("n10"));
  3527. this.rect = (this.getChild("rect"));
  3528. this.dir11 = (this.getChild("dir11"));
  3529. this.dir = (this.getChild("dir"));
  3530. this.rootDir = (this.getChild("rootDir"));
  3531. this.dirDot = (this.getChild("dirDot"));
  3532. }
  3533. }
  3534. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3535. class D2HelpLine {
  3536. constructor() {
  3537. this.starX = 0;
  3538. this.starY = 0;
  3539. this.ui = ui_HelpLine.createInstance();
  3540. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3541. this.starX = this.ui.rect.x;
  3542. this.starY = this.ui.rect.y;
  3543. }
  3544. shoot() {
  3545. this.ui.visible = false;
  3546. }
  3547. destroySelf() {
  3548. if (this.ui.isDisposed) {
  3549. this.ui.removeFromParent();
  3550. this.ui.dispose();
  3551. }
  3552. }
  3553. }
  3554. class D2World extends Laya.Script {
  3555. constructor() {
  3556. super();
  3557. this.ballArr = [];
  3558. this.openCheckStill = false;
  3559. this.checkArr = [];
  3560. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3561. this.isHelpLineOnBall = false;
  3562. this.isOnSameLine = false;
  3563. this.reflectAngle = 0;
  3564. this.powerPercent = 0;
  3565. this.inHolesSpeed = [];
  3566. this.outDir = new Laya.Vector2();
  3567. this.rootDir = new Laya.Vector2();
  3568. this.aiLv = 0;
  3569. this.rootPos = new Laya.Vector2();
  3570. this.tempDir1 = new Laya.Vector2();
  3571. this.tempDir2 = new Laya.Vector2();
  3572. this.tempDir3 = new Laya.Vector2();
  3573. this.ballSize = 33;
  3574. this.destRot = 0;
  3575. }
  3576. initSelf() {
  3577. this.createBalls();
  3578. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3579. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3580. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3581. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3582. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3583. }
  3584. setBorderRect() {
  3585. let ui = xGame.common.gameUI.ui;
  3586. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3587. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3588. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3589. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3590. this.borderRect.x = starX;
  3591. this.borderRect.y = starY;
  3592. this.borderRect.width = width;
  3593. this.borderRect.height = height;
  3594. }
  3595. resetGame() {
  3596. this.openCheckStill = false;
  3597. let temp;
  3598. for (let index = 0; index < this.ballArr.length; index++) {
  3599. temp = this.ballArr[index];
  3600. temp.destroySelf();
  3601. }
  3602. xGame.common.d3World.ballRoot.destroyChildren();
  3603. xGame.common.gameUI.ui.ballNode.removeChildren();
  3604. console.log("进入摧毁逻辑");
  3605. this.d2Gan.destroySelf();
  3606. this.d2HelpLine.destroySelf();
  3607. this.ballArr = [];
  3608. }
  3609. setD2Gan() {
  3610. let ballNode = this.rootBall.ui;
  3611. let d2Gan = new D2Gan();
  3612. this.d2Gan = d2Gan;
  3613. let ganNode = d2Gan.ui;
  3614. ballNode.addChild(ganNode);
  3615. ganNode.pivotX = ganNode.pivotX;
  3616. ganNode.pivotY = ganNode.pivotY;
  3617. ganNode.x = ganNode.myIcon.width / 2;
  3618. ganNode.y = this.rootBall.gameObj.width;
  3619. d2Gan.setGanLastInfo();
  3620. }
  3621. setHelpLine() {
  3622. let d2Help = new D2HelpLine();
  3623. this.d2HelpLine = d2Help;
  3624. }
  3625. createBalls() {
  3626. let cfg;
  3627. switch (xGame.common.gameMode) {
  3628. case GameMode.classic:
  3629. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3630. break;
  3631. case GameMode.bigMove:
  3632. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3633. break;
  3634. case GameMode.placeBall:
  3635. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3636. break;
  3637. default:
  3638. break;
  3639. }
  3640. cfg = JSON.parse(JSON.stringify(cfg));
  3641. for (const key in cfg) {
  3642. if (cfg[key].value == 0) {
  3643. this.createRootBall(cfg[key]);
  3644. delete cfg[key];
  3645. break;
  3646. }
  3647. }
  3648. this.createOtherBalls(cfg);
  3649. }
  3650. createRootBall(data) {
  3651. let root = new D2Ball(true);
  3652. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3653. this.rootBall = root.d2Src;
  3654. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3655. let d3BallSrc = d3Ball.getComponent(Ball);
  3656. xGame.common.d3World.rootBall = d3Ball;
  3657. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3658. let xx = data.x;
  3659. let yy = data.y;
  3660. let numer = data.value;
  3661. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3662. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3663. this.ballArr.push(this.rootBall);
  3664. this.setD2Gan();
  3665. this.setHelpLine();
  3666. }
  3667. createOtherBalls(cfg) {
  3668. let temp;
  3669. let src;
  3670. let data;
  3671. for (const key in cfg) {
  3672. data = cfg[key];
  3673. temp = new D2Ball();
  3674. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3675. src = temp.d2Src;
  3676. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3677. src.initSelf(data.value, data.x, data.y, d3Ball);
  3678. this.ballArr.push(src);
  3679. }
  3680. }
  3681. shoot(percent) {
  3682. this.powerPercent = percent;
  3683. this.openCheckStill = true;
  3684. let d2Angle = this.d2Gan.ui.rotation;
  3685. this.rootBall.setSpeed(percent, d2Angle);
  3686. this.clearBallAllEft();
  3687. this.changePlayerView();
  3688. }
  3689. onUpdate() {
  3690. if (!this.openCheckStill)
  3691. return;
  3692. this.checkStill();
  3693. }
  3694. checkStill() {
  3695. for (let index = 0; index < this.ballArr.length; index++) {
  3696. if (!this.ballArr[index].isStill()) {
  3697. return;
  3698. }
  3699. }
  3700. xGame.eventMgr.event(ALL_BALL_STOP);
  3701. }
  3702. allBallStop() {
  3703. this.openCheckStill = false;
  3704. xGame.common.recoverCameraView();
  3705. }
  3706. waitShoot() {
  3707. if (!this.d2Gan.ui.isDisposed) {
  3708. this.d2Gan.ui.visible = true;
  3709. }
  3710. if (!this.d2HelpLine.ui.isDisposed) {
  3711. this.d2HelpLine.ui.visible = true;
  3712. }
  3713. this.clearBallAllEft();
  3714. this.showBallRightEft();
  3715. this.getHelpLine();
  3716. this.inHolesSpeed = [];
  3717. this.selectOneBall();
  3718. }
  3719. _getAllBallArr() {
  3720. let arr = this.ballArr;
  3721. let outArr = [];
  3722. for (let index = 0; index < arr.length; index++) {
  3723. if (arr[index] instanceof D2RootBallSrc)
  3724. continue;
  3725. if (arr[index].ballFunc == "ice")
  3726. continue;
  3727. if (arr[index].destroyed)
  3728. continue;
  3729. outArr.push(arr[index]);
  3730. }
  3731. return outArr;
  3732. }
  3733. _getBlackObj() {
  3734. let arr = this.ballArr;
  3735. for (let index = 0; index < arr.length; index++) {
  3736. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3737. return arr[index];
  3738. }
  3739. }
  3740. }
  3741. selectOneBall() {
  3742. let all = this._getAllBallArr();
  3743. let target;
  3744. switch (xGame.common.gameMode) {
  3745. case GameMode.classic:
  3746. if (xGame.common.gameMgr.selfTurn) {
  3747. let self = xGame.common.gameMgr.selfBallArr;
  3748. let black = this._getBlackObj();
  3749. if (xGame.common.gameMgr.ensureBallType) {
  3750. if (self.length > 0) {
  3751. let out = [];
  3752. for (let j = 0; j < all.length; j++) {
  3753. if (self.indexOf(all[j].number) > -1) {
  3754. out.push(all[j]);
  3755. }
  3756. }
  3757. target = this.selectBestEnterOne(out);
  3758. }
  3759. else {
  3760. target = this.selectBestEnterOne([black]);
  3761. }
  3762. }
  3763. else {
  3764. target = this.selectBestEnterOne(all);
  3765. }
  3766. }
  3767. else {
  3768. target = this.selectBestEnterOne(all);
  3769. }
  3770. break;
  3771. case GameMode.bigMove:
  3772. target = this.selectBestEnterOne(all);
  3773. break;
  3774. case GameMode.placeBall:
  3775. if (all.length > 0) {
  3776. target = this.selectBestEnterOne(all);
  3777. }
  3778. break;
  3779. default:
  3780. break;
  3781. }
  3782. if (target && !target.destroyed && target.onClick) {
  3783. target.onClick(0, true);
  3784. let num = -200 + xGame.common.randomNum(0, 400);
  3785. num /= 150;
  3786. if (xGame.common.longHelpLine) {
  3787. num = 0;
  3788. }
  3789. this.destRot += num;
  3790. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3791. }
  3792. }
  3793. removeOneBall(ball) {
  3794. for (let index = 0; index < this.ballArr.length; index++) {
  3795. if (this.ballArr[index].id == ball.id) {
  3796. this.ballArr.splice(index, 1);
  3797. break;
  3798. }
  3799. }
  3800. }
  3801. getHelpLine() {
  3802. this.d2HelpLine.ui.dirDot.visible = false;
  3803. this.isOnSameLine = false;
  3804. let startX = this.rootBall.gameObj.x;
  3805. let startY = this.rootBall.gameObj.y;
  3806. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3807. if (dis == null) {
  3808. this.d2HelpLine.ui.visible = false;
  3809. console.error("辅助线异常");
  3810. return;
  3811. }
  3812. this.d2HelpLine.ui.visible = true;
  3813. let angle = this.d2Gan.ui.rotation;
  3814. let radius = 16.5;
  3815. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3816. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3817. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3818. if (colliObj == null) {
  3819. this.getColliPos(disX, disY, radius, angle);
  3820. xGame.common.d2World.isHelpLineOnBall = false;
  3821. this.targetBall = null;
  3822. this.reflectAngle = 0;
  3823. this.showBallWrongEft();
  3824. }
  3825. else {
  3826. let target = colliObj.src;
  3827. let radius = 16.5;
  3828. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3829. dis1 = Math.sqrt(dis1);
  3830. let realDis = colliObj.disHon - dis1;
  3831. let dir = colliObj.dir;
  3832. let xx = startX + dir.x * realDis;
  3833. let yy = startY + dir.y * realDis;
  3834. this.getColliPos(xx, yy, radius, angle);
  3835. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3836. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3837. let offset = xGame.common.rodOffest;
  3838. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3839. this.isOnSameLine = true;
  3840. }
  3841. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3842. xGame.common.d2World.isHelpLineOnBall = true;
  3843. this.targetBall = target;
  3844. this.reflectAngle = reflectAngle;
  3845. this.showBallWrongEft();
  3846. if (xGame.common.longHelpLine) {
  3847. this.delayReflectLine(target, reflectAngle);
  3848. }
  3849. }
  3850. }
  3851. getBorderDot(startX, startY, angle) {
  3852. let radius = 17;
  3853. let distance;
  3854. let isDone;
  3855. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3856. isDone = this.judgeUpDown(distance, angle, startX);
  3857. if (isDone != null) {
  3858. return isDone;
  3859. }
  3860. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3861. isDone = this.judgeUpDown(distance, angle, startX);
  3862. if (isDone != null) {
  3863. return isDone;
  3864. }
  3865. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3866. isDone = this.judgeLeftRight(distance, angle, startY);
  3867. if (isDone != null) {
  3868. return isDone;
  3869. }
  3870. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3871. isDone = this.judgeLeftRight(distance, angle, startY);
  3872. if (isDone != null) {
  3873. return isDone;
  3874. }
  3875. }
  3876. judgeUpDown(distance, angle, startX) {
  3877. let flag = Math.sin(angle * Math.PI / 180);
  3878. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3879. if (distance >= 0) {
  3880. if (flag > 0) {
  3881. if (temp < this.borderRect.x + this.borderRect.width) {
  3882. return distance;
  3883. }
  3884. }
  3885. else {
  3886. if (temp > this.borderRect.x) {
  3887. return distance;
  3888. }
  3889. }
  3890. }
  3891. }
  3892. judgeLeftRight(distance, angle, starY) {
  3893. let flag = -Math.cos(angle * Math.PI / 180);
  3894. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3895. if (distance >= 0) {
  3896. if (flag > 0) {
  3897. if (temp < this.borderRect.y + this.borderRect.height) {
  3898. return distance;
  3899. }
  3900. }
  3901. else {
  3902. if (temp > this.borderRect.y) {
  3903. return distance;
  3904. }
  3905. }
  3906. }
  3907. }
  3908. clearBallAllEft() {
  3909. let temp;
  3910. for (let index = 0; index < this.ballArr.length; index++) {
  3911. temp = this.ballArr[index];
  3912. temp.clearBallEft();
  3913. }
  3914. }
  3915. showBallRightEft() {
  3916. let gameMgr = xGame.common.gameMgr;
  3917. let temp;
  3918. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3919. if (targetArr.length <= 0)
  3920. return;
  3921. for (let index = 0; index < this.ballArr.length; index++) {
  3922. temp = this.ballArr[index];
  3923. if (targetArr.indexOf(temp.number) > -1) {
  3924. temp.showRightEft();
  3925. }
  3926. }
  3927. }
  3928. showBallWrongEft() {
  3929. let gameMgr = xGame.common.gameMgr;
  3930. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3931. if (targetArr.length <= 0)
  3932. return;
  3933. let temp;
  3934. for (let index = 0; index < this.ballArr.length; index++) {
  3935. temp = this.ballArr[index];
  3936. if (this.targetBall && this.targetBall.number == temp.number) {
  3937. if (targetArr.indexOf(temp.number) <= -1) {
  3938. temp.showWrongEft();
  3939. }
  3940. else {
  3941. temp.clearBallWrongEft();
  3942. }
  3943. }
  3944. else {
  3945. temp.clearBallWrongEft();
  3946. }
  3947. }
  3948. }
  3949. getColliPos(x, y, radius, angle) {
  3950. this.d2HelpLine.ui.x = x;
  3951. this.d2HelpLine.ui.y = y;
  3952. let dirX = x - this.rootBall.gameObj.x;
  3953. let dirY = y - this.rootBall.gameObj.y;
  3954. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3955. if (rectH <= 0)
  3956. rectH = 0;
  3957. this.d2HelpLine.ui.rect.height = 0;
  3958. this.d2HelpLine.ui.rect.height = rectH;
  3959. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3960. if (rectH < this.rootBall.gameObj.width) {
  3961. this.d2HelpLine.ui.rect.visible = false;
  3962. }
  3963. else {
  3964. this.d2HelpLine.ui.rect.visible = true;
  3965. }
  3966. this.d2HelpLine.ui.dir.visible = false;
  3967. this.d2HelpLine.ui.rootDir.visible = false;
  3968. }
  3969. getReflectLine(x, y, radius, target) {
  3970. this.d2HelpLine.ui.dir.visible = true;
  3971. let dirX = target.x - x;
  3972. let dirY = target.y - y;
  3973. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3974. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3975. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3976. this.d2HelpLine.ui.dir.height = 48;
  3977. this.d2HelpLine.ui.dir.rotation = angle;
  3978. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3979. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3980. return angle;
  3981. }
  3982. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3983. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3984. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3985. let targetX = target.gameObj.x;
  3986. let targetY = target.gameObj.y;
  3987. this.outDir.setValue(targetX - xx, targetY - yy);
  3988. this.rootDir.setValue(rtX - xx, rtY - yy);
  3989. let ver = Math.PI / 2;
  3990. let sin = Math.sin(ver);
  3991. let cos = Math.cos(ver);
  3992. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3993. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3994. this.outDir.setValue(outX, outY);
  3995. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3996. Laya.Vector2.normalize(this.outDir, this.outDir);
  3997. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3998. if (Math.abs(result) <= 0.08) {
  3999. this.d2HelpLine.ui.rootDir.visible = false;
  4000. return;
  4001. }
  4002. if (result > 0) {
  4003. angle += 90;
  4004. }
  4005. else if (result < 0) {
  4006. angle -= 90;
  4007. }
  4008. this.d2HelpLine.ui.rootDir.visible = true;
  4009. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  4010. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  4011. this.d2HelpLine.ui.rootDir.rotation = angle;
  4012. }
  4013. delayReflectLine(obj, angle) {
  4014. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  4015. return;
  4016. }
  4017. this.isOnSameLine = false;
  4018. let startX = obj.gameObj.x;
  4019. let startY = obj.gameObj.y;
  4020. let dis = this.getBorderDot(startX, startY, angle);
  4021. if (dis == null) {
  4022. this.d2HelpLine.ui.dirDot.visible = false;
  4023. return;
  4024. }
  4025. this.d2HelpLine.ui.visible = true;
  4026. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4027. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4028. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4029. if (colliObj == null) {
  4030. this.setDelayLine(disX, disY, obj, angle);
  4031. }
  4032. else {
  4033. let radius = 16;
  4034. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4035. dis1 = Math.sqrt(dis1);
  4036. let realDis = colliObj.disHon - dis1;
  4037. let dir = colliObj.dir;
  4038. let xx = startX + dir.x * realDis;
  4039. let yy = startY + dir.y * realDis;
  4040. this.setDelayLine(xx, yy, obj, angle);
  4041. }
  4042. }
  4043. setDelayLine(x, y, obj, angle) {
  4044. let dirX = x - obj.gameObj.x;
  4045. let dirY = y - obj.gameObj.y;
  4046. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4047. if (rectH <= 0)
  4048. rectH = 0;
  4049. this.d2HelpLine.ui.dir.height = rectH;
  4050. this.d2HelpLine.ui.dirDot.visible = true;
  4051. this.d2HelpLine.ui.dirDot.x = 17;
  4052. this.d2HelpLine.ui.dirDot.y = 17;
  4053. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4054. ;
  4055. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4056. }
  4057. changePlayerView() {
  4058. if (Math.random() >= 0.7)
  4059. return;
  4060. if (!this.targetBall) {
  4061. return;
  4062. }
  4063. if (!xGame.common.gameMgr.selfTurn)
  4064. return;
  4065. switch (xGame.common.gameMode) {
  4066. case GameMode.classic:
  4067. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4068. if (this.targetBall.number != 8) {
  4069. return;
  4070. }
  4071. }
  4072. break;
  4073. case GameMode.bigMove:
  4074. return;
  4075. case GameMode.placeBall:
  4076. break;
  4077. default:
  4078. break;
  4079. }
  4080. let startX = this.targetBall.gameObj.x;
  4081. let startY = this.targetBall.gameObj.y;
  4082. let angle = this.reflectAngle;
  4083. let dis = this.getBorderDot(startX, startY, angle);
  4084. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4085. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4086. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4087. if (colliObj) {
  4088. return;
  4089. }
  4090. let offset = 40;
  4091. let posObj = xGame.common.gameMgr.posObj;
  4092. let temp;
  4093. let radius;
  4094. let tarX, tarY;
  4095. for (const key in posObj) {
  4096. temp = posObj[key];
  4097. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4098. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4099. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4100. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4101. xGame.common.showOneCamera("angle" + key);
  4102. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4103. Laya.physicsTimer.scale = 0.7;
  4104. break;
  4105. }
  4106. }
  4107. }
  4108. selectBestEnterOne(arr) {
  4109. this.aiLv = xGame.tools.random(1, 11);
  4110. this.aiLv = 10;
  4111. this.wBall = xGame.common.d2World.rootBall;
  4112. this.rootPos.x = this.wBall.gameObj.x;
  4113. this.rootPos.y = this.wBall.gameObj.y;
  4114. this.initHoleBall(arr);
  4115. return this.selectBall();
  4116. }
  4117. selectBall() {
  4118. let ball = null;
  4119. this.destRot = 0;
  4120. let ai = 110 - this.aiLv * 10;
  4121. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4122. let score = false;
  4123. if (this.scoreBall.length < 1) {
  4124. if (this.lineBall.length < 1) {
  4125. for (let i = 0; i < this.kickBall.length; i++) {
  4126. let list = [];
  4127. let bo = this.kickBall[i];
  4128. let bobj = bo.gameObj;
  4129. let rect = xGame.common.d2World.borderRect;
  4130. let mobj = this.wBall.gameObj;
  4131. let minb = bobj.y - rect.y - 20;
  4132. let minw = mobj.y - rect.y - 50;
  4133. if (minb > 0 && minw > 0) {
  4134. let dlenx = 0;
  4135. let dleny = mobj.y - rect.y;
  4136. let spx = mobj.x;
  4137. let spy = rect.y - dleny;
  4138. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4139. }
  4140. minb = rect.y + rect.height - bobj.y - 20;
  4141. minw = rect.y + rect.height - mobj.y - 50;
  4142. if (minb > 0 && minw > 0) {
  4143. let dlenx = 0;
  4144. let dleny = rect.y + rect.height - mobj.y;
  4145. let spx = mobj.x;
  4146. let spy = rect.y + rect.height + dleny;
  4147. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4148. }
  4149. minb = bobj.x - rect.x - 20;
  4150. minw = mobj.x - rect.x - 50;
  4151. if (minb > 0 && minw > 0) {
  4152. let dlenx = mobj.x - rect.x;
  4153. let dleny = 0;
  4154. let spx = rect.x - dlenx;
  4155. let spy = mobj.y;
  4156. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4157. }
  4158. minb = rect.x + rect.width - bobj.x - 20;
  4159. minw = rect.x + rect.width - mobj.x - 50;
  4160. if (minb > 0 && minw > 0) {
  4161. let dlenx = rect.x + rect.width - mobj.x;
  4162. let dleny = 0;
  4163. let spx = rect.x + rect.width + dlenx;
  4164. let spy = mobj.y;
  4165. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4166. }
  4167. list.sort(function (a, b) {
  4168. return a.order - b.order;
  4169. });
  4170. for (let i = 0; i < list.length; i++) {
  4171. let data = list[i];
  4172. let mx = mobj.x - bobj.x;
  4173. let my = mobj.y - bobj.y;
  4174. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4175. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4176. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4177. if (num > 1)
  4178. num = 1;
  4179. let cos = Math.acos(num);
  4180. if (cos > 1.57)
  4181. cos = 1.57;
  4182. else if (cos < 0.01)
  4183. cos = 0.01;
  4184. let tan = Math.tan(cos);
  4185. let dx = tan * data.dleny;
  4186. let dy = tan * data.dlenx;
  4187. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4188. if (Math.abs(bx - 667) < 40)
  4189. continue;
  4190. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4191. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4192. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4193. this.forceMax = dis * 0.08;
  4194. this.destRot += mis * 0.1;
  4195. this.setKick(bx, by);
  4196. return true;
  4197. }
  4198. }
  4199. }
  4200. }
  4201. else {
  4202. ball = xGame.common.getRandArrEle(this.lineBall);
  4203. }
  4204. }
  4205. else {
  4206. for (let i = 0; i < this.scoreBall.length; i++) {
  4207. if (i < this.scoreBall.length - 1) {
  4208. let rand = 70 + this.aiLv * 10 + i * 10;
  4209. if (xGame.tools.random(0, 100) < rand) {
  4210. ball = this.scoreBall[i];
  4211. break;
  4212. }
  4213. }
  4214. else {
  4215. ball = this.scoreBall[i];
  4216. break;
  4217. }
  4218. }
  4219. score = true;
  4220. this.selectNum++;
  4221. }
  4222. if (!ball)
  4223. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4224. let dx = ball.gameObj.x;
  4225. let dy = ball.gameObj.y;
  4226. let kickAngle = 0;
  4227. if (score) {
  4228. dx = ball.kickPos.x;
  4229. dy = ball.kickPos.y;
  4230. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4231. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4232. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4233. if (adot > 1)
  4234. adot = 1;
  4235. kickAngle = Math.acos(adot) * 57.3;
  4236. if (kickAngle > 45) {
  4237. let kdx = ball.kickPos.x - ball.gameObj.x;
  4238. let kdy = ball.kickPos.y - ball.gameObj.y;
  4239. dx = ball.kickPos.x - kdx * mis * 0.3;
  4240. dy = ball.kickPos.y - kdy * mis * 0.3;
  4241. }
  4242. else
  4243. this.destRot += mis;
  4244. }
  4245. else if (ball.poleAngle != 0) {
  4246. this.destRot += ball.poleAngle;
  4247. }
  4248. if (xGame.common.gameMode == 0) {
  4249. let af = kickAngle * 0.08;
  4250. this.forceMax = ball.hard * 0.1 + af * af;
  4251. }
  4252. this.setKick(dx, dy);
  4253. return ball;
  4254. }
  4255. initHoleBall(arr) {
  4256. this.kickBall = [];
  4257. this.lineBall = [];
  4258. this.scoreBall = [];
  4259. this.holeBall = [];
  4260. this.selectNum = 0;
  4261. this.forceNum = 0;
  4262. this.forceMax = 0;
  4263. this.turnNum = 0;
  4264. let list = arr;
  4265. let holes = xGame.common.gameMgr.holePosList;
  4266. let self = xGame.common.aiPlayer;
  4267. for (let i = 0; i < list.length; i++) {
  4268. let obj = list[i];
  4269. if (!obj)
  4270. continue;
  4271. obj.kickPos.x = 0;
  4272. obj.kickPos.y = 0;
  4273. obj.poleAngle = 0;
  4274. obj.hard = 0;
  4275. obj.borderDis = 0;
  4276. obj.kickAngle = 180;
  4277. let b = obj.gameObj;
  4278. let wbp = this.rootPos;
  4279. let bx = wbp.x - b.x;
  4280. let by = wbp.y - b.y;
  4281. obj.borderDis = xGame.tools.random(0, 100);
  4282. this.kickBall.push(obj);
  4283. if (!this.isLine(wbp, obj))
  4284. continue;
  4285. obj.kickAngle = xGame.tools.random(90, 180);
  4286. obj.kickPos.x = b.x;
  4287. obj.kickPos.y = b.y;
  4288. this.lineBall.push(obj);
  4289. let minDis = 999999;
  4290. let hole = false;
  4291. for (let j = 0; j < holes.length; j++) {
  4292. let hp = holes[j];
  4293. if (bx >= 0 && hp.x > b.x + 100)
  4294. continue;
  4295. if (bx <= 0 && hp.x < b.x - 100)
  4296. continue;
  4297. if (by < -10 && hp.y < wbp.y)
  4298. continue;
  4299. if (by > 10 && hp.y > wbp.y)
  4300. continue;
  4301. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4302. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4303. if (dis < minDis) {
  4304. let dx = b.x - this.tempDir1.x * this.ballSize;
  4305. let dy = b.y - this.tempDir1.y * this.ballSize;
  4306. this.tempDir3.x = this.tempDir1.x;
  4307. this.tempDir3.y = this.tempDir1.y;
  4308. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4309. obj.kickPos.x = dx;
  4310. obj.kickPos.y = dy;
  4311. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4312. if (num > 1)
  4313. num = 1;
  4314. obj.kickAngle = Math.acos(num) * 57.3;
  4315. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4316. dis = dis * 2;
  4317. if (Math.abs(hp.x - 600) < 100)
  4318. dis += 50;
  4319. obj.hard = dis + obj.kickAngle * 3;
  4320. hole = true;
  4321. }
  4322. }
  4323. }
  4324. }
  4325. if (hole) {
  4326. this.scoreBall.push(obj);
  4327. this.holeBall.push(obj);
  4328. }
  4329. }
  4330. this.scoreBall.sort(function (a, b) {
  4331. return a.hard - b.hard;
  4332. });
  4333. this.holeBall.sort(function (a, b) {
  4334. return a.kickAngle - b.kickAngle;
  4335. });
  4336. this.kickBall.sort(function (a, b) {
  4337. return a.borderDis - b.borderDis;
  4338. });
  4339. }
  4340. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4341. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4342. let balls = xGame.common.d2World.ballArr;
  4343. let max = xGame.tools.getDis(hx, hy, bx, by);
  4344. for (let index = 0; index < balls.length; index++) {
  4345. let obj = balls[index];
  4346. if (obj.number == 0)
  4347. continue;
  4348. if (obj.number == bn || obj.number == dn)
  4349. continue;
  4350. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4351. if (dis * dis > max)
  4352. continue;
  4353. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4354. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4355. if (num > 1)
  4356. num = 1;
  4357. if (num < 0)
  4358. continue;
  4359. let gap = Math.sin(Math.acos(num)) * dis;
  4360. if (gap < this.ballSize)
  4361. return true;
  4362. }
  4363. return false;
  4364. }
  4365. isLine(xy, ball) {
  4366. let bx = xy.x;
  4367. let by = xy.y;
  4368. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4369. let dis = ball.getDestDis(xy);
  4370. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4371. let sin = Math.sin(angle);
  4372. let cos = Math.cos(angle);
  4373. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4374. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4375. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4376. let dx = bx + this.tempDir2.x * dis;
  4377. let dy = by + this.tempDir2.y * dis;
  4378. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4379. sin = Math.sin(-angle);
  4380. cos = Math.cos(-angle);
  4381. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4382. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4383. dx = bx + this.tempDir2.x * dis;
  4384. dy = by + this.tempDir2.y * dis;
  4385. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4386. if (isr && isl)
  4387. return false;
  4388. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4389. }
  4390. return true;
  4391. }
  4392. setKick(dx, dy) {
  4393. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4394. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4395. this.tempDir1.x = 0;
  4396. this.tempDir1.y = 1;
  4397. this.tempDir2.y = -this.tempDir2.y;
  4398. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4399. if (num > 1)
  4400. num = 1;
  4401. let rot = Math.acos(num) * 57.3;
  4402. if (this.tempDir2.x < 0)
  4403. rot = 360 - rot;
  4404. this.destRot += rot;
  4405. }
  4406. }
  4407. class ui_UIGame extends fgui.GComponent {
  4408. static createInstance() {
  4409. return (fgui.UIPackage.createObject("game", "UIGame"));
  4410. }
  4411. onConstruct() {
  4412. this.c1 = this.getController("c1");
  4413. this.d3Root = (this.getChild("d3Root"));
  4414. this.clickNode = (this.getChild("clickNode"));
  4415. this.d2Root = (this.getChild("d2Root"));
  4416. this.topNode = (this.getChild("topNode"));
  4417. this.n72 = (this.getChild("n72"));
  4418. this.n40 = (this.getChild("n40"));
  4419. this.rulerNode = (this.getChild("rulerNode"));
  4420. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4421. this.n50 = (this.getChild("n50"));
  4422. this.keduNode = (this.getChild("keduNode"));
  4423. this.powerTxt = (this.getChild("powerTxt"));
  4424. this.powerNode = (this.getChild("powerNode"));
  4425. this.colorNode = (this.getChild("colorNode"));
  4426. this.powerEft = (this.getChild("powerEft"));
  4427. this.myPowerNode = (this.getChild("myPowerNode"));
  4428. this.ganNode = (this.getChild("ganNode"));
  4429. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4430. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4431. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4432. this.skillRod = (this.getChild("skillRod"));
  4433. this.border = (this.getChild("border"));
  4434. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4435. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4436. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4437. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4438. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4439. this.guanyuNode = (this.getChild("guanyuNode"));
  4440. this.helpBtn = (this.getChild("helpBtn"));
  4441. this.wordsBtn = (this.getChild("wordsBtn"));
  4442. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4443. this.returnBtn = (this.getChild("returnBtn"));
  4444. this.ballNode = (this.getChild("ballNode"));
  4445. this.whiteAni = (this.getChild("whiteAni"));
  4446. this.blackAni = (this.getChild("blackAni"));
  4447. this.selfTurn = (this.getChild("selfTurn"));
  4448. this.aiTurn = (this.getChild("aiTurn"));
  4449. this.deskNode = (this.getChild("deskNode"));
  4450. this.moveNode = (this.getChild("moveNode"));
  4451. this.selfTalk = (this.getChild("selfTalk"));
  4452. this.aiTalk = (this.getChild("aiTalk"));
  4453. this.d2Node = (this.getChild("d2Node"));
  4454. this.snowNode = (this.getChild("snowNode"));
  4455. this.guide2 = (this.getChild("guide2"));
  4456. this.guide1 = (this.getChild("guide1"));
  4457. this.guide3 = (this.getChild("guide3"));
  4458. this.guideNode = (this.getChild("guideNode"));
  4459. this.n_lxms_yd1 = (this.getChild("n_lxms_yd1"));
  4460. this.n_lxms_yd2 = (this.getChild("n_lxms_yd2"));
  4461. this.n_lxms_yd3 = (this.getChild("n_lxms_yd3"));
  4462. }
  4463. }
  4464. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4465. class ui_UIGameEnd extends fgui.GComponent {
  4466. static createInstance() {
  4467. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4468. }
  4469. onConstruct() {
  4470. this.c1 = this.getController("c1");
  4471. this.n22 = (this.getChild("n22"));
  4472. this.n2 = (this.getChild("n2"));
  4473. this.n52 = (this.getChild("n52"));
  4474. this.n53 = (this.getChild("n53"));
  4475. this.coinNode = (this.getChild("coinNode"));
  4476. this.closeNode = (this.getChild("closeNode"));
  4477. this.moneyNode = (this.getChild("moneyNode"));
  4478. this.secretary = (this.getChild("secretary"));
  4479. this.n27 = (this.getChild("n27"));
  4480. this.n29 = (this.getChild("n29"));
  4481. this.talkNode = (this.getChild("talkNode"));
  4482. this.n38 = (this.getChild("n38"));
  4483. this.n39 = (this.getChild("n39"));
  4484. this.n40 = (this.getChild("n40"));
  4485. this.awardNode = (this.getChild("awardNode"));
  4486. this.starNumNode = (this.getChild("starNumNode"));
  4487. this.n47 = (this.getChild("n47"));
  4488. this.conditionNode = (this.getChild("conditionNode"));
  4489. this.isGetAward = (this.getChild("isGetAward"));
  4490. this.leftBtn = (this.getChild("leftBtn"));
  4491. this.rightBtn = (this.getChild("rightBtn"));
  4492. this.btnNode = (this.getChild("btnNode"));
  4493. }
  4494. }
  4495. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4496. class ui_UIAddCoin extends fgui.GComponent {
  4497. static createInstance() {
  4498. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4499. }
  4500. onConstruct() {
  4501. this.n11 = (this.getChild("n11"));
  4502. this.myNode = (this.getChild("myNode"));
  4503. this.t0 = this.getTransition("t0");
  4504. }
  4505. }
  4506. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4507. class UIAddCoin extends UIBase {
  4508. constructor() {
  4509. super();
  4510. this.coinNum = 2000;
  4511. }
  4512. onConstructor() {
  4513. this.ui = ui_UIAddCoin.createInstance();
  4514. this.contentPane = this.ui;
  4515. this.isEject = false;
  4516. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4517. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4518. }
  4519. show() {
  4520. super.show();
  4521. this.ui.t0.play();
  4522. this.setGlobalFont(this.ui);
  4523. }
  4524. videoAddCoin() {
  4525. console.log('zh:qjff_AD_for_UIAddCoin');
  4526. if (Laya.Browser.onAndroid) {
  4527. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4528. if (!boo) {
  4529. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4530. return;
  4531. }
  4532. }
  4533. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4534. }
  4535. else {
  4536. console.log('zh:AD 失败,直接发放奖励');
  4537. this.qjff_AD_for_UIAddCoin();
  4538. }
  4539. }
  4540. qjff_AD_for_UIAddCoin() {
  4541. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4542. this.hide();
  4543. }
  4544. }
  4545. UIAddCoin.uiName = "UIAddCoin";
  4546. class ui_UIInvitation extends fgui.GComponent {
  4547. static createInstance() {
  4548. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4549. }
  4550. onConstruct() {
  4551. this.n14 = (this.getChild("n14"));
  4552. this.myNode = (this.getChild("myNode"));
  4553. this.t0 = this.getTransition("t0");
  4554. }
  4555. }
  4556. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4557. class UIInvitation extends UIBase {
  4558. constructor() {
  4559. super();
  4560. }
  4561. onConstructor() {
  4562. this.ui = ui_UIInvitation.createInstance();
  4563. this.contentPane = this.ui;
  4564. this.isEject = false;
  4565. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4566. }
  4567. show() {
  4568. super.show();
  4569. this.setGlobalFont(this.ui);
  4570. }
  4571. enterGame() {
  4572. xGame.common.gameMode = GameMode.classic;
  4573. DataMgr.setChallengeTimes(1);
  4574. xGame.common.passAwardCoin = 2000;
  4575. let need = xGame.common.classicNiceNeddCoin;
  4576. if (DataMgr.coinEnough(need)) {
  4577. DataMgr.setCoin(-need);
  4578. xGame.eventMgr.event(RESTART_GAME, true);
  4579. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4580. }
  4581. else {
  4582. xGame.eventMgr.event(RESTART_GAME, true);
  4583. }
  4584. this.hide();
  4585. }
  4586. hide() {
  4587. super.hide();
  4588. }
  4589. }
  4590. UIInvitation.uiName = "UIInvitation";
  4591. class ui_UIMain extends fgui.GComponent {
  4592. static createInstance() {
  4593. return (fgui.UIPackage.createObject("game", "UIMain"));
  4594. }
  4595. onConstruct() {
  4596. this.n47 = (this.getChild("n47"));
  4597. this.n10 = (this.getChild("n10"));
  4598. this.secretary = (this.getChild("secretary"));
  4599. this.moneyNode = (this.getChild("moneyNode"));
  4600. this.headNode = (this.getChild("headNode"));
  4601. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4602. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4603. this.classicBtn = (this.getChild("classicBtn"));
  4604. this.globalBtn = (this.getChild("globalBtn"));
  4605. this.n44 = (this.getChild("n44"));
  4606. this.n_dengLu = (this.getChild("n_dengLu"));
  4607. this.settingNode = (this.getChild("settingNode"));
  4608. this.drawBtn = (this.getChild("drawBtn"));
  4609. this.signBtn = (this.getChild("signBtn"));
  4610. this.shopBtn = (this.getChild("shopBtn"));
  4611. this.n45 = (this.getChild("n45"));
  4612. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4613. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4614. this.rankBtn = (this.getChild("rankBtn"));
  4615. this.n46 = (this.getChild("n46"));
  4616. this.liucheng1 = (this.getChild("liucheng1"));
  4617. this.rightBtn = (this.getChild("rightBtn"));
  4618. this.n75 = (this.getChild("n75"));
  4619. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4620. this.liucheng2 = (this.getChild("liucheng2"));
  4621. this.guideBtn = (this.getChild("guideBtn"));
  4622. this.n73 = (this.getChild("n73"));
  4623. this.wordsNode = (this.getChild("wordsNode"));
  4624. this.enterGuide = (this.getChild("enterGuide"));
  4625. this.talkNode = (this.getChild("talkNode"));
  4626. this.n83 = (this.getChild("n83"));
  4627. this.n84 = (this.getChild("n84"));
  4628. this.n_yd_challenge_1_mask = (this.getChild("n_yd_challenge_1_mask"));
  4629. this.n_yd_challenge_1_btn = (this.getChild("n_yd_challenge_1_btn"));
  4630. this.n_yd_challenge_1_hand = (this.getChild("n_yd_challenge_1_hand"));
  4631. this.n_yd_lxms_1 = (this.getChild("n_yd_lxms_1"));
  4632. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4633. }
  4634. }
  4635. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4636. class ui_UIMoyu extends fgui.GComponent {
  4637. static createInstance() {
  4638. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4639. }
  4640. onConstruct() {
  4641. this.ageTip = (this.getChild("ageTip"));
  4642. this.mainBg = (this.getChild("mainBg"));
  4643. this.xyNode = (this.getChild("xyNode"));
  4644. this.rnNode = (this.getChild("rnNode"));
  4645. this.fcmNode = (this.getChild("fcmNode"));
  4646. this.ageNode = (this.getChild("ageNode"));
  4647. this.tipNode = (this.getChild("tipNode"));
  4648. this.msgNode = (this.getChild("msgNode"));
  4649. }
  4650. }
  4651. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4652. class MoyuMgr {
  4653. static initMoyu() {
  4654. this.moyuView = new MoyuView();
  4655. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4656. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4657. this.moyuView.ui.displayObject.zOrder = 1000;
  4658. this.moyuView.init();
  4659. this.moyuView.showTip(true);
  4660. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4661. window['XApk'] = this;
  4662. }
  4663. static showAge(show) {
  4664. if (this.moyuView)
  4665. this.moyuView.showAge(show);
  4666. }
  4667. static onPlatMsg(idx) {
  4668. if (!MoyuMgr.moyuView)
  4669. return;
  4670. if (idx == '0') {
  4671. MoyuMgr.moyuView.showTip(false);
  4672. }
  4673. }
  4674. static showAgree(call) {
  4675. if (this.moyuView)
  4676. this.moyuView.showAgree(call);
  4677. else
  4678. call && call();
  4679. }
  4680. static showXy(type = 1) {
  4681. if (this.moyuView)
  4682. this.moyuView.showXy(type);
  4683. }
  4684. }
  4685. MoyuMgr.isAdvise = false;
  4686. class MoyuView {
  4687. constructor() {
  4688. this.ysxyNum = 1;
  4689. this.ysJson = null;
  4690. this.ui = ui_UIMoyu.createInstance();
  4691. }
  4692. init() {
  4693. this.ui.mainBg.visible = false;
  4694. this.ui.xyNode.visible = false;
  4695. this.ui.ageNode.visible = false;
  4696. this.ui.tipNode.visible = false;
  4697. this.ui.rnNode.visible = false;
  4698. this.ui.fcmNode.visible = false;
  4699. this.ui.ageTip.visible = false;
  4700. this.ui.msgNode.visible = false;
  4701. this.ui.visible = false;
  4702. this.ui.xyNode.xyList.setVirtual();
  4703. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4704. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4705. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4706. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4707. this.ui.xyNode.btnKnown.visible = false;
  4708. this.ui.xyNode.xy1.visible = false;
  4709. this.ui.xyNode.xy2.visible = false;
  4710. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4711. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4712. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4713. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4714. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4715. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4716. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4717. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4718. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4719. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4720. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4721. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4722. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4723. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4724. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4725. this.ysxyNum = 2;
  4726. }
  4727. }
  4728. onClick(obj) {
  4729. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4730. switch (obj) {
  4731. case this.ui.ageTip:
  4732. if (Moyu.isTTApk) {
  4733. this.ui.ageNode.visible = true;
  4734. this.ui.mainBg.visible = true;
  4735. }
  4736. break;
  4737. case this.ui.tipNode:
  4738. this.showTip(false);
  4739. break;
  4740. case this.ui.ageNode.btnAge:
  4741. this.ui.ageNode.visible = false;
  4742. this.ui.mainBg.visible = false;
  4743. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4744. this.ui.visible = false;
  4745. break;
  4746. case this.ui.xyNode.btnXy3:
  4747. case this.ui.xyNode.btnXy1:
  4748. this.loadXy(1);
  4749. break;
  4750. case this.ui.xyNode.btnXy2:
  4751. this.loadXy(2);
  4752. break;
  4753. case this.ui.xyNode.btnBack:
  4754. this.ui.xyNode.xy1.visible = true;
  4755. this.ui.xyNode.xy2.visible = false;
  4756. break;
  4757. case this.ui.xyNode.btnKnown:
  4758. this.ui.xyNode.visible = false;
  4759. this.ui.mainBg.visible = false;
  4760. this.ui.visible = false;
  4761. break;
  4762. case this.ui.rnNode.btnCheck:
  4763. this.check();
  4764. break;
  4765. case this.ui.rnNode.btnExit:
  4766. case this.ui.xyNode.btnNo:
  4767. this.ysxyNum--;
  4768. if (this.ysxyNum > 0)
  4769. this.showMsg("Refuse to quit the game once again");
  4770. else {
  4771. Moyu.userAgree(false);
  4772. Moyu.exit();
  4773. }
  4774. break;
  4775. case this.ui.xyNode.btnSure:
  4776. case this.ui.xyNode.btnYes:
  4777. DataMgr.userData.isAgree = true;
  4778. DataMgr.saveUserData();
  4779. this.onAgree();
  4780. break;
  4781. case this.ui.rnNode.btnDone:
  4782. this.ui.rnNode.visible = false;
  4783. this.ui.visible = false;
  4784. break;
  4785. case this.ui.fcmNode.btnRn:
  4786. this.showRn();
  4787. break;
  4788. }
  4789. }
  4790. showTip(show) {
  4791. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4792. return;
  4793. if (show) {
  4794. MoyuMgr.isAdvise = true;
  4795. this.ui.visible = true;
  4796. this.ui.tipNode.visible = true;
  4797. this.ui.tipNode.alpha = 1;
  4798. Laya.timer.once(1000, this, this.showTip, [false]);
  4799. }
  4800. else {
  4801. this.ui.tipNode.alpha = 1;
  4802. this.ui.tipNode.visible = true;
  4803. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4804. this.ui.tipNode.visible = false;
  4805. MoyuMgr.isAdvise = false;
  4806. }), 1000);
  4807. }
  4808. }
  4809. showAge(show, px = 0, py = 0) {
  4810. if (Moyu.platType > 10 && !Moyu.isIos) {
  4811. this.ui.ageTip.x = px;
  4812. this.ui.ageTip.y = py;
  4813. this.ui.ageTip.visible = show;
  4814. if (show)
  4815. this.ui.visible = true;
  4816. }
  4817. }
  4818. showAgree(call) {
  4819. this.agreeCall = call;
  4820. this.onAgree();
  4821. return;
  4822. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4823. this.showXy(0);
  4824. }
  4825. else
  4826. this.onAgree();
  4827. }
  4828. onAgree() {
  4829. if (!this.ui.ageNode.visible)
  4830. this.ui.visible = false;
  4831. this.ui.xyNode.visible = false;
  4832. Moyu.userAgree(true);
  4833. this.showAge(false);
  4834. this.agreeCall && this.agreeCall();
  4835. this.showRn();
  4836. }
  4837. showMsg(txt) {
  4838. this.ui.msgNode.txtMsg.text = txt;
  4839. this.ui.msgNode.visible = true;
  4840. this.ui.msgNode.alpha = 1;
  4841. this.ui.visible = true;
  4842. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4843. this.ui.msgNode.visible = false;
  4844. }), 2500, true);
  4845. }
  4846. showRn() {
  4847. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4848. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4849. this.ui.rnNode.rn1.visible = true;
  4850. this.ui.rnNode.rn2.visible = false;
  4851. this.ui.rnNode.rn3.visible = false;
  4852. this.ui.rnNode.rn4.visible = false;
  4853. this.ui.rnNode.visible = true;
  4854. this.ui.mainBg.visible = true;
  4855. this.ui.rnNode.btnDone.visible = false;
  4856. this.ui.rnNode.btnExit.visible = true;
  4857. this.ui.rnNode.btnCheck.visible = true;
  4858. this.ui.fcmNode.visible = false;
  4859. this.ui.visible = true;
  4860. return;
  4861. }
  4862. }
  4863. this.showFcm();
  4864. }
  4865. showFcm() {
  4866. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4867. Moyu.initFCM(true);
  4868. if (Moyu.gameTime < 1)
  4869. this.fcmLoop();
  4870. else if (Moyu.gameTime < 999)
  4871. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4872. }
  4873. }
  4874. fcmLoop() {
  4875. if (Moyu.gameTime < 1) {
  4876. this.ui.rnNode.visible = false;
  4877. this.ui.fcmNode.visible = true;
  4878. this.ui.mainBg.visible = true;
  4879. this.ui.visible = true;
  4880. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4881. Laya.timer.clear(this.ui, this.fcmLoop);
  4882. }
  4883. }
  4884. check() {
  4885. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4886. this.ui.rnNode.rn1.visible = false;
  4887. this.ui.rnNode.rn2.visible = false;
  4888. this.ui.rnNode.rn4.visible = true;
  4889. }
  4890. else if (this.ui.rnNode.rn4.visible) {
  4891. let name = this.ui.rnNode.inputName.text;
  4892. let code = this.ui.rnNode.inputCode.text;
  4893. if (code && code.length == 18) {
  4894. this.ui.rnNode.rn1.visible = false;
  4895. this.ui.rnNode.rn4.visible = false;
  4896. Moyu.authenticate(name, code, (res) => {
  4897. this.ui.rnNode.rn2.visible = !res;
  4898. this.ui.rnNode.rn3.visible = res;
  4899. this.ui.rnNode.btnDone.visible = res;
  4900. this.ui.rnNode.btnExit.visible = !res;
  4901. this.ui.rnNode.btnCheck.visible = !res;
  4902. if (res)
  4903. this.showFcm();
  4904. });
  4905. }
  4906. else
  4907. this.showMsg("信息填写不完整");
  4908. }
  4909. }
  4910. loadXy(type = 0) {
  4911. this.ui.xyNode.xy1.visible = false;
  4912. this.ui.xyNode.xy2.visible = true;
  4913. this.ui.xyNode.xyList.scrollToView(0);
  4914. if (type == 1) {
  4915. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4916. }
  4917. else if (type == 2) {
  4918. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4919. }
  4920. }
  4921. showXy(type = 0) {
  4922. this.xyBtn();
  4923. if (type == 0) {
  4924. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4925. this.ui.xyNode.btnSure.visible = true;
  4926. }
  4927. else {
  4928. this.ui.xyNode.btnYes.visible = true;
  4929. this.ui.xyNode.btnNo.visible = true;
  4930. }
  4931. }
  4932. else {
  4933. this.ui.xyNode.btnKnown.visible = true;
  4934. this.ui.mainBg.visible = true;
  4935. }
  4936. this.ui.xyNode.xy1.visible = true;
  4937. this.ui.xyNode.xy2.visible = false;
  4938. this.ui.xyNode.visible = true;
  4939. this.ui.visible = true;
  4940. }
  4941. xyBtn() {
  4942. this.ui.xyNode.btnSure.visible = false;
  4943. this.ui.xyNode.btnYes.visible = false;
  4944. this.ui.xyNode.btnNo.visible = false;
  4945. this.ui.xyNode.btnKnown.visible = false;
  4946. {
  4947. this.ui.xyNode.btnXy3.visible = false;
  4948. this.ui.xyNode.btnXy2.visible = true;
  4949. this.ui.xyNode.btnXy1.visible = true;
  4950. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4951. }
  4952. }
  4953. createXY(json) {
  4954. this.ysJson = json.content;
  4955. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4956. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4957. this.ui.xyNode.xy2.visible = true;
  4958. }
  4959. renderListItem(idx, cell) {
  4960. let xy = this.ysJson[idx];
  4961. cell.height = xy.line * 30;
  4962. cell.xyItem.text = xy.text;
  4963. }
  4964. onDestroy() {
  4965. this.agreeCall = null;
  4966. }
  4967. }
  4968. class SettingNode {
  4969. constructor(ui) {
  4970. this.showSetting = false;
  4971. this.openSound = true;
  4972. this.openShake = true;
  4973. this.ui = ui;
  4974. this.ui.soundBtn.onClick(this, this.switchSound);
  4975. this.ui.shakeBtn.onClick(this, this.switchShake);
  4976. this.ui.xyBtn.onClick(this, this.onXy);
  4977. this.ui.clickNode.onClick(this, this.changeSetting);
  4978. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4979. this.ui.xyBtn.visible = false;
  4980. this.ui.shakeBtn.visible = false;
  4981. }
  4982. changeSetting() {
  4983. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4984. this.showSetting = !this.showSetting;
  4985. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4986. }
  4987. switchSound() {
  4988. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4989. this.openSound = !this.openSound;
  4990. Moyu.onSetting(this.openSound, this.openShake);
  4991. xGame.soundMgr.onSetting(this.openSound);
  4992. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4993. }
  4994. switchShake() {
  4995. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4996. this.openShake = !this.openShake;
  4997. Moyu.onSetting(this.openSound, this.openShake);
  4998. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4999. }
  5000. onXy() {
  5001. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5002. MoyuMgr.showXy(1);
  5003. }
  5004. }
  5005. class ui_UILevelDisplay extends fgui.GComponent {
  5006. static createInstance() {
  5007. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  5008. }
  5009. onConstruct() {
  5010. this.n9 = (this.getChild("n9"));
  5011. this.myNode = (this.getChild("myNode"));
  5012. this.closeNode = (this.getChild("closeNode"));
  5013. }
  5014. }
  5015. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  5016. class ui_UILevelProp extends fgui.GComponent {
  5017. static createInstance() {
  5018. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  5019. }
  5020. onConstruct() {
  5021. this.n16 = (this.getChild("n16"));
  5022. this.myNode = (this.getChild("myNode"));
  5023. this.closeBtn = (this.getChild("closeBtn"));
  5024. this.moneyNode = (this.getChild("moneyNode"));
  5025. this.t1 = this.getTransition("t1");
  5026. }
  5027. }
  5028. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  5029. class ui_ShowItem extends fgui.GComponent {
  5030. static createInstance() {
  5031. return (fgui.UIPackage.createObject("game", "ShowItem"));
  5032. }
  5033. onConstruct() {
  5034. this.myImg = (this.getChild("myImg"));
  5035. }
  5036. }
  5037. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5038. class ShowItem {
  5039. constructor() {
  5040. this.ui = ui_ShowItem.createInstance();
  5041. }
  5042. destroySelf() {
  5043. if (!this.ui.isDisposed) {
  5044. this.ui.removeFromParent();
  5045. this.ui.dispose();
  5046. }
  5047. }
  5048. setParent(parent) {
  5049. parent.addChild(this.ui);
  5050. }
  5051. setPos(x, y) {
  5052. this.ui.x = x;
  5053. this.ui.y = y;
  5054. }
  5055. setUrl(index) {
  5056. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5057. }
  5058. }
  5059. class ui_UIPower extends fgui.GComponent {
  5060. static createInstance() {
  5061. return (fgui.UIPackage.createObject("game", "UIPower"));
  5062. }
  5063. onConstruct() {
  5064. this.n11 = (this.getChild("n11"));
  5065. this.myNode = (this.getChild("myNode"));
  5066. this.t0 = this.getTransition("t0");
  5067. }
  5068. }
  5069. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5070. class UIPower extends UIBase {
  5071. constructor() {
  5072. super();
  5073. }
  5074. onConstructor() {
  5075. this.ui = ui_UIPower.createInstance();
  5076. this.contentPane = this.ui;
  5077. this.isEject = false;
  5078. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5079. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5080. }
  5081. show() {
  5082. super.show();
  5083. this.ui.t0.play();
  5084. this.setGlobalFont(this.ui);
  5085. }
  5086. videoGetPower() {
  5087. console.log('zh:qjff_AD_for_uipower');
  5088. if (Laya.Browser.onAndroid) {
  5089. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5090. if (!boo) {
  5091. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5092. return;
  5093. }
  5094. }
  5095. if (Laya.Browser.onAndroid) {
  5096. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5097. }
  5098. else {
  5099. console.log('zh:AD 失败,直接发放奖励');
  5100. this.qjff_AD_for_uipower();
  5101. }
  5102. }
  5103. else {
  5104. this.qjff_AD_for_uipower();
  5105. }
  5106. }
  5107. qjff_AD_for_uipower() {
  5108. DataMgr.setPower(xGame.common.videoPower, true);
  5109. xGame.eventMgr.event(POWER_TIME);
  5110. this.hide();
  5111. }
  5112. }
  5113. UIPower.uiName = "UIPower";
  5114. class UILevelProp extends UIBase {
  5115. constructor() {
  5116. super();
  5117. this.firstPos = 385;
  5118. this.secondPos = 467;
  5119. this.showItemArr = [];
  5120. }
  5121. onConstructor() {
  5122. this.ui = ui_UILevelProp.createInstance();
  5123. this.contentPane = this.ui;
  5124. this.isEject = false;
  5125. this.addUIClick(this.ui.closeBtn, this.hideWin);
  5126. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5127. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5128. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  5129. }
  5130. show(level) {
  5131. console.log('zh:show.');
  5132. super.show();
  5133. this.ui.t1.play();
  5134. this.level = level;
  5135. this.data = cfgTable.placeballData[this.level];
  5136. this.updateSelf();
  5137. this.showPreView();
  5138. this.moneyNode.ui.c1.selectedIndex = 2;
  5139. this.moneyNode.checkPowerTime();
  5140. this.moneyNode.powerChange();
  5141. this.yinDaoForLianxi();
  5142. this.setGlobalFont(this.ui);
  5143. }
  5144. yinDaoForLianxi() {
  5145. let lianXiGuide = DataMgr.getLianXiGuide();
  5146. console.log('zh:lianXiGuide=', lianXiGuide);
  5147. if (lianXiGuide === 0) {
  5148. this.ui.myNode.n_yd_lxms_3.visible = true;
  5149. console.log('zh:yinDaoForLianxi 333 set ok');
  5150. }
  5151. else {
  5152. this.ui.myNode.n_yd_lxms_3.visible = false;
  5153. console.log('zh:无需引导33');
  5154. }
  5155. }
  5156. showPreView() {
  5157. let item;
  5158. let data;
  5159. for (let index = 0; index < this.showItemArr.length; index++) {
  5160. item = this.showItemArr[index];
  5161. item.destroySelf();
  5162. }
  5163. this.showItemArr = [];
  5164. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5165. for (const key in cfgData) {
  5166. data = cfgData[key];
  5167. item = new ShowItem();
  5168. item.setParent(this.ui.myNode.displayRoot);
  5169. item.setPos(data.x, data.y);
  5170. item.setUrl(data.value);
  5171. this.showItemArr.push(item);
  5172. }
  5173. }
  5174. updateSelf() {
  5175. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5176. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5177. if (this.data.ball == -1) {
  5178. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5179. }
  5180. else {
  5181. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5182. }
  5183. let localData = DataMgr.getPlaceBallLevel(this.level);
  5184. let getAward = localData.getAward;
  5185. let cfg = cfgTable.placeballData[this.level];
  5186. let coin = this.data.award[0];
  5187. let diamond = this.data.award[1];
  5188. if (cfg.type == PlaceBallType.challenge) {
  5189. diamond = 0;
  5190. coin = 100;
  5191. }
  5192. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5193. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5194. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5195. if (cfg.type == PlaceBallType.challenge) {
  5196. this.ui.myNode.coinNode.numTxt.text = "";
  5197. }
  5198. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5199. if (coin > 0 && diamond > 0) {
  5200. this.ui.myNode.diamondNode.x = 385;
  5201. this.ui.myNode.coinNode.x = 467;
  5202. }
  5203. else {
  5204. this.ui.myNode.diamondNode.x = 385;
  5205. this.ui.myNode.coinNode.x = 385;
  5206. }
  5207. if (!getAward) {
  5208. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5209. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5210. }
  5211. else {
  5212. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5213. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5214. }
  5215. }
  5216. startGame() {
  5217. console.log("zh:startGame");
  5218. if (DataMgr.powerEnough()) {
  5219. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5220. this.ui.myNode.startBtn.touchable = false;
  5221. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5222. console.log('zh:startGame dh ');
  5223. this.ui.myNode.startBtn.touchable = true;
  5224. DataMgr.setPower(-1);
  5225. xGame.eventMgr.event(POWER_TIME);
  5226. xGame.common.gameMode = GameMode.placeBall;
  5227. xGame.common.placeBallCurLevel = this.level;
  5228. xGame.uiMgr.Show(UIGame);
  5229. xGame.uiMgr.Hide(UILevelDisplay);
  5230. xGame.uiMgr.Hide(UIMain);
  5231. this.logEventForChallenge_level_start(this.level);
  5232. this.hideWin();
  5233. }));
  5234. console.log('zh:eeeee');
  5235. }
  5236. else {
  5237. let guide = DataMgr.getLianXiGuide();
  5238. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  5239. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  5240. DataMgr.setPower(2);
  5241. }
  5242. console.log('zh:guide = ' + guide);
  5243. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  5244. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  5245. xGame.uiMgr.Show(UIPower);
  5246. }
  5247. }
  5248. logEventForChallenge_level_start(level) {
  5249. let keyStr = 'sjmd_challenge_level_start';
  5250. let jsonStr = {
  5251. "count": 1,
  5252. "gold_balance ": DataMgr.getCoin(),
  5253. "level": level,
  5254. "diamond_balance ": DataMgr.getDiamond()
  5255. };
  5256. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5257. const d = LocalStorageManager.getItem(keyStr);
  5258. if (level > d.level) {
  5259. jsonStr.count = d.count + 1;
  5260. LocalStorageManager.setItem(keyStr, jsonStr);
  5261. }
  5262. else {
  5263. }
  5264. }
  5265. else {
  5266. LocalStorageManager.setItem(keyStr, jsonStr);
  5267. }
  5268. const reqStr = JSON.stringify(jsonStr);
  5269. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5270. }
  5271. hideWin() {
  5272. super.hide();
  5273. if (this.ui.myNode.startBtn) {
  5274. this.ui.myNode.startBtn.touchable = true;
  5275. if (this.ui.myNode.startBtn.powerEft.t0) {
  5276. this.ui.myNode.startBtn.powerEft.t0.stop();
  5277. }
  5278. }
  5279. }
  5280. }
  5281. UILevelProp.uiName = "UILevelProp";
  5282. class PutBallLevelDisplay {
  5283. constructor(ui, index) {
  5284. this.index = 0;
  5285. this.ui = ui;
  5286. this.index = index;
  5287. this.ui.onClick(this, this.clickSelf);
  5288. this.updateSelf();
  5289. this.ui.levelTxt.text = (this.index + 1) + "";
  5290. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5291. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5292. }
  5293. updateSelf() {
  5294. let level = this.index + 1;
  5295. this.data = DataMgr.getPlaceBallLevel(level);
  5296. this.ui.starNode.c1.selectedIndex = this.data.star;
  5297. let isChallenge = cfgTable.placeballData[level].type;
  5298. if (this.data.isCur) {
  5299. if (isChallenge) {
  5300. this.ui.c1.selectedIndex = 5;
  5301. }
  5302. else {
  5303. this.ui.c1.selectedIndex = 2;
  5304. }
  5305. }
  5306. else {
  5307. if (this.data.play) {
  5308. if (this.data.star == 3) {
  5309. this.ui.c1.selectedIndex = 0;
  5310. }
  5311. else {
  5312. this.ui.c1.selectedIndex = 1;
  5313. }
  5314. }
  5315. else {
  5316. if (isChallenge) {
  5317. this.ui.c1.selectedIndex = 4;
  5318. }
  5319. else {
  5320. this.ui.c1.selectedIndex = 3;
  5321. }
  5322. }
  5323. }
  5324. }
  5325. clickSelf() {
  5326. console.log("zh:lev clickSelf");
  5327. if (!this.data.play)
  5328. return;
  5329. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5330. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5331. }
  5332. }
  5333. class UILevelDisplay extends UIBase {
  5334. constructor() {
  5335. super();
  5336. }
  5337. onConstructor() {
  5338. this.ui = ui_UILevelDisplay.createInstance();
  5339. this.contentPane = this.ui;
  5340. this.isEject = false;
  5341. this.myList = this.ui.myNode.myList;
  5342. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5343. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  5344. this.levelItemArr = [];
  5345. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5346. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5347. this.myList.numItems = levelNum;
  5348. }
  5349. levelItemRender(index, target) {
  5350. let item = new PutBallLevelDisplay(target, index);
  5351. this.levelItemArr.push(item);
  5352. }
  5353. show() {
  5354. super.show();
  5355. this.updateLevel();
  5356. this.scrollToPlace();
  5357. this.yinDaoForLianxi();
  5358. this.setGlobalFont(this.ui);
  5359. }
  5360. yinDaoForLianxi() {
  5361. let lianXiGuide = DataMgr.getLianXiGuide();
  5362. console.log('zh:lianXiGuide=', lianXiGuide);
  5363. if (lianXiGuide === 0) {
  5364. this.ui.myNode.n_yd_lxms_2.visible = true;
  5365. console.log('zh:yinDaoForLianxi 222 set ok');
  5366. }
  5367. else {
  5368. this.ui.myNode.n_yd_lxms_2.visible = false;
  5369. console.log('zh:无需引导');
  5370. }
  5371. }
  5372. showLevelTipWindows() {
  5373. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5374. xGame.uiMgr.Show(UILevelProp, 1);
  5375. }
  5376. updateLevel() {
  5377. let temp;
  5378. for (let index = 0; index < this.levelItemArr.length; index++) {
  5379. temp = this.levelItemArr[index];
  5380. temp.updateSelf();
  5381. }
  5382. }
  5383. scrollToPlace() {
  5384. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5385. let passArr = DataMgr.getPlaceBallLevelList();
  5386. let offest = passArr.length;
  5387. if (offest >= maxNum - 1)
  5388. offest = maxNum - 1;
  5389. this.myList.scrollToView(offest, true, true);
  5390. }
  5391. hide() {
  5392. super.hide();
  5393. }
  5394. }
  5395. UILevelDisplay.uiName = "UILevelDisplay";
  5396. class ui_UIMatching extends fgui.GComponent {
  5397. static createInstance() {
  5398. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5399. }
  5400. onConstruct() {
  5401. this.n5 = (this.getChild("n5"));
  5402. this.n49 = (this.getChild("n49"));
  5403. this.n51 = (this.getChild("n51"));
  5404. this.n64 = (this.getChild("n64"));
  5405. this.n2 = (this.getChild("n2"));
  5406. this.n53 = (this.getChild("n53"));
  5407. this.n54 = (this.getChild("n54"));
  5408. this.n56 = (this.getChild("n56"));
  5409. this.n58 = (this.getChild("n58"));
  5410. this.n59 = (this.getChild("n59"));
  5411. this.n57 = (this.getChild("n57"));
  5412. this.n60 = (this.getChild("n60"));
  5413. this.n62 = (this.getChild("n62"));
  5414. this.awardTxt = (this.getChild("awardTxt"));
  5415. this.n61 = (this.getChild("n61"));
  5416. this.selfHead = (this.getChild("selfHead"));
  5417. this.aiHead = (this.getChild("aiHead"));
  5418. this.n82 = (this.getChild("n82"));
  5419. this.n84 = (this.getChild("n84"));
  5420. this.n83 = (this.getChild("n83"));
  5421. this.t1 = this.getTransition("t1");
  5422. this.t2 = this.getTransition("t2");
  5423. this.t3 = this.getTransition("t3");
  5424. this.t4 = this.getTransition("t4");
  5425. }
  5426. }
  5427. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5428. class UIMatching extends UIBase {
  5429. constructor() {
  5430. super();
  5431. }
  5432. onConstructor() {
  5433. this.ui = ui_UIMatching.createInstance();
  5434. this.contentPane = this.ui;
  5435. this.isEject = false;
  5436. }
  5437. show(callback) {
  5438. super.show();
  5439. PlatMgr.showBanner(true);
  5440. this.callback = callback;
  5441. let user = Moyu.getUserInfo();
  5442. if (!this.selfPot) {
  5443. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5444. }
  5445. if (!this.aiPot) {
  5446. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5447. }
  5448. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5449. this.ui.selfHead.nameTxt.text = user.nickName;
  5450. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5451. this.ui.aiHead.nameTxt.text = "???";
  5452. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5453. this.ui.selfHead.c1.selectedIndex = 0;
  5454. this.ui.aiHead.c1.selectedIndex = 0;
  5455. this.ui.selfHead.x = this.selfPot.x;
  5456. this.ui.selfHead.y = this.selfPot.y;
  5457. this.ui.aiHead.x = this.aiPot.x;
  5458. this.ui.aiHead.y = this.aiPot.y;
  5459. switch (xGame.common.gameMode) {
  5460. case GameMode.classic:
  5461. break;
  5462. case GameMode.bigMove:
  5463. this.initSkillData();
  5464. break;
  5465. default:
  5466. break;
  5467. }
  5468. this.ui.t1.play(Laya.Handler.create(this, () => {
  5469. this.ui.t2.play(Laya.Handler.create(this, () => {
  5470. switch (xGame.common.gameMode) {
  5471. case GameMode.classic:
  5472. this.waitingPeople();
  5473. break;
  5474. case GameMode.bigMove:
  5475. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5476. break;
  5477. default:
  5478. break;
  5479. }
  5480. }));
  5481. }));
  5482. this.setGlobalFont(this.ui);
  5483. }
  5484. initSkillData() {
  5485. this.skillSelectData = [];
  5486. let skillUrl = xGame.common.skillIconList;
  5487. let skillName = xGame.common.skillNameList;
  5488. let skillLevel = DataMgr.getBigSkillList();
  5489. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5490. for (let index = 0; index < 5; index++) {
  5491. let obj = {};
  5492. obj.skillImg = skillUrl[index];
  5493. obj.skillName = skillName[index];
  5494. obj.skillType = skillType[index];
  5495. obj.skillLevel = skillLevel[index];
  5496. this.skillSelectData.push(obj);
  5497. }
  5498. }
  5499. getAISkillLevel(myLevel) {
  5500. let video = xGame.common.upSkillLevel;
  5501. let aiLevel;
  5502. let temp;
  5503. if (video) {
  5504. temp = xGame.common.randomNum(-2, -1);
  5505. }
  5506. else {
  5507. if (myLevel <= 5) {
  5508. temp = xGame.common.randomNum(1, 3);
  5509. }
  5510. else if (myLevel <= 9) {
  5511. temp = xGame.common.randomNum(-2, 1);
  5512. }
  5513. else {
  5514. temp = xGame.common.randomNum(-4, 0);
  5515. }
  5516. }
  5517. aiLevel = temp + myLevel;
  5518. if (aiLevel <= 1)
  5519. aiLevel = 1;
  5520. if (aiLevel >= 10)
  5521. aiLevel = 10;
  5522. return aiLevel;
  5523. }
  5524. getAISkillType() {
  5525. return xGame.common.randomNum(1, 4);
  5526. let successTimes = DataMgr.getSkillSuccessTimes();
  5527. let info = cfgTable.aiskillData[successTimes];
  5528. if (!info) {
  5529. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5530. info = cfgTable.aiskillData[max];
  5531. }
  5532. let dataArr = info.skillselect;
  5533. let myCfg = {};
  5534. for (let index = 0; index < dataArr.length; index++) {
  5535. let temp = dataArr[index].split('-');
  5536. myCfg[temp[0]] = {};
  5537. myCfg[temp[0]].id = parseInt(temp[0]);
  5538. myCfg[temp[0]].weight = parseInt(temp[1]);
  5539. }
  5540. let aiCfg = xGame.common.initWeight(myCfg);
  5541. let curData = xGame.common.getRandomWeightData(aiCfg);
  5542. return parseInt(curData.id);
  5543. }
  5544. getAISkillData(index) {
  5545. let myLevel = this.skillSelectData[index].skillLevel;
  5546. let aiLevel = this.getAISkillLevel(myLevel);
  5547. let aiType = this.getAISkillType() - 1;
  5548. return { aiLevel, aiType } = { aiLevel, aiType };
  5549. }
  5550. skillSelectFinish(index) {
  5551. let aiInfo = this.getAISkillData(index);
  5552. xGame.common.gameMgr.selfCurSkill = index;
  5553. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5554. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5555. this.ui.selfHead.c1.selectedIndex = 1;
  5556. this.ui.aiHead.c1.selectedIndex = 1;
  5557. let myData = this.skillSelectData[index];
  5558. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5559. let guide = DataMgr.getSkillGuide();
  5560. if (guide == 0) {
  5561. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5562. }
  5563. else {
  5564. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5565. }
  5566. let aiData = this.skillSelectData[aiInfo.aiType];
  5567. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5568. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5569. this.waitingPeople();
  5570. }
  5571. waitingPeople() {
  5572. let time = xGame.common.randomNum(1000, 3000);
  5573. time += 1000;
  5574. Laya.timer.once(time, this, () => {
  5575. this.matchingSuccess();
  5576. });
  5577. }
  5578. matchingSuccess() {
  5579. let gameUI = xGame.common.gameUI;
  5580. let name = gameUI.ui.topNode.aiNameTxt.text;
  5581. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5582. this.ui.aiHead.nameTxt.text = name;
  5583. this.ui.aiHead.headImg.url = url;
  5584. name = gameUI.ui.topNode.selfNameTxt.text;
  5585. url = gameUI.ui.topNode.selfHeadLoader.url;
  5586. this.ui.selfHead.nameTxt.text = name;
  5587. this.ui.selfHead.headImg.url = url;
  5588. this.ui.t3.play(Laya.Handler.create(this, () => {
  5589. this.callback && this.callback();
  5590. this.ui.t4.play(Laya.Handler.create(this, () => {
  5591. this.destroySelf();
  5592. }));
  5593. }));
  5594. }
  5595. destroySelf() {
  5596. this.callback = null;
  5597. this.skillSelectData = null;
  5598. this.selfPot = null;
  5599. this.aiPot = null;
  5600. if (!this.ui.isDisposed) {
  5601. this.ui.removeFromParent();
  5602. this.ui.dispose();
  5603. }
  5604. xGame.uiMgr.destroyUI(this);
  5605. }
  5606. }
  5607. UIMatching.uiName = "UIMatching";
  5608. class ui_UIRanking extends fgui.GComponent {
  5609. static createInstance() {
  5610. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5611. }
  5612. onConstruct() {
  5613. this.n26 = (this.getChild("n26"));
  5614. this.myNode = (this.getChild("myNode"));
  5615. }
  5616. }
  5617. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5618. class UIRanking extends UIBase {
  5619. constructor() {
  5620. super();
  5621. this.showSelf = true;
  5622. this.rankType = 1;
  5623. this.rankList = [];
  5624. this.topX = 10;
  5625. this.myIndex = this.topX + 1;
  5626. this.myStar = 0;
  5627. }
  5628. onConstructor() {
  5629. this.ui = ui_UIRanking.createInstance();
  5630. this.contentPane = this.ui;
  5631. this.isEject = false;
  5632. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5633. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5634. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5635. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5636. this.ui.myNode.myList.setVirtual();
  5637. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5638. }
  5639. show() {
  5640. super.show();
  5641. this.getPaiHangBangDataFormJosnFile();
  5642. this.updateSelf();
  5643. let self = Moyu.getUserInfo();
  5644. if (!self.isAuth) {
  5645. Moyu.initUser(this, () => {
  5646. DataMgr.upRankData();
  5647. });
  5648. }
  5649. this.setGlobalFont(this.ui);
  5650. }
  5651. getPaiHangBangDataFormJosnFile() {
  5652. const rankingList = cfgTable.paiHangBangData.list;
  5653. this.updateItemData(rankingList);
  5654. }
  5655. updateSelfItem() {
  5656. console.log('zh:Moyu.platType =' + Moyu.platType);
  5657. let self = Moyu.getUserInfo();
  5658. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5659. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5660. if (this.myIndex > this.topX) {
  5661. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5662. }
  5663. else {
  5664. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5665. }
  5666. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5667. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5668. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5669. }
  5670. updateItemData(data) {
  5671. this.myStar = xGame.common.getAllStarNum();
  5672. if (this.rankList.length < 2) {
  5673. this.rankList = data;
  5674. let self = Moyu.getUserInfo();
  5675. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5676. self.headIcon = self.headIcon;
  5677. for (let i = 0; i < data.length; i++) {
  5678. let data = this.rankList[i];
  5679. if (data.userId == self.userId) {
  5680. this.rankList.splice(i, 1);
  5681. break;
  5682. }
  5683. }
  5684. for (let i = 0; i < data.length; i++) {
  5685. let data = this.rankList[i];
  5686. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5687. this.myIndex = i + 1;
  5688. let user = { headIcon: self.headIcon, nickName: "myself" };
  5689. let ud = { user: user, data: {} };
  5690. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5691. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5692. if (Moyu.platType < 11) {
  5693. user.headIcon = self.headIcon;
  5694. user.nickName = self.nickName;
  5695. }
  5696. this.rankList.splice(i, 0, md);
  5697. break;
  5698. }
  5699. }
  5700. }
  5701. this.updateSelfItem();
  5702. this.ui.myNode.myList.numItems = this.rankList.length;
  5703. }
  5704. updateItemUI(index, obj) {
  5705. let data = this.rankList[index];
  5706. let userData = JSON.parse(data.userData).user;
  5707. obj.nameTxt.text = userData.nickName.toString();
  5708. obj.valueTxt.text = data.rankScore;
  5709. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5710. obj.rankTxt.text = index + 1;
  5711. switch (index) {
  5712. case 0:
  5713. this.setImg(obj, 1, 0, 0);
  5714. obj.rankTxt.color = "#FFC047";
  5715. break;
  5716. case 1:
  5717. this.setImg(obj, 0, 1, 0);
  5718. obj.rankTxt.color = "#ACACAC";
  5719. break;
  5720. case 2:
  5721. this.setImg(obj, 0, 0, 1);
  5722. obj.rankTxt.color = "#D09672";
  5723. break;
  5724. default:
  5725. this.setImg(obj, 0, 0, 0);
  5726. obj.rankTxt.color = "#496FAB";
  5727. break;
  5728. }
  5729. }
  5730. setImg(obj, a, b, c) {
  5731. obj.img1.visible = a ? true : false;
  5732. obj.img2.visible = b ? true : false;
  5733. obj.img3.visible = c ? true : false;
  5734. }
  5735. changeList(type) {
  5736. this.rankType = type;
  5737. this.updateSelf();
  5738. }
  5739. changeSelfNode() {
  5740. this.showSelf = !this.showSelf;
  5741. this.updateSelf();
  5742. }
  5743. updateSelf() {
  5744. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5745. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5746. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5747. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5748. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5749. }
  5750. }
  5751. UIRanking.uiName = "UIRanking";
  5752. class ui_UISecretary extends fgui.GComponent {
  5753. static createInstance() {
  5754. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5755. }
  5756. onConstruct() {
  5757. this.n0 = (this.getChild("n0"));
  5758. this.myNode = (this.getChild("myNode"));
  5759. this.closeBtn = (this.getChild("closeBtn"));
  5760. this.t0 = this.getTransition("t0");
  5761. }
  5762. }
  5763. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5764. class UISecretary extends UIBase {
  5765. constructor() {
  5766. super();
  5767. this.curIndex = 1;
  5768. }
  5769. onConstructor() {
  5770. this.ui = ui_UISecretary.createInstance();
  5771. this.contentPane = this.ui;
  5772. this.isEject = false;
  5773. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5774. this.nodeObj = { left: null, right: null, cur: null };
  5775. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5776. }
  5777. show() {
  5778. super.show();
  5779. this.ui.t0.play();
  5780. this.updateData();
  5781. this.setGlobalFont(this.ui);
  5782. }
  5783. addSecretarySpine(node, spineName) {
  5784. if (spineName == "mishu") {
  5785. if (this.secretarySpine1) {
  5786. node.displayObject.destroyChildren();
  5787. this.playWoman(this.secretarySpine1, node.displayObject);
  5788. }
  5789. else {
  5790. let spine1 = new SpineMgr("mishu", () => {
  5791. this.secretarySpine1 = spine1;
  5792. this.playWoman(this.secretarySpine1, node.displayObject);
  5793. });
  5794. }
  5795. }
  5796. else {
  5797. if (this.secretarySpine2) {
  5798. node.displayObject.destroyChildren();
  5799. this.playWoman(this.secretarySpine2, node.displayObject);
  5800. }
  5801. else {
  5802. let spine2 = new SpineMgr("xiaomishu2", () => {
  5803. this.secretarySpine2 = spine2;
  5804. this.playWoman(this.secretarySpine2, node.displayObject);
  5805. });
  5806. }
  5807. }
  5808. }
  5809. playWoman(node, parent) {
  5810. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5811. let yy = this.ui.myNode.gameNode3.secretary.height;
  5812. let scale = 1.5;
  5813. if (node == this.secretarySpine2) {
  5814. scale = 1.2;
  5815. }
  5816. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5817. node.play(data, 0, true, parent);
  5818. }
  5819. turnLeft() {
  5820. this.curIndex--;
  5821. if (this.curIndex < 1) {
  5822. this.curIndex = 2;
  5823. }
  5824. let left = this.nodeObj.left;
  5825. let right = this.nodeObj.right;
  5826. let cur = this.nodeObj.cur;
  5827. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5828. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5829. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5830. this.updateData();
  5831. }));
  5832. this.ui.myNode.setChildIndex(right, 2);
  5833. this.nodeObj.left = cur;
  5834. this.nodeObj.right = left;
  5835. this.nodeObj.cur = right;
  5836. }
  5837. turnRight() {
  5838. this.curIndex++;
  5839. if (this.curIndex > 2) {
  5840. this.curIndex = 1;
  5841. }
  5842. let left = this.nodeObj.left;
  5843. let right = this.nodeObj.right;
  5844. let cur = this.nodeObj.cur;
  5845. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5846. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5847. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5848. this.updateData();
  5849. }));
  5850. this.ui.myNode.setChildIndex(left, 2);
  5851. this.nodeObj.left = right;
  5852. this.nodeObj.right = cur;
  5853. this.nodeObj.cur = left;
  5854. }
  5855. updateData() {
  5856. console.log('zh: updateData FFFFFFFFFF');
  5857. let data = cfgTable.secretaryshopData;
  5858. let children = this.ui.myNode._children;
  5859. let temp;
  5860. let curData;
  5861. for (let index = 0; index < children.length; index++) {
  5862. temp = children[index];
  5863. curData = data[1];
  5864. temp.heightTxt.text = curData.height;
  5865. temp.foodTxt.text = curData.food;
  5866. temp.historyTxt.text = curData.history;
  5867. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5868. this.addSecretarySpine(temp.secretary, curData.spine);
  5869. let womanIndex = curData.id - 1;
  5870. let getWoman = DataMgr.getSecretary(womanIndex);
  5871. let curUse = DataMgr.getCurSecretary();
  5872. if (getWoman) {
  5873. if (curUse == womanIndex) {
  5874. temp.purchaseBtn.c1.selectedIndex = 1;
  5875. }
  5876. else {
  5877. temp.purchaseBtn.c1.selectedIndex = 2;
  5878. }
  5879. }
  5880. else {
  5881. temp.purchaseBtn.c1.selectedIndex = 0;
  5882. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5883. }
  5884. temp.purchaseBtn.visible = false;
  5885. }
  5886. }
  5887. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5888. console.log('zh: 点击了clickSecretary ');
  5889. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5890. if (getWoman) {
  5891. if (curUse != womanIndex) {
  5892. console.log();
  5893. DataMgr.setCurSecretary(womanIndex);
  5894. this.updateData();
  5895. }
  5896. }
  5897. else {
  5898. console.log('zh:点击购买了');
  5899. let need = needDiamond;
  5900. if (DataMgr.diamondEnough(need)) {
  5901. DataMgr.setDiamond(-need);
  5902. DataMgr.setSecretary(womanIndex, 1);
  5903. DataMgr.setCurSecretary(womanIndex);
  5904. this.updateData();
  5905. }
  5906. else {
  5907. xGame.uiMgr.Show(UIAddProp, 1);
  5908. }
  5909. }
  5910. }
  5911. closeSelf() {
  5912. this.hide();
  5913. }
  5914. }
  5915. UISecretary.uiName = "UISecretary";
  5916. class ui_UIShop extends fgui.GComponent {
  5917. static createInstance() {
  5918. return (fgui.UIPackage.createObject("game", "UIShop"));
  5919. }
  5920. onConstruct() {
  5921. this.n48 = (this.getChild("n48"));
  5922. this.n0 = (this.getChild("n0"));
  5923. this.secretary = (this.getChild("secretary"));
  5924. this.talkNode = (this.getChild("talkNode"));
  5925. this.closeNode = (this.getChild("closeNode"));
  5926. this.moneyNode = (this.getChild("moneyNode"));
  5927. this.myNode = (this.getChild("myNode"));
  5928. }
  5929. }
  5930. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5931. class ui_UIMsg extends fgui.GComponent {
  5932. static createInstance() {
  5933. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5934. }
  5935. onConstruct() {
  5936. this.tipsNode = (this.getChild("tipsNode"));
  5937. }
  5938. }
  5939. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5940. class UIMsg extends UIBase {
  5941. constructor() {
  5942. super();
  5943. }
  5944. onConstructor() {
  5945. this.ui = ui_UIMsg.createInstance();
  5946. this.contentPane = this.ui;
  5947. this.isEject = false;
  5948. this.isMuti = true;
  5949. }
  5950. show(msg, callback) {
  5951. super.show();
  5952. this.ui.tipsNode.msgTxt.text = msg;
  5953. this.ui.alpha = 1;
  5954. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5955. this.hide();
  5956. callback && callback();
  5957. }), 1000);
  5958. this.setGlobalFont(this.ui);
  5959. }
  5960. }
  5961. UIMsg.uiName = "UIMsg";
  5962. class BallRodDisplay {
  5963. constructor(ui, index) {
  5964. this.index = 0;
  5965. this.uiIndex = 0;
  5966. this.ui = ui;
  5967. this.index = index;
  5968. this.initData();
  5969. }
  5970. initData() {
  5971. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5972. let data = cfgTable.ballrodData[this.index + 1];
  5973. this.ui.nameTxt.text = data.name;
  5974. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5975. this.ui.levelNode.c1.selectedIndex = data.quality;
  5976. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5977. if (data.spine) {
  5978. this.mySpine = new SpineMgr(data.spine, () => {
  5979. let xx = 150;
  5980. let yy = 70;
  5981. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5982. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5983. });
  5984. }
  5985. }
  5986. updateSelf() {
  5987. let get = DataMgr.getBallRod(this.index);
  5988. if (get == null)
  5989. get = 1;
  5990. let curUse = DataMgr.getCurBallRod();
  5991. if (get) {
  5992. if (curUse == this.index) {
  5993. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5994. }
  5995. else {
  5996. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5997. }
  5998. }
  5999. else {
  6000. this.ui.purchaseBtn.c1.selectedIndex = 2;
  6001. }
  6002. }
  6003. buyBallRod() {
  6004. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6005. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  6006. switch (selectedIndex) {
  6007. case 0:
  6008. break;
  6009. case 1:
  6010. console.log('zh:点击了 USE THIS');
  6011. DataMgr.setCurBallRod(this.index);
  6012. let curUse = DataMgr.getCurBallRod();
  6013. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  6014. let ui = xGame.uiMgr.getUI(UIShop);
  6015. ui.updateBallRod();
  6016. break;
  6017. case 2:
  6018. let data = cfgTable.ballrodData[this.index + 1];
  6019. let need = data.price;
  6020. if (DataMgr.diamondEnough(need)) {
  6021. this.buyQiuGan(data);
  6022. DataMgr.setDiamond(-need);
  6023. DataMgr.setBallRod(this.index, 1);
  6024. DataMgr.setCurBallRod(this.index);
  6025. let ui = xGame.uiMgr.getUI(UIShop);
  6026. ui.updateBallRod();
  6027. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  6028. }
  6029. else {
  6030. xGame.uiMgr.Show(UIAddProp, 1);
  6031. }
  6032. break;
  6033. default:
  6034. break;
  6035. }
  6036. }
  6037. buyQiuGan(qgItem) {
  6038. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  6039. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6040. if (userInfo == null) {
  6041. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6042. return;
  6043. }
  6044. let reqData = xGame.httpMgr.getReqData();
  6045. let pd = JSON.parse(reqData);
  6046. pd.qiuGanData = qgItem;
  6047. reqData = JSON.stringify(pd);
  6048. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  6049. try {
  6050. console.log('zh:buySp res = ' + JSON.stringify(res));
  6051. let code = res.code;
  6052. let msg = res.msg;
  6053. if (code == 401) {
  6054. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6055. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  6056. return;
  6057. }
  6058. if (code == 200) {
  6059. xGame.uiMgr.Show(UIMsg, msg);
  6060. DataMgr.getUserZiChanInfo(false);
  6061. }
  6062. else {
  6063. xGame.uiMgr.Show(UIMsg, msg);
  6064. }
  6065. }
  6066. catch (error) {
  6067. console.log('error=' + error);
  6068. alert(error);
  6069. }
  6070. finally {
  6071. }
  6072. });
  6073. }
  6074. logEventForGouMaiGan(qiuGanName) {
  6075. const ev = {
  6076. value: qiuGanName
  6077. };
  6078. const jsonStr = JSON.stringify(ev);
  6079. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  6080. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  6081. }
  6082. }
  6083. class DaoJuDisplay {
  6084. constructor(ui, index) {
  6085. this.index = 0;
  6086. this.uiIndex = 0;
  6087. this.ggSpid = "";
  6088. this.spid = 0;
  6089. this.ui = ui;
  6090. this.index = index;
  6091. this.initData();
  6092. }
  6093. initData() {
  6094. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6095. let data = cfgTable.daoJuData[this.index + 1];
  6096. this.ui.nameTxt.text = data.spbt;
  6097. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6098. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6099. this.ggSpid = data.ggSpid;
  6100. this.spid = data.spid;
  6101. let baseUrl = "asset/sound/ogg/";
  6102. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6103. }
  6104. gotoBuy() {
  6105. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6106. if (userInfo != null) {
  6107. let token = userInfo.token;
  6108. let ggSpid = this.ggSpid;
  6109. let spid = this.spid;
  6110. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6111. console.log('zh:gotoBuy1 spid =' + spid);
  6112. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6113. return;
  6114. }
  6115. else {
  6116. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6117. }
  6118. }
  6119. gotoBuy1() {
  6120. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6121. let djItem = cfgTable.daoJuData[this.index + 1];
  6122. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6123. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6124. if (userInfo == null) {
  6125. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6126. return;
  6127. }
  6128. let reqData = xGame.httpMgr.getReqData();
  6129. let pd = JSON.parse(reqData);
  6130. pd.spItem = djItem;
  6131. reqData = JSON.stringify(pd);
  6132. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6133. try {
  6134. console.log('zh:buySp res = ' + JSON.stringify(res));
  6135. let code = res.code;
  6136. let msg = res.msg;
  6137. if (code == 401) {
  6138. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6139. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6140. return;
  6141. }
  6142. if (code == 200) {
  6143. xGame.uiMgr.Show(UIMsg, msg);
  6144. DataMgr.getUserZiChanInfo(false);
  6145. }
  6146. else {
  6147. xGame.uiMgr.Show(UIMsg, msg);
  6148. }
  6149. }
  6150. catch (error) {
  6151. console.log('error=' + error);
  6152. alert(error);
  6153. }
  6154. finally {
  6155. }
  6156. });
  6157. }
  6158. }
  6159. class UIShop extends UIBase {
  6160. constructor() {
  6161. super();
  6162. this.itemNums = 0;
  6163. this.itemNumsForDj = 0;
  6164. this.curType = "";
  6165. }
  6166. onConstructor() {
  6167. this.ui = ui_UIShop.createInstance();
  6168. this.contentPane = this.ui;
  6169. this.isEject = false;
  6170. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6171. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6172. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6173. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6174. this.addUIClick(this.ui, this.interuptSecretary);
  6175. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6176. this.ballRodArr = [];
  6177. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6178. this.ui.myNode.myList.numItems = this.itemNums;
  6179. this.loadDjdata_old();
  6180. }
  6181. loadDjdata_old() {
  6182. let fff = cfgTable.daoJuData;
  6183. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6184. this.daoJuArr = [];
  6185. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6186. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6187. }
  6188. getProductList() {
  6189. let reqData = xGame.httpMgr.getReqData();
  6190. let pd = JSON.parse(reqData);
  6191. pd.splx = "Consumable";
  6192. reqData = JSON.stringify(pd);
  6193. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6194. try {
  6195. let code = res.code;
  6196. let msg = res.msg;
  6197. if (code == 401) {
  6198. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6199. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6200. return;
  6201. }
  6202. if (code == 200) {
  6203. let data = res.data;
  6204. for (let index = 0; index < data.length; index++) {
  6205. let element = data[index];
  6206. cfgTable.daoJuData[element.spid] = element;
  6207. }
  6208. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6209. }
  6210. else {
  6211. xGame.uiMgr.Show(UIMsg, msg);
  6212. }
  6213. }
  6214. catch (error) {
  6215. console.log('error=' + error);
  6216. alert(error);
  6217. }
  6218. finally {
  6219. }
  6220. });
  6221. }
  6222. show(type) {
  6223. super.show();
  6224. this.curType = type == 0 ? "qiugan" : "daoju";
  6225. this.switchBtn("");
  6226. this.playSecretaryIdle();
  6227. this.updateBallRod();
  6228. this.setGlobalFont(this.ui);
  6229. }
  6230. test123() {
  6231. console.log('zh:test123 ');
  6232. }
  6233. switchBtn(type) {
  6234. console.log('zh:1111切換 sel type=' + type);
  6235. if (type == "") {
  6236. type = this.curType;
  6237. }
  6238. else {
  6239. if (this.curType == type) {
  6240. return;
  6241. }
  6242. else {
  6243. this.curType = type;
  6244. }
  6245. }
  6246. if (type == "qiugan") {
  6247. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6248. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6249. this.ui.myNode.c1.selectedIndex = 0;
  6250. this.ui.myNode.myList.visible = true;
  6251. this.ui.myNode.djList.visible = false;
  6252. }
  6253. else {
  6254. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6255. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6256. this.ui.myNode.c1.selectedIndex = 1;
  6257. this.ui.myNode.myList.visible = false;
  6258. this.ui.myNode.djList.visible = true;
  6259. }
  6260. }
  6261. updateBallRod() {
  6262. for (let index = 0; index < this.ballRodArr.length; index++) {
  6263. this.ballRodArr[index].updateSelf();
  6264. }
  6265. }
  6266. renderBallRod(sort, obj) {
  6267. let index = this.getIndexBySort(sort + 1) - 1;
  6268. let ballRod = new BallRodDisplay(obj, index);
  6269. this.ballRodArr.push(ballRod);
  6270. }
  6271. renderDaoJu(idx, obj) {
  6272. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6273. let b = new DaoJuDisplay(obj, index);
  6274. this.daoJuArr.push(b);
  6275. }
  6276. getIndexBySort(sort) {
  6277. let object = cfgTable.ballrodData;
  6278. for (const key in object) {
  6279. if (object[key].sort == sort) {
  6280. return parseInt(key);
  6281. }
  6282. }
  6283. }
  6284. getIndexBySortForDj(idx) {
  6285. let object = cfgTable.daoJuData;
  6286. for (const key in object) {
  6287. if (object[key].idx == idx) {
  6288. return parseInt(key);
  6289. }
  6290. }
  6291. }
  6292. playSecretaryIdle() {
  6293. let parent = this.ui.secretary.displayObject;
  6294. parent.destroyChildren();
  6295. let xx = this.ui.secretary.width / 2;
  6296. let yy = this.ui.secretary.height;
  6297. let scale = xGame.common.getSecretaryScale();
  6298. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6299. xGame.common.secretary.play(data, 0, true, parent);
  6300. }
  6301. interuptSecretary() {
  6302. Laya.timer.clearAll(this);
  6303. this.playSecretaryRandomSound();
  6304. }
  6305. playSecretaryRandomSound() {
  6306. if (this.isHide)
  6307. return;
  6308. let time = xGame.common.randomNum(45000, 60000);
  6309. Laya.timer.once(time, this, () => {
  6310. if (this.isHide)
  6311. return;
  6312. let index = xGame.common.randomNum(4, 7);
  6313. xGame.soundMgr.playSound("s_main0" + index);
  6314. let words = 1;
  6315. switch (index) {
  6316. case 4:
  6317. words = 5;
  6318. break;
  6319. case 5:
  6320. words = 3;
  6321. break;
  6322. case 6:
  6323. words = 6;
  6324. break;
  6325. case 7:
  6326. words = 7;
  6327. break;
  6328. default:
  6329. break;
  6330. }
  6331. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6332. this.playSecretaryRandomSound();
  6333. });
  6334. }
  6335. closeSelf() {
  6336. this.hide();
  6337. }
  6338. }
  6339. UIShop.uiName = "UIShop";
  6340. class ui_UISign extends fgui.GComponent {
  6341. static createInstance() {
  6342. return (fgui.UIPackage.createObject("game", "UISign"));
  6343. }
  6344. onConstruct() {
  6345. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6346. this.n6 = (this.getChild("n6"));
  6347. this.closeNode = (this.getChild("closeNode"));
  6348. this.myNode = (this.getChild("myNode"));
  6349. this.moneyNode = (this.getChild("moneyNode"));
  6350. this.secretary = (this.getChild("secretary"));
  6351. this.talkNode = (this.getChild("talkNode"));
  6352. this.tripleBtn = (this.getChild("tripleBtn"));
  6353. this.normalBtn = (this.getChild("normalBtn"));
  6354. this.tipsNode = (this.getChild("tipsNode"));
  6355. this.againBtn = (this.getChild("againBtn"));
  6356. this.t0 = this.getTransition("t0");
  6357. }
  6358. }
  6359. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6360. class SignMax {
  6361. constructor(ui) {
  6362. this.ui = ui;
  6363. }
  6364. updateSelf(index, sameDay, curDayIndex) {
  6365. let data = cfgTable.signData[index + 1];
  6366. this.ui.titleTxt.text = data.title;
  6367. let arr1 = data.award[0].split('-');
  6368. let arr2 = data.award[1].split('-');
  6369. let num1 = parseInt(arr1[1]);
  6370. let num2 = parseInt(arr2[1]);
  6371. this.ui.numTxt1.text = num1 + "";
  6372. this.ui.numTxt2.text = num2 + "";
  6373. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6374. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6375. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6376. this.ui.numTxt1.visible = false;
  6377. }
  6378. else {
  6379. this.ui.numTxt1.visible = true;
  6380. }
  6381. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6382. this.ui.numTxt2.visible = false;
  6383. }
  6384. else {
  6385. this.ui.numTxt2.visible = true;
  6386. }
  6387. if (index < curDayIndex) {
  6388. this.ui.c1.selectedIndex = 1;
  6389. }
  6390. else if (index == curDayIndex) {
  6391. if (sameDay) {
  6392. this.ui.c1.selectedIndex = 2;
  6393. }
  6394. else {
  6395. this.ui.c1.selectedIndex = 2;
  6396. }
  6397. }
  6398. else {
  6399. this.ui.c1.selectedIndex = 0;
  6400. }
  6401. }
  6402. }
  6403. class SignNormal {
  6404. constructor(ui) {
  6405. this.ui = ui;
  6406. }
  6407. updateSelf(index, sameDay, curDayIndex) {
  6408. let data = cfgTable.signData[index + 1];
  6409. this.ui.titleTxt.text = data.title;
  6410. let arr = data.award[0].split('-');
  6411. let type = parseInt(arr[0]);
  6412. let num = parseInt(arr[1]);
  6413. this.ui.numTxt.text = num + "";
  6414. if (type > 2) {
  6415. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6416. this.ui.myIcon.rotation = 0;
  6417. }
  6418. else {
  6419. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6420. this.ui.myIcon.rotation = 0;
  6421. }
  6422. if (xGame.common.signAwardContainsRod(data.award)) {
  6423. this.ui.numTxt.visible = false;
  6424. }
  6425. else {
  6426. this.ui.numTxt.visible = true;
  6427. }
  6428. if (index < curDayIndex) {
  6429. this.ui.c1.selectedIndex = 1;
  6430. }
  6431. else if (index == curDayIndex) {
  6432. if (sameDay) {
  6433. this.ui.c1.selectedIndex = 2;
  6434. }
  6435. else {
  6436. this.ui.c1.selectedIndex = 2;
  6437. }
  6438. }
  6439. else {
  6440. this.ui.c1.selectedIndex = 0;
  6441. }
  6442. }
  6443. }
  6444. class UISign extends UIBase {
  6445. constructor() {
  6446. super();
  6447. this.curDayIndex = 0;
  6448. this.starX = 0;
  6449. }
  6450. onConstructor() {
  6451. this.ui = ui_UISign.createInstance();
  6452. this.contentPane = this.ui;
  6453. this.isEject = false;
  6454. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6455. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6456. this.initSignItem();
  6457. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6458. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6459. }
  6460. show() {
  6461. super.show();
  6462. this.ui.t0.play();
  6463. this.playSecretaryIdle();
  6464. this.updateSign();
  6465. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6466. this.setGlobalFont(this.ui);
  6467. }
  6468. initSignItem() {
  6469. this.signArr = [];
  6470. for (let index = 0; index < 6; index++) {
  6471. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6472. this.signArr.push(temp);
  6473. }
  6474. this.signMax = new SignMax(this.ui.myNode.day7);
  6475. if (Moyu.isKs)
  6476. this.ui.closeNode.closeBtn.x += 100;
  6477. }
  6478. updateSign() {
  6479. let sameDay = xGame.common.judgeSameDay();
  6480. let max = 7;
  6481. this.curDayIndex = DataMgr.getSignData();
  6482. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6483. this.curDayIndex = 0;
  6484. if (!sameDay) {
  6485. this.ui.normalBtn.visible = true;
  6486. this.ui.tipsNode.visible = false;
  6487. this.ui.againBtn.visible = false;
  6488. }
  6489. else {
  6490. this.ui.normalBtn.visible = false;
  6491. let again = DataMgr.getExtraSign();
  6492. let isCurrency = false;
  6493. let index = this.curDayIndex;
  6494. if (index == 0)
  6495. index = 7;
  6496. let award = cfgTable.signData[index].award;
  6497. let num = award[0].split("-")[0];
  6498. if (num == "1" || num == "2")
  6499. isCurrency = true;
  6500. let showAgain = again == 0 && isCurrency;
  6501. this.ui.againBtn.visible = showAgain;
  6502. this.ui.tipsNode.visible = !showAgain;
  6503. }
  6504. for (let index = 0; index < this.signArr.length; index++) {
  6505. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6506. }
  6507. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6508. }
  6509. playSecretaryIdle() {
  6510. let parent = this.ui.secretary.displayObject;
  6511. parent.destroyChildren();
  6512. let xx = this.ui.secretary.width / 2;
  6513. let yy = this.ui.secretary.height;
  6514. let scale = xGame.common.getSecretaryScale();
  6515. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6516. xGame.common.secretary.play(data, 0, true, parent);
  6517. }
  6518. closeSelf() {
  6519. this.hide();
  6520. }
  6521. normalGetAward() {
  6522. let sameDay = xGame.common.judgeSameDay();
  6523. if (!sameDay) {
  6524. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6525. let temp;
  6526. let type;
  6527. let num;
  6528. let arr = [];
  6529. for (let index = 0; index < award.length; index++) {
  6530. temp = award[index].split("-");
  6531. type = parseInt(temp[0]);
  6532. num = parseInt(temp[1]);
  6533. let awardType = new AwardType();
  6534. awardType.num = num;
  6535. awardType.type = type;
  6536. arr.push(awardType);
  6537. }
  6538. xGame.common.getAward(arr, (watchVideo) => {
  6539. this.curDayIndex++;
  6540. if (this.curDayIndex > 7)
  6541. this.curDayIndex = 0;
  6542. DataMgr.setSignData(this.curDayIndex);
  6543. this.updateSignData2Server(this.curDayIndex);
  6544. DataMgr.setSignTime(new Date().getTime());
  6545. if (watchVideo) {
  6546. DataMgr.setExtraSign(1);
  6547. Moyu.sendDataEvent("signIn1");
  6548. }
  6549. this.updateSign();
  6550. });
  6551. }
  6552. }
  6553. againGetAward() {
  6554. Moyu.sendDataEvent("signIn2");
  6555. console.log('zh:qjff_AD_for_uisign');
  6556. if (Laya.Browser.onAndroid) {
  6557. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6558. if (!boo) {
  6559. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6560. return;
  6561. }
  6562. }
  6563. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6564. }
  6565. else {
  6566. console.log('zh:AD 失败,直接发放奖励');
  6567. this.qjff_AD_for_uisign();
  6568. }
  6569. }
  6570. qjff_AD_for_uisign() {
  6571. let index = this.curDayIndex;
  6572. if (index == 0)
  6573. index = 7;
  6574. let award = cfgTable.signData[index].award;
  6575. let temp;
  6576. let type;
  6577. let num;
  6578. for (let index = 0; index < award.length; index++) {
  6579. temp = award[index].split("-");
  6580. type = parseInt(temp[0]);
  6581. num = parseInt(temp[1]) * 3;
  6582. xGame.common.playObjFlyAnim(num, type);
  6583. }
  6584. DataMgr.setExtraSign(1);
  6585. this.updateSign();
  6586. }
  6587. updateSignData2Server(day) {
  6588. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6589. if (userInfo == null) {
  6590. return;
  6591. }
  6592. let reqData = xGame.httpMgr.getReqData();
  6593. let pd = JSON.parse(reqData);
  6594. pd.signData = day;
  6595. reqData = JSON.stringify(pd);
  6596. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6597. try {
  6598. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6599. let code = res.code;
  6600. let msg = res.msg;
  6601. if (code == 401) {
  6602. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6603. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6604. return;
  6605. }
  6606. if (code == 200) {
  6607. let data = res.data;
  6608. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6609. }
  6610. else {
  6611. xGame.uiMgr.Show(UIMsg, msg);
  6612. }
  6613. }
  6614. catch (error) {
  6615. console.log('error=' + error);
  6616. alert(error);
  6617. }
  6618. finally {
  6619. }
  6620. });
  6621. }
  6622. }
  6623. UISign.uiName = "UISign";
  6624. class ui_UISkill extends fgui.GComponent {
  6625. static createInstance() {
  6626. return (fgui.UIPackage.createObject("game", "UISkill"));
  6627. }
  6628. onConstruct() {
  6629. this.n48 = (this.getChild("n48"));
  6630. this.n0 = (this.getChild("n0"));
  6631. this.secretary = (this.getChild("secretary"));
  6632. this.talkNode = (this.getChild("talkNode"));
  6633. this.closeNode = (this.getChild("closeNode"));
  6634. this.moneyNode = (this.getChild("moneyNode"));
  6635. this.skillNode = (this.getChild("skillNode"));
  6636. this.guideNode = (this.getChild("guideNode"));
  6637. }
  6638. }
  6639. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6640. class SkillDisplay {
  6641. constructor(ui, data, uiIndex) {
  6642. this.starX = 0;
  6643. this.starY = 0;
  6644. this.index = 0;
  6645. this.ui = ui;
  6646. this.data = data;
  6647. this.index = uiIndex;
  6648. this.initSelf();
  6649. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6650. }
  6651. initSelf() {
  6652. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6653. this.ui.nameTxt.text = this.data.name;
  6654. this.ui.describeTxt.text = this.data.describe;
  6655. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6656. this.ui.startBtn.onClick(this, this.startGame);
  6657. this.updateSelf();
  6658. }
  6659. updateSelf() {
  6660. this.checkTry();
  6661. let level = DataMgr.getBigSkillByIndex(this.index);
  6662. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6663. }
  6664. checkTry() {
  6665. let index = this.index;
  6666. let level = DataMgr.getBigSkillByIndex(index);
  6667. if (level == null) {
  6668. DataMgr.setBigSkill(index, 1, false);
  6669. level = 1;
  6670. }
  6671. this.ui.levelTxt.text = "LV." + level;
  6672. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6673. this.ui.tryNode.visible = true;
  6674. else
  6675. this.ui.tryNode.visible = false;
  6676. }
  6677. clickAddLevel() {
  6678. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6679. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6680. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6681. if (Laya.Browser.onAndroid) {
  6682. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6683. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6684. }
  6685. else {
  6686. console.log('zh:AD 失败,直接发放奖励');
  6687. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6688. }
  6689. }
  6690. else {
  6691. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6692. }
  6693. }
  6694. qjff_AD_for_skilldisplay_clickAddLevel() {
  6695. DataMgr.setBigSkill(this.data.index, 1);
  6696. this.updateSelf();
  6697. xGame.common.upSkillLevel = true;
  6698. }
  6699. startGame() {
  6700. console.log('zh:rod skill startgame');
  6701. if (this.data.index == 3) {
  6702. alert('Coming soon!');
  6703. return;
  6704. }
  6705. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6706. let needCoin = xGame.common.bigMoveNeedCoin;
  6707. xGame.common.passAwardCoin = 2000;
  6708. let guide = DataMgr.getSkillGuide();
  6709. console.log('zh:startGame guide=' + guide);
  6710. xGame.common.temSelfLevel = 0;
  6711. if (guide == 0) {
  6712. needCoin = 0;
  6713. xGame.common.temSelfLevel = 100;
  6714. }
  6715. if (DataMgr.coinEnough(needCoin)) {
  6716. DataMgr.setCoin(-needCoin);
  6717. xGame.common.curPlayerSkillType = this.index;
  6718. if (guide == 0)
  6719. xGame.common.curPlayerSkillType = 0;
  6720. console.log('zh: skilldisplay 1');
  6721. xGame.uiMgr.Show(UIGame);
  6722. xGame.uiMgr.Hide(UIMain);
  6723. xGame.uiMgr.Show(UIMatching, () => {
  6724. xGame.common.gameUI.ui.alpha = 1;
  6725. xGame.common.gameUI.startGame();
  6726. xGame.uiMgr.Hide(UISkill);
  6727. });
  6728. this.logEventForRod_start();
  6729. }
  6730. else {
  6731. console.log('zh: skilldisplay 2');
  6732. xGame.uiMgr.Show(UIAddProp, 0);
  6733. Moyu.sendDataEvent("AddCoinVideo");
  6734. }
  6735. }
  6736. logEventForRod_start() {
  6737. let gfmsIdx = xGame.common.curPlayerSkillType;
  6738. console.log('zh:选择的技能=' + gfmsIdx);
  6739. let gfmc = 'Skyfall Shot';
  6740. if (gfmsIdx == 0) {
  6741. gfmc = 'Skyfall Shot';
  6742. }
  6743. if (gfmsIdx == 1) {
  6744. gfmc = 'Surging break';
  6745. }
  6746. if (gfmsIdx == 2) {
  6747. gfmc = 'Frost Lock';
  6748. }
  6749. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6750. let jsonStr = {
  6751. "count": 0,
  6752. "name": gfmc
  6753. };
  6754. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6755. const d = LocalStorageManager.getItem(keyStr);
  6756. jsonStr.count = d.count + 1;
  6757. LocalStorageManager.setItem(keyStr, jsonStr);
  6758. }
  6759. else {
  6760. LocalStorageManager.setItem(keyStr, jsonStr);
  6761. }
  6762. const reqStr = JSON.stringify(jsonStr);
  6763. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6764. }
  6765. }
  6766. class UISkill extends UIBase {
  6767. constructor() {
  6768. super();
  6769. this.skillData = [];
  6770. }
  6771. onConstructor() {
  6772. this.ui = ui_UISkill.createInstance();
  6773. this.contentPane = this.ui;
  6774. this.isEject = false;
  6775. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6776. this.initSkillData();
  6777. console.log('zh:aaaaaa1111111111');
  6778. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6779. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6780. console.log('zh:aaaaaa22222222');
  6781. this.displayList = [];
  6782. this.ui.skillNode.skillList.numItems = 3;
  6783. this.addUIClick(this.ui, this.interuptSecretary);
  6784. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6785. this.ui.talkNode.visible = false;
  6786. if (Moyu.isKs)
  6787. this.ui.closeNode.closeBtn.x += 100;
  6788. }
  6789. show() {
  6790. super.show();
  6791. this.playSecretaryIdle();
  6792. this.moneyNode.ui.c1.selectedIndex = 1;
  6793. Laya.timer.clearAll(this);
  6794. xGame.soundMgr.playSound("s_start");
  6795. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6796. let guide = 0;
  6797. if (DataMgr.getGuideDefaultModel() === 2) {
  6798. guide = DataMgr.getSkillGuide();
  6799. this.ui.guideNode.visible = guide == 0;
  6800. }
  6801. let item = this.getSkillItemByUIIndex(0);
  6802. if (guide == 0) {
  6803. item.ui.c1.selectedIndex = 1;
  6804. }
  6805. else {
  6806. item.ui.c1.selectedIndex = 0;
  6807. }
  6808. if (DataMgr.getGuideDefaultModel() === 2) {
  6809. this.ui.guideNode.guideBtn.visible = guide == 0;
  6810. }
  6811. for (let index = 0; index < this.displayList.length; index++) {
  6812. this.displayList[index].checkTry();
  6813. }
  6814. this.setGlobalFont(this.ui);
  6815. }
  6816. getSkillItemByUIIndex(cur) {
  6817. for (let index = 0; index < this.displayList.length; index++) {
  6818. if (this.displayList[index].index == cur) {
  6819. return this.displayList[index];
  6820. }
  6821. }
  6822. }
  6823. enterGuideLevel() {
  6824. let item = this.getSkillItemByUIIndex(0);
  6825. item.startGame();
  6826. if (DataMgr.getNewUser())
  6827. Moyu.sendDataEvent("gameStart1");
  6828. }
  6829. initSkillData() {
  6830. this.skillData = [];
  6831. let nameList = xGame.common.skillNameList;
  6832. let iconList = xGame.common.skillIconList;
  6833. let describeList = [
  6834. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6835. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6836. "The power of frost descends—freezing the flow and taking full control of the game!"
  6837. ];
  6838. console.log('zh:initSkillData 111111111');
  6839. let data;
  6840. for (let index = 0; index < nameList.length; index++) {
  6841. data = {};
  6842. data.name = nameList[index];
  6843. data.icon = iconList[index];
  6844. data.describe = describeList[index];
  6845. data.index = index;
  6846. this.skillData.push(data);
  6847. }
  6848. }
  6849. updateSkillItem(index, target) {
  6850. if (this.displayList[index] == null) {
  6851. let uiIndex;
  6852. switch (index) {
  6853. case 0:
  6854. uiIndex = 1;
  6855. break;
  6856. case 1:
  6857. uiIndex = 0;
  6858. break;
  6859. case 2:
  6860. uiIndex = 2;
  6861. break;
  6862. case 3:
  6863. uiIndex = 3;
  6864. break;
  6865. default:
  6866. break;
  6867. }
  6868. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6869. this.displayList.push(temp);
  6870. }
  6871. }
  6872. playSecretaryIdle() {
  6873. let parent = this.ui.secretary.displayObject;
  6874. parent.destroyChildren();
  6875. let xx = this.ui.secretary.width / 2;
  6876. let yy = this.ui.secretary.height;
  6877. let scale = xGame.common.getSecretaryScale();
  6878. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6879. xGame.common.secretary.play(data, 0, true, parent);
  6880. }
  6881. returnUIMain() {
  6882. this.hide();
  6883. xGame.common.stopGirlPop(this.ui.talkNode);
  6884. xGame.uiMgr.Show(UIMain);
  6885. }
  6886. interuptSecretary() {
  6887. Laya.timer.clearAll(this);
  6888. this.playSecretaryRandomSound();
  6889. }
  6890. playSecretaryRandomSound() {
  6891. if (this.isHide)
  6892. return;
  6893. let time = xGame.common.randomNum(45000, 60000);
  6894. Laya.timer.once(time, this, () => {
  6895. if (this.isHide)
  6896. return;
  6897. let index = xGame.common.randomNum(4, 7);
  6898. xGame.soundMgr.playSound("s_main0" + index);
  6899. let words = 1;
  6900. switch (index) {
  6901. case 4:
  6902. words = 5;
  6903. break;
  6904. case 5:
  6905. words = 3;
  6906. break;
  6907. case 6:
  6908. words = 6;
  6909. break;
  6910. case 7:
  6911. words = 7;
  6912. break;
  6913. default:
  6914. break;
  6915. }
  6916. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6917. this.playSecretaryRandomSound();
  6918. });
  6919. }
  6920. }
  6921. UISkill.uiName = "UISkill";
  6922. class ui_UIModeSelection extends fgui.GComponent {
  6923. static createInstance() {
  6924. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6925. }
  6926. onConstruct() {
  6927. this.n19 = (this.getChild("n19"));
  6928. this.closeBtn = (this.getChild("closeBtn"));
  6929. this.myNode = (this.getChild("myNode"));
  6930. this.t0 = this.getTransition("t0");
  6931. }
  6932. }
  6933. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6934. class UIModeSelection extends UIBase {
  6935. constructor() {
  6936. super();
  6937. }
  6938. onConstructor() {
  6939. this.ui = ui_UIModeSelection.createInstance();
  6940. this.contentPane = this.ui;
  6941. this.isEject = false;
  6942. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6943. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6944. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6945. this.addUIClick(this.ui.closeBtn, this.hide);
  6946. this.peopleArr = [65, 990, 580];
  6947. this.peopleOffest = [5, 10, 10];
  6948. }
  6949. show(callback) {
  6950. this.updateSelf();
  6951. super.show();
  6952. this.ui.t0.play();
  6953. this.callback = callback;
  6954. this.setGlobalFont(this.ui);
  6955. }
  6956. updateSelf() {
  6957. let cfg = cfgTable.modeselectData;
  6958. for (let index = 1; index <= 3; index++) {
  6959. let node = this.ui.myNode["type" + index];
  6960. node.need.text = cfg[index].need;
  6961. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6962. node.peopleTxt.text = this.getRandPeople(index - 1);
  6963. }
  6964. }
  6965. enterGame(type) {
  6966. console.log('zh: 进入经典模式 type: ' + type);
  6967. xGame.common.classicRoomType = type;
  6968. let cfg = cfgTable.modeselectData[type];
  6969. let need = cfg.need;
  6970. xGame.common.passAwardCoin = cfg.award;
  6971. if (DataMgr.coinEnough(need)) {
  6972. DataMgr.setCoin(-need);
  6973. this.ui.myNode["type" + type].t0.play();
  6974. Laya.timer.once(200, this, () => {
  6975. this.callback && this.callback();
  6976. });
  6977. this.logEventForClassic_start();
  6978. }
  6979. else {
  6980. Moyu.sendDataEvent("AddCoinVideo");
  6981. xGame.uiMgr.Show(UIAddProp, 0);
  6982. }
  6983. }
  6984. getRandPeople(index) {
  6985. let rand = this.peopleOffest[index];
  6986. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6987. }
  6988. logEventForClassic_start() {
  6989. let rtype = xGame.common.classicRoomType;
  6990. let msmc = '';
  6991. if (rtype == 1) {
  6992. msmc = 'beginner';
  6993. }
  6994. if (rtype == 2) {
  6995. msmc = 'expert';
  6996. }
  6997. if (rtype == 3) {
  6998. msmc = 'master';
  6999. }
  7000. let keyStr = 'sjmd_classic_start_' + rtype;
  7001. let jsonStr = {
  7002. "difficulty": msmc,
  7003. "classic_count": 1,
  7004. "difficulty_count": 1
  7005. };
  7006. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7007. const d = LocalStorageManager.getItem(keyStr);
  7008. jsonStr.classic_count = d.classic_count + 1;
  7009. jsonStr.difficulty_count = d.difficulty_count + 1;
  7010. LocalStorageManager.setItem(keyStr, jsonStr);
  7011. }
  7012. else {
  7013. LocalStorageManager.setItem(keyStr, jsonStr);
  7014. }
  7015. const reqStr = JSON.stringify(jsonStr);
  7016. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  7017. }
  7018. }
  7019. UIModeSelection.uiName = "UIModeSelection";
  7020. class ui_UIReg extends fgui.GComponent {
  7021. static createInstance() {
  7022. return (fgui.UIPackage.createObject("game", "UIReg"));
  7023. }
  7024. onConstruct() {
  7025. this.n38 = (this.getChild("n38"));
  7026. this.n51 = (this.getChild("n51"));
  7027. this.closeBtn = (this.getChild("closeBtn"));
  7028. this.lab_tip = (this.getChild("lab_tip"));
  7029. this.txt_ua = (this.getChild("txt_ua"));
  7030. this.txt_up1 = (this.getChild("txt_up1"));
  7031. this.txt_up2 = (this.getChild("txt_up2"));
  7032. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  7033. this.btn_reg = (this.getChild("btn_reg"));
  7034. }
  7035. }
  7036. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  7037. class ui_UILogin extends fgui.GComponent {
  7038. static createInstance() {
  7039. return (fgui.UIPackage.createObject("game", "UILogin"));
  7040. }
  7041. onConstruct() {
  7042. this.c1 = this.getController("c1");
  7043. this.n18 = (this.getChild("n18"));
  7044. this.n21 = (this.getChild("n21"));
  7045. this.closeBtn = (this.getChild("closeBtn"));
  7046. this.txt_ua = (this.getChild("txt_ua"));
  7047. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  7048. this.btn_login = (this.getChild("btn_login"));
  7049. this.txt_up = (this.getChild("txt_up"));
  7050. }
  7051. }
  7052. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  7053. class UILogin extends UIBase {
  7054. constructor() {
  7055. super();
  7056. this.fontStr = 'big-john-woff2-2';
  7057. try {
  7058. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7059. console.log("zh: constructor加载arial字体成功");
  7060. }
  7061. catch (error) {
  7062. console.log("zh: constructor加载arial字体失败");
  7063. }
  7064. }
  7065. onFontLoaded() {
  7066. try {
  7067. Laya.Text.defaultFont = this.fontStr;
  7068. this.ui.txt_ua.font = this.fontStr;
  7069. this.ui.txt_up.font = this.fontStr;
  7070. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7071. }
  7072. catch (error) {
  7073. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7074. }
  7075. }
  7076. onConstructor() {
  7077. this.ui = ui_UILogin.createInstance();
  7078. this.contentPane = this.ui;
  7079. this.isEject = false;
  7080. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7081. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  7082. this.addUIClick(this.ui.btn_login, this.userLogin);
  7083. }
  7084. show() {
  7085. super.show();
  7086. this.x = (Laya.stage.width - this.width) / 2;
  7087. this.y = (Laya.stage.height - this.height) / 2;
  7088. this.onFontLoaded();
  7089. }
  7090. closeSelf() {
  7091. this.hide();
  7092. }
  7093. userLogin() {
  7094. let ua = this.ui.txt_ua.text;
  7095. let up = this.ui.txt_up.text;
  7096. console.log('zh:ua font' + this.ui.txt_ua.font);
  7097. if (ua && up) {
  7098. let reqData = JSON.stringify({
  7099. username: ua.trim(),
  7100. password: up.trim(),
  7101. fromMark: 'app_game'
  7102. });
  7103. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7104. try {
  7105. console.log('zh:res = ' + JSON.stringify(res));
  7106. let code = res.code;
  7107. let msg = res.msg;
  7108. if (code == 200) {
  7109. let keyStr = keyForLoginInfo;
  7110. let jsonStr = {
  7111. "username": res.username,
  7112. "token": res.token,
  7113. "buySpids": { 1: false, 7: false }
  7114. };
  7115. LocalStorageManager.setItem(keyStr, jsonStr);
  7116. let myu = Moyu.getUserInfo();
  7117. console.log('zh:myu = ' + JSON.stringify(myu));
  7118. DataMgr.updateUserNickName(res.username);
  7119. Moyu.updateUserInfo(res.username);
  7120. xGame.uiMgr.Show(UIMsg, msg);
  7121. DataMgr.loadUserSpOrderForAd();
  7122. DataMgr.getUserZiChanInfo(false);
  7123. xGame.eventMgr.event(LOGIN_IN);
  7124. this.closeSelf();
  7125. }
  7126. else {
  7127. xGame.uiMgr.Show(UIMsg, msg);
  7128. }
  7129. }
  7130. catch (error) {
  7131. console.log('error=' + error);
  7132. alert(error);
  7133. }
  7134. finally {
  7135. }
  7136. });
  7137. }
  7138. else {
  7139. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7140. }
  7141. }
  7142. gotoRegPage() {
  7143. this.closeSelf();
  7144. xGame.uiMgr.Show(UIReg);
  7145. }
  7146. }
  7147. UILogin.uiName = "UILogin";
  7148. class UIReg extends UIBase {
  7149. constructor() {
  7150. super();
  7151. this.fontStr = 'big-john-woff2-2';
  7152. try {
  7153. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7154. console.log("zh: constructor加载arial字体成功");
  7155. }
  7156. catch (error) {
  7157. console.log("zh: constructor加载arial字体失败");
  7158. }
  7159. }
  7160. onFontLoaded() {
  7161. try {
  7162. Laya.Text.defaultFont = this.fontStr;
  7163. this.ui.txt_ua.font = this.fontStr;
  7164. this.ui.txt_up1.font = this.fontStr;
  7165. this.ui.txt_up2.font = this.fontStr;
  7166. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7167. }
  7168. catch (error) {
  7169. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7170. }
  7171. }
  7172. onConstructor() {
  7173. this.ui = ui_UIReg.createInstance();
  7174. this.contentPane = this.ui;
  7175. this.isEject = false;
  7176. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7177. this.addUIClick(this.ui.btn_reg, this.regUser);
  7178. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7179. }
  7180. show() {
  7181. super.show();
  7182. this.x = (Laya.stage.width - this.width) / 2;
  7183. this.y = (Laya.stage.height - this.height) / 2;
  7184. this.onFontLoaded();
  7185. }
  7186. closeSelf() {
  7187. this.hide();
  7188. }
  7189. regUser() {
  7190. this.ui.lab_tip.visible = false;
  7191. let ua = this.ui.txt_ua.text;
  7192. let up1 = this.ui.txt_up1.text;
  7193. let up2 = this.ui.txt_up2.text;
  7194. if (ua && up1 && up2 && up1 == up2) {
  7195. let reqData = JSON.stringify({
  7196. username: ua.trim(),
  7197. password: up1.trim(),
  7198. fromMark: 'app_game'
  7199. });
  7200. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7201. try {
  7202. console.log('zh:res = ' + JSON.stringify(res));
  7203. let code = res.code;
  7204. let msg = res.msg;
  7205. xGame.uiMgr.Show(UIMsg, msg);
  7206. if (code == 200) {
  7207. this.ui.lab_tip.color = "#FFFFFF";
  7208. xGame.uiMgr.Show(UIMsg, msg);
  7209. this.closeSelf();
  7210. }
  7211. else {
  7212. this.ui.lab_tip.color = "#FF0000";
  7213. xGame.uiMgr.Show(UIMsg, msg);
  7214. }
  7215. }
  7216. catch (error) {
  7217. console.log('error=' + error);
  7218. alert(error);
  7219. }
  7220. finally {
  7221. }
  7222. });
  7223. }
  7224. else {
  7225. if (up1 != up2) {
  7226. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7227. }
  7228. else {
  7229. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7230. }
  7231. }
  7232. }
  7233. gotoLogin() {
  7234. this.closeSelf();
  7235. xGame.uiMgr.Show(UILogin);
  7236. }
  7237. }
  7238. UIReg.uiName = "UIReg";
  7239. class ui_UIGetAward extends fgui.GComponent {
  7240. static createInstance() {
  7241. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7242. }
  7243. onConstruct() {
  7244. this.n4 = (this.getChild("n4"));
  7245. this.n0 = (this.getChild("n0"));
  7246. this.myList = (this.getChild("myList"));
  7247. this.n1 = (this.getChild("n1"));
  7248. this.eftNode = (this.getChild("eftNode"));
  7249. this.btnNode = (this.getChild("btnNode"));
  7250. this.t0 = this.getTransition("t0");
  7251. }
  7252. }
  7253. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7254. class UIGetAward extends UIBase {
  7255. constructor() {
  7256. super();
  7257. this.showTriple = true;
  7258. }
  7259. onConstructor() {
  7260. this.ui = ui_UIGetAward.createInstance();
  7261. this.contentPane = this.ui;
  7262. this.isEject = false;
  7263. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7264. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7265. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7266. }
  7267. show(arr, showTriple, callback) {
  7268. super.show();
  7269. this.ui.t0.play();
  7270. this.ui.eftNode.visible = true;
  7271. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7272. this.ui.eftNode.visible = false;
  7273. }), 1, 0, 0, 0.9);
  7274. this.awardArr = arr;
  7275. this.showTriple = showTriple;
  7276. this.callback = callback;
  7277. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7278. this.ui.myList.numItems = arr.length;
  7279. xGame.soundMgr.playSound("getaward");
  7280. this.setGlobalFont(this.ui);
  7281. }
  7282. updateSelf(index, obj) {
  7283. let temp = this.awardArr[index];
  7284. let icon = this.getIcon(temp.type);
  7285. let str = icon;
  7286. if (temp.type > 2) {
  7287. str = "s" + icon;
  7288. }
  7289. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7290. obj.myIcon.rotation = 0;
  7291. obj.numTxt.text = temp.num + "";
  7292. obj.numTxt.visible = temp.type > 2 ? false : true;
  7293. obj.nameTxt.text = this.getNameStr(temp.type);
  7294. }
  7295. renderItem(index, obj) {
  7296. this.updateSelf(index, obj);
  7297. }
  7298. tripleGetAward() {
  7299. console.log('zh:qjff_AD_for_uigetAward');
  7300. if (Laya.Browser.onAndroid) {
  7301. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7302. if (!boo) {
  7303. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7304. return;
  7305. }
  7306. }
  7307. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7308. }
  7309. else {
  7310. console.log('zh:AD 失败,直接发放奖励');
  7311. this.qjff_AD_for_uigetAward();
  7312. }
  7313. }
  7314. qjff_AD_for_uigetAward() {
  7315. this.getAward(3);
  7316. }
  7317. normalGetAward() {
  7318. if (PlatMgr.isMisVideo())
  7319. this.tripleGetAward();
  7320. else
  7321. this.getAward();
  7322. }
  7323. getAward(times = 1) {
  7324. this.hide();
  7325. for (let index = 0; index < this.awardArr.length; index++) {
  7326. this.awardArr[index].num *= times;
  7327. }
  7328. this.callback && this.callback(times != 1);
  7329. }
  7330. getIcon(type) {
  7331. switch (type) {
  7332. case Prop.diamond:
  7333. return "ty_zs";
  7334. case Prop.coin:
  7335. return "ty_jb";
  7336. case Prop.gan1:
  7337. return "qg1";
  7338. case Prop.gan2:
  7339. return "qg2";
  7340. case Prop.gan3:
  7341. return "qg3";
  7342. case Prop.gan4:
  7343. return "qg4";
  7344. default:
  7345. break;
  7346. }
  7347. }
  7348. getNameStr(type) {
  7349. switch (type) {
  7350. case Prop.diamond:
  7351. return "Diamond";
  7352. case Prop.coin:
  7353. return "Coins";
  7354. case Prop.gan1:
  7355. case Prop.gan2:
  7356. case Prop.gan3:
  7357. case Prop.gan4:
  7358. return cfgTable.ballrodData[type - 1].name;
  7359. default:
  7360. break;
  7361. }
  7362. }
  7363. }
  7364. UIGetAward.uiName = "UIGetAward";
  7365. class ui_UIRepentProp extends fgui.GComponent {
  7366. static createInstance() {
  7367. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7368. }
  7369. onConstruct() {
  7370. this.c1 = this.getController("c1");
  7371. this.n11 = (this.getChild("n11"));
  7372. this.regretNode = (this.getChild("regretNode"));
  7373. this.helpLineNode = (this.getChild("helpLineNode"));
  7374. this.t0 = this.getTransition("t0");
  7375. }
  7376. }
  7377. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7378. class UIRepentProp extends UIBase {
  7379. constructor() {
  7380. super();
  7381. this.viewType = 0;
  7382. this.regretType = 0;
  7383. }
  7384. onConstructor() {
  7385. this.ui = ui_UIRepentProp.createInstance();
  7386. this.contentPane = this.ui;
  7387. this.isEject = false;
  7388. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7389. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7390. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7391. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7392. }
  7393. show(viewType, regretType, callback) {
  7394. PlatMgr.showInsert(true);
  7395. this.viewType = viewType;
  7396. this.regretType = regretType;
  7397. this.callback = callback;
  7398. super.show();
  7399. this.ui.t0.play();
  7400. this.ui.c1.selectedIndex = this.viewType;
  7401. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7402. if (this.viewType == 0) {
  7403. let guide = DataMgr.getGuideHelpLine();
  7404. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7405. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7406. }
  7407. xGame.common.gameMgr.gamePause = true;
  7408. this.setGlobalFont(this.ui);
  7409. }
  7410. hideSelf() {
  7411. xGame.common.gameMgr.gamePause = false;
  7412. this.callback && this.callback(false);
  7413. this.hide();
  7414. }
  7415. videoRegret() {
  7416. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7417. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7418. }
  7419. else {
  7420. console.log('zh:AD 失败,直接发放奖励');
  7421. this.qjff_AD_for_UIrepentProp_videoRegret();
  7422. }
  7423. }
  7424. qjff_AD_for_UIrepentProp_videoRegret() {
  7425. this.callback && this.callback(true);
  7426. this.hideSelf();
  7427. }
  7428. videoAddHelpLine() {
  7429. let guide = DataMgr.getGuideHelpLine();
  7430. if (guide == 0) {
  7431. this.callback && this.callback(true);
  7432. this.hideSelf();
  7433. DataMgr.setGuideHelpLine();
  7434. xGame.common.gameUI.ui.guideNode.visible = false;
  7435. }
  7436. else {
  7437. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7438. if (Laya.Browser.onAndroid) {
  7439. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7440. if (!boo) {
  7441. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7442. return;
  7443. }
  7444. }
  7445. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7446. }
  7447. else {
  7448. console.log('zh:AD 失败,直接发放奖励');
  7449. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7450. }
  7451. }
  7452. }
  7453. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7454. this.callback && this.callback(true);
  7455. this.hideSelf();
  7456. }
  7457. }
  7458. UIRepentProp.uiName = "UIRepentProp";
  7459. class ui_UITips extends fgui.GComponent {
  7460. static createInstance() {
  7461. return (fgui.UIPackage.createObject("game", "UITips"));
  7462. }
  7463. onConstruct() {
  7464. this.n0 = (this.getChild("n0"));
  7465. this.myNode = (this.getChild("myNode"));
  7466. this.t0 = this.getTransition("t0");
  7467. }
  7468. }
  7469. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7470. class UITips extends UIBase {
  7471. constructor() {
  7472. super();
  7473. this.type = 0;
  7474. }
  7475. onConstructor() {
  7476. this.ui = ui_UITips.createInstance();
  7477. this.contentPane = this.ui;
  7478. this.isEject = false;
  7479. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7480. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7481. }
  7482. show(tipsTxt, womanTxt, type) {
  7483. super.show();
  7484. this.ui.t0.play();
  7485. this.ui.myNode.tipsTxt.text = tipsTxt;
  7486. this.ui.myNode.womanTxt.text = womanTxt;
  7487. PlatMgr.showInsert(true);
  7488. this.ui.myNode.c1.selectedIndex = type;
  7489. this.type = type;
  7490. switch (this.type) {
  7491. case TipsType.exitGame:
  7492. xGame.common.gameMgr.gamePause = true;
  7493. break;
  7494. case TipsType.foul:
  7495. Laya.timer.once(200, this, () => {
  7496. if (xGame.common.gameMgr) {
  7497. xGame.common.gameMgr.gamePause = true;
  7498. }
  7499. else {
  7500. console.log("zh:gameMgr is null");
  7501. }
  7502. });
  7503. break;
  7504. default:
  7505. break;
  7506. }
  7507. this.setGlobalFont(this.ui);
  7508. }
  7509. clickLeftBtn() {
  7510. this.hide();
  7511. xGame.common.gameMgr.gamePause = false;
  7512. switch (this.type) {
  7513. case TipsType.exitGame:
  7514. break;
  7515. case TipsType.foul:
  7516. break;
  7517. default:
  7518. break;
  7519. }
  7520. }
  7521. clickRightBtn() {
  7522. this.hide();
  7523. switch (this.type) {
  7524. case TipsType.exitGame:
  7525. xGame.eventMgr.event(RESET_GAME);
  7526. xGame.uiMgr.Show(UIMain);
  7527. Moyu.recordEnd(this, null);
  7528. xGame.common.longHelpLine = false;
  7529. break;
  7530. case TipsType.foul:
  7531. if (xGame.common.gameMgr) {
  7532. xGame.common.gameMgr.gamePause = false;
  7533. }
  7534. Laya.timer.clearAll(this);
  7535. break;
  7536. default:
  7537. break;
  7538. }
  7539. }
  7540. }
  7541. UITips.uiName = "UITips";
  7542. class UIMain extends UIBase {
  7543. constructor() {
  7544. super();
  7545. this.firstEnter = true;
  7546. this.moni_click_count = 0;
  7547. }
  7548. nativeCallJs(msg) {
  7549. let t = msg;
  7550. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7551. switch (t) {
  7552. case 'qjff_chouJiang':
  7553. let dui = xGame.uiMgr.getUI(UIDraw);
  7554. dui.qjff_chouJiang();
  7555. break;
  7556. case 'qjff_AD_for_uisign':
  7557. let dui2 = xGame.uiMgr.getUI(UISign);
  7558. dui2.qjff_AD_for_uisign();
  7559. break;
  7560. case 'qjff_AD_for_uitry':
  7561. let dui3 = xGame.uiMgr.getUI(UITry);
  7562. dui3.qjff_AD_for_uitry();
  7563. break;
  7564. case 'qjff_AD_for_uipower':
  7565. let dui4 = xGame.uiMgr.getUI(UIPower);
  7566. dui4.qjff_AD_for_uipower();
  7567. break;
  7568. case 'qjff_AD_for_uigetAward':
  7569. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7570. dui5.qjff_AD_for_uigetAward();
  7571. break;
  7572. case 'qjff_AD_for_uiGameEnd':
  7573. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7574. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7575. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7576. break;
  7577. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7578. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7579. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7580. break;
  7581. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7582. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7583. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7584. break;
  7585. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7586. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7587. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7588. break;
  7589. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7590. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7591. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7592. break;
  7593. case 'qjff_AD_for_UIBOX_onOpenBox':
  7594. let dui11 = xGame.uiMgr.getUI(UIBox);
  7595. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7596. break;
  7597. case 'qjff_AD_for_UIAddCoin':
  7598. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7599. dui12.qjff_AD_for_UIAddCoin();
  7600. break;
  7601. case 'app_sign_for_buyProduct_onSuccess':
  7602. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7603. DataMgr.getUserZiChanInfo(false);
  7604. break;
  7605. case '222axxxxxx':
  7606. let dui15 = xGame.uiMgr.getUI(UISign);
  7607. dui15.qjff_AD_for_uisign();
  7608. break;
  7609. case '333axsxxxxxx':
  7610. let dui16 = xGame.uiMgr.getUI(UISign);
  7611. dui16.qjff_AD_for_uisign();
  7612. break;
  7613. default:
  7614. console.log('zh:未知的方法名字' + t);
  7615. break;
  7616. }
  7617. }
  7618. onConstructor() {
  7619. console.log('zh: UIMain onConstructor');
  7620. this.ui = ui_UIMain.createInstance();
  7621. this.contentPane = this.ui;
  7622. this.isEject = false;
  7623. this.addEvent();
  7624. this.addClickSpine();
  7625. this.settingNode = new SettingNode(this.ui.settingNode);
  7626. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7627. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7628. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7629. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7630. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7631. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7632. xGame.eventMgr.on("gameConfigReadyMark", this, this.event_gameConfigReadyMark);
  7633. let curUse = DataMgr.getCurSecretary();
  7634. this.changeSecretary(curUse);
  7635. this.ui.talkNode.visible = false;
  7636. let guide = DataMgr.getSkillGuide();
  7637. if (xGame.common.isNewDay && guide == 1) {
  7638. xGame.common.isNewDay = false;
  7639. xGame.soundMgr.playSound("s_main01");
  7640. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7641. console.log("zh:播放小秘书每天语音");
  7642. }
  7643. this.onGetUserInfo();
  7644. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7645. DataMgr.getUserZiChanInfo(false);
  7646. }
  7647. this.ui.n83.visible = false;
  7648. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7649. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7650. let ua = d.username;
  7651. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7652. }
  7653. this.c_btn_for_user();
  7654. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7655. }
  7656. Logout() {
  7657. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7658. LocalStorageManager.removeItem(keyForLoginInfo);
  7659. this.freshUser();
  7660. }
  7661. JSBridgeUtils.instance.loginOutForApp();
  7662. this.setUserDefaultNickname();
  7663. DataMgr.setCoin2(4000);
  7664. DataMgr.setDiamond2(0);
  7665. this.setDefaultQiuGanInfo();
  7666. DataMgr.setPlaceBallLevelList("");
  7667. DataMgr.setChallengeMode_overLev(1);
  7668. this.setDefaultSignData();
  7669. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7670. DataMgr.setCurBallRod(5);
  7671. }
  7672. setDefaultSignData() {
  7673. DataMgr.setSignData(1);
  7674. DataMgr.setSignTime(new Date().getTime());
  7675. }
  7676. setDefaultQiuGanInfo() {
  7677. DataMgr.setBallRod(0, 1);
  7678. DataMgr.setBallRod(1, 0);
  7679. DataMgr.setBallRod(2, 0);
  7680. DataMgr.setBallRod(3, 0);
  7681. DataMgr.setBallRod(4, 0);
  7682. DataMgr.setBallRod(5, 1);
  7683. }
  7684. setUserDefaultNickname() {
  7685. let defUsername = "player";
  7686. this.ui.headNode.nameTxt.text = defUsername;
  7687. DataMgr.updateUserNickName(defUsername);
  7688. Moyu.updateUserInfo(defUsername);
  7689. }
  7690. gotoLogin() {
  7691. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7692. xGame.uiMgr.Show(UILogin);
  7693. }
  7694. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7695. this.Logout();
  7696. }
  7697. }
  7698. gotoRegUser() {
  7699. xGame.uiMgr.Show(UIReg);
  7700. }
  7701. showFuLiSp1() {
  7702. console.log('zh:福利1');
  7703. DataMgr.checkForShowFuLi17AndAlert(1);
  7704. }
  7705. showFuLiSp7() {
  7706. console.log('zh:福利7');
  7707. DataMgr.checkForShowFuLi17AndAlert(7);
  7708. }
  7709. c_btn_for_user() {
  7710. this.ui.n_dengLu.c1.selectedIndex = 0;
  7711. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7712. this.ui.n_dengLu.c1.selectedIndex = 1;
  7713. }
  7714. else {
  7715. this.ui.n_dengLu.c1.selectedIndex = 0;
  7716. }
  7717. }
  7718. changeSecretary(curUse) {
  7719. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7720. xGame.common.secretary && xGame.common.secretary.dispose();
  7721. this.addSecretarySpine(name);
  7722. }
  7723. addSecretarySpine(name) {
  7724. let spine = new SpineMgr(name, () => {
  7725. this.playSecretaryIdle();
  7726. });
  7727. xGame.common.secretary = spine;
  7728. }
  7729. addClickSpine() {
  7730. let clickSpine = new SpineMgr("dianji", () => {
  7731. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7732. let parent = Laya.stage;
  7733. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7734. clickSpine.play(data, 0, false, parent, (spine) => {
  7735. spine.destroy(true);
  7736. });
  7737. });
  7738. });
  7739. }
  7740. addEvent() {
  7741. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7742. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7743. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7744. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7745. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7746. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7747. this.addUIClick(this.ui, this.interuptSecretary);
  7748. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7749. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7750. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7751. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7752. this.addUIClick(this.ui.signBtn, this.openSignView);
  7753. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7754. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7755. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7756. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  7757. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7758. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7759. }
  7760. show(showFailWords) {
  7761. super.show();
  7762. DataMgr.loadUserSpOrderForAd();
  7763. this.moneyNode.ui.c1.selectedIndex = 1;
  7764. this.playSecretaryIdle();
  7765. xGame.soundMgr.playMusic("caromhall01", 0);
  7766. Laya.timer.clearAll(this);
  7767. this.playSecretaryRandomSound();
  7768. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7769. if (showFailWords) {
  7770. console.log('zh:uimain.ts ');
  7771. setTimeout(() => {
  7772. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7773. let words = -1;
  7774. if (str == "s_main02") {
  7775. words = 2;
  7776. }
  7777. else {
  7778. words = 3;
  7779. }
  7780. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7781. xGame.soundMgr.playSound(str);
  7782. }, 300);
  7783. }
  7784. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7785. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7786. let isGuideOver = false;
  7787. let randTime = xGame.common.randomNum(300, 800);
  7788. if (DataMgr.getGuideDefaultModel() === 1) {
  7789. let guide = DataMgr.getLianXiGuide();
  7790. if (guide == 1) {
  7791. isGuideOver = true;
  7792. this.ui.n_yd_lxms_1.visible = false;
  7793. this.firstEnter = false;
  7794. }
  7795. }
  7796. else {
  7797. let guide = DataMgr.getSkillGuide();
  7798. if (guide == 1) {
  7799. isGuideOver = true;
  7800. if (this.firstEnter) {
  7801. console.log("zh: firstEnter");
  7802. this.firstEnter = false;
  7803. randTime += 900;
  7804. }
  7805. else {
  7806. console.log("zh: no firstEnter");
  7807. }
  7808. }
  7809. }
  7810. if (isGuideOver) {
  7811. Laya.timer.once(randTime, this, () => {
  7812. });
  7813. Laya.timer.once(1000, this, () => {
  7814. console.log('zh: 1秒后 showFuLiSp7');
  7815. this.showFuLiSp7();
  7816. });
  7817. this.showTipForGuest();
  7818. }
  7819. this.setGlobalFont(this.ui);
  7820. }
  7821. event_gameConfigReadyMark() {
  7822. console.log('zh:事件触发,配置加载OK');
  7823. if (DataMgr.getGuideDefaultModel() === 1) {
  7824. this.showGuideForLianxi();
  7825. }
  7826. else {
  7827. this.showGuide();
  7828. }
  7829. }
  7830. showGuideForLianxi() {
  7831. let lianXiGuide = DataMgr.getLianXiGuide();
  7832. console.log('zh: AAAAA练习模式引导判断:lianXiGuide=' + lianXiGuide);
  7833. if (lianXiGuide == 0) {
  7834. let x = this.ui.placeBallBtn.x;
  7835. let y = this.ui.placeBallBtn.y;
  7836. this.ui.n_yd_lxms_1.visible = true;
  7837. this.ui.n_yd_challenge_1_hand.x = x + 150;
  7838. this.ui.n_yd_challenge_1_hand.y = y;
  7839. this.ui.n_yd_challenge_1_btn.x = x;
  7840. this.ui.n_yd_challenge_1_btn.y = y;
  7841. console.log('zh:yinDaoForLianxi set ok');
  7842. }
  7843. else {
  7844. this.ui.n_yd_lxms_1.visible = false;
  7845. }
  7846. }
  7847. showTipForGuest() {
  7848. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7849. if (userInfo == null) {
  7850. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7851. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7852. let woman = "this is an important notice.";
  7853. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7854. return;
  7855. }
  7856. }
  7857. checkActive(show) {
  7858. }
  7859. showGuide() {
  7860. let guide = DataMgr.getSkillGuide();
  7861. this.ui.guideBtn.visible = guide == 0;
  7862. this.ui.enterGuide.visible = false;
  7863. this.ui.secretaryGuide.visible = guide == 0;
  7864. if (guide == 0) {
  7865. console.log("zh:显示引导");
  7866. xGame.soundMgr.playSound("s_guide");
  7867. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7868. }
  7869. else {
  7870. console.log("zh:不需要显示引导");
  7871. }
  7872. }
  7873. ensureSecretary() {
  7874. console.log('zh: ensureSecretary ');
  7875. this.ui.secretaryGuide.visible = false;
  7876. this.ui.enterGuide.visible = true;
  7877. this.ui.wordsNode.t0.play();
  7878. if (DataMgr.getNewUser())
  7879. Moyu.sendDataEvent("gameReady");
  7880. }
  7881. playSecretaryIdle() {
  7882. let parent = this.ui.secretary.displayObject;
  7883. parent.destroyChildren();
  7884. let xx = this.ui.secretary.width / 2;
  7885. let yy = this.ui.secretary.height;
  7886. let scale = xGame.common.getSecretaryScale();
  7887. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7888. xGame.common.secretary.play(data, 0, true, parent);
  7889. }
  7890. startGame(type) {
  7891. if (!this.isReadyForLoadNetSource()) {
  7892. return;
  7893. }
  7894. xGame.common.gameMode = type;
  7895. Moyu.sendDataEvent("PlayGame", { type: type });
  7896. let gm = xGame.common.gameMode;
  7897. console.log('zh:进入游戏gameMode =' + gm);
  7898. switch (gm) {
  7899. case GameMode.classic:
  7900. console.log('zh:进入经典模式111111111');
  7901. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7902. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7903. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7904. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7905. console.log('zh:判断是否可以玩该模式classic =NO');
  7906. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7907. xGame.uiMgr.Show(UIMsg, tipStr);
  7908. return;
  7909. }
  7910. else {
  7911. console.log('zh:可以玩该模式classic');
  7912. this.beginGame();
  7913. }
  7914. }
  7915. else {
  7916. console.log('zh:不需要判断是否可以玩该classic');
  7917. let challengeTimes = DataMgr.getChallengeTimes();
  7918. if (challengeTimes == 0) {
  7919. xGame.uiMgr.Show(UIInvitation);
  7920. }
  7921. else {
  7922. this.beginGame();
  7923. }
  7924. }
  7925. break;
  7926. case GameMode.bigMove:
  7927. console.info('zh:bigMove check 大招');
  7928. let guide = DataMgr.getSkillGuide();
  7929. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7930. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7931. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7932. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7933. console.log('zh:提示不可以玩');
  7934. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7935. xGame.uiMgr.Show(UIMsg, tipStr);
  7936. return;
  7937. }
  7938. else {
  7939. console.log('zh:可以玩该模式 bigMove');
  7940. this.beginGame();
  7941. if (DataMgr.getNewUser())
  7942. Moyu.sendDataEvent("gameStart0");
  7943. }
  7944. }
  7945. else {
  7946. this.beginGame();
  7947. if (DataMgr.getNewUser())
  7948. Moyu.sendDataEvent("gameStart0");
  7949. }
  7950. break;
  7951. default:
  7952. console.error('zh:未知错误!!!!');
  7953. break;
  7954. }
  7955. }
  7956. beginGame(isNice = false) {
  7957. console.log('zh:beginGame ');
  7958. let guide = DataMgr.getSkillGuide();
  7959. if (guide == 1) {
  7960. console.log('zh:非新手引导,showInternAd ');
  7961. JSBridgeUtils.instance.showInternAd('beginGame');
  7962. }
  7963. else {
  7964. console.log('zh:新手引导,不显示AD ');
  7965. }
  7966. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7967. console.log('zh:beginGame 1');
  7968. if (xGame.common.gameMode == GameMode.classic) {
  7969. console.log('zh:beginGame 2');
  7970. if (isNice) {
  7971. console.log('zh:进入巅峰赛');
  7972. this.enterClassic();
  7973. }
  7974. else {
  7975. console.log('zh:beginGame 3-1');
  7976. xGame.uiMgr.Show(UIModeSelection, () => {
  7977. console.log('zh:beginGame 3-2');
  7978. this.enterClassic();
  7979. });
  7980. }
  7981. }
  7982. else if (xGame.common.gameMode == GameMode.bigMove) {
  7983. console.log('zh:beginGame 5');
  7984. this.ui.enterGuide.visible = false;
  7985. xGame.uiMgr.Show(UISkill);
  7986. }
  7987. }
  7988. enterClassic() {
  7989. console.log('zh:beginGame 7');
  7990. xGame.uiMgr.Show(UIGame);
  7991. xGame.uiMgr.Show(UIMatching, () => {
  7992. if (!this.isHide)
  7993. this.hide();
  7994. xGame.common.gameUI.ui.alpha = 1;
  7995. console.log('zh:beginGame 8');
  7996. xGame.common.gameUI.startGame();
  7997. xGame.uiMgr.Hide(UIGameEnd);
  7998. });
  7999. }
  8000. start_debug_for_moni_payOk() {
  8001. let ccc = this.moni_click_count + 1;
  8002. this.moni_click_count = ccc;
  8003. if (ccc % 5 == 0) {
  8004. console.log('zh:start_debug_for_moni_payOk');
  8005. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8006. if (userInfo != null) {
  8007. let token = userInfo.token;
  8008. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  8009. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  8010. alert('模拟支付OK');
  8011. return;
  8012. }
  8013. else {
  8014. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8015. }
  8016. }
  8017. }
  8018. startGlobal() {
  8019. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  8020. }
  8021. startWeekly() {
  8022. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  8023. }
  8024. zhouSaiMonth() {
  8025. console.log('zh: zhouSaiMonth 被调用');
  8026. }
  8027. isReadyForLoadNetSource() {
  8028. let reqCount = xGame.cfgMgr.httpReqCount;
  8029. let ok = xGame.cfgMgr.httpReqOkCount;
  8030. if (reqCount > ok) {
  8031. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  8032. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  8033. Laya.timer.once(5000, this, () => {
  8034. let retryCount = 0;
  8035. const maxRetries = 3;
  8036. const tryFetchConfig = () => {
  8037. try {
  8038. xGame.cfgMgr.getConfigFromServer();
  8039. }
  8040. catch (error) {
  8041. if (retryCount < maxRetries) {
  8042. retryCount++;
  8043. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8044. Laya.timer.once(5000, this, tryFetchConfig);
  8045. }
  8046. else {
  8047. console.error("❌ 达到最大重试次数,配置获取失败");
  8048. }
  8049. }
  8050. };
  8051. tryFetchConfig();
  8052. });
  8053. return false;
  8054. }
  8055. return true;
  8056. }
  8057. startPlaceBall() {
  8058. if (!this.isReadyForLoadNetSource()) {
  8059. return;
  8060. }
  8061. xGame.uiMgr.Show(UILevelDisplay);
  8062. }
  8063. hide() {
  8064. console.log('zh:uimain hide ...');
  8065. super.hide();
  8066. xGame.common.stopGirlPop(this.ui.talkNode);
  8067. }
  8068. onGetUserInfo(force = false) {
  8069. if (Moyu.isWx) {
  8070. let info = Moyu.getSystemInfo();
  8071. if (info)
  8072. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8073. }
  8074. else {
  8075. Moyu.initUser(this, this.freshUser, force);
  8076. }
  8077. this.freshUser();
  8078. console.log('zh:5秒后更新用户信息');
  8079. setTimeout(() => {
  8080. DataMgr.getUserZiChanInfo(true);
  8081. }, 5000);
  8082. }
  8083. event_login_in() {
  8084. console.log("zh:event_login_in被触发");
  8085. this.freshUser();
  8086. }
  8087. freshUser() {
  8088. let user = Moyu.getUserInfo();
  8089. if (!user.isAuth) {
  8090. user.headIcon = 'res/ty_touxiang.png';
  8091. }
  8092. else {
  8093. DataMgr.upRankData();
  8094. }
  8095. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8096. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8097. let keyStr = keyForLoginInfo;
  8098. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8099. const d = LocalStorageManager.getItem(keyStr);
  8100. let ua = d.username;
  8101. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8102. }
  8103. else {
  8104. }
  8105. this.c_btn_for_user();
  8106. }
  8107. interuptSecretary() {
  8108. Laya.timer.clearAll(this);
  8109. this.playSecretaryRandomSound();
  8110. }
  8111. playSecretaryRandomSound() {
  8112. if (this.isHide)
  8113. return;
  8114. let time = xGame.common.randomNum(45000, 60000);
  8115. Laya.timer.once(time, this, () => {
  8116. if (this.isHide)
  8117. return;
  8118. let index = xGame.common.randomNum(4, 7);
  8119. xGame.soundMgr.playSound("s_main0" + index);
  8120. let words = 1;
  8121. switch (index) {
  8122. case 4:
  8123. words = 5;
  8124. break;
  8125. case 5:
  8126. words = 3;
  8127. break;
  8128. case 6:
  8129. words = 6;
  8130. break;
  8131. case 7:
  8132. words = 7;
  8133. break;
  8134. default:
  8135. break;
  8136. }
  8137. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8138. this.playSecretaryRandomSound();
  8139. });
  8140. }
  8141. openSecretaryView() {
  8142. xGame.uiMgr.Show(UISecretary);
  8143. Moyu.sendDataEvent("secretary");
  8144. }
  8145. openShopView() {
  8146. xGame.uiMgr.Show(UIShop, 1);
  8147. }
  8148. openShopView0() {
  8149. xGame.uiMgr.Show(UIShop, 0);
  8150. }
  8151. openSignView() {
  8152. xGame.uiMgr.Show(UISign);
  8153. }
  8154. openDrawView() {
  8155. xGame.uiMgr.Show(UIDraw);
  8156. }
  8157. openRanking() {
  8158. console.log('zh:phb openRanking');
  8159. xGame.uiMgr.Show(UIRanking);
  8160. Moyu.sendDataEvent("rankingList");
  8161. }
  8162. }
  8163. UIMain.uiName = "UIMain";
  8164. class UIGameEnd extends UIBase {
  8165. constructor() {
  8166. super();
  8167. this.success = false;
  8168. this.awardCoinNum = 1000;
  8169. this.awardDiamondNum = 10;
  8170. }
  8171. onConstructor() {
  8172. this.ui = ui_UIGameEnd.createInstance();
  8173. this.contentPane = this.ui;
  8174. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8175. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8176. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8177. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8178. this.ui.talkNode.visible = false;
  8179. if (Moyu.isKs)
  8180. this.ui.closeNode.closeBtn.x += 100;
  8181. }
  8182. updateType() {
  8183. switch (xGame.common.gameMode) {
  8184. case GameMode.classic:
  8185. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8186. this.ui.coinNode.visible = this.success;
  8187. if (!this.success) {
  8188. Laya.timer.once(500, this, () => {
  8189. xGame.uiMgr.Show(UIAddCoin);
  8190. });
  8191. }
  8192. else {
  8193. this.logEventForClassic_win();
  8194. }
  8195. this.logEventForClassic_complete();
  8196. this.ui.isGetAward.visible = false;
  8197. this.ui.leftBtn.c1.selectedIndex = 3;
  8198. this.ui.rightBtn.c1.selectedIndex = 0;
  8199. this.moneyNode.ui.c1.selectedIndex = 1;
  8200. break;
  8201. case GameMode.bigMove:
  8202. console.log('zh:招法模式 aaaaaa bigMove');
  8203. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8204. this.ui.coinNode.visible = this.success;
  8205. if (xGame.common.gameMode == GameMode.bigMove) {
  8206. if (this.success) {
  8207. DataMgr.setSkillSuccessTimes(1, true);
  8208. DataMgr.setSkillAccTimes(1);
  8209. }
  8210. else {
  8211. DataMgr.setSkillSuccessTimes(0, false);
  8212. }
  8213. }
  8214. this.logEventForRod_complete_N();
  8215. if (!this.success) {
  8216. Laya.timer.once(500, this, () => {
  8217. xGame.uiMgr.Show(UIAddCoin);
  8218. });
  8219. }
  8220. else {
  8221. this.logEventForRod_win();
  8222. }
  8223. this.ui.isGetAward.visible = false;
  8224. this.ui.leftBtn.c1.selectedIndex = 3;
  8225. this.ui.rightBtn.c1.selectedIndex = 0;
  8226. this.moneyNode.ui.c1.selectedIndex = 1;
  8227. break;
  8228. case GameMode.placeBall:
  8229. this.ui.coinNode.visible = false;
  8230. if (this.success) {
  8231. if (xGame.common.placeBallStarNum == 3) {
  8232. this.ui.c1.selectedIndex = 2;
  8233. }
  8234. else {
  8235. this.ui.c1.selectedIndex = 3;
  8236. }
  8237. let level = xGame.common.placeBallCurLevel;
  8238. if (level > 59) {
  8239. this.logEventForChallenge_level_complete(level);
  8240. }
  8241. else {
  8242. this.logEventForChallenge_level_N(level);
  8243. }
  8244. }
  8245. else {
  8246. this.ui.c1.selectedIndex = 4;
  8247. }
  8248. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8249. if (cfg.type == PlaceBallType.challenge) {
  8250. this.ui.c1.selectedIndex = 2;
  8251. }
  8252. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8253. this.updatePlaceBallBtn();
  8254. this.updatePlaceBallStarNum();
  8255. this.updatePlaceBallAwardState();
  8256. this.moneyNode.ui.c1.selectedIndex = 2;
  8257. this.moneyNode.checkPowerTime();
  8258. this.moneyNode.powerChange();
  8259. DataMgr.upRankData();
  8260. break;
  8261. default:
  8262. break;
  8263. }
  8264. }
  8265. logEventForRod_complete_N() {
  8266. let gfmsIdx = xGame.common.curPlayerSkillType;
  8267. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8268. let gfmc = 'Skyfall Shot';
  8269. if (gfmsIdx == 0) {
  8270. gfmc = 'Skyfall Shot';
  8271. }
  8272. if (gfmsIdx == 1) {
  8273. gfmc = 'Surging break';
  8274. }
  8275. if (gfmsIdx == 2) {
  8276. gfmc = 'Frost Lock';
  8277. }
  8278. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8279. console.log('zh:logEventForRod_complete_N level = ' + level);
  8280. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8281. let jsonStr = {
  8282. "count": 0,
  8283. "name": gfmc
  8284. };
  8285. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8286. const d = LocalStorageManager.getItem(keyStr);
  8287. jsonStr.count = d.count + 1;
  8288. LocalStorageManager.setItem(keyStr, jsonStr);
  8289. }
  8290. else {
  8291. LocalStorageManager.setItem(keyStr, jsonStr);
  8292. }
  8293. const d2 = LocalStorageManager.getItem(keyStr);
  8294. let count = d2.count;
  8295. console.log('zh:logEventForRod_complete_N count = ' + count);
  8296. if (count % 5 == 0) {
  8297. const reqStr = JSON.stringify(jsonStr);
  8298. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8299. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8300. }
  8301. }
  8302. logEventForRod_win() {
  8303. console.log('zh:logEventForRod_win,胜利');
  8304. let gfmsIdx = xGame.common.curPlayerSkillType;
  8305. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8306. let gfmc = 'Skyfall Shot';
  8307. if (gfmsIdx == 0) {
  8308. gfmc = 'Skyfall Shot';
  8309. }
  8310. if (gfmsIdx == 1) {
  8311. gfmc = 'Surging break';
  8312. }
  8313. if (gfmsIdx == 2) {
  8314. gfmc = 'Frost Lock';
  8315. }
  8316. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8317. console.log('zh:logEventForRod_win level = ' + level);
  8318. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8319. let jsonStr = {
  8320. "count": 1,
  8321. "name": gfmc + ' Lev' + level
  8322. };
  8323. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8324. const d = LocalStorageManager.getItem(keyStr);
  8325. jsonStr.count = d.count + 1;
  8326. LocalStorageManager.setItem(keyStr, jsonStr);
  8327. }
  8328. else {
  8329. LocalStorageManager.setItem(keyStr, jsonStr);
  8330. }
  8331. const reqStr = JSON.stringify(jsonStr);
  8332. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8333. }
  8334. logEventForClassic_win() {
  8335. console.log('zh:logEventForClassic_win,胜利');
  8336. let rtype = xGame.common.classicRoomType;
  8337. let msmc = '';
  8338. if (rtype == 1) {
  8339. msmc = 'beginner';
  8340. }
  8341. if (rtype == 2) {
  8342. msmc = 'expert';
  8343. }
  8344. if (rtype == 3) {
  8345. msmc = 'master';
  8346. }
  8347. let keyStr = 'sjmd_classic_win_' + rtype;
  8348. let jsonStr = {
  8349. "difficulty": msmc,
  8350. "classic_count": 1,
  8351. "difficulty_count": 1
  8352. };
  8353. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8354. const d = LocalStorageManager.getItem(keyStr);
  8355. jsonStr.classic_count = d.classic_count + 1;
  8356. jsonStr.difficulty_count = d.difficulty_count + 1;
  8357. LocalStorageManager.setItem(keyStr, jsonStr);
  8358. }
  8359. else {
  8360. LocalStorageManager.setItem(keyStr, jsonStr);
  8361. }
  8362. const reqStr = JSON.stringify(jsonStr);
  8363. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8364. }
  8365. logEventForClassic_complete() {
  8366. console.log('zh:logEventForClassic_complete,胜利');
  8367. let rtype = xGame.common.classicRoomType;
  8368. let msmc = '';
  8369. if (rtype == 1) {
  8370. msmc = 'beginner';
  8371. }
  8372. if (rtype == 2) {
  8373. msmc = 'expert';
  8374. }
  8375. if (rtype == 3) {
  8376. msmc = 'master';
  8377. }
  8378. let keyStr = 'sjmd_classic_complete_' + rtype;
  8379. let jsonStr = {
  8380. "msmc": msmc,
  8381. "count": 0
  8382. };
  8383. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8384. const d = LocalStorageManager.getItem(keyStr);
  8385. jsonStr.count = d.count + 1;
  8386. LocalStorageManager.setItem(keyStr, jsonStr);
  8387. }
  8388. else {
  8389. LocalStorageManager.setItem(keyStr, jsonStr);
  8390. }
  8391. if (jsonStr.count % 5 == 0) {
  8392. const reqStr = JSON.stringify(jsonStr);
  8393. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8394. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8395. }
  8396. }
  8397. updatePlaceBallBtn() {
  8398. this.ui.leftBtn.c1.selectedIndex = 5;
  8399. if (this.success) {
  8400. this.ui.rightBtn.c1.selectedIndex = 14;
  8401. }
  8402. else {
  8403. if (xGame.common.placeBallStarNum == 3) {
  8404. this.ui.rightBtn.c1.selectedIndex = 14;
  8405. }
  8406. else {
  8407. this.ui.rightBtn.c1.selectedIndex = 1;
  8408. }
  8409. }
  8410. }
  8411. updatePlaceBallStarNum() {
  8412. let starNum = xGame.common.placeBallStarNum;
  8413. if (starNum == 0)
  8414. this.ui.starNumNode.c1.selectedIndex = 3;
  8415. else {
  8416. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8417. }
  8418. }
  8419. updatePlaceBallAwardState() {
  8420. let level = xGame.common.placeBallCurLevel;
  8421. let starNum = xGame.common.placeBallStarNum;
  8422. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8423. let data = cfgTable.placeballData[level].award;
  8424. let cfg = cfgTable.placeballData[level];
  8425. this.awardDiamondNum = data[1];
  8426. this.awardCoinNum = data[0];
  8427. if (cfg.type == PlaceBallType.challenge) {
  8428. this.awardDiamondNum = 0;
  8429. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8430. }
  8431. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8432. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8433. if (cfg.type == PlaceBallType.challenge) {
  8434. this.ui.awardNode.coinNode.visible = true;
  8435. }
  8436. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8437. this.ui.awardNode.diamondNode.x = 265;
  8438. this.ui.awardNode.coinNode.x = 354;
  8439. }
  8440. else {
  8441. this.ui.awardNode.diamondNode.x = 291;
  8442. this.ui.awardNode.coinNode.x = 291;
  8443. }
  8444. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8445. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8446. if (this.awardCoinNum == 0) {
  8447. this.ui.awardNode.coinNode.numTxt.text = "";
  8448. }
  8449. if (getAward) {
  8450. this.ui.isGetAward.visible = true;
  8451. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8452. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8453. }
  8454. else {
  8455. this.ui.isGetAward.visible = false;
  8456. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8457. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8458. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8459. }
  8460. else {
  8461. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8462. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8463. }
  8464. }
  8465. }
  8466. show(success) {
  8467. super.show();
  8468. xGame.eventMgr.event(RESET_GAME);
  8469. this.success = success;
  8470. Laya.timer.clearAll(this);
  8471. this.playSecretaryAni();
  8472. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8473. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8474. offsetTime = Math.floor(offsetTime / 1000);
  8475. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8476. this.updateType();
  8477. Laya.timer.once(200, this, () => {
  8478. this.addAward(() => {
  8479. this.updateType();
  8480. Laya.timer.once(500, this, () => {
  8481. this.showChallengeLevel();
  8482. });
  8483. });
  8484. });
  8485. if (this.success) {
  8486. JSBridgeUtils.instance.showInternAd('gameend_success');
  8487. console.log('zh:game end 成功');
  8488. xGame.soundMgr.playSound('slots_roll01');
  8489. xGame.soundMgr.playSound("s_win");
  8490. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8491. this.diyGameDataUtilForGameWin();
  8492. this.updateGamePlaceBallData2Server();
  8493. }
  8494. else {
  8495. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8496. console.log('zh:game end失败');
  8497. xGame.soundMgr.playSound('matchwin01');
  8498. xGame.soundMgr.playSound("s_lose");
  8499. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8500. }
  8501. console.log('zh:开始弹出福利框2个');
  8502. Laya.timer.once(1000, this, () => {
  8503. console.log('zh: 1秒后 showFuLiSp1');
  8504. DataMgr.checkForShowFuLi17AndAlert(1);
  8505. });
  8506. let challengeNum = DataMgr.getChallengeTimes();
  8507. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8508. DataMgr.setChallengeTimes(1);
  8509. }
  8510. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8511. DataMgr.setClassicTimes();
  8512. }
  8513. this.setGlobalFont(this.ui);
  8514. }
  8515. diyGameDataUtilForGameWin() {
  8516. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8517. switch (xGame.common.gameMode) {
  8518. case GameMode.classic:
  8519. console.log('zh:DiyGameDataUtilForGameWin 111');
  8520. case GameMode.bigMove:
  8521. console.log('zh:DiyGameDataUtilForGameWin 222');
  8522. this.restartGame();
  8523. break;
  8524. case GameMode.placeBall:
  8525. console.log('zh:DiyGameDataUtilForGameWin 333');
  8526. var level = xGame.common.placeBallCurLevel;
  8527. console.log('zh:练习模式 联系了多少LEV=' + level);
  8528. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8529. if (level > db_over_lev) {
  8530. DataMgr.setChallengeMode_overLev(level);
  8531. }
  8532. break;
  8533. default:
  8534. console.log('zh:DiyGameDataUtilForGameWin 444');
  8535. break;
  8536. }
  8537. }
  8538. updateGamePlaceBallData2Server() {
  8539. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8540. if (userInfo == null) {
  8541. return;
  8542. }
  8543. let pbdObj = DataMgr.getPlaceBallLevelList();
  8544. let reqData = xGame.httpMgr.getReqData();
  8545. let pd = JSON.parse(reqData);
  8546. pd.placeBallData = JSON.stringify(pbdObj);
  8547. reqData = JSON.stringify(pd);
  8548. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8549. try {
  8550. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8551. let code = res.code;
  8552. let msg = res.msg;
  8553. if (code == 401) {
  8554. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8555. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8556. return;
  8557. }
  8558. if (code == 200) {
  8559. let data = res.data;
  8560. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8561. }
  8562. else {
  8563. xGame.uiMgr.Show(UIMsg, msg);
  8564. }
  8565. }
  8566. catch (error) {
  8567. console.log('error=' + error);
  8568. alert(error);
  8569. }
  8570. finally {
  8571. }
  8572. });
  8573. }
  8574. showChallengeLevel() {
  8575. if (DataMgr.getChallengeTimes() != 0)
  8576. return;
  8577. let skill = DataMgr.getSkillAccTimes();
  8578. let put = DataMgr.getPlaceBallLevelList().length;
  8579. if (skill >= 3 || put >= 5) {
  8580. xGame.uiMgr.Show(UIInvitation);
  8581. this.hide();
  8582. }
  8583. }
  8584. addAward(callback) {
  8585. if (!this.success) {
  8586. callback && callback();
  8587. return;
  8588. }
  8589. switch (xGame.common.gameMode) {
  8590. case GameMode.classic:
  8591. this.awardCoinNum = xGame.common.passAwardCoin;
  8592. this.awardDiamondNum = 0;
  8593. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8594. break;
  8595. case GameMode.bigMove:
  8596. this.awardCoinNum = xGame.common.passAwardCoin;
  8597. this.awardDiamondNum = 0;
  8598. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8599. callback && callback();
  8600. break;
  8601. case GameMode.placeBall:
  8602. let level = xGame.common.placeBallCurLevel;
  8603. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8604. if (xGame.common.placeBallStarNum != 3) {
  8605. callback && callback();
  8606. return;
  8607. }
  8608. else {
  8609. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8610. if (getAward) {
  8611. callback && callback();
  8612. return;
  8613. }
  8614. }
  8615. let cfg = cfgTable.placeballData[level];
  8616. let data = cfgTable.placeballData[level].award;
  8617. this.awardCoinNum = data[0];
  8618. this.awardDiamondNum = data[1];
  8619. if (cfg.type == PlaceBallType.challenge) {
  8620. this.awardDiamondNum = 0;
  8621. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8622. }
  8623. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8624. let diamondAward;
  8625. if (this.awardDiamondNum > 0) {
  8626. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8627. xGame.common.getAward([diamondAward, coinAward], callback);
  8628. }
  8629. else {
  8630. xGame.common.getAward([coinAward], callback);
  8631. }
  8632. if (cfg.type == PlaceBallType.normal) {
  8633. DataMgr.setPlaceBallAward(level);
  8634. }
  8635. break;
  8636. default:
  8637. break;
  8638. }
  8639. }
  8640. playSecretaryAni_old() {
  8641. let parent = this.ui.secretary.displayObject;
  8642. parent.destroyChildren();
  8643. let xx = this.ui.secretary.width / 2;
  8644. let yy = this.ui.secretary.height;
  8645. let scale = xGame.common.getSecretaryScale();
  8646. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8647. if (this.success) {
  8648. let rand = Math.random() <= 0.5 ? 2 : 3;
  8649. xGame.common.secretary.play(data, rand, false, parent, () => {
  8650. xGame.common.secretary.play(data, 1, true, parent);
  8651. });
  8652. }
  8653. else {
  8654. xGame.common.secretary.play(data, 0, true, parent);
  8655. }
  8656. }
  8657. playSecretaryAni() {
  8658. let parent = this.ui.secretary.displayObject;
  8659. parent.destroyChildren();
  8660. let xx = this.ui.secretary.width / 2;
  8661. let yy = this.ui.secretary.height;
  8662. let scale = xGame.common.getSecretaryScale();
  8663. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8664. if (this.success) {
  8665. let rand = 0;
  8666. xGame.common.secretary.play(data, 0, true, parent);
  8667. }
  8668. else {
  8669. xGame.common.secretary.play(data, 0, true, parent);
  8670. }
  8671. }
  8672. restartGame() {
  8673. switch (xGame.common.gameMode) {
  8674. case GameMode.classic:
  8675. xGame.eventMgr.event(RESTART_GAME);
  8676. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8677. break;
  8678. case GameMode.bigMove:
  8679. this.hide();
  8680. xGame.eventMgr.event(RESTART_GAME);
  8681. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8682. break;
  8683. default:
  8684. break;
  8685. }
  8686. }
  8687. hide() {
  8688. super.hide();
  8689. xGame.common.stopGirlPop(this.ui.talkNode);
  8690. PlatMgr.showBanner(false);
  8691. }
  8692. returnHome() {
  8693. this.hide();
  8694. let showFailWords = !this.success;
  8695. xGame.uiMgr.Show(UIMain, showFailWords);
  8696. }
  8697. clickLeftBtn() {
  8698. switch (xGame.common.gameMode) {
  8699. case GameMode.classic:
  8700. case GameMode.bigMove:
  8701. this.returnHome();
  8702. break;
  8703. case GameMode.placeBall:
  8704. let level = xGame.common.placeBallCurLevel;
  8705. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8706. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8707. break;
  8708. default:
  8709. break;
  8710. }
  8711. }
  8712. powerStartPlaceBallLevel(level, btn) {
  8713. if (DataMgr.powerEnough()) {
  8714. btn.touchable = false;
  8715. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8716. btn.touchable = true;
  8717. DataMgr.setPower(-1);
  8718. xGame.eventMgr.event(POWER_TIME);
  8719. this.startPlaceBallLevel(level);
  8720. this.logEventForChallenge_level_start(level);
  8721. }));
  8722. }
  8723. else {
  8724. xGame.uiMgr.Show(UIPower, 0);
  8725. }
  8726. }
  8727. clickRightBtn() {
  8728. switch (xGame.common.gameMode) {
  8729. case GameMode.classic:
  8730. console.log('zh:clickRightBtn 111');
  8731. case GameMode.bigMove:
  8732. console.log('zh:clickRightBtn 222');
  8733. this.restartGame();
  8734. break;
  8735. case GameMode.placeBall:
  8736. console.log('zh:clickRightBtn 333');
  8737. let level = xGame.common.placeBallCurLevel;
  8738. let data = DataMgr.getPlaceBallLevel(level);
  8739. let curPss = data.play && !data.isCur;
  8740. if (curPss) {
  8741. console.log('zh:clickRightBtn 333-111');
  8742. console.log('zh:当前LV=' + level);
  8743. if (level == 60) {
  8744. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8745. Laya.timer.once(3000, this, () => {
  8746. this.returnHome();
  8747. });
  8748. }
  8749. else {
  8750. let lev = level + 1;
  8751. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8752. }
  8753. }
  8754. else {
  8755. console.log('zh:clickRightBtn 333-000');
  8756. Moyu.sendDataEvent("placeBallNextLevel");
  8757. console.log('zh:qjff_AD_for_uiGameEnd');
  8758. if (Laya.Browser.onAndroid) {
  8759. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8760. if (!boo) {
  8761. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8762. return;
  8763. }
  8764. }
  8765. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8766. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8767. }
  8768. else {
  8769. console.log('zh:AD 失败,直接发放奖励');
  8770. this.qjff_AD_for_uiGameEnd(level);
  8771. }
  8772. }
  8773. break;
  8774. default:
  8775. console.log('zh:clickRightBtn 444');
  8776. break;
  8777. }
  8778. }
  8779. logEventForChallenge_level_start(level) {
  8780. let keyStr = 'sjmd_challenge_level_start';
  8781. let jsonStr = {
  8782. "count": 0,
  8783. "gold_balance ": DataMgr.getCoin(),
  8784. "level": level,
  8785. "diamond_balance ": DataMgr.getDiamond()
  8786. };
  8787. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8788. const d = LocalStorageManager.getItem(keyStr);
  8789. if (level > d.level) {
  8790. jsonStr.count = d.count + 1;
  8791. LocalStorageManager.setItem(keyStr, jsonStr);
  8792. }
  8793. else {
  8794. }
  8795. }
  8796. else {
  8797. LocalStorageManager.setItem(keyStr, jsonStr);
  8798. }
  8799. const reqStr = JSON.stringify(jsonStr);
  8800. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8801. }
  8802. qjff_AD_for_uiGameEnd(level) {
  8803. DataMgr.setPlaceBallLevel(level, 1);
  8804. this.startPlaceBallLevel(level + 1);
  8805. }
  8806. startPlaceBallLevel(level) {
  8807. xGame.common.gameMode = GameMode.placeBall;
  8808. xGame.common.placeBallCurLevel = level;
  8809. xGame.uiMgr.Show(UIGame);
  8810. this.hide();
  8811. }
  8812. logEventForChallenge_level_complete(level) {
  8813. let keyStr = 'sjmd_challenge_level_complete';
  8814. let jsonStr = {
  8815. "count": 1,
  8816. "gold_balance ": DataMgr.getCoin(),
  8817. "level": level,
  8818. "diamond_balance ": DataMgr.getDiamond()
  8819. };
  8820. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8821. const d = LocalStorageManager.getItem(keyStr);
  8822. jsonStr.count = d.count + 1;
  8823. LocalStorageManager.setItem(keyStr, jsonStr);
  8824. }
  8825. else {
  8826. LocalStorageManager.setItem(keyStr, jsonStr);
  8827. }
  8828. const reqStr = JSON.stringify(jsonStr);
  8829. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8830. }
  8831. logEventForChallenge_level_N(level) {
  8832. console.log('zh:logEventForChallenge_level_N ' + level);
  8833. let keyStr = 'sjmd_challenge_level_N';
  8834. if (LocalStorageManager.hasKey(keyStr)) {
  8835. let lev = LocalStorageManager.getItem(keyStr);
  8836. if (level > lev) {
  8837. LocalStorageManager.setItem(keyStr, level);
  8838. }
  8839. if ((level) % 5 == 0) {
  8840. console.log('zh:每5关上报1次');
  8841. let sjmc = 'challenge_level_' + level;
  8842. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8843. let sjmcForFirebase = 'challenge_level_' + level;
  8844. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8845. }
  8846. else {
  8847. console.log('zh:5 no 上报');
  8848. }
  8849. }
  8850. else {
  8851. LocalStorageManager.setItem(keyStr, level);
  8852. }
  8853. }
  8854. }
  8855. UIGameEnd.uiName = "UIGameEnd";
  8856. class ui_UIVideoShare extends fgui.GComponent {
  8857. static createInstance() {
  8858. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8859. }
  8860. onConstruct() {
  8861. this.n10 = (this.getChild("n10"));
  8862. this.myNode = (this.getChild("myNode"));
  8863. this.t0 = this.getTransition("t0");
  8864. }
  8865. }
  8866. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8867. class UIVideoShare extends UIBase {
  8868. constructor() {
  8869. super();
  8870. this.success = false;
  8871. this.awardNum = 0;
  8872. this.isShared = true;
  8873. }
  8874. onConstructor() {
  8875. this.ui = ui_UIVideoShare.createInstance();
  8876. this.contentPane = this.ui;
  8877. this.isEject = false;
  8878. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8879. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8880. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8881. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8882. }
  8883. show(success) {
  8884. super.show();
  8885. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8886. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8887. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8888. this.success = success;
  8889. let time = xGame.common.randomNum(600, 1500);
  8890. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8891. if (success)
  8892. xGame.soundMgr.playSound("applause");
  8893. this.ui.t0.play();
  8894. this.checkShareState();
  8895. let times = DataMgr.getDailyVideoShareTimes();
  8896. this.awardNum = times == 0 ? 2000 : 200;
  8897. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8898. this.setGlobalFont(this.ui);
  8899. }
  8900. checkShareState() {
  8901. if (PlatMgr.forceShare == 0) {
  8902. this.ui.myNode.closeBtn.visible = true;
  8903. this.ui.myNode.tipsNode.visible = false;
  8904. this.ui.myNode.closeBtn.x = 90;
  8905. this.ui.myNode.shareBtn.x = 342;
  8906. }
  8907. else if (PlatMgr.forceShare == 1) {
  8908. this.ui.myNode.closeBtn.visible = false;
  8909. this.ui.myNode.tipsNode.visible = true;
  8910. this.ui.myNode.shareBtn.x = 218;
  8911. this.isShared = true;
  8912. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8913. }
  8914. }
  8915. checkForceShare() {
  8916. this.isShared = !this.isShared;
  8917. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8918. }
  8919. videoShare() {
  8920. if (PlatMgr.forceShare == 1) {
  8921. if (this.isShared) {
  8922. this.shareGame();
  8923. }
  8924. else {
  8925. this.hideSelf();
  8926. }
  8927. }
  8928. else {
  8929. this.shareGame();
  8930. }
  8931. }
  8932. shareGame() {
  8933. if (2 > 1) {
  8934. this.hideSelf();
  8935. return;
  8936. }
  8937. Moyu.sendDataEvent("VideoShare");
  8938. if (Moyu.canShare() > 100) {
  8939. Moyu.shareGame((success) => {
  8940. if (success) {
  8941. DataMgr.setDailyVideoShareTimes(1);
  8942. DataMgr.setCoin(this.awardNum);
  8943. }
  8944. this.hideSelf();
  8945. }, this);
  8946. }
  8947. else {
  8948. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8949. this.hideSelf();
  8950. }
  8951. }
  8952. hideSelf() {
  8953. this.hide();
  8954. xGame.uiMgr.Show(UIGameEnd, this.success);
  8955. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8956. xGame.common.screenImg.destroy();
  8957. xGame.common.screenImg = null;
  8958. }
  8959. }
  8960. }
  8961. UIVideoShare.uiName = "UIVideoShare";
  8962. class GameMgr {
  8963. constructor() {
  8964. this.selfCamp = "";
  8965. this.selfFoulNum = 0;
  8966. this.selfBallArr = [];
  8967. this.selfTimer = 0;
  8968. this.selfScore = 0;
  8969. this.aiCamp = "";
  8970. this.aiFoulNum = 0;
  8971. this.aiBallArr = [];
  8972. this.aiTimer = 0;
  8973. this.aiScore = 0;
  8974. this.aiSkillLevelNum = 1;
  8975. this.targertScore = 0;
  8976. this.setTime = 30;
  8977. this.selfTurnRate = 0.5;
  8978. this.accTime = 0;
  8979. this.curFoul = "";
  8980. this.maxFoulTimes = 3;
  8981. this.isFirstInGame = true;
  8982. this.firstColliObj = null;
  8983. this.inHoleBalls = [];
  8984. this.blackNum = 8;
  8985. this.success = false;
  8986. this.holePosList = [];
  8987. this.posObj = {};
  8988. this._selfTurn = false;
  8989. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8990. this.ensureBallType = false;
  8991. this.isOpenBall = true;
  8992. this.finishOneShoot = true;
  8993. this.isEnd = false;
  8994. this.isChangeTurn = false;
  8995. this.isInterrupt = false;
  8996. this.aiPlayedBreakArmy = false;
  8997. this.isTouchedBall = false;
  8998. this.finishBalls = 0;
  8999. this.needBalls = 0;
  9000. this.allBallNum = 0;
  9001. this.placeBallPosData = {};
  9002. this.curHP = 0;
  9003. this.showLongView = false;
  9004. this.firstShoot = true;
  9005. this._gamePause = false;
  9006. this.trunCount = 0;
  9007. this.isBlackInHole = false;
  9008. this.isEnter = true;
  9009. xGame.eventMgr.offAll(ALL_BALL_STOP);
  9010. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  9011. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  9012. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  9013. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  9014. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  9015. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9016. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9017. }
  9018. get gamePause() {
  9019. return this._gamePause;
  9020. }
  9021. set gamePause(v) {
  9022. if (v) {
  9023. Laya.physicsTimer.pause();
  9024. }
  9025. else {
  9026. Laya.physicsTimer.resume();
  9027. }
  9028. this._gamePause = v;
  9029. }
  9030. get selfTurn() {
  9031. return this._selfTurn;
  9032. }
  9033. set selfTurn(val) {
  9034. this.trunCount++;
  9035. this._selfTurn = val;
  9036. if (val) {
  9037. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9038. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9039. }
  9040. else {
  9041. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9042. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9043. if (this.trunCount > 1)
  9044. PlatMgr.openBox();
  9045. }
  9046. }
  9047. resetGame() {
  9048. this.inHoleBalls = [];
  9049. this.isFirstInGame = true;
  9050. this.firstColliObj = null;
  9051. this.aiCamp = "";
  9052. this.selfCamp = "";
  9053. this.aiFoulNum = 0;
  9054. this.selfFoulNum = 0;
  9055. this.selfBallArr = [];
  9056. this.aiBallArr = [];
  9057. this.gamePause = false;
  9058. this.ensureBallType = false;
  9059. this.isInterrupt = false;
  9060. this.updateLeftBall();
  9061. this.clearTime();
  9062. this.aiPlayedBreakArmy = false;
  9063. this.isBlackInHole = false;
  9064. this.placeBallPosData = {};
  9065. if (xGame.common.d3World.knifeRoot) {
  9066. xGame.common.d3World.knifeRoot.destroyChildren();
  9067. }
  9068. }
  9069. gameReady() {
  9070. this.trunCount = 0;
  9071. this.firstColliObj = null;
  9072. this.isFirstInGame = true;
  9073. this.selfTurn = Math.random() <= this.selfTurnRate;
  9074. let challengeNum = DataMgr.getChallengeTimes();
  9075. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9076. this.selfTurn = true;
  9077. }
  9078. if (xGame.common.gameMode == GameMode.placeBall)
  9079. this.selfTurn = true;
  9080. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9081. this.selfTurn = true;
  9082. }
  9083. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9084. if (DataMgr.getGuideDefaultModel() === 1) {
  9085. this.checkGuideForPlaceBall();
  9086. }
  9087. else {
  9088. this.checkGuide();
  9089. }
  9090. if (xGame.common.uiRodMethod)
  9091. xGame.common.uiRodMethod.resetRod();
  9092. xGame.common.d2World.getHelpLine();
  9093. this.isOpenBall = true;
  9094. this.isTouchedBall = false;
  9095. xGame.common.aiPlayer.stopRun();
  9096. this.setTime = 30;
  9097. let ui = xGame.common.gameUI.ui;
  9098. switch (xGame.common.gameMode) {
  9099. case GameMode.classic:
  9100. xGame.common.aiPlayer.init();
  9101. this.blackNum = 8;
  9102. this.placeRootBall();
  9103. this.peoplePlay(9, 10);
  9104. ui.wordsBtn.visible = true;
  9105. ui.aiWordsBtn.visible = true;
  9106. xGame.common.talkMgr.changeAIState(true);
  9107. DataMgr.gameData.gameCount++;
  9108. DataMgr.saveGameData();
  9109. break;
  9110. case GameMode.bigMove:
  9111. this.blackNum = -1;
  9112. this.selfScore = 0;
  9113. this.aiScore = 0;
  9114. xGame.common.aiPlayer.init();
  9115. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9116. this.updateSelfScore();
  9117. this.updateAIScore();
  9118. this.updateTargetSroce();
  9119. this.placeRootBall();
  9120. this.peoplePlay(9, 10);
  9121. ui.wordsBtn.visible = true;
  9122. ui.aiWordsBtn.visible = true;
  9123. xGame.common.talkMgr.changeAIState(true);
  9124. if (DataMgr.getSkillGuide() < 1)
  9125. DataMgr.gameData.gameCount = 0;
  9126. else {
  9127. DataMgr.gameData.gameCount++;
  9128. DataMgr.saveGameData();
  9129. PlatMgr.openTry();
  9130. }
  9131. if (xGame.common.d3World.knifeRoot) {
  9132. xGame.common.d3World.knifeRoot.destroyChildren();
  9133. }
  9134. break;
  9135. case GameMode.placeBall:
  9136. this.blackNum = -1;
  9137. this.selfTurn = true;
  9138. this.setTime = 10000;
  9139. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9140. this.curHP = this.placeBallData.hp;
  9141. if (this.placeBallData.ball == -1)
  9142. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9143. else
  9144. this.needBalls = this.placeBallData.ball;
  9145. console.log("需要的进球数目", this.needBalls);
  9146. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9147. this.finishBalls = 0;
  9148. this.placeBallPosData = {};
  9149. this.updatePlaceBallPos();
  9150. this.updatePlaceBallState();
  9151. this.finishOneShoot = true;
  9152. xGame.common.gameUI.ui.moveNode.visible = false;
  9153. this.isOpenBall = false;
  9154. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9155. ui.wordsBtn.visible = false;
  9156. ui.aiWordsBtn.visible = false;
  9157. xGame.common.talkMgr.changeAIState(false);
  9158. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9159. PlatMgr.openBox();
  9160. });
  9161. break;
  9162. default:
  9163. break;
  9164. }
  9165. this.showLongView = false;
  9166. xGame.common.wordsMgr.comboTimes = 1;
  9167. let guide = DataMgr.getSkillGuide();
  9168. if (guide)
  9169. xGame.eventMgr.event(WAIT_SHOOT);
  9170. xGame.common.upSkillLevel = false;
  9171. xGame.common.gameStartTime = new Date().getTime();
  9172. this.firstShoot = true;
  9173. }
  9174. checkGuide() {
  9175. console.log('zh: 检查引导123');
  9176. let guide = DataMgr.getSkillGuide();
  9177. let gameUI = xGame.common.gameUI.ui;
  9178. gameUI.guide1.visible = false;
  9179. gameUI.guide2.visible = false;
  9180. gameUI.guide3.visible = false;
  9181. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9182. this.selfTurn = true;
  9183. }
  9184. else {
  9185. return;
  9186. }
  9187. let oneBall = this.getOneBall();
  9188. gameUI.guide1.visible = true;
  9189. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9190. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9191. }
  9192. checkGuideForPlaceBall() {
  9193. console.log('zh: 检查引导123 checkGuideForPlaceBall');
  9194. let gameUI = xGame.common.gameUI.ui;
  9195. let guide = DataMgr.getLianXiGuide();
  9196. console.log('zh:checkGuideForPlaceBall =', guide);
  9197. console.log('zh:xGame.common.gameMode=' + xGame.common.gameMode);
  9198. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  9199. gameUI.n_lxms_yd1.visible = true;
  9200. let oneBall = this.getOneBallForPlaceBall();
  9201. gameUI.n_lxms_yd1.fingerNode.x = oneBall.gameObj.x + 15;
  9202. gameUI.n_lxms_yd1.fingerNode.y = oneBall.gameObj.y;
  9203. }
  9204. else {
  9205. gameUI.n_lxms_yd1.visible = false;
  9206. return;
  9207. }
  9208. }
  9209. getOneBall() {
  9210. let arr = xGame.common.d2World.ballArr;
  9211. for (let index = 0; index < arr.length; index++) {
  9212. if (arr[index].number == 0)
  9213. continue;
  9214. return arr[index];
  9215. }
  9216. }
  9217. getOneBallForPlaceBall() {
  9218. let arr = xGame.common.d2World.ballArr;
  9219. return arr[2];
  9220. }
  9221. updateSelfScore() {
  9222. let ui = xGame.common.gameUI.ui.topNode;
  9223. ui.selfScoreTxt.text = this.selfScore + "";
  9224. }
  9225. updateAIScore() {
  9226. let ui = xGame.common.gameUI.ui.topNode;
  9227. ui.aiScoreTxt.text = this.aiScore + "";
  9228. }
  9229. updateTargetSroce() {
  9230. let ui = xGame.common.gameUI.ui.topNode;
  9231. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9232. }
  9233. updateLeftBall() {
  9234. let topUI = xGame.common.gameUI.ui.topNode;
  9235. topUI.selfBallList.numItems = this.selfBallArr.length;
  9236. topUI.aiBallList.numItems = this.aiBallArr.length;
  9237. }
  9238. ballShoot() {
  9239. this.clearTime();
  9240. this.finishOneShoot = false;
  9241. xGame.common.gameUI.ui.moveNode.visible = false;
  9242. if (xGame.common.gameUI.ui.guideNode.visible) {
  9243. xGame.common.gameUI.ui.guideNode.visible = false;
  9244. }
  9245. if (this.firstShoot) {
  9246. this.firstShoot = false;
  9247. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9248. }
  9249. }
  9250. ensureCamp(number) {
  9251. this.ensureBallType = true;
  9252. this.isOpenBall = false;
  9253. if (xGame.common.gameMode != GameMode.classic)
  9254. return;
  9255. let full = [1, 2, 3, 4, 5, 6, 7];
  9256. let flower = [9, 10, 11, 12, 13, 14, 15];
  9257. let sayWords = "";
  9258. if (this.selfTurn) {
  9259. if (number <= 7) {
  9260. this.selfCamp = ballCamp.full;
  9261. this.selfBallArr = full;
  9262. this.aiCamp = ballCamp.flower;
  9263. this.aiBallArr = flower;
  9264. sayWords = cfgTable.wordsData[3].msg;
  9265. }
  9266. else {
  9267. this.selfCamp = ballCamp.flower;
  9268. this.selfBallArr = flower;
  9269. this.aiCamp = ballCamp.full;
  9270. this.aiBallArr = full;
  9271. sayWords = cfgTable.wordsData[4].msg;
  9272. }
  9273. }
  9274. else {
  9275. if (number <= 7) {
  9276. this.selfCamp = ballCamp.flower;
  9277. this.selfBallArr = flower;
  9278. this.aiCamp = ballCamp.full;
  9279. this.aiBallArr = full;
  9280. sayWords = cfgTable.wordsData[2].msg;
  9281. }
  9282. else {
  9283. this.selfCamp = ballCamp.full;
  9284. this.selfBallArr = full;
  9285. this.aiCamp = ballCamp.flower;
  9286. this.aiBallArr = flower;
  9287. sayWords = cfgTable.wordsData[1].msg;
  9288. }
  9289. }
  9290. this.updateLeftBall();
  9291. xGame.uiMgr.Show(UIMsg, sayWords);
  9292. }
  9293. updatePlaceBallState() {
  9294. let ui = xGame.common.gameUI.ui;
  9295. switch (this.placeBallData.type) {
  9296. case PlaceBallType.normal:
  9297. let normal = ui.placeNormalNode;
  9298. normal.hpTxt.text = this.curHP + "";
  9299. this.updatePlaceBallStar(normal);
  9300. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9301. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9302. break;
  9303. case PlaceBallType.challenge:
  9304. let challenge = ui.placeChallengeNode;
  9305. challenge.hpTxt.text = "Shots:" + this.curHP;
  9306. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9307. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9308. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9309. break;
  9310. default:
  9311. break;
  9312. }
  9313. }
  9314. playSubHpAni() {
  9315. let ui = xGame.common.gameUI.ui;
  9316. switch (this.placeBallData.type) {
  9317. case PlaceBallType.normal:
  9318. let normal = ui.placeNormalNode;
  9319. normal.hpTxt.visible = false;
  9320. normal.starAni.c1.selectedIndex = 1;
  9321. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9322. normal.hpTxt.visible = true;
  9323. normal.starAni.c1.selectedIndex = 0;
  9324. }));
  9325. break;
  9326. default:
  9327. break;
  9328. }
  9329. }
  9330. getEndStarNum() {
  9331. let num;
  9332. let level = xGame.common.placeBallCurLevel;
  9333. if (this.curHP == this.placeBallData.hp) {
  9334. num = 3;
  9335. }
  9336. else if (this.curHP <= 1) {
  9337. num = 1;
  9338. }
  9339. else {
  9340. num = 2;
  9341. }
  9342. if (!this.success) {
  9343. num = 0;
  9344. }
  9345. else {
  9346. DataMgr.setPlaceBallLevel(level, num);
  9347. }
  9348. let myType = cfgTable.placeballData[level].type;
  9349. if (this.success && myType == 1) {
  9350. num = 3;
  9351. }
  9352. xGame.common.placeBallStarNum = num;
  9353. }
  9354. updatePlaceBallStar(node) {
  9355. let star = 0;
  9356. if (this.curHP == this.placeBallData.hp) {
  9357. star = 3;
  9358. }
  9359. else if (this.curHP >= 2) {
  9360. star = 2;
  9361. }
  9362. else if (this.curHP == 1) {
  9363. star = 1;
  9364. }
  9365. else {
  9366. star = 0;
  9367. }
  9368. let temp;
  9369. for (let index = 1; index <= 3; index++) {
  9370. temp = node["star" + index];
  9371. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9372. }
  9373. node.myProgress.value = (star / 3) * 100;
  9374. }
  9375. openRegretView(isFoul, GoalNum, challenge = false) {
  9376. let regretType = -1;
  9377. if (isFoul) {
  9378. regretType = 1;
  9379. }
  9380. else {
  9381. if (GoalNum <= 0) {
  9382. regretType = 0;
  9383. }
  9384. }
  9385. if (challenge) {
  9386. regretType = 1;
  9387. }
  9388. if (regretType != -1) {
  9389. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9390. if (success) {
  9391. this.curHP++;
  9392. this.updatePlaceBallState();
  9393. this.setPlaceBallAllPos();
  9394. xGame.common.gameUI.ui.moveNode.visible = false;
  9395. }
  9396. else {
  9397. if (this.curHP <= 0) {
  9398. this.success = false;
  9399. this.gameEnd();
  9400. }
  9401. this.playSubHpAni();
  9402. }
  9403. this.updatePlaceBallState();
  9404. this.updatePlaceBallPos();
  9405. });
  9406. }
  9407. }
  9408. setPlaceBallAllPos() {
  9409. let allBall = xGame.common.d2World.ballArr;
  9410. let cfgArr = this.placeBallPosData;
  9411. let temp;
  9412. let obj;
  9413. for (let index = 0; index < allBall.length; index++) {
  9414. temp = allBall[index];
  9415. if (temp.destroyed)
  9416. continue;
  9417. obj = cfgArr[temp.myUNID];
  9418. if (obj && obj.src && !obj.src.destroyed) {
  9419. temp.gameObj.x = obj.posX;
  9420. temp.gameObj.y = obj.posY;
  9421. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9422. }
  9423. }
  9424. xGame.common.d2World.getHelpLine();
  9425. }
  9426. updatePlaceBallPos() {
  9427. let arr = xGame.common.d2World.ballArr;
  9428. let temp;
  9429. for (let index = 0; index < arr.length; index++) {
  9430. temp = arr[index];
  9431. if (!this.placeBallPosData[temp.myUNID]) {
  9432. this.placeBallPosData[temp.myUNID] = {
  9433. src: temp,
  9434. posX: temp.gameObj.x,
  9435. posY: temp.gameObj.y
  9436. };
  9437. }
  9438. else {
  9439. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9440. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9441. }
  9442. }
  9443. let check;
  9444. for (const key in this.placeBallPosData) {
  9445. check = this.placeBallPosData[key];
  9446. if (check.src.destroyed) {
  9447. delete this.placeBallPosData[key];
  9448. }
  9449. }
  9450. }
  9451. gameRun(type) {
  9452. if (this.gamePause)
  9453. return;
  9454. this.curFoul = this.getFoulType();
  9455. if (type) {
  9456. xGame.common.d2World.d2Gan.shoot();
  9457. xGame.common.gameUI.forceCancel();
  9458. this.curFoul = type;
  9459. }
  9460. this.isEnd = false;
  9461. this.isChangeTurn = true;
  9462. if (xGame.common.gameMode == GameMode.classic) {
  9463. this.judgeClassic(this.curFoul);
  9464. this.checkClassicWords(() => {
  9465. xGame.common.destroyClassicEmotion();
  9466. if (this.isEnd) {
  9467. if (this.isBlackInHole) {
  9468. xGame.common.gameUI.ui.blackAni.visible = true;
  9469. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9470. xGame.common.gameUI.ui.blackAni.visible = false;
  9471. this.gameEnd();
  9472. }));
  9473. }
  9474. else {
  9475. this.gameEnd();
  9476. }
  9477. }
  9478. else {
  9479. this.waitShoot();
  9480. xGame.eventMgr.event(WAIT_SHOOT);
  9481. }
  9482. });
  9483. }
  9484. else if (xGame.common.gameMode == GameMode.bigMove) {
  9485. xGame.common.aiPlayer.stopRun();
  9486. let scoreArr = this.getScore(this.curFoul);
  9487. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9488. this.isEnd = true;
  9489. }
  9490. this.checkBigSkillWords(() => {
  9491. if (this.isEnd) {
  9492. this.gameEnd();
  9493. }
  9494. else {
  9495. this.waitShoot();
  9496. xGame.eventMgr.event(WAIT_SHOOT);
  9497. }
  9498. });
  9499. }
  9500. else if (xGame.common.gameMode == GameMode.placeBall) {
  9501. xGame.common.destroyAwardSpine();
  9502. let isFoul = this.curFoul == FoulType.rootHole;
  9503. let GoalNum = this.inHoleBalls.length;
  9504. if (this.inHoleBalls.indexOf(0) > -1)
  9505. GoalNum -= 1;
  9506. if (isFoul) {
  9507. this.placeRootBall();
  9508. }
  9509. console.log("neeballs", this.needBalls);
  9510. console.log("当前完成的goalNum", GoalNum);
  9511. this.finishBalls += GoalNum;
  9512. console.log("当前完成的finishballs", this.finishBalls);
  9513. let need = this.needBalls;
  9514. if (this.placeBallData.type == PlaceBallType.challenge) {
  9515. need += 100;
  9516. }
  9517. if (this.finishBalls >= need) {
  9518. this.success = true;
  9519. this.gameEnd();
  9520. }
  9521. else {
  9522. switch (this.placeBallData.type) {
  9523. case PlaceBallType.normal:
  9524. if (!isFoul && GoalNum > 0) {
  9525. this.updatePlaceBallPos();
  9526. this.updatePlaceBallState();
  9527. }
  9528. else {
  9529. this.curHP--;
  9530. this.openRegretView(isFoul, GoalNum);
  9531. }
  9532. this.waitShoot();
  9533. xGame.eventMgr.event(WAIT_SHOOT);
  9534. break;
  9535. case PlaceBallType.challenge:
  9536. this.curHP--;
  9537. this.updatePlaceBallState();
  9538. if (isFoul) {
  9539. this.openRegretView(isFoul, GoalNum, true);
  9540. }
  9541. else {
  9542. this.updatePlaceBallPos();
  9543. if (this.curHP <= 0) {
  9544. this.success = true;
  9545. this.gameEnd();
  9546. }
  9547. }
  9548. this.waitShoot();
  9549. xGame.eventMgr.event(WAIT_SHOOT);
  9550. break;
  9551. default:
  9552. break;
  9553. }
  9554. }
  9555. }
  9556. }
  9557. checkClassicWords(callback) {
  9558. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9559. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9560. let type = this.getClassicWordsType();
  9561. if (condition && type != -1) {
  9562. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9563. xGame.soundMgr.playSound(str);
  9564. xGame.common.wordsMgr.playClassicWords(type, callback);
  9565. }
  9566. else {
  9567. Laya.timer.once(300, this, () => {
  9568. callback && callback();
  9569. });
  9570. }
  9571. }
  9572. getClassicWordsType() {
  9573. let d2world = xGame.common.d2World;
  9574. let type = -1;
  9575. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9576. type = ClassicWordsType.perfectShow;
  9577. return type;
  9578. }
  9579. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9580. type = ClassicWordsType.directShoot;
  9581. return type;
  9582. }
  9583. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9584. type = ClassicWordsType.anotherShoot;
  9585. return type;
  9586. }
  9587. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9588. type = ClassicWordsType.bigPower;
  9589. return type;
  9590. }
  9591. let minSpeed = 1;
  9592. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9593. type = ClassicWordsType.hardShoot;
  9594. return type;
  9595. }
  9596. if (this.inHoleBalls.length > 0) {
  9597. type = ClassicWordsType.directShoot;
  9598. return type;
  9599. }
  9600. return type;
  9601. }
  9602. checkBigSkillWords(callback) {
  9603. if (this.curFoul == FoulType.timeOut) {
  9604. callback && callback();
  9605. }
  9606. else {
  9607. let playSkill = false;
  9608. if (this.selfTurn) {
  9609. playSkill = true;
  9610. }
  9611. else {
  9612. if (!this.aiPlayedBreakArmy) {
  9613. this.aiPlayedBreakArmy = true;
  9614. playSkill = true;
  9615. }
  9616. if (this.aiCurSkill != SkillType.breakArmy) {
  9617. playSkill = true;
  9618. }
  9619. }
  9620. if (xGame.common.skillMgr.playedLastSkill) {
  9621. xGame.common.skillMgr.playedLastSkill = false;
  9622. playSkill = false;
  9623. }
  9624. if (playSkill) {
  9625. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9626. let selfExtra = 0;
  9627. let aiExtra = 0;
  9628. if (this.selfTurn)
  9629. selfExtra += extraScore;
  9630. else
  9631. aiExtra += extraScore;
  9632. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9633. this.isEnd = true;
  9634. }
  9635. this.playBigSkillTimes(callback);
  9636. });
  9637. }
  9638. else {
  9639. this.playBigSkillTimes(callback);
  9640. }
  9641. }
  9642. }
  9643. playBigSkillTimes(callback) {
  9644. let length = this.inHoleBalls.length;
  9645. if (this.inHoleBalls.indexOf(0) > -1) {
  9646. length = this.inHoleBalls.length - 1;
  9647. }
  9648. if (length <= 0) {
  9649. callback && callback();
  9650. return;
  9651. }
  9652. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9653. callback && callback();
  9654. });
  9655. }
  9656. playSkillTips() {
  9657. let levelNum = 0;
  9658. let curType;
  9659. if (this.selfTurn) {
  9660. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9661. curType = this.selfCurSkill;
  9662. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9663. levelNum += 5;
  9664. }
  9665. }
  9666. else {
  9667. levelNum = this.aiSkillLevelNum;
  9668. curType = this.aiCurSkill;
  9669. }
  9670. let str = ``;
  9671. switch (curType) {
  9672. case SkillType.highSpace:
  9673. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9674. break;
  9675. case SkillType.breakArmy:
  9676. str = `You pocketed ${levelNum} extra balls`;
  9677. break;
  9678. case SkillType.ice:
  9679. str = `${levelNum * 2} extra balls were frozen`;
  9680. break;
  9681. case SkillType.fireworks:
  9682. str = `${levelNum} extra balls exploded `;
  9683. break;
  9684. case SkillType.GuanYu:
  9685. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9686. break;
  9687. default:
  9688. break;
  9689. }
  9690. xGame.uiMgr.Show(UIMsg, str);
  9691. }
  9692. getFoulType() {
  9693. let foulType = "";
  9694. if (this.firstColliObj == null) {
  9695. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9696. return FoulType.rootHole;
  9697. }
  9698. return FoulType.notTouch;
  9699. }
  9700. else {
  9701. if (this.selfTurn) {
  9702. if (this.selfBallArr.length > 0) {
  9703. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9704. foulType = FoulType.wrongTouch;
  9705. }
  9706. }
  9707. else {
  9708. if (this.ensureBallType) {
  9709. }
  9710. else {
  9711. if (this.firstColliObj == this.blackNum) {
  9712. foulType = FoulType.wrongTouch;
  9713. }
  9714. }
  9715. }
  9716. }
  9717. else {
  9718. if (this.aiBallArr.length > 0) {
  9719. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9720. foulType = FoulType.wrongTouch;
  9721. }
  9722. }
  9723. else {
  9724. if (this.ensureBallType) {
  9725. }
  9726. else {
  9727. if (this.firstColliObj == this.blackNum) {
  9728. foulType = FoulType.wrongTouch;
  9729. }
  9730. }
  9731. }
  9732. }
  9733. if (this.inHoleBalls.length <= 0) {
  9734. return foulType;
  9735. }
  9736. let temp;
  9737. if (this.inHoleBalls.indexOf(0) > -1) {
  9738. foulType = FoulType.rootHole;
  9739. }
  9740. else {
  9741. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9742. temp = this.inHoleBalls[index];
  9743. if (this.selfTurn) {
  9744. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9745. foulType = FoulType.wrongHole;
  9746. break;
  9747. }
  9748. }
  9749. else {
  9750. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9751. foulType = FoulType.wrongHole;
  9752. break;
  9753. }
  9754. }
  9755. }
  9756. }
  9757. let foo;
  9758. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9759. temp = this.inHoleBalls[index];
  9760. foo = this.selfBallArr.indexOf(temp);
  9761. if (foo > -1) {
  9762. this.selfBallArr.splice(foo, 1);
  9763. }
  9764. foo = this.aiBallArr.indexOf(temp);
  9765. if (foo > -1) {
  9766. this.aiBallArr.splice(foo, 1);
  9767. }
  9768. }
  9769. this.updateLeftBall();
  9770. }
  9771. return foulType;
  9772. }
  9773. judgeGameEndByBlack(arr) {
  9774. if (this.selfTurn) {
  9775. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9776. this.selfFoulNum = this.maxFoulTimes;
  9777. return true;
  9778. }
  9779. }
  9780. else {
  9781. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9782. this.aiFoulNum = this.maxFoulTimes;
  9783. return true;
  9784. }
  9785. }
  9786. }
  9787. judgeClassic(type) {
  9788. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9789. xGame.common.aiPlayer.stopRun();
  9790. if (this.judgeNormalSuccess()) {
  9791. this.isEnd = true;
  9792. return;
  9793. }
  9794. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9795. if (this.selfTurn) {
  9796. if (isFoul) {
  9797. this.selfFoulNum++;
  9798. }
  9799. if (this.selfFoulNum >= this.maxFoulTimes) {
  9800. this.success = false;
  9801. this.isEnd = true;
  9802. return;
  9803. }
  9804. }
  9805. else {
  9806. if (isFoul)
  9807. this.aiFoulNum++;
  9808. if (this.aiFoulNum >= this.maxFoulTimes) {
  9809. this.success = true;
  9810. this.isEnd = true;
  9811. return;
  9812. }
  9813. }
  9814. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9815. this.isChangeTurn = false;
  9816. }
  9817. else {
  9818. this.isInterrupt = true;
  9819. }
  9820. }
  9821. waitShoot() {
  9822. if (xGame.common.gameMode == GameMode.classic) {
  9823. switch (this.curFoul) {
  9824. case FoulType.timeOut:
  9825. case FoulType.rootHole:
  9826. this.selfTurn = !this.selfTurn;
  9827. this.peoplePlay(5, 6, true);
  9828. break;
  9829. case FoulType.notTouch:
  9830. this.selfTurn = !this.selfTurn;
  9831. this.peoplePlay(7, 7);
  9832. break;
  9833. case FoulType.wrongHole:
  9834. this.selfTurn = !this.selfTurn;
  9835. this.peoplePlay(11, 11);
  9836. break;
  9837. default:
  9838. if (this.inHoleBalls.length > 0) {
  9839. this.peoplePlay(0, 0, false, false);
  9840. }
  9841. else {
  9842. this.selfTurn = !this.selfTurn;
  9843. this.peoplePlay(7, 7);
  9844. }
  9845. break;
  9846. }
  9847. }
  9848. else if (xGame.common.gameMode == GameMode.bigMove) {
  9849. if (this.curFoul == FoulType.timeOut) {
  9850. this.selfTurn = !this.selfTurn;
  9851. this.peoplePlay(14, 15);
  9852. this.placeRootBall();
  9853. }
  9854. else {
  9855. this.selfTurn = !this.selfTurn;
  9856. if (this.curFoul == FoulType.rootHole) {
  9857. this.peoplePlay(12, 13);
  9858. this.placeRootBall();
  9859. }
  9860. else {
  9861. this.peoplePlay(0, 0, false, false);
  9862. }
  9863. }
  9864. }
  9865. else if (xGame.common.gameMode == GameMode.placeBall) {
  9866. this.finishOneShoot = true;
  9867. }
  9868. this.gameResult();
  9869. }
  9870. gameResult() {
  9871. this.firstColliObj = null;
  9872. this.inHoleBalls = [];
  9873. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9874. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9875. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9876. if (xGame.common.uiRodMethod)
  9877. xGame.common.uiRodMethod.resetRod();
  9878. xGame.common.d2World.rootBall.showSelf();
  9879. this.clearIceSkill();
  9880. if (this.selfTurn) {
  9881. PlatMgr.gameInsert();
  9882. }
  9883. xGame.common.d3World.knifeRoot.destroyChildren();
  9884. if (this.selfTurn) {
  9885. xGame.common.gameUI.showHelpLineGuide();
  9886. xGame.common.gameUI.setTurnAlpha(true);
  9887. }
  9888. else {
  9889. xGame.common.gameUI.setTurnAlpha(false);
  9890. }
  9891. }
  9892. getScore(type) {
  9893. let selfAdd = 0;
  9894. let aiAdd = 0;
  9895. if (type == FoulType.timeOut) {
  9896. if (this.selfTurn)
  9897. aiAdd += 3;
  9898. else
  9899. selfAdd += 3;
  9900. }
  9901. else {
  9902. if (this.inHoleBalls.length > 0) {
  9903. if (this.selfTurn) {
  9904. if (type == FoulType.rootHole) {
  9905. aiAdd += 3;
  9906. if (this.inHoleBalls.length - 1 > 0) {
  9907. selfAdd += this.inHoleBalls.length - 1;
  9908. }
  9909. }
  9910. else {
  9911. selfAdd += this.inHoleBalls.length;
  9912. }
  9913. }
  9914. else {
  9915. if (type == FoulType.rootHole) {
  9916. selfAdd += 3;
  9917. if (this.inHoleBalls.length - 1 > 0) {
  9918. aiAdd += this.inHoleBalls.length - 1;
  9919. }
  9920. }
  9921. else {
  9922. aiAdd += this.inHoleBalls.length;
  9923. }
  9924. }
  9925. }
  9926. }
  9927. return [selfAdd, aiAdd];
  9928. }
  9929. judgeScoreEnd(selfAdd, aiAdd) {
  9930. this.selfScore += selfAdd;
  9931. this.aiScore += aiAdd;
  9932. this.updateAIScore();
  9933. this.updateSelfScore();
  9934. if (this.selfScore >= this.targertScore) {
  9935. this.success = true;
  9936. return true;
  9937. }
  9938. if (this.aiScore >= this.targertScore) {
  9939. this.success = false;
  9940. return true;
  9941. }
  9942. let ballArr = xGame.common.d2World.ballArr;
  9943. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9944. if (this.selfScore > this.aiScore) {
  9945. this.success = true;
  9946. return true;
  9947. }
  9948. else if (this.selfScore < this.aiScore) {
  9949. this.success = false;
  9950. return true;
  9951. }
  9952. else {
  9953. if (this.selfTurn) {
  9954. this.success = false;
  9955. }
  9956. else {
  9957. this.success = true;
  9958. }
  9959. return true;
  9960. }
  9961. }
  9962. }
  9963. clearIceSkill() {
  9964. let arr = xGame.common.d2World.ballArr;
  9965. let temp;
  9966. if (this.selfTurn) {
  9967. if (this.selfCurSkill == SkillType.ice) {
  9968. for (let index = 0; index < arr.length; index++) {
  9969. temp = arr[index];
  9970. if (temp.ballFunc == "ice") {
  9971. temp.setBallFunc("normal", "self");
  9972. }
  9973. }
  9974. }
  9975. }
  9976. else {
  9977. if (this.aiCurSkill == SkillType.ice) {
  9978. for (let index = 0; index < arr.length; index++) {
  9979. temp = arr[index];
  9980. if (temp.ballFunc == "ice") {
  9981. temp.setBallFunc("normal", "ai");
  9982. }
  9983. }
  9984. }
  9985. }
  9986. }
  9987. judgeNormalSuccess() {
  9988. if (this.selfTurn) {
  9989. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9990. this.success = true;
  9991. return true;
  9992. }
  9993. }
  9994. else {
  9995. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9996. this.success = false;
  9997. return true;
  9998. }
  9999. }
  10000. }
  10001. gameEnd() {
  10002. if (Moyu.isTT) {
  10003. xGame.common.screenImg = getScreenImg();
  10004. }
  10005. console.log("游戏结束", this.success);
  10006. xGame.common.aiPlayer.stopRun();
  10007. if (xGame.common.gameMode == GameMode.placeBall) {
  10008. this.getEndStarNum();
  10009. this.updatePlaceBallState();
  10010. }
  10011. this.isEnter = false;
  10012. Moyu.recordEnd(this, () => {
  10013. if (this.isEnter)
  10014. return;
  10015. this.isEnter = true;
  10016. console.log("进入录结束回调");
  10017. this.enterNext();
  10018. });
  10019. Laya.timer.once(1000, this, () => {
  10020. if (this.isEnter)
  10021. return;
  10022. this.isEnter = true;
  10023. this.enterNext();
  10024. });
  10025. xGame.common.longHelpLine = false;
  10026. }
  10027. enterNext() {
  10028. Laya.timer.clearAll(this);
  10029. if (Moyu.canShare() > 100 || Moyu.isKs) {
  10030. xGame.uiMgr.Show(UIVideoShare, this.success);
  10031. }
  10032. else {
  10033. xGame.uiMgr.Show(UIGameEnd, this.success);
  10034. }
  10035. }
  10036. aiLeave() {
  10037. let ui = xGame.common.gameUI.ui;
  10038. ui.topNode.aiNameTxt.text = "offline";
  10039. }
  10040. aiGameEnd(suc) {
  10041. this.success = suc;
  10042. xGame.common.aiPlayer.stopRun();
  10043. if (this.success) {
  10044. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10045. Laya.timer.once(1000, this, () => {
  10046. this.clearTime();
  10047. this.gameEnd();
  10048. });
  10049. }
  10050. }
  10051. openTimer() {
  10052. let src = xGame.common.gameUI;
  10053. if (this.selfTurn) {
  10054. src.ui.topNode.selfProgress.visible = true;
  10055. src.ui.topNode.aiProgress.visible = false;
  10056. this.curTimer = src.ui.topNode.selfProgress;
  10057. }
  10058. else {
  10059. src.ui.topNode.selfProgress.visible = false;
  10060. src.ui.topNode.aiProgress.visible = true;
  10061. this.curTimer = src.ui.topNode.aiProgress;
  10062. }
  10063. this.accTime = 0;
  10064. Laya.timer.clearAll(this);
  10065. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10066. this.curTimer.value = 100;
  10067. }
  10068. updateTime(dt) {
  10069. if (this.gamePause)
  10070. return;
  10071. this.accTime += dt;
  10072. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10073. if (this.accTime >= this.setTime) {
  10074. this.clearTime();
  10075. console.log("时钟进入了gameRun");
  10076. this.gameRun(FoulType.timeOut);
  10077. }
  10078. }
  10079. clearTime() {
  10080. let src = xGame.common.gameUI;
  10081. src.ui.topNode.selfProgress.visible = false;
  10082. src.ui.topNode.aiProgress.visible = false;
  10083. Laya.timer.clearAll(this);
  10084. }
  10085. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10086. let ui = xGame.common.gameUI.ui;
  10087. let selfMsg, aiMsg;
  10088. if (sayWords) {
  10089. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10090. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10091. if (Foul) {
  10092. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10093. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10094. this.placeRootBall();
  10095. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10096. if (this.curFoul == FoulType.rootHole) {
  10097. if (!DataMgr.getRootBallFoul()) {
  10098. DataMgr.setRootBallFoul();
  10099. aiMsg = "";
  10100. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10101. let woman = "Boss, pay attention next time~";
  10102. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10103. }
  10104. }
  10105. else if (this.curFoul == FoulType.timeOut) {
  10106. if (!DataMgr.getTimeoutFoul()) {
  10107. DataMgr.setTimeoutFoul();
  10108. aiMsg = "";
  10109. let tips = "Game timeout, 3 fouls, this game failed.";
  10110. let woman = "Boss, pay attention to the timeline~";
  10111. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10112. }
  10113. }
  10114. }
  10115. }
  10116. }
  10117. if (this.selfTurn) {
  10118. if (sayWords) {
  10119. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10120. ui.selfTurn.visible = true;
  10121. ui.aiTurn.visible = false;
  10122. ui.selfTurn.t0.play();
  10123. Moyu.vibration();
  10124. });
  10125. }
  10126. }
  10127. else {
  10128. let aiNum = xGame.tools.random(1, 11);
  10129. let challengeNum = DataMgr.getChallengeTimes();
  10130. let delay = false;
  10131. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10132. aiNum = 9;
  10133. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10134. aiNum = 3;
  10135. if (challengeNum == 3) {
  10136. if (!this.showLongView) {
  10137. this.showLongView = true;
  10138. delay = true;
  10139. }
  10140. }
  10141. }
  10142. }
  10143. if (delay) {
  10144. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10145. if (success) {
  10146. xGame.common.longHelpLine = true;
  10147. xGame.common.d2World.getHelpLine();
  10148. }
  10149. else {
  10150. aiNum = 10;
  10151. }
  10152. xGame.common.aiPlayer.setAiLevel(aiNum);
  10153. if (sayWords) {
  10154. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10155. xGame.common.aiPlayer.runAI();
  10156. ui.selfTurn.visible = false;
  10157. ui.aiTurn.visible = true;
  10158. ui.aiTurn.t0.play();
  10159. });
  10160. }
  10161. else {
  10162. xGame.common.aiPlayer.runAI();
  10163. }
  10164. this.openTimer();
  10165. this.finishOneShoot = true;
  10166. if (this.selfTurn) {
  10167. ui.topNode.selfKuang.visible = true;
  10168. ui.topNode.aiKuang.visible = false;
  10169. ui.topNode.selfTips.visible = true;
  10170. ui.topNode.aiTips.visible = false;
  10171. }
  10172. else {
  10173. ui.topNode.selfKuang.visible = false;
  10174. ui.topNode.aiKuang.visible = true;
  10175. ui.topNode.selfTips.visible = false;
  10176. ui.topNode.aiTips.visible = true;
  10177. }
  10178. });
  10179. return;
  10180. }
  10181. if (xGame.common.gameMode == GameMode.classic) {
  10182. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10183. if (cfg) {
  10184. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10185. aiNum = aiLevel;
  10186. }
  10187. }
  10188. xGame.common.aiPlayer.setAiLevel(aiNum);
  10189. if (sayWords) {
  10190. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10191. xGame.common.aiPlayer.runAI();
  10192. ui.selfTurn.visible = false;
  10193. ui.aiTurn.visible = true;
  10194. ui.aiTurn.t0.play();
  10195. });
  10196. }
  10197. else {
  10198. xGame.common.aiPlayer.runAI();
  10199. }
  10200. }
  10201. this.openTimer();
  10202. this.finishOneShoot = true;
  10203. if (this.selfTurn) {
  10204. ui.topNode.selfKuang.visible = true;
  10205. ui.topNode.aiKuang.visible = false;
  10206. ui.topNode.selfTips.visible = true;
  10207. ui.topNode.aiTips.visible = false;
  10208. }
  10209. else {
  10210. ui.topNode.selfKuang.visible = false;
  10211. ui.topNode.aiKuang.visible = true;
  10212. ui.topNode.selfTips.visible = false;
  10213. ui.topNode.aiTips.visible = true;
  10214. }
  10215. }
  10216. placeRootBall() {
  10217. let rootBall = xGame.common.d2World.rootBall;
  10218. if (!rootBall)
  10219. return;
  10220. rootBall.gameObj.x = this.lastRootBallPos.x;
  10221. rootBall.gameObj.y = this.lastRootBallPos.y;
  10222. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10223. let moveNode = xGame.common.gameUI.ui.moveNode;
  10224. moveNode.visible = true;
  10225. moveNode.x = this.lastRootBallPos.x;
  10226. moveNode.y = this.lastRootBallPos.y;
  10227. if (!this.selfTurn) {
  10228. xGame.common.aiPlayer.resetRoot();
  10229. }
  10230. }
  10231. }
  10232. class ui_guanyuAni extends fgui.GComponent {
  10233. static createInstance() {
  10234. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10235. }
  10236. onConstruct() {
  10237. this.n0 = (this.getChild("n0"));
  10238. }
  10239. }
  10240. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10241. class UIFireworks extends UIBase {
  10242. constructor() {
  10243. super();
  10244. }
  10245. onConstructor() {
  10246. this.isEject = false;
  10247. }
  10248. show(callback) {
  10249. super.show();
  10250. }
  10251. }
  10252. UIFireworks.uiName = "UIFireworks";
  10253. class ui_UIGuanYu extends fgui.GComponent {
  10254. static createInstance() {
  10255. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10256. }
  10257. onConstruct() {
  10258. this.n2 = (this.getChild("n2"));
  10259. this.n1 = (this.getChild("n1"));
  10260. this.n3 = (this.getChild("n3"));
  10261. this.n4 = (this.getChild("n4"));
  10262. this.n5 = (this.getChild("n5"));
  10263. this.n6 = (this.getChild("n6"));
  10264. this.n8 = (this.getChild("n8"));
  10265. this.n7 = (this.getChild("n7"));
  10266. this.t0 = this.getTransition("t0");
  10267. }
  10268. }
  10269. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10270. class UIGuanYu extends UIBase {
  10271. constructor() {
  10272. super();
  10273. }
  10274. onConstructor() {
  10275. this.ui = ui_UIGuanYu.createInstance();
  10276. this.contentPane = this.ui;
  10277. this.isEject = false;
  10278. }
  10279. show(callback) {
  10280. super.show();
  10281. this.ui.t0.play(Laya.Handler.create(this, () => {
  10282. callback && callback();
  10283. this.hide();
  10284. }));
  10285. this.setGlobalFont(this.ui);
  10286. }
  10287. }
  10288. UIGuanYu.uiName = "UIGuanYu";
  10289. class SkillMgr {
  10290. constructor() {
  10291. this.leveNum = 0;
  10292. this.extraScore = 0;
  10293. this.selfTurn = false;
  10294. this.playedLastSkill = false;
  10295. this.tweenArr = [];
  10296. this._finishNum = 0;
  10297. this._curFinish = 0;
  10298. this._rootX = 0;
  10299. this._rootY = 0;
  10300. this.knifeTimes = 0;
  10301. this.knifeV2 = new Laya.Vector2();
  10302. this.knifeV3 = new Laya.Vector3();
  10303. this.rtStarX = 0;
  10304. this.rtStarY = 0;
  10305. this.addBigSkillSpine();
  10306. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10307. }
  10308. addBigSkillSpine() {
  10309. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10310. console.log("extra2 success");
  10311. });
  10312. }
  10313. runBigSkill(callback) {
  10314. this.tweenArr = [];
  10315. this.callback = callback;
  10316. this.judgeSkill();
  10317. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10318. let guide = DataMgr.getSkillGuide();
  10319. if (!xGame.common.gameMgr.selfTurn) {
  10320. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10321. }
  10322. else {
  10323. if (xGame.common.temSelfLevel != 0) {
  10324. this.leveNum = xGame.common.temSelfLevel;
  10325. }
  10326. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10327. this.leveNum += 5;
  10328. }
  10329. }
  10330. if (guide == 0) {
  10331. DataMgr.setSkillGuide(1);
  10332. if (DataMgr.getNewUser()) {
  10333. Moyu.sendDataEvent("gameFirstPlay");
  10334. DataMgr.setNewUser();
  10335. }
  10336. }
  10337. this.playSpineAni(() => {
  10338. switch (this.curSkill) {
  10339. case SkillType.highSpace:
  10340. this.runHighSpace();
  10341. break;
  10342. case SkillType.breakArmy:
  10343. this.runBreakArmy();
  10344. break;
  10345. case SkillType.ice:
  10346. this.runIce();
  10347. break;
  10348. case SkillType.fireworks:
  10349. this.runFireworks();
  10350. break;
  10351. case SkillType.GuanYu:
  10352. this.runGuanYu();
  10353. break;
  10354. default:
  10355. break;
  10356. }
  10357. });
  10358. }
  10359. judgeSkill() {
  10360. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10361. let gameMgr = xGame.common.gameMgr;
  10362. let type;
  10363. for (let index = 0; index < typeArr.length; index++) {
  10364. type = typeArr[index];
  10365. if (gameMgr.selfTurn) {
  10366. if (gameMgr.selfCurSkill == type) {
  10367. this.selfTurn = true;
  10368. this.curSkill = type;
  10369. return;
  10370. }
  10371. }
  10372. else {
  10373. if (gameMgr.aiCurSkill == type) {
  10374. this.selfTurn = false;
  10375. this.curSkill = type;
  10376. return;
  10377. }
  10378. }
  10379. }
  10380. }
  10381. playSpineAni(callback) {
  10382. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10383. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10384. parent.destroyChildren();
  10385. let aniIndex = 0;
  10386. let skillSpine;
  10387. switch (this.curSkill) {
  10388. case SkillType.highSpace:
  10389. aniIndex = 1;
  10390. xGame.soundMgr.playSound("skill01");
  10391. skillSpine = this.skillSpine2;
  10392. data.scaleX = 0.5;
  10393. data.scaleY = 0.5;
  10394. skillSpine.play(data, 1, false, parent, () => {
  10395. callback && callback();
  10396. });
  10397. break;
  10398. case SkillType.breakArmy:
  10399. aniIndex = 2;
  10400. xGame.soundMgr.playSound("skill02");
  10401. skillSpine = this.skillSpine2;
  10402. data.scaleX = 0.5;
  10403. data.scaleY = 0.5;
  10404. skillSpine.play(data, 2, false, parent, () => {
  10405. callback && callback();
  10406. });
  10407. break;
  10408. case SkillType.ice:
  10409. aniIndex = 0;
  10410. xGame.soundMgr.playSound("skill03");
  10411. skillSpine = this.skillSpine2;
  10412. data.scaleX = 0.5;
  10413. data.scaleY = 0.5;
  10414. skillSpine.play(data, 0, false, parent, () => {
  10415. callback && callback();
  10416. });
  10417. break;
  10418. case SkillType.fireworks:
  10419. xGame.soundMgr.playSound("skill_04_01");
  10420. xGame.soundMgr.playSound("skill04");
  10421. xGame.uiMgr.Show(UIFireworks, callback);
  10422. break;
  10423. case SkillType.GuanYu:
  10424. xGame.soundMgr.playSound("skill05_1");
  10425. xGame.soundMgr.playSound("skill05");
  10426. xGame.uiMgr.Show(UIGuanYu, callback);
  10427. break;
  10428. default:
  10429. break;
  10430. }
  10431. }
  10432. getAllBallArr() {
  10433. let arr = xGame.common.d2World.ballArr;
  10434. let outArr = [];
  10435. for (let index = 0; index < arr.length; index++) {
  10436. if (arr[index] instanceof D2RootBallSrc)
  10437. continue;
  10438. if (arr[index].ballFunc == "ice")
  10439. continue;
  10440. if (arr[index].destroyed)
  10441. continue;
  10442. outArr.push(arr[index]);
  10443. }
  10444. return outArr;
  10445. }
  10446. getOneArr(deletObj) {
  10447. let allArr = this.getAllBallArr();
  10448. let temp;
  10449. for (let index = 0; index < allArr.length; index++) {
  10450. temp = allArr[index];
  10451. if (temp.id == deletObj.id) {
  10452. allArr.splice(index, 1);
  10453. break;
  10454. }
  10455. }
  10456. return allArr;
  10457. }
  10458. getNearBallBag(ball) {
  10459. let ui = xGame.common.gameUI.ui;
  10460. let circleArr = [];
  10461. for (let index = 1; index <= 6; index++) {
  10462. circleArr.push(ui.border["circle" + index]);
  10463. }
  10464. let outIndex = 0;
  10465. let temp;
  10466. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10467. ;
  10468. let dis = 0;
  10469. for (let index = 1; index < circleArr.length; index++) {
  10470. temp = circleArr[index];
  10471. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10472. if (dis < min) {
  10473. min = dis;
  10474. outIndex = index;
  10475. }
  10476. }
  10477. return [circleArr[outIndex], outIndex];
  10478. }
  10479. ballFlyToBag(ballArr, time = 300) {
  10480. let temp;
  10481. let hole;
  10482. this._finishNum = ballArr.length;
  10483. this._curFinish = 0;
  10484. let holeObj = {};
  10485. let holeCfg = {
  10486. "1": 0,
  10487. "2": 0,
  10488. "3": 0,
  10489. "4": 0,
  10490. "5": 0,
  10491. "6": 0
  10492. };
  10493. for (let index = 0; index < ballArr.length; index++) {
  10494. temp = ballArr[index];
  10495. temp.outColli.isSensor = true;
  10496. temp.innerColli.isSensor = true;
  10497. temp.isRunSkillAni = true;
  10498. let holeArr = this.getNearBallBag(temp);
  10499. hole = holeArr[0];
  10500. holeObj[index] = holeArr[1];
  10501. temp.d3BallSrc.scaleXYZ = 0.5;
  10502. this.tweenArr.push(temp.d3BallSrc, temp);
  10503. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10504. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10505. }));
  10506. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10507. let mIndex = holeObj[this._curFinish];
  10508. let isDone = holeCfg[mIndex];
  10509. if (isDone) {
  10510. ballArr[this._curFinish].checkWrongBall(false);
  10511. }
  10512. else {
  10513. holeCfg[mIndex] = 1;
  10514. ballArr[this._curFinish].checkWrongBall();
  10515. }
  10516. this._curFinish++;
  10517. if (this._curFinish >= this._finishNum) {
  10518. if (this.curSkill == SkillType.highSpace) {
  10519. }
  10520. else if (this.curSkill == SkillType.breakArmy) {
  10521. let rootBall = xGame.common.d2World.rootBall;
  10522. rootBall.gameObj.x = this._rootX;
  10523. rootBall.gameObj.y = this._rootY;
  10524. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10525. xGame.common.d2World.d2Gan.ui.visible = true;
  10526. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10527. xGame.common.d2World.getHelpLine();
  10528. this.callback && this.callback(this.extraScore);
  10529. }
  10530. }
  10531. }));
  10532. }
  10533. }
  10534. runHighSpace() {
  10535. let rootBall = xGame.common.d2World.rootBall;
  10536. rootBall.showSelf();
  10537. let d3Src = rootBall.d3BallSrc;
  10538. let allArr = this.getAllBallArr();
  10539. if (allArr.length <= 0) {
  10540. this.callback && this.callback(0);
  10541. return;
  10542. }
  10543. let selectBall = xGame.common.d2World.targetBall;
  10544. let wrong = selectBall && selectBall.destroyed;
  10545. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10546. selectBall = xGame.common.getRandArrEle(allArr);
  10547. }
  10548. let targetD3Src = selectBall.d3BallSrc;
  10549. xGame.common.d2World.d2Gan.ui.visible = false;
  10550. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10551. d3Src.scaleXYZ = 0.5;
  10552. this.tweenArr.push(d3Src);
  10553. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10554. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10555. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10556. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10557. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10558. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10559. let outArr = [selectBall];
  10560. let other = this.leveNum - 1;
  10561. if (other > 0) {
  10562. let nearArr = this.getOneArr(selectBall);
  10563. if (nearArr.length > 0) {
  10564. xGame.common.botherArr(nearArr);
  10565. if (other >= nearArr.length)
  10566. other = nearArr.length;
  10567. for (let index = 0; index < other; index++) {
  10568. outArr.push(nearArr[index]);
  10569. }
  10570. }
  10571. }
  10572. xGame.common.extraMoveNum = other + 1;
  10573. this.extraScore = other + 1;
  10574. this._rootX = selectBall.gameObj.x;
  10575. this._rootY = selectBall.gameObj.y;
  10576. rootBall.gameObj.x = this._rootX;
  10577. rootBall.gameObj.y = this._rootY;
  10578. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10579. Laya.Tween.clearAll(d3Src);
  10580. this.addRandomForce(outArr);
  10581. }));
  10582. }));
  10583. }
  10584. addRandomForce(outArr) {
  10585. if (outArr.length > 0) {
  10586. xGame.common.d2World.openCheckStill = true;
  10587. this.playedLastSkill = true;
  10588. }
  10589. let temp;
  10590. for (let index = 0; index < outArr.length; index++) {
  10591. let angle = xGame.common.randomNum(0, 360);
  10592. let linearPercent = xGame.common.randomNum(65, 100);
  10593. temp = outArr[index];
  10594. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10595. }
  10596. }
  10597. setLinearSpeed(angle, rigy, linearPercent) {
  10598. let sin = Math.sin(angle * Math.PI / 180);
  10599. let cos = Math.cos(angle * Math.PI / 180);
  10600. let maxSpeed = 4;
  10601. let speed = new Laya.Vector2();
  10602. speed.x = maxSpeed * linearPercent * sin;
  10603. speed.y = -maxSpeed * linearPercent * cos;
  10604. rigy.applyLinearImpulseToCenter(speed);
  10605. }
  10606. runBreakArmy() {
  10607. xGame.common.d2World.d2Gan.ui.visible = false;
  10608. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10609. let gameUI = xGame.common.gameUI.ui;
  10610. gameUI.skillRod.visible = true;
  10611. gameUI.skillRod.rotation = 110;
  10612. let outArr = this.getAllBallArr();
  10613. if (outArr.length <= 0) {
  10614. gameUI.skillRod.visible = false;
  10615. this.callback && this.callback(0);
  10616. return;
  10617. }
  10618. xGame.common.botherArr(outArr);
  10619. if (this.leveNum >= outArr.length)
  10620. this.leveNum = outArr.length;
  10621. let deleteNum = outArr.length - this.leveNum;
  10622. outArr.splice(0, deleteNum);
  10623. this.extraScore = this.leveNum;
  10624. let potX = gameUI.skillRod.x;
  10625. let potY = gameUI.skillRod.y;
  10626. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10627. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10628. let disArr = [];
  10629. for (let index = 0; index < outArr.length; index++) {
  10630. let obj = outArr[index];
  10631. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10632. dis = Math.pow(dis, 0.5);
  10633. disArr.push(dis);
  10634. }
  10635. this.tweenArr.push(gameUI.skillRod);
  10636. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10637. })).update = Laya.Handler.create(this, (e, t, c) => {
  10638. let angle = gameUI.skillRod.rotation;
  10639. let xx;
  10640. let yy;
  10641. let temp;
  10642. for (let index = 0; index < outArr.length; index++) {
  10643. temp = outArr[index];
  10644. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10645. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10646. yy -= 20;
  10647. temp.gameObj.x = xx;
  10648. temp.gameObj.y = yy;
  10649. temp.d3BallSrc.setTransPos(xx, yy);
  10650. }
  10651. if (angle <= 60) {
  10652. Laya.Tween.clearAll(gameUI.skillRod);
  10653. this.ballFlyToBag(outArr, 150);
  10654. gameUI.skillRod.visible = false;
  10655. }
  10656. }, null, false);
  10657. }
  10658. runIce() {
  10659. let ballArr = xGame.common.d2World.ballArr;
  10660. this.leveNum *= 2;
  10661. if (this.leveNum >= ballArr.length - 1)
  10662. this.leveNum = ballArr.length - 1;
  10663. let tempArr = [];
  10664. let outArr = [];
  10665. for (let index = 0; index < ballArr.length; index++) {
  10666. if (ballArr[index] instanceof D2RootBallSrc)
  10667. continue;
  10668. tempArr.push(ballArr[index]);
  10669. }
  10670. if (tempArr.length <= 0) {
  10671. this.callback && this.callback(0);
  10672. return;
  10673. }
  10674. xGame.common.botherArr(tempArr);
  10675. for (let index = 0; index < this.leveNum; index++) {
  10676. outArr.push(tempArr[index]);
  10677. }
  10678. this.extraScore = this.leveNum;
  10679. let temp;
  10680. for (let index = 0; index < outArr.length; index++) {
  10681. temp = outArr[index];
  10682. temp.d3BallSrc.playIceEft();
  10683. }
  10684. Laya.timer.once(2000, this, () => {
  10685. for (let index = 0; index < outArr.length; index++) {
  10686. temp = outArr[index];
  10687. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10688. temp.setBallFunc("ice", str);
  10689. }
  10690. this.callback && this.callback(0);
  10691. });
  10692. }
  10693. runFireworks() {
  10694. let allArr = this.getAllBallArr();
  10695. if (allArr.length <= 0) {
  10696. this.callback && this.callback(0);
  10697. return;
  10698. }
  10699. xGame.common.d2World.d2Gan.ui.visible = false;
  10700. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10701. let outArr = [];
  10702. let other = this.leveNum;
  10703. if (other > 0) {
  10704. if (allArr.length > 0) {
  10705. xGame.common.botherArr(allArr);
  10706. if (other >= allArr.length)
  10707. other = allArr.length;
  10708. for (let index = 0; index < other; index++) {
  10709. outArr.push(allArr[index]);
  10710. }
  10711. }
  10712. }
  10713. xGame.common.extraMoveNum = other;
  10714. this.extraScore = other;
  10715. this.addRandmomFireworks(outArr);
  10716. }
  10717. addRandmomFireworks(outArr) {
  10718. Laya.timer.once(1100, this, () => {
  10719. if (outArr.length > 0) {
  10720. xGame.common.d2World.openCheckStill = true;
  10721. this.playedLastSkill = true;
  10722. }
  10723. });
  10724. xGame.soundMgr.playSound("skill_04_02");
  10725. let temp;
  10726. let delay = -200;
  10727. for (let index = 0; index < outArr.length; index++) {
  10728. temp = outArr[index];
  10729. delay += 200;
  10730. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10731. let angle = xGame.common.randomNum(0, 360);
  10732. angle = this.getFireworksAngle(obj);
  10733. let linearPercent = xGame.common.randomNum(45, 80);
  10734. if (!obj.destroyed)
  10735. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10736. });
  10737. }
  10738. }
  10739. getFireworksAngle(obj) {
  10740. let rootBall = xGame.common.d2World.rootBall;
  10741. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10742. }
  10743. resetGame() {
  10744. Laya.timer.clearAll(this);
  10745. if (this.tweenArr) {
  10746. for (let index = 0; index < this.tweenArr.length; index++) {
  10747. Laya.Tween.clearAll(this.tweenArr[index]);
  10748. }
  10749. }
  10750. this.tweenArr = null;
  10751. }
  10752. runGuanYu() {
  10753. xGame.common.d2World.d2Gan.ui.visible = false;
  10754. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10755. let rootBall = xGame.common.d2World.rootBall;
  10756. if (rootBall.isInHole) {
  10757. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10758. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10759. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10760. rootBall.showSelf();
  10761. }
  10762. this.rtStarX = rootBall.gameObj.x;
  10763. this.rtStarY = rootBall.gameObj.y;
  10764. this.knifeTimes = 0;
  10765. this.playedLastSkill = true;
  10766. rootBall.forceRun = true;
  10767. rootBall.rigy.type = "static";
  10768. xGame.common.d2World.openCheckStill = true;
  10769. this.guanyuRandomKnife();
  10770. }
  10771. guanyuRandomKnife() {
  10772. let rootBall = xGame.common.d2World.rootBall;
  10773. let dir = this.getRandDir();
  10774. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10775. console.log("当前angle", angle);
  10776. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10777. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10778. let dis = 324;
  10779. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10780. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10781. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10782. this.rtStarX = rootBall.gameObj.x;
  10783. this.rtStarY = rootBall.gameObj.y;
  10784. this.knifeTimes++;
  10785. let skillLevel;
  10786. if (xGame.common.gameMgr.selfTurn) {
  10787. skillLevel = DataMgr.getBigSkillByIndex(4);
  10788. }
  10789. else {
  10790. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10791. }
  10792. if (!skillLevel)
  10793. skillLevel = 1;
  10794. skillLevel += 2;
  10795. if (this.knifeTimes < skillLevel) {
  10796. Laya.timer.once(400, this, () => {
  10797. this.guanyuRandomKnife();
  10798. });
  10799. }
  10800. else {
  10801. rootBall.forceRun = false;
  10802. rootBall.rigy.type = "dynamic";
  10803. xGame.common.extraMoveNum = skillLevel;
  10804. }
  10805. }));
  10806. }
  10807. getRandDir() {
  10808. let rootBall = xGame.common.d2World.rootBall;
  10809. let allBall = this.getAllBallArr();
  10810. let target = xGame.common.getRandArrEle(allBall);
  10811. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10812. return this.knifeV2;
  10813. }
  10814. cloneKnife(x, y, rotation) {
  10815. let parent = xGame.common.d3World.knifeRoot;
  10816. let prefab = xGame.common.d3World.knife;
  10817. let clone = prefab.clone();
  10818. parent.addChild(clone);
  10819. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10820. clone.transform.localPositionX = this.knifeV3.x;
  10821. clone.transform.localPositionY = 0;
  10822. clone.transform.localPositionZ = this.knifeV3.z;
  10823. clone.transform.localRotationEulerX = 0;
  10824. clone.transform.localRotationEulerY = rotation;
  10825. clone.transform.localRotationEulerZ = 0;
  10826. clone.active = true;
  10827. return clone;
  10828. }
  10829. cloneGuanYuEft(x, y, angle) {
  10830. return;
  10831. let parent = xGame.common.gameUI.ui.guanyuNode;
  10832. let eft = new ui_guanyuAni();
  10833. eft.parent = parent;
  10834. eft.x = x;
  10835. eft.y = y;
  10836. eft.rotation = angle;
  10837. }
  10838. }
  10839. class ui_UIWordsList extends fgui.GComponent {
  10840. static createInstance() {
  10841. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10842. }
  10843. onConstruct() {
  10844. this.c1 = this.getController("c1");
  10845. this.n74 = (this.getChild("n74"));
  10846. this.clickNode = (this.getChild("clickNode"));
  10847. this.myNode = (this.getChild("myNode"));
  10848. this.n68 = (this.getChild("n68"));
  10849. this.n66 = (this.getChild("n66"));
  10850. this.n55 = (this.getChild("n55"));
  10851. this.wordsBtn = (this.getChild("wordsBtn"));
  10852. this.emotionBtn = (this.getChild("emotionBtn"));
  10853. this.mybggg = (this.getChild("mybggg"));
  10854. this.wordsList = (this.getChild("wordsList"));
  10855. this.emotionList = (this.getChild("emotionList"));
  10856. this.myRoot = (this.getChild("myRoot"));
  10857. }
  10858. }
  10859. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10860. class EmotionDisplay {
  10861. constructor(index, ui) {
  10862. this.ui = ui;
  10863. this.index = index;
  10864. this.ui.onClick(this, this.clickSelf);
  10865. this.updateSelf();
  10866. }
  10867. updateSelf() {
  10868. let data = cfgTable.emotionData[this.index + 1];
  10869. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10870. }
  10871. clickSelf() {
  10872. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10873. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10874. xGame.common.talkMgr.closeTalkView();
  10875. }
  10876. }
  10877. class WordsDisplay {
  10878. constructor(index, ui) {
  10879. this.ui = ui;
  10880. this.index = index;
  10881. this.ui.onClick(this, this.clickSelf);
  10882. this.updateSelf();
  10883. }
  10884. updateSelf() {
  10885. let data = cfgTable.talkwordsData[this.index + 1];
  10886. this.ui.txt.text = data.msg;
  10887. }
  10888. clickSelf() {
  10889. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10890. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10891. xGame.common.talkMgr.closeTalkView();
  10892. }
  10893. }
  10894. class UIWordsList extends UIBase {
  10895. constructor() {
  10896. super();
  10897. }
  10898. onConstructor() {
  10899. this.ui = ui_UIWordsList.createInstance();
  10900. this.contentPane = this.ui;
  10901. this.isEject = false;
  10902. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10903. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10904. this.addUIClick(this.ui.clickNode, this.hide);
  10905. this.initTalkList();
  10906. this.initEmotionList();
  10907. }
  10908. show() {
  10909. super.show();
  10910. this.setGlobalFont(this.ui);
  10911. }
  10912. initTalkList() {
  10913. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10914. let data = cfgTable.talkwordsData;
  10915. let length = Object.keys(data).length;
  10916. this.ui.wordsList.numItems = length;
  10917. }
  10918. initEmotionList() {
  10919. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10920. let data = cfgTable.emotionData;
  10921. let length = Object.keys(data).length;
  10922. this.ui.emotionList.numItems = length;
  10923. }
  10924. renderTalkItem(index, obj) {
  10925. let temp = new WordsDisplay(index, obj);
  10926. }
  10927. renderEmotionItem(index, obj) {
  10928. let temp = new EmotionDisplay(index, obj);
  10929. }
  10930. openTalkList() {
  10931. this.ui.c1.selectedIndex = 0;
  10932. }
  10933. openEmotionList() {
  10934. this.ui.c1.selectedIndex = 1;
  10935. }
  10936. }
  10937. UIWordsList.uiName = "UIWordsList";
  10938. class TalkMgr {
  10939. constructor() {
  10940. this.aiSpeak = true;
  10941. this.emotionList = [];
  10942. this.talkList = [];
  10943. this.addEvent();
  10944. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10945. this.emotionList = [];
  10946. this.talkList = [];
  10947. for (let k in cfgTable.emotionData) {
  10948. this.emotionList.push(cfgTable.emotionData[k].id);
  10949. }
  10950. for (let k in cfgTable.talkwordsData) {
  10951. this.talkList.push(cfgTable.talkwordsData[k].id);
  10952. }
  10953. }
  10954. addEvent() {
  10955. let ui = xGame.common.gameUI.ui;
  10956. ui.wordsBtn.visible = true;
  10957. ui.wordsBtn.onClick(this, this.openTalkView);
  10958. ui.aiWordsBtn.visible = true;
  10959. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10960. }
  10961. openTalkView() {
  10962. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10963. xGame.uiMgr.Show(UIWordsList);
  10964. }
  10965. closeTalkView() {
  10966. xGame.uiMgr.Hide(UIWordsList);
  10967. }
  10968. clickAIState() {
  10969. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10970. this.aiSpeak = !this.aiSpeak;
  10971. this.changeAIState(this.aiSpeak);
  10972. }
  10973. changeAIState(speak) {
  10974. this.aiSpeak = speak;
  10975. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10976. if (speak) {
  10977. btn.c1.selectedIndex = 0;
  10978. }
  10979. else {
  10980. btn.c1.selectedIndex = 1;
  10981. }
  10982. }
  10983. showSelfTalk(wordsId) {
  10984. let ui = xGame.common.gameUI.ui;
  10985. ui.selfTalk.visible = true;
  10986. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10987. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10988. ui.selfTalk.t0.play();
  10989. }
  10990. showSelfEmotion(emotionId) {
  10991. let ui = xGame.common.gameUI.ui;
  10992. ui.selfTalk.visible = true;
  10993. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10994. this.selfSpine && this.selfSpine.dispose();
  10995. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10996. let spineData = cfgTable.emotionData[emotionId].spine;
  10997. this.selfSpine = new SpineMgr(spineData, () => {
  10998. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10999. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  11000. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11001. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  11002. });
  11003. ui.selfTalk.t0.play();
  11004. }
  11005. showAITalk(wordsId) {
  11006. if (!this.aiSpeak)
  11007. return;
  11008. if (DataMgr.gameData.gameCount < 2)
  11009. return;
  11010. if (wordsId < 1)
  11011. wordsId = this.getRandTalk();
  11012. let ui = xGame.common.gameUI.ui;
  11013. ui.aiTalk.visible = true;
  11014. ui.aiTalk.myNode.c1.selectedIndex = 1;
  11015. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11016. ui.aiTalk.t0.play();
  11017. }
  11018. getRandTalk() {
  11019. let rand = xGame.tools.random(0, this.talkList.length);
  11020. return this.emotionList[rand];
  11021. }
  11022. getRandEmotion() {
  11023. let rand = xGame.tools.random(0, this.emotionList.length);
  11024. return this.emotionList[rand];
  11025. }
  11026. showAIEmotion(emotionId) {
  11027. if (!this.aiSpeak)
  11028. return;
  11029. if (DataMgr.gameData.gameCount < 2)
  11030. return;
  11031. if (emotionId < 1)
  11032. emotionId = this.getRandEmotion();
  11033. let ui = xGame.common.gameUI.ui;
  11034. ui.aiTalk.visible = true;
  11035. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11036. this.aiSpine && this.aiSpine.dispose();
  11037. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11038. let spineData = cfgTable.emotionData[emotionId].spine;
  11039. this.aiSpine = new SpineMgr(spineData, () => {
  11040. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11041. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11042. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11043. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11044. });
  11045. ui.aiTalk.t0.play();
  11046. }
  11047. resetGame() {
  11048. let ui = xGame.common.gameUI.ui;
  11049. ui.aiTalk.visible = false;
  11050. ui.selfTalk.visible = false;
  11051. this.aiSpine && this.aiSpine.dispose();
  11052. this.selfSpine && this.selfSpine.dispose();
  11053. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11054. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11055. this.closeTalkView();
  11056. }
  11057. }
  11058. class WordsMgr {
  11059. constructor() {
  11060. this.comboTimes = 1;
  11061. this.skillTimes = 0;
  11062. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11063. this.comboSpine = new SpineMgr("yxz_liangan");
  11064. this.skillSpine = new SpineMgr("yiganxqiu");
  11065. this.scoreSpine = new SpineMgr("defen");
  11066. }
  11067. setClassicCombo(isInterrupt) {
  11068. if (isInterrupt) {
  11069. this.comboTimes = 0;
  11070. }
  11071. }
  11072. playClassicWords(type, callback) {
  11073. this.callback = callback;
  11074. let aniIndex = type;
  11075. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11076. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11077. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11078. mySpine.destroy(true);
  11079. this.playClassicTimes();
  11080. });
  11081. }
  11082. playClassicTimes() {
  11083. this.comboTimes++;
  11084. if (this.comboTimes <= 1) {
  11085. this.callback && this.callback();
  11086. }
  11087. else {
  11088. let aniIndex = this.comboTimes - 1;
  11089. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11090. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11091. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11092. mySpine.destroy(true);
  11093. this.callback && this.callback();
  11094. });
  11095. }
  11096. }
  11097. playBigSkillTimes(times, callback) {
  11098. if (times <= 0) {
  11099. callback && callback();
  11100. return;
  11101. }
  11102. this.callback = callback;
  11103. let pre = "sz_0";
  11104. let aniIndex = 0;
  11105. this.getWordsImg(times, pre, () => {
  11106. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11107. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11108. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11109. let r1 = ``;
  11110. let r2 = ``;
  11111. if (times <= 9) {
  11112. r1 = `res/d2Res/${pre}${times}.png`;
  11113. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11114. aniIndex = 0;
  11115. }
  11116. else {
  11117. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11118. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11119. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11120. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11121. aniIndex = 1;
  11122. }
  11123. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11124. mySpine.destroy(true);
  11125. xGame.common.gameMgr.playSkillTips();
  11126. this.playScore(times);
  11127. xGame.common.playRandomMutiBallBigSkillSound();
  11128. }, mySpine);
  11129. });
  11130. }
  11131. playScore(score) {
  11132. let pre = "sz_";
  11133. let aniIndex = 0;
  11134. this.getWordsImg(score, pre, () => {
  11135. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11136. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11137. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11138. let r1 = ``;
  11139. let r2 = ``;
  11140. if (score <= 9) {
  11141. r1 = `res/d2Res/${pre}${score}.png`;
  11142. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11143. aniIndex = 0;
  11144. }
  11145. else {
  11146. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11147. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11148. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11149. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11150. aniIndex = 1;
  11151. }
  11152. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11153. mySpine.destroy(true);
  11154. this.callback && this.callback();
  11155. }, mySpine);
  11156. });
  11157. }
  11158. getWordsImg(number, pre = "", callback) {
  11159. let arr = [];
  11160. if (number <= 9) {
  11161. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11162. }
  11163. else {
  11164. 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 });
  11165. }
  11166. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11167. callback && callback();
  11168. }));
  11169. }
  11170. }
  11171. class ui_UIRodMethod extends fgui.GComponent {
  11172. static createInstance() {
  11173. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11174. }
  11175. onConstruct() {
  11176. this.n24 = (this.getChild("n24"));
  11177. this.white = (this.getChild("white"));
  11178. this.dot = (this.getChild("dot"));
  11179. this.sureBtn = (this.getChild("sureBtn"));
  11180. this.n20 = (this.getChild("n20"));
  11181. this.n21 = (this.getChild("n21"));
  11182. this.n22 = (this.getChild("n22"));
  11183. this.n23 = (this.getChild("n23"));
  11184. this.n5 = (this.getChild("n5"));
  11185. this.n14 = (this.getChild("n14"));
  11186. this.t0 = this.getTransition("t0");
  11187. }
  11188. }
  11189. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11190. class UIRodMethod extends UIBase {
  11191. constructor() {
  11192. super();
  11193. this.isPressd = false;
  11194. }
  11195. onConstructor() {
  11196. this.ui = ui_UIRodMethod.createInstance();
  11197. this.contentPane = this.ui;
  11198. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11199. this.moveDir = new Laya.Vector2();
  11200. this.moveDest = new Laya.Vector2();
  11201. this.centerPos = new Laya.Vector2();
  11202. xGame.common.uiRodMethod = this;
  11203. }
  11204. show() {
  11205. super.show();
  11206. xGame.common.gameMgr.gamePause = true;
  11207. this.openPressDotEvent();
  11208. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11209. this.centerPos.x = this.ui.white.x;
  11210. this.centerPos.y = this.ui.white.y;
  11211. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11212. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11213. this.setDot();
  11214. this.setGlobalFont(this.ui);
  11215. }
  11216. setDot() {
  11217. this.ui.dot.x = this.moveDest.x;
  11218. this.ui.dot.y = this.moveDest.y;
  11219. }
  11220. closeSelf() {
  11221. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11222. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11223. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11224. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11225. xGame.common.gameMgr.gamePause = false;
  11226. this.hide();
  11227. }
  11228. openPressDotEvent() {
  11229. this.closePressDotEvent();
  11230. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11231. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11232. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11233. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11234. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11235. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11236. }
  11237. closePressDotEvent() {
  11238. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11239. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11240. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11241. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11242. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11243. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11244. }
  11245. onDown(e) {
  11246. if (e.type == Laya.Event.MOUSE_DOWN)
  11247. this.isPressd = true;
  11248. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11249. this.isPressd = false;
  11250. if (!this.isPressd)
  11251. return;
  11252. this.moveDest.x = e.stageX;
  11253. this.moveDest.y = e.stageY;
  11254. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11255. if (dis > 6724) {
  11256. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11257. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11258. }
  11259. this.setDot();
  11260. }
  11261. resetRod() {
  11262. this.ui.dot.x = this.ui.white.x;
  11263. this.ui.dot.y = this.ui.white.y;
  11264. this.gameRod.dot.x = this.gameRod.bg.x;
  11265. this.gameRod.dot.y = this.gameRod.bg.y;
  11266. xGame.common.rodOffest.x = 0;
  11267. xGame.common.rodOffest.y = 0;
  11268. }
  11269. }
  11270. UIRodMethod.uiName = "UIRodMethod";
  11271. class UIGame extends UIBase {
  11272. constructor() {
  11273. super();
  11274. this.powerNum = 0;
  11275. this.isD3Inited = false;
  11276. this.isPrePlay = false;
  11277. this.isMoveRod = false;
  11278. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11279. this.rulerDis = 20;
  11280. this.rulerOffset = 0;
  11281. }
  11282. onConstructor() {
  11283. this.ui = ui_UIGame.createInstance();
  11284. this.contentPane = this.ui;
  11285. this.ui.x += xGame.common.sysOffestNum;
  11286. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11287. this.isEject = false;
  11288. xGame.common.gameUI = this;
  11289. this.initSelf();
  11290. }
  11291. isTurnSelf() {
  11292. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11293. return true;
  11294. }
  11295. }
  11296. initSelf() {
  11297. let topUI = this.ui.topNode;
  11298. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11299. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11300. this.barInfo = {};
  11301. this.barInfo.curY = 0;
  11302. this.barInfo.height = this.ui.powerNode.height;
  11303. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11304. this.barInfo.powerStartY = this.ui.powerNode.y;
  11305. xGame.common.aiPlayer = new AIPlayer();
  11306. xGame.common.gameMgr = new GameMgr();
  11307. xGame.common.skillMgr = new SkillMgr();
  11308. xGame.common.wordsMgr = new WordsMgr();
  11309. xGame.common.talkMgr = new TalkMgr();
  11310. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11311. });
  11312. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11313. });
  11314. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11315. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11316. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11317. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11318. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11319. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11320. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11321. }
  11322. getGanZiImg() {
  11323. let index = DataMgr.getCurBallRod();
  11324. let data = cfgTable.ballrodData[index + 1];
  11325. let gan_url = xGame.common.getGameIconUrl(data.img);
  11326. this.ui.powerNode.showImg.url = gan_url;
  11327. }
  11328. returnHome() {
  11329. let tips = "Are you sure to exit the game?";
  11330. let woman = "Boss, why don't you play for a while longer?";
  11331. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11332. }
  11333. addRodMethodClick() {
  11334. if (this.isTurnSelf()) {
  11335. xGame.uiMgr.Show(UIRodMethod);
  11336. }
  11337. }
  11338. clickHelpLineBtn(force = false) {
  11339. if (!this.isTurnSelf())
  11340. return;
  11341. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11342. if (success) {
  11343. xGame.common.longHelpLine = true;
  11344. xGame.common.d2World.getHelpLine();
  11345. Moyu.sendDataEvent("guideNum");
  11346. }
  11347. else {
  11348. }
  11349. });
  11350. }
  11351. renderSelfDisplayBalls(index, target) {
  11352. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11353. target.myImg.url = xGame.common.getGameIconUrl(str);
  11354. }
  11355. renderAIDisplayBalls(index, target) {
  11356. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11357. target.myImg.url = xGame.common.getGameIconUrl(str);
  11358. ;
  11359. }
  11360. updateMode() {
  11361. if (xGame.common.gameMode == GameMode.classic) {
  11362. this.ui.topNode.scoreNode.visible = false;
  11363. }
  11364. else if (xGame.common.gameMode == GameMode.bigMove) {
  11365. this.ui.topNode.scoreNode.visible = true;
  11366. }
  11367. }
  11368. show() {
  11369. super.show();
  11370. this.ui.alpha = 0;
  11371. this.updateSelf();
  11372. xGame.common.gameMgr.gamePause = false;
  11373. xGame.common.gameUI.ui.blackAni.visible = false;
  11374. xGame.common.gameUI.ui.whiteAni.visible = false;
  11375. this.ui.powerEft.visible = false;
  11376. this.ui.colorNode.visible = false;
  11377. this.updateHead();
  11378. let curUse = DataMgr.getCurBallRod();
  11379. this.getGanZiImg();
  11380. if (DataMgr.getGuideDefaultModel() === 1) {
  11381. Laya.timer.once(3000, this, () => {
  11382. this.yinDaoForLianxi();
  11383. });
  11384. }
  11385. else {
  11386. }
  11387. this.setGlobalFont(this.ui);
  11388. }
  11389. yinDaoForLianxi() {
  11390. let lianXiGuide = DataMgr.getLianXiGuide();
  11391. console.log('zh:lianXiGuide=', lianXiGuide);
  11392. if (lianXiGuide === 0) {
  11393. this.ui.n_lxms_yd1.visible = true;
  11394. console.log('zh:yinDaoForLianxi 111 set ok');
  11395. }
  11396. else {
  11397. this.ui.n_lxms_yd1.visible = false;
  11398. console.log('zh:无需引导11');
  11399. }
  11400. }
  11401. updateSelf() {
  11402. if (xGame.common.gameMode == GameMode.classic) {
  11403. this.ui.c1.selectedIndex = 0;
  11404. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11405. this.ui.topNode.middleNode.visible = true;
  11406. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11407. }
  11408. else if (xGame.common.gameMode == GameMode.bigMove) {
  11409. this.ui.c1.selectedIndex = 0;
  11410. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11411. this.ui.topNode.middleNode.visible = false;
  11412. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11413. let rand = xGame.common.randomNum(1, max);
  11414. let guide = DataMgr.getSkillGuide();
  11415. if (guide == 0)
  11416. rand = 1;
  11417. xGame.common.bigMoveLevelIndex = rand;
  11418. }
  11419. else if (xGame.common.gameMode == GameMode.placeBall) {
  11420. console.log('zh:练习模式...');
  11421. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11422. this.ui.c1.selectedIndex = 1 + data.type;
  11423. this.ui.alpha = 1;
  11424. this.startGame();
  11425. }
  11426. this.updateMode();
  11427. this.initD3world();
  11428. this.initD2world();
  11429. }
  11430. startGame() {
  11431. this.ui.snowNode.visible = Math.random() <= 0.1;
  11432. this.ui.d2Node.visible = false;
  11433. xGame.common.d3World.d3Hand.gameObj.active = false;
  11434. xGame.common.d3World.tableSrc.init();
  11435. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11436. this.cameraViewChange(() => {
  11437. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11438. switch (xGame.common.gameMode) {
  11439. case GameMode.classic:
  11440. xGame.common.d3World.d3Hand.gameObj.active = true;
  11441. this.playPutBallD3Ani();
  11442. break;
  11443. case GameMode.bigMove:
  11444. this.enterGame();
  11445. Laya.timer.once(500, this, () => {
  11446. this.ui.topNode.middleNode.visible = true;
  11447. this.ui.topNode.middleNode.t0.play();
  11448. });
  11449. break;
  11450. case GameMode.placeBall:
  11451. this.enterGame();
  11452. break;
  11453. default:
  11454. break;
  11455. }
  11456. });
  11457. PlatMgr.showBanner(false);
  11458. }
  11459. enterGame() {
  11460. this.ui.d2Node.visible = true;
  11461. xGame.common.d3World.d3Hand.gameObj.active = false;
  11462. xGame.common.showOneCamera("mainCamera");
  11463. Moyu.recordGame(30, true);
  11464. if (!this.isPrePlay) {
  11465. this.isPrePlay = true;
  11466. xGame.common.d3World.prePlayEft();
  11467. }
  11468. xGame.common.gameMgr.gameReady();
  11469. this.openAllEvent();
  11470. this.ui.snowNode.visible = false;
  11471. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11472. this.ui.helpBtn.visible = condition;
  11473. }
  11474. showHelpLineGuide() {
  11475. let longGuide = DataMgr.getGuideHelpLine();
  11476. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11477. this.ui.helpBtn.visible = true;
  11478. this.ui.guideNode.visible = true;
  11479. }
  11480. }
  11481. setTurnAlpha(alpha) {
  11482. this.ui.keduNode.alpha = alpha;
  11483. this.ui.ganNode.alpha = alpha;
  11484. this.ui.rodMethodNode.alpha = alpha;
  11485. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11486. }
  11487. cameraViewChange(callback) {
  11488. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11489. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11490. xGame.common.showOneCamera("visitAngle");
  11491. cameraSrc.localRotationEulerY = 180;
  11492. cameraSrc.localRotationEulerZ = 0;
  11493. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11494. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11495. callback && callback();
  11496. }));
  11497. }));
  11498. }
  11499. playPutBallD3Ani() {
  11500. xGame.common.showOneCamera("mainCamera");
  11501. let handSrc = xGame.common.d3World.d3Hand;
  11502. handSrc.gameObj.active = true;
  11503. handSrc.transform.localPositionZ = 3;
  11504. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11505. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11506. handSrc.gameObj.active = false;
  11507. this.enterGame();
  11508. }), 400);
  11509. }));
  11510. }
  11511. updateHead() {
  11512. let user = Moyu.getUserInfo();
  11513. this.ui.topNode.selfNameTxt.text = user.nickName;
  11514. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11515. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11516. if (DataMgr.getSkillGuide() < 1) {
  11517. this.ui.topNode.aiNameTxt.text = 'billiards';
  11518. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11519. }
  11520. else {
  11521. this.ui.topNode.aiNameTxt.text = aiData.name;
  11522. let randNo = Math.floor(Math.random() * 10) + 1;
  11523. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11524. }
  11525. }
  11526. initD2world() {
  11527. let node = this.ui.d2Root.displayObject;
  11528. let src = node.getComponent(D2World);
  11529. if (!src) {
  11530. xGame.common.d2World = node.addComponent(D2World);
  11531. }
  11532. xGame.common.d2World.initSelf();
  11533. }
  11534. initD3world() {
  11535. if (this.isD3Inited)
  11536. return;
  11537. this.isD3Inited = true;
  11538. let scene3D = xGame.common.d3Scene;
  11539. this.ui.d3Root.displayObject.addChild(scene3D);
  11540. scene3D.active = true;
  11541. xGame.common.d3World.tableSrc.setBorderPos();
  11542. }
  11543. onRootMove(e) {
  11544. let rootBall = xGame.common.d2World.rootBall;
  11545. this.ui.moveNode.x = e.x;
  11546. this.ui.moveNode.y = e.y;
  11547. rootBall.gameObj.x = e.x;
  11548. rootBall.gameObj.y = e.y;
  11549. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11550. }
  11551. aiRootMove(move) {
  11552. if (move)
  11553. this.hideBallUI();
  11554. else {
  11555. this.showBallUI();
  11556. xGame.common.d2World.getHelpLine();
  11557. }
  11558. }
  11559. aiForce(type, force = 0) {
  11560. this.pressTarget = PressType.powerNode;
  11561. if (type == 1)
  11562. this.onEventUp({ force: true });
  11563. else if (type == 2)
  11564. this.onEventMove({ stageY: force, force: true });
  11565. }
  11566. onEventPress(e) {
  11567. if (e.stopPropagation)
  11568. e.stopPropagation();
  11569. if (!this.isTurnSelf())
  11570. return;
  11571. let target = e.target;
  11572. switch (target) {
  11573. case this.ui.myPowerNode.displayObject:
  11574. this.pressTarget = PressType.powerNode;
  11575. this.barInfo.curY = e.stageY;
  11576. this.updateBarInfo();
  11577. break;
  11578. case this.ui.moveNode.displayObject:
  11579. this.pressTarget = PressType.moveNode;
  11580. this.hideBallUI();
  11581. this.eventObj.curX = this.ui.moveNode.x;
  11582. this.eventObj.curY = this.ui.moveNode.y;
  11583. this.ui.moveNode.finger.visible = false;
  11584. this.eventObj.lastX = e.stageX;
  11585. this.eventObj.lastY = e.stageY;
  11586. break;
  11587. case this.ui.rulerClickNode.displayObject:
  11588. this.pressTarget = PressType.rulerNode;
  11589. this.eventObj.lastY = e.stageY;
  11590. break;
  11591. case this.ui.d2Root.displayObject:
  11592. this.pressTarget = PressType.d2Root;
  11593. this.eventObj.lastX = e.stageX;
  11594. this.eventObj.lastY = e.stageY;
  11595. this.eventObj.starX = e.stageX;
  11596. this.eventObj.starY = e.stageY;
  11597. this.eventObj.curX = 0;
  11598. this.eventObj.curY = 0;
  11599. xGame.common.d2World.d2Gan.setGanLastInfo();
  11600. this.rulerOffset = 0;
  11601. break;
  11602. default:
  11603. break;
  11604. }
  11605. }
  11606. onEventMove(e) {
  11607. if (e.stopPropagation)
  11608. e.stopPropagation();
  11609. if (e && e.force) {
  11610. }
  11611. else {
  11612. if (!this.isTurnSelf())
  11613. return;
  11614. }
  11615. switch (this.pressTarget) {
  11616. case PressType.powerNode:
  11617. this.barInfo.curY = e.stageY;
  11618. this.updateBarInfo();
  11619. this.isMoveRod = true;
  11620. break;
  11621. case PressType.moveNode:
  11622. let rootBall = xGame.common.d2World.rootBall;
  11623. let radius = rootBall.gameObj.width / 2;
  11624. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11625. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11626. let border = xGame.common.d2World.borderRect;
  11627. if (curX <= border.x + radius)
  11628. curX = border.x + radius;
  11629. else if (curX >= border.x + border.width - radius)
  11630. curX = border.x + border.width - radius;
  11631. if (curY <= border.y + radius)
  11632. curY = border.y + radius;
  11633. else if (curY >= border.y + border.height - radius)
  11634. curY = border.y + border.height - radius;
  11635. if (xGame.common.gameMgr.isOpenBall) {
  11636. if (curX >= border.x + border.openBallW - radius)
  11637. curX = border.x + border.openBallW - radius;
  11638. }
  11639. this.ui.moveNode.x = curX;
  11640. this.ui.moveNode.y = curY;
  11641. rootBall.gameObj.x = curX;
  11642. rootBall.gameObj.y = curY;
  11643. rootBall.d3BallSrc.setTransPos(curX, curY);
  11644. this.isMoveRod = true;
  11645. break;
  11646. case PressType.rulerNode:
  11647. let yy = e.stageY - this.eventObj.lastY;
  11648. this.eventObj.lastY = e.stageY;
  11649. let ruler1 = this.ui.rulerNode.img1;
  11650. let ruler2 = this.ui.rulerNode.img2;
  11651. ruler1.y += yy;
  11652. ruler2.y += yy;
  11653. this.rulerOffset += yy;
  11654. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11655. this.rulerOffset = 0;
  11656. xGame.soundMgr.playSound("inch", 1, 10);
  11657. }
  11658. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11659. let h = ruler1.height;
  11660. if (DataMgr.getGuideDefaultModel() === 1) {
  11661. this.checkGuideForLxms();
  11662. }
  11663. else {
  11664. this.checkGuide();
  11665. }
  11666. this.isMoveRod = true;
  11667. if (ruler1.y >= h) {
  11668. ruler1.y = -h;
  11669. ruler2.y = 0;
  11670. return;
  11671. }
  11672. else if (ruler1.y <= -h) {
  11673. ruler1.y = h;
  11674. ruler2.y = 0;
  11675. return;
  11676. }
  11677. if (ruler2.y >= h) {
  11678. ruler2.y = -h;
  11679. ruler1.y = 0;
  11680. return;
  11681. }
  11682. else if (ruler2.y <= -h) {
  11683. ruler2.y = h;
  11684. ruler1.y = 0;
  11685. return;
  11686. }
  11687. break;
  11688. case PressType.d2Root:
  11689. this.eventObj.curX = e.stageX;
  11690. this.eventObj.curY = e.stageY;
  11691. let offset = this.checkRodMoveDir();
  11692. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11693. this.eventObj.lastX = e.stageX;
  11694. this.eventObj.lastY = e.stageY;
  11695. break;
  11696. default:
  11697. break;
  11698. }
  11699. }
  11700. onEventUp(e) {
  11701. if (e.stopPropagation)
  11702. e.stopPropagation();
  11703. if (e && e.force) {
  11704. }
  11705. else {
  11706. if (!this.isTurnSelf())
  11707. return;
  11708. }
  11709. switch (this.pressTarget) {
  11710. case PressType.powerNode:
  11711. this.ui.powerNode.value = 0;
  11712. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11713. this.ui.powerTxt.text = "";
  11714. if (this.powerNum > 0) {
  11715. xGame.eventMgr.event(BALL_SHOOT);
  11716. xGame.common.d2World.shoot(this.powerNum);
  11717. xGame.common.d2World.d2Gan.shoot();
  11718. xGame.common.d2World.d2HelpLine.shoot();
  11719. if (DataMgr.getGuideDefaultModel() === 1) {
  11720. this.finishGuideForLxms();
  11721. }
  11722. else {
  11723. this.finishGuide();
  11724. }
  11725. this.ui.powerEft.visible = false;
  11726. this.ui.colorNode.visible = false;
  11727. let ganStr = "";
  11728. if (this.powerNum <= 30) {
  11729. ganStr = "gan_30";
  11730. }
  11731. else if (this.powerNum <= 60) {
  11732. ganStr = "gan_50";
  11733. }
  11734. else {
  11735. ganStr = "gan_80";
  11736. }
  11737. xGame.soundMgr.playSound(ganStr);
  11738. }
  11739. break;
  11740. case PressType.moveNode:
  11741. let rootBall = xGame.common.d2World.rootBall;
  11742. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11743. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11744. let isIntersect = this.judgeBallIntersect();
  11745. if (isIntersect) {
  11746. this.ui.moveNode.x = lastX;
  11747. this.ui.moveNode.y = lastY;
  11748. rootBall.gameObj.x = lastX;
  11749. rootBall.gameObj.y = lastY;
  11750. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11751. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11752. }
  11753. else {
  11754. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11755. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11756. }
  11757. this.showBallUI();
  11758. this.ui.moveNode.finger.visible = true;
  11759. xGame.common.d2World.getHelpLine();
  11760. break;
  11761. case PressType.rulerNode:
  11762. break;
  11763. case PressType.d2Root:
  11764. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11765. if (dis <= 25) {
  11766. this.moveToClickDot(e);
  11767. }
  11768. break;
  11769. default:
  11770. break;
  11771. }
  11772. this.pressTarget = -1;
  11773. }
  11774. checkGuide() {
  11775. console.log('zh:111111111111aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafFFFFFFFFFFFFFFFFFF');
  11776. let guide = DataMgr.getSkillGuide();
  11777. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11778. xGame.common.guideStep++;
  11779. xGame.common.gameUI.ui.guide2.visible = false;
  11780. xGame.common.gameUI.ui.guide3.visible = true;
  11781. }
  11782. }
  11783. checkGuideForLxms() {
  11784. let guide = DataMgr.getLianXiGuide();
  11785. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  11786. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  11787. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11788. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  11789. xGame.common.guideStepForLianXi = 3;
  11790. }
  11791. }
  11792. finishGuide() {
  11793. let guide = DataMgr.getSkillGuide();
  11794. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11795. xGame.common.guideStep = 10;
  11796. this.closeAllGuide();
  11797. console.log('zh: 新手引导完毕');
  11798. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11799. }
  11800. }
  11801. finishGuideForLxms() {
  11802. let guide = DataMgr.getLianXiGuide();
  11803. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  11804. xGame.common.guideStepForLianXi = 3;
  11805. DataMgr.setLianXiGuide(1);
  11806. this.closeAllGuideForLxms();
  11807. console.log('zh: lxms新手引导完毕');
  11808. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11809. }
  11810. }
  11811. closeAllGuide() {
  11812. xGame.common.gameUI.ui.guide1.visible = false;
  11813. xGame.common.gameUI.ui.guide2.visible = false;
  11814. xGame.common.gameUI.ui.guide3.visible = false;
  11815. }
  11816. closeAllGuideForLxms() {
  11817. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  11818. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11819. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  11820. }
  11821. updateBarInfo() {
  11822. let star = this.ui.powerNode.y;
  11823. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11824. if (rate >= 1)
  11825. rate = 1;
  11826. if (rate <= 0)
  11827. rate = 0;
  11828. this.powerNum = Math.ceil(rate * 100);
  11829. this.ui.powerNode.value = this.powerNum;
  11830. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11831. this.ui.colorNode.value = this.powerNum;
  11832. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11833. this.ui.powerEft.visible = this.powerNum != 0;
  11834. this.ui.colorNode.visible = this.powerNum != 0;
  11835. this.ui.powerTxt.text = this.powerNum + "";
  11836. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11837. }
  11838. forceCancel() {
  11839. this.ui.powerNode.value = 0;
  11840. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11841. this.ui.powerTxt.text = "";
  11842. }
  11843. checkRodMoveDir() {
  11844. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11845. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11846. if (tempX >= 0 && tempY <= 0) {
  11847. return this.checkDir();
  11848. }
  11849. else if (tempX < 0 && tempY < 0) {
  11850. return this.checkDir(1, -1);
  11851. }
  11852. else if (tempX < 0 && tempY > 0) {
  11853. return this.checkDir(-1, -1);
  11854. }
  11855. else {
  11856. return this.checkDir(-1, 1);
  11857. }
  11858. }
  11859. checkDir(flagX = 1, flagY = 1) {
  11860. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11861. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11862. if (offsetY == 0) {
  11863. return offsetX * flagX;
  11864. }
  11865. if (offsetX == 0) {
  11866. return offsetY * flagY;
  11867. }
  11868. let angle = offsetY / offsetX;
  11869. if (Math.abs(angle) >= 1) {
  11870. return offsetY * flagY;
  11871. }
  11872. else {
  11873. return offsetX * flagX;
  11874. }
  11875. }
  11876. judgeBallIntersect() {
  11877. let rootBall = xGame.common.d2World.rootBall;
  11878. let ballArr = xGame.common.d2World.ballArr;
  11879. let radius = rootBall.gameObj.width / 2;
  11880. let temp;
  11881. let isIntersect = false;
  11882. for (let index = 0; index < ballArr.length; index++) {
  11883. temp = ballArr[index];
  11884. if (temp.number == rootBall.number)
  11885. continue;
  11886. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11887. if (isIntersect) {
  11888. break;
  11889. }
  11890. }
  11891. return isIntersect;
  11892. }
  11893. hideBallUI() {
  11894. let d2Gan = xGame.common.d2World.d2Gan;
  11895. if (!d2Gan.ui.isDisposed)
  11896. d2Gan.ui.visible = false;
  11897. let d2Help = xGame.common.d2World.d2HelpLine;
  11898. if (!d2Help.ui.isDisposed)
  11899. d2Help.ui.visible = false;
  11900. let rootBall = xGame.common.d2World.rootBall;
  11901. if (!rootBall.destroyed) {
  11902. rootBall.gameObj.active = false;
  11903. }
  11904. }
  11905. showBallUI() {
  11906. let d2Gan = xGame.common.d2World.d2Gan;
  11907. if (!d2Gan.ui.isDisposed)
  11908. d2Gan.ui.visible = true;
  11909. let d2Help = xGame.common.d2World.d2HelpLine;
  11910. if (!d2Help.ui.isDisposed)
  11911. d2Help.ui.visible = true;
  11912. let rootBall = xGame.common.d2World.rootBall;
  11913. if (!rootBall.destroyed) {
  11914. rootBall.gameObj.active = true;
  11915. }
  11916. }
  11917. moveToClickDot(e) {
  11918. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11919. let root = xGame.common.d2World.rootBall.gameObj;
  11920. let xx = e.stageX - xGame.common.sysOffestNum;
  11921. let yy = e.stageY;
  11922. let x = xx - root.x;
  11923. let y = yy - root.y;
  11924. let angle = xGame.common.getfguiRotation(x, y);
  11925. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11926. xGame.common.d2World.getHelpLine();
  11927. }
  11928. this.isMoveRod = false;
  11929. xGame.common.clickedBall = false;
  11930. }
  11931. openAllEvent() {
  11932. this.closeAllEvent();
  11933. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11934. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11935. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11936. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11937. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11938. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11939. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11940. }
  11941. closeAllEvent() {
  11942. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11943. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11944. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11945. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11946. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11947. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11948. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11949. }
  11950. resetGame() {
  11951. this.closeAllEvent();
  11952. this.hideBallUI();
  11953. xGame.common.gameMgr.gamePause = true;
  11954. }
  11955. }
  11956. UIGame.uiName = "UIGame";
  11957. class UIAddProp extends UIBase {
  11958. constructor() {
  11959. super();
  11960. this.curType = "";
  11961. }
  11962. onConstructor() {
  11963. this.ui = ui_UIAddProp.createInstance();
  11964. this.contentPane = this.ui;
  11965. this.isEject = false;
  11966. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11967. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11968. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11969. this.updateUI();
  11970. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11971. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11972. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11973. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11974. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11975. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11976. }
  11977. show(type) {
  11978. super.show();
  11979. this.curType = type == 0 ? "coin" : "diamond";
  11980. this.switchBtn("");
  11981. this.ui.t0.play();
  11982. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11983. PlatMgr.showInsert(true);
  11984. this.setGlobalFont(this.ui);
  11985. }
  11986. closeSelf() {
  11987. this.hide();
  11988. }
  11989. updateUI() {
  11990. let data = cfgTable.moneyData;
  11991. let temp;
  11992. let obj;
  11993. for (const key in data) {
  11994. temp = data[key];
  11995. obj = this.ui.myNode["node" + key];
  11996. if (parseInt(key) <= 2) {
  11997. obj.diamondTxt.text = "+" + temp.num;
  11998. }
  11999. else {
  12000. obj.coinTxt.text = temp.num;
  12001. obj.diamondTxt.text = temp.get.split('_')[1];
  12002. }
  12003. }
  12004. this.updateDiamondShare();
  12005. }
  12006. updateDiamondShare() {
  12007. let data = DataMgr.getShareDiamondTimes();
  12008. if (data >= xGame.common.maxShareDiamondTimes) {
  12009. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  12010. this.ui.myNode.node1.touchable = false;
  12011. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12012. }
  12013. else {
  12014. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  12015. this.ui.myNode.node1.touchable = true;
  12016. }
  12017. }
  12018. switchBtn(type) {
  12019. if (type == "")
  12020. type = this.curType;
  12021. else {
  12022. if (this.curType == type) {
  12023. return;
  12024. }
  12025. else {
  12026. this.curType = type;
  12027. }
  12028. }
  12029. if (type == "coin") {
  12030. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  12031. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  12032. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  12033. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  12034. this.ui.myNode.c1.selectedIndex = 0;
  12035. }
  12036. else {
  12037. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  12038. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  12039. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  12040. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  12041. this.ui.myNode.c1.selectedIndex = 1;
  12042. }
  12043. }
  12044. convertCoin(index) {
  12045. let data = cfgTable.moneyData[index];
  12046. let coinNum = data.num;
  12047. let str = data.get.split('_')[1];
  12048. let needDiamond = parseInt(str);
  12049. if (DataMgr.diamondEnough(needDiamond)) {
  12050. DataMgr.setDiamond(-needDiamond);
  12051. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  12052. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12053. }
  12054. else {
  12055. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12056. this.switchBtn("diamond");
  12057. }
  12058. }
  12059. videoGetDiamond() {
  12060. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12061. if (Laya.Browser.onAndroid) {
  12062. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12063. if (!boo) {
  12064. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12065. return;
  12066. }
  12067. }
  12068. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12069. }
  12070. else {
  12071. console.log('zh:AD 失败,直接发放奖励');
  12072. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12073. }
  12074. }
  12075. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12076. let num = cfgTable.moneyData[2].num;
  12077. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12078. this.closeSelf();
  12079. }
  12080. videoGetCoin() {
  12081. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12082. if (Laya.Browser.onAndroid) {
  12083. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12084. if (!boo) {
  12085. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12086. return;
  12087. }
  12088. }
  12089. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12090. }
  12091. else {
  12092. console.log('zh:AD 失败,直接发放奖励');
  12093. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12094. }
  12095. }
  12096. qjff_AD_for_uiAddProp_videoGetCoin() {
  12097. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12098. this.closeSelf();
  12099. }
  12100. shareGetDiamond() {
  12101. let times = DataMgr.getShareDiamondTimes();
  12102. if (times >= xGame.common.maxShareDiamondTimes) {
  12103. console.log('zh: 233333333333 maxShareDiamondTimes');
  12104. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12105. }
  12106. else {
  12107. console.log('zh:33333333333333ad');
  12108. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12109. if (Laya.Browser.onAndroid) {
  12110. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12111. if (!boo) {
  12112. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12113. return;
  12114. }
  12115. }
  12116. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12117. }
  12118. else {
  12119. console.log('zh:AD 失败,直接发放奖励');
  12120. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12121. }
  12122. }
  12123. }
  12124. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12125. let diamond = xGame.common.randomNum(50, 100);
  12126. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12127. DataMgr.setShareDiamondTimes(1);
  12128. this.updateDiamondShare();
  12129. }
  12130. openPutBallView() {
  12131. let end = xGame.uiMgr.getUI(UIGameEnd);
  12132. let skill = xGame.uiMgr.getUI(UISkill);
  12133. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12134. let uigame = xGame.uiMgr.getUI(UIGame);
  12135. if (end && !end.isHide) {
  12136. xGame.uiMgr.Hide(UIGameEnd);
  12137. xGame.uiMgr.Show(UIMain);
  12138. }
  12139. if (skill && !skill.isHide)
  12140. xGame.uiMgr.Hide(UISkill);
  12141. if (uigame && !uigame.isHide)
  12142. xGame.uiMgr.Hide(UIGame);
  12143. if (level && !level.isHide) {
  12144. }
  12145. else {
  12146. xGame.uiMgr.Show(UILevelDisplay);
  12147. }
  12148. this.closeSelf();
  12149. }
  12150. }
  12151. UIAddProp.uiName = "UIAddProp";
  12152. class MoneyNode {
  12153. constructor(ui) {
  12154. this.leftTime = 0;
  12155. this.ui = ui;
  12156. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12157. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12158. this.ui.addPowerBtn.onClick(this, this.addPower);
  12159. this.ui.c1.selectedIndex = 1;
  12160. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12161. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12162. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12163. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12164. this.coinChange();
  12165. this.diamondChange();
  12166. this.powerChange();
  12167. }
  12168. addPower() {
  12169. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12170. xGame.uiMgr.Show(UIPower);
  12171. }
  12172. powerChange() {
  12173. let powerNum = DataMgr.getPower();
  12174. this.ui.powerTxt.text = powerNum + "";
  12175. }
  12176. checkPowerTime() {
  12177. let cur = new Date().getTime();
  12178. let last = DataMgr.getPowerTime();
  12179. if (last == 0) {
  12180. last = cur;
  12181. DataMgr.setPowerTime(cur);
  12182. }
  12183. let power = DataMgr.getPower();
  12184. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12185. Laya.timer.clearAll(this);
  12186. if (power >= xGame.common.natureMaxPower) {
  12187. this.ui.powerTimeTxt.text = "";
  12188. DataMgr.setPowerTime(cur);
  12189. return;
  12190. }
  12191. if (power + offset >= xGame.common.natureMaxPower) {
  12192. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12193. this.ui.powerTimeTxt.text = "";
  12194. DataMgr.setPowerTime(cur);
  12195. }
  12196. else {
  12197. if (offset > 0) {
  12198. DataMgr.setPower(offset);
  12199. DataMgr.setPowerTime(cur);
  12200. }
  12201. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12202. this.leftTime = xGame.common.powerRecoverNum - time;
  12203. if (this.leftTime <= 0)
  12204. this.leftTime = 0;
  12205. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12206. Laya.timer.loop(1000, this, this.updatePowerTime);
  12207. }
  12208. }
  12209. updatePowerTime() {
  12210. this.leftTime -= 1;
  12211. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12212. if (this.leftTime <= 0) {
  12213. this.checkPowerTime();
  12214. }
  12215. }
  12216. coinChange() {
  12217. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12218. }
  12219. diamondChange() {
  12220. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12221. }
  12222. addCoin() {
  12223. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12224. Moyu.sendDataEvent("AddCoinBtn");
  12225. xGame.uiMgr.Show(UIAddProp, 0);
  12226. }
  12227. addDiamond() {
  12228. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12229. Moyu.sendDataEvent("AddDiamondBtn");
  12230. xGame.uiMgr.Show(UIAddProp, 1);
  12231. }
  12232. }
  12233. class UIDraw extends UIBase {
  12234. constructor() {
  12235. super();
  12236. this.curKey = 0;
  12237. }
  12238. onConstructor() {
  12239. this.ui = ui_UIDraw.createInstance();
  12240. this.contentPane = this.ui;
  12241. this.isEject = false;
  12242. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12243. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12244. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12245. this.initDraw();
  12246. this.initUI();
  12247. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12248. }
  12249. show() {
  12250. super.show();
  12251. this.ui.t0.play();
  12252. this.playSecretaryIdle();
  12253. this.updateDraw();
  12254. this.checkFree();
  12255. if (PlatMgr.bannerDelay > 0) {
  12256. this.ui.closeNode.closeBtn.visible = false;
  12257. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12258. this.ui.closeNode.closeBtn.visible = true;
  12259. });
  12260. }
  12261. PlatMgr.showRateBanner();
  12262. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12263. this.setGlobalFont(this.ui);
  12264. }
  12265. hide() {
  12266. Laya.timer.clearAll(this);
  12267. super.hide();
  12268. }
  12269. checkFree() {
  12270. let isFree = DataMgr.getDailyfreeDrawTimes();
  12271. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12272. }
  12273. initDraw() {
  12274. this.drawObj = [];
  12275. let data = cfgTable.drawData;
  12276. let temp;
  12277. let weight = 0;
  12278. for (const key in data) {
  12279. temp = data[key];
  12280. weight += temp.weight;
  12281. this.drawObj.push(weight);
  12282. }
  12283. this.allWeight = weight;
  12284. }
  12285. initUI() {
  12286. let data = cfgTable.drawData;
  12287. let temp;
  12288. let img;
  12289. let txt;
  12290. for (const key in data) {
  12291. temp = data[key];
  12292. img = this.ui.myNode.rotNode["img" + key];
  12293. txt = this.ui.myNode.rotNode["txt" + key];
  12294. img.url = xGame.common.getGameIconUrl(temp.icon);
  12295. txt.visible = true;
  12296. if (temp.award > 2) {
  12297. img.rotation = 0;
  12298. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12299. }
  12300. else {
  12301. img.rotation = temp.rotation;
  12302. txt.text = temp.num;
  12303. }
  12304. }
  12305. }
  12306. getCurkey() {
  12307. let rand = Math.random() * this.allWeight;
  12308. let temp;
  12309. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12310. temp = this.drawObj[index];
  12311. if (index == 0) {
  12312. if (rand < temp) {
  12313. return index + 1;
  12314. }
  12315. }
  12316. else {
  12317. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12318. return index + 1;
  12319. }
  12320. }
  12321. }
  12322. return 2;
  12323. }
  12324. startDraw() {
  12325. console.log('zh:开始抽奖');
  12326. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12327. if (freeTimes > 0) {
  12328. console.log('zh:freeTimes=' + freeTimes);
  12329. this.beginDraw();
  12330. DataMgr.setDailyfreeDrawTimes(0);
  12331. this.checkFree();
  12332. }
  12333. else {
  12334. if (Laya.Browser.onAndroid) {
  12335. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12336. if (!boo) {
  12337. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12338. return;
  12339. }
  12340. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12341. }
  12342. else {
  12343. console.log('zh:AD 失败,直接发放奖励');
  12344. this.qjff_chouJiang();
  12345. }
  12346. }
  12347. else {
  12348. this.qjff_chouJiang();
  12349. }
  12350. }
  12351. }
  12352. qjff_chouJiang() {
  12353. this.beginDraw();
  12354. }
  12355. beginDraw() {
  12356. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12357. this.ui.drawBtn.touchable = false;
  12358. this.curKey = this.getCurkey();
  12359. console.log("zh:当前key", this.curKey);
  12360. let cell = 60;
  12361. let lap = 3;
  12362. let angle = cell * (this.curKey - 1) + lap * 360;
  12363. let target = this.ui.myNode.rotNode;
  12364. target.rotation = 0;
  12365. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12366. console.log("zh:旋转完成");
  12367. this.ui.drawBtn.touchable = true;
  12368. this.getAward();
  12369. }));
  12370. }
  12371. getAward() {
  12372. let data = cfgTable.drawData[this.curKey];
  12373. let temp = new AwardType();
  12374. temp.type = data.award;
  12375. temp.num = data.num;
  12376. xGame.common.getAward([temp], () => {
  12377. DataMgr.setDrawTimes(1);
  12378. this.updateDraw();
  12379. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12380. });
  12381. }
  12382. updateDraw() {
  12383. let drawTimes = DataMgr.getDrawTimes();
  12384. let awardTimes = DataMgr.getDrawAwardTimes();
  12385. if (Math.floor(drawTimes / 3) > awardTimes) {
  12386. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12387. this.ui.extraNode.boxBtn.touchable = true;
  12388. this.ui.extraNode.tipsTxt.text = "3/3";
  12389. this.ui.extraNode.barNode.width = 265;
  12390. this.getExtraAward();
  12391. }
  12392. else {
  12393. this.ui.extraNode.boxBtn.t0.stop();
  12394. this.ui.extraNode.boxBtn.touchable = false;
  12395. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12396. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12397. }
  12398. let data = cfgTable.drawData[1];
  12399. if (awardTimes == 0) {
  12400. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12401. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12402. this.ui.myNode.rotNode.img1.rotation = 0;
  12403. }
  12404. else {
  12405. let award = data.nextid;
  12406. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12407. this.ui.myNode.rotNode.txt1.text = award[1];
  12408. this.ui.myNode.rotNode.img1.rotation = 0;
  12409. }
  12410. }
  12411. getExtraAward() {
  12412. let drawTimes = DataMgr.getDrawTimes();
  12413. let awardTimes = DataMgr.getDrawAwardTimes();
  12414. let data = cfgTable.drawData[1];
  12415. let award = new AwardType();
  12416. if (awardTimes == 0) {
  12417. award.num = data.num;
  12418. award.type = data.award;
  12419. xGame.common.getAward([award], () => {
  12420. let all = Math.floor(drawTimes / 3);
  12421. DataMgr.setDrawAwardTimes(all);
  12422. this.updateDraw();
  12423. });
  12424. }
  12425. else {
  12426. award.num = parseInt(data.nextid[1]);
  12427. award.type = parseInt(data.nextid[0]);
  12428. xGame.common.getAward([award], () => {
  12429. let all = Math.floor(drawTimes / 3);
  12430. DataMgr.setDrawAwardTimes(all);
  12431. this.updateDraw();
  12432. });
  12433. }
  12434. }
  12435. closeSelf() {
  12436. this.hide();
  12437. }
  12438. playSecretaryIdle() {
  12439. let parent = this.ui.secretary.displayObject;
  12440. parent.destroyChildren();
  12441. let xx = this.ui.secretary.width / 2;
  12442. let yy = this.ui.secretary.height;
  12443. let scale = xGame.common.getSecretaryScale();
  12444. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12445. xGame.common.secretary.play(data, 0, true, parent);
  12446. }
  12447. }
  12448. UIDraw.uiName = "UIDraw";
  12449. class ui_UIFlyEft extends fgui.GComponent {
  12450. static createInstance() {
  12451. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12452. }
  12453. onConstruct() {
  12454. this.n0 = (this.getChild("n0"));
  12455. this.n1 = (this.getChild("n1"));
  12456. this.n2 = (this.getChild("n2"));
  12457. this.n3 = (this.getChild("n3"));
  12458. this.n4 = (this.getChild("n4"));
  12459. this.n5 = (this.getChild("n5"));
  12460. this.n6 = (this.getChild("n6"));
  12461. this.n7 = (this.getChild("n7"));
  12462. this.iconNode = (this.getChild("iconNode"));
  12463. this.txt = (this.getChild("txt"));
  12464. this.txtNode = (this.getChild("txtNode"));
  12465. }
  12466. }
  12467. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12468. class UIFlyEft extends UIBase {
  12469. constructor() {
  12470. super();
  12471. this.max = 8;
  12472. this.delay = 0;
  12473. }
  12474. onConstructor() {
  12475. this.ui = ui_UIFlyEft.createInstance();
  12476. this.contentPane = this.ui;
  12477. this.isEject = false;
  12478. this.isMuti = true;
  12479. this.ui.x += xGame.common.sysOffestNum;
  12480. }
  12481. getArrPos() {
  12482. if (this.iconPos && this.iconPos.length > 0)
  12483. return;
  12484. this.iconPos = [];
  12485. let temp;
  12486. for (let index = 0; index < this.max; index++) {
  12487. temp = this.ui["n" + index];
  12488. this.iconPos.push([temp.x, temp.y]);
  12489. }
  12490. }
  12491. show(stPos, edPos, num, type, callback) {
  12492. super.show();
  12493. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12494. this.getArrPos();
  12495. this.updateUI(type);
  12496. this.updatePos();
  12497. this.runFly(edPos, callback);
  12498. this.runWorlds(stPos, num);
  12499. this.setGlobalFont(this.ui);
  12500. }
  12501. updateUI(type) {
  12502. let temp;
  12503. let str;
  12504. for (let index = 0; index < this.max; index++) {
  12505. temp = this.ui["n" + index];
  12506. str = this.getIconStr(type);
  12507. temp.url = xGame.common.getGameIconUrl(str);
  12508. }
  12509. }
  12510. getIconStr(type) {
  12511. switch (type) {
  12512. case Prop.diamond:
  12513. return "ty_zs";
  12514. case Prop.coin:
  12515. return "ty_jb";
  12516. default:
  12517. break;
  12518. }
  12519. }
  12520. updatePos() {
  12521. let temp;
  12522. for (let index = 0; index < this.max; index++) {
  12523. temp = this.ui["n" + index];
  12524. temp.x = this.iconPos[index][0];
  12525. temp.y = this.iconPos[index][1];
  12526. }
  12527. }
  12528. runFly(endPos, callback) {
  12529. let all = 0;
  12530. let temp;
  12531. for (let index = 0; index < this.max; index++) {
  12532. temp = this.ui["n" + index];
  12533. temp.visible = true;
  12534. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12535. temp.visible = false;
  12536. all++;
  12537. if (all >= this.max) {
  12538. callback && callback();
  12539. }
  12540. }), 20 * index);
  12541. }
  12542. }
  12543. runWorlds(stPos, num) {
  12544. let str = "+" + num;
  12545. this.ui.txt.text = str;
  12546. let starX = stPos.x;
  12547. let starY = stPos.y + 50;
  12548. this.ui.txt.x = starX;
  12549. this.ui.txt.y = starY;
  12550. this.ui.txt.visible = true;
  12551. this.ui.txt.alpha = 1;
  12552. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12553. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12554. this.ui.txt.visible = false;
  12555. this.hide();
  12556. }));
  12557. }));
  12558. }
  12559. }
  12560. UIFlyEft.uiName = "UIFlyEft";
  12561. class Common {
  12562. constructor() {
  12563. this.convertNum = 0.025;
  12564. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12565. this.scaleV3One = new Laya.Vector3();
  12566. this.scaleV3Two = new Laya.Vector3();
  12567. this.posV4 = new Laya.Vector4();
  12568. this.showDebug = false;
  12569. this.openGuide = true;
  12570. this.rodOffest = new Laya.Vector2(0, 0);
  12571. this.rodAngle = 0;
  12572. this.gameMode = GameMode.classic;
  12573. this.bigMoveLevelIndex = 1;
  12574. this.bigMoveNeedCoin = 1000;
  12575. this.classicNiceNeddCoin = 1000;
  12576. this.passAwardCoin = 2000;
  12577. this.classicRoomType = 1;
  12578. this.maxPower = 20;
  12579. this.natureMaxPower = 5;
  12580. this.videoPower = 2;
  12581. this.powerRecoverNum = 900;
  12582. this.curPlayerSkillType = 0;
  12583. this.isNewDay = false;
  12584. this.clickedBall = false;
  12585. this.placeBallCurLevel = 0;
  12586. this.placeBallStarNum = 0;
  12587. this.longHelpLine = false;
  12588. this.maxShareDiamondTimes = 3;
  12589. this.guideStep = 0;
  12590. this.guideStepForLianXi = 0;
  12591. this.temSelfLevel = 0;
  12592. this.extraMoveNum = 0;
  12593. this.curRankID = 0;
  12594. this.rankID = {
  12595. normalStar: 12000,
  12596. wxStar: 12001
  12597. };
  12598. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12599. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12600. this.btnClickStr = "buttonclick";
  12601. this.maxSkillLevel = 10;
  12602. this.upSkillLevel = false;
  12603. this.gameStartTime = 0;
  12604. this._sysOffestNum = 0;
  12605. this.angleV2 = new Laya.Vector2();
  12606. this.rootV = new Laya.Vector2(0, 1);
  12607. this.tempDir1 = new Laya.Vector2();
  12608. this.tempDir2 = new Laya.Vector2();
  12609. this.ballSize = 33;
  12610. this.stPos = new Laya.Point();
  12611. this.edPos = new Laya.Point();
  12612. Common._instance = this;
  12613. window["common"] = this;
  12614. }
  12615. static getInstance() {
  12616. if (!this._instance) {
  12617. this._instance = new Common();
  12618. }
  12619. return this._instance;
  12620. }
  12621. get sysOffestNum() {
  12622. if (this._sysOffestNum == 0) {
  12623. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12624. }
  12625. return this._sysOffestNum;
  12626. }
  12627. testShader() {
  12628. let test = new LightShader();
  12629. test.texture = "res/d3Res/ballTexture/ball1.png";
  12630. Laya.stage.addChild(test);
  12631. }
  12632. playScale(node) {
  12633. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12634. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12635. }));
  12636. }));
  12637. }
  12638. setGroup(colli, ...group) {
  12639. let out = 0;
  12640. for (let index = 0; index < group.length; index++) {
  12641. if (index == 0) {
  12642. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12643. }
  12644. else {
  12645. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12646. }
  12647. }
  12648. colli.collisionGroup = out;
  12649. }
  12650. setCanGroupWith(colli, ...group) {
  12651. let out = 0;
  12652. for (let index = 0; index < group.length; index++) {
  12653. if (index == 0) {
  12654. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12655. }
  12656. else {
  12657. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12658. }
  12659. }
  12660. colli.canCollideWith = out;
  12661. }
  12662. loadPrefab(name, callback) {
  12663. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12664. let prefab = new Laya.Prefab();
  12665. prefab.json = obj;
  12666. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12667. callback && callback(img);
  12668. }));
  12669. }
  12670. pos2to3Convert(x, y, d3Pos) {
  12671. x = x + this.sysOffestNum;
  12672. d3Pos.setValue(x, y, 0);
  12673. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12674. if (success) {
  12675. }
  12676. else {
  12677. console.error("转换出错了。。。。。。。。");
  12678. }
  12679. }
  12680. scale2to3Convert(num) {
  12681. this.scaleV3One.setValue(0, 0, 0);
  12682. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12683. this.scaleV3Two.setValue(0, num, 0);
  12684. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12685. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12686. return outNum;
  12687. }
  12688. pos3to2Convert(d3Pos) {
  12689. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12690. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12691. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12692. d3Pos.x -= this.sysOffestNum;
  12693. }
  12694. scale3to2Convert(num) {
  12695. let scale = this.scale2to3Convert(1);
  12696. let d2Out = num / scale;
  12697. return d2Out;
  12698. }
  12699. getCollider(type, restitution = 0.9, density = 10) {
  12700. let colli;
  12701. if (type == "box")
  12702. colli = new Laya.BoxCollider();
  12703. else
  12704. colli = new Laya.CircleCollider();
  12705. colli.friction = 0;
  12706. colli.restitution = restitution;
  12707. colli.density = density;
  12708. return colli;
  12709. }
  12710. getRigbody() {
  12711. let rigy = new Laya.RigidBody();
  12712. rigy.bullet = true;
  12713. rigy.allowRotation = false;
  12714. rigy.allowSleep = false;
  12715. rigy.gravityScale = 0;
  12716. return rigy;
  12717. }
  12718. getfguiRotation(x, y) {
  12719. this.angleV2.setValue(x, y);
  12720. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12721. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12722. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12723. angle = -angle;
  12724. }
  12725. return 180 + angle;
  12726. }
  12727. getAngle(x, y) {
  12728. this.angleV2.setValue(x, y);
  12729. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12730. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12731. return angle;
  12732. }
  12733. randomNum(a, b) {
  12734. return a + Math.floor((b - a + 1) * Math.random());
  12735. }
  12736. getRandArrEle(arr) {
  12737. return arr[Math.floor(arr.length * Math.random())];
  12738. }
  12739. getSign(val) {
  12740. return val >= 0 ? 1 : -1;
  12741. }
  12742. botherArr(arr) {
  12743. let times = arr.length + 2;
  12744. let length = arr.length;
  12745. let a;
  12746. let b;
  12747. let temp;
  12748. for (let index = 0; index < times; index++) {
  12749. a = Math.floor(Math.random() * length);
  12750. b = Math.floor(Math.random() * length);
  12751. temp = arr[a];
  12752. arr[a] = arr[b];
  12753. arr[b] = temp;
  12754. }
  12755. }
  12756. getGameIconUrl(id) {
  12757. return "ui://game/" + id;
  12758. }
  12759. getComponentUrl(id) {
  12760. return "ui://game/" + id;
  12761. }
  12762. getAnimation() {
  12763. }
  12764. judgeSkillType(type = SkillType.highSpace) {
  12765. if (this.gameMode == GameMode.classic)
  12766. return;
  12767. let gameMgr = this.gameMgr;
  12768. if (gameMgr.selfTurn) {
  12769. if (gameMgr.selfCurSkill == type) {
  12770. return true;
  12771. }
  12772. }
  12773. else {
  12774. if (gameMgr.aiCurSkill == type) {
  12775. return true;
  12776. }
  12777. }
  12778. }
  12779. ballColliHole(collider) {
  12780. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12781. xGame.common.gameMgr.isFirstInGame = false;
  12782. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12783. }
  12784. collider.owner.mySrc.checkWrongBall();
  12785. }
  12786. getArrMaxEle(arr) {
  12787. let max = -Infinity;
  12788. for (let index = 0; index < arr.length; index++) {
  12789. max = Math.max(arr[index], max);
  12790. }
  12791. return max;
  12792. }
  12793. getArrMinEle(arr) {
  12794. let min = Infinity;
  12795. for (let index = 0; index < arr.length; index++) {
  12796. min = Math.min(arr[index], min);
  12797. }
  12798. return min;
  12799. }
  12800. playRandomMutiBallBigSkillSound() {
  12801. if (Math.random() <= 0.5)
  12802. return;
  12803. let rand = this.randomNum(1, 6);
  12804. let str = "ganfa0" + rand;
  12805. xGame.soundMgr.playSound(str);
  12806. }
  12807. showOneCamera(type) {
  12808. let object = xGame.common.d3World.cameraObj;
  12809. for (const key in object) {
  12810. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12811. object[key].init();
  12812. object[key].owner.active = key == type;
  12813. }
  12814. }
  12815. }
  12816. checkBallOverBorder(x, y) {
  12817. let radius = 17;
  12818. let condition = this._checkBorder(x + radius, y) ||
  12819. this._checkBorder(x - radius, y) ||
  12820. this._checkBorder(x, y + radius) ||
  12821. this._checkBorder(x, y - radius);
  12822. if (condition) {
  12823. return true;
  12824. }
  12825. }
  12826. _checkBorder(x, y) {
  12827. let borderRect = this.d2World.borderRect;
  12828. let xOffest = 20;
  12829. let yOffest = 20;
  12830. if (y <= borderRect.y - yOffest) {
  12831. return true;
  12832. }
  12833. if (y >= borderRect.y + borderRect.height + yOffest) {
  12834. return true;
  12835. }
  12836. if (x <= borderRect.x - xOffest) {
  12837. return true;
  12838. }
  12839. if (x >= borderRect.x + borderRect.width + xOffest) {
  12840. return true;
  12841. }
  12842. }
  12843. initWeight(cfg) {
  12844. let allCfgData = { data: {}, allWeightNum: 0 };
  12845. let weightCfg = allCfgData.data;
  12846. let weight = 0;
  12847. for (const key in cfg) {
  12848. weightCfg[key] = {};
  12849. weightCfg[key].id = cfg[key].id;
  12850. weightCfg[key].minWeight = weight;
  12851. weight += cfg[key].weight;
  12852. weightCfg[key].maxWeight = weight;
  12853. }
  12854. allCfgData.allWeightNum = weight;
  12855. return allCfgData;
  12856. }
  12857. getRandomWeightData(cfg) {
  12858. let weightCfg = cfg.data;
  12859. let allWeightNum = cfg.allWeightNum;
  12860. let rand = Math.floor(Math.random() * allWeightNum);
  12861. for (const key in weightCfg) {
  12862. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12863. return weightCfg[key];
  12864. }
  12865. }
  12866. return weightCfg[1];
  12867. }
  12868. showGirlTalkPop(wordsIndex, node, msgNode) {
  12869. node.visible = true;
  12870. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12871. node.t0.play(Laya.Handler.create(this, () => {
  12872. node.visible = false;
  12873. }));
  12874. }
  12875. stopGirlPop(node) {
  12876. node.t0.stop();
  12877. node.visible = false;
  12878. }
  12879. createHead(loader, url, size = 107) {
  12880. if (Laya.Browser.name == "Browser") {
  12881. loader.url = url;
  12882. return;
  12883. }
  12884. else {
  12885. console.log('zh:url=', url);
  12886. loader.url = url;
  12887. }
  12888. }
  12889. addTestCoin(num) {
  12890. DataMgr.setCoin(num);
  12891. }
  12892. addTestDiamond(num) {
  12893. DataMgr.setDiamond(num);
  12894. }
  12895. addTestSkill() {
  12896. DataMgr.setBigSkill(0, 99);
  12897. DataMgr.setBigSkill(1, 99);
  12898. DataMgr.setBigSkill(2, 99);
  12899. }
  12900. playClassicEmotion(number, x, y) {
  12901. if (this.gameMode == GameMode.bigMove)
  12902. return;
  12903. let randIndex = this.randomNum(0, 2);
  12904. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12905. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12906. if (this.gameMgr.selfTurn) {
  12907. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12908. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12909. }
  12910. else {
  12911. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12912. }
  12913. else {
  12914. if (number == this.gameMgr.blackNum) {
  12915. if (this.gameMgr.selfBallArr.length == 0) {
  12916. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12917. }
  12918. else {
  12919. }
  12920. }
  12921. else {
  12922. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12923. }
  12924. }
  12925. }
  12926. }
  12927. else {
  12928. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12929. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12930. }
  12931. else {
  12932. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12933. }
  12934. else {
  12935. if (number == this.gameMgr.blackNum) {
  12936. if (this.gameMgr.aiBallArr.length == 0) {
  12937. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12938. }
  12939. else {
  12940. }
  12941. }
  12942. else {
  12943. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12944. }
  12945. }
  12946. }
  12947. }
  12948. }
  12949. playHappySound(number) {
  12950. if (this.gameMode != GameMode.classic)
  12951. return;
  12952. if (number == 8)
  12953. return;
  12954. let play = false;
  12955. if (this.gameMgr.selfTurn) {
  12956. if (this.gameMgr.ensureBallType) {
  12957. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12958. play = true;
  12959. }
  12960. }
  12961. else {
  12962. play = true;
  12963. }
  12964. }
  12965. else {
  12966. if (this.gameMgr.ensureBallType) {
  12967. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12968. play = true;
  12969. }
  12970. }
  12971. else {
  12972. play = true;
  12973. }
  12974. }
  12975. if (play)
  12976. xGame.soundMgr.playSound("applause");
  12977. }
  12978. destroyClassicEmotion() {
  12979. if (this.gameMode == GameMode.bigMove)
  12980. return;
  12981. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12982. parent.destroyChildren();
  12983. }
  12984. playAwardSpine(x, y) {
  12985. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12986. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12987. this.awardSpine.play(data, 0, false, parent);
  12988. }
  12989. destroyAwardSpine() {
  12990. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12991. parent.destroyChildren();
  12992. }
  12993. isBlock(bx, by, hx, hy, except = null) {
  12994. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12995. let balls = xGame.common.d2World.ballArr;
  12996. let outArr = [];
  12997. for (let index = 0; index < balls.length; index++) {
  12998. let obj = balls[index];
  12999. if (obj.number == 0)
  13000. continue;
  13001. if (obj == except)
  13002. continue;
  13003. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  13004. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  13005. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  13006. if (num >= 1)
  13007. num = 1;
  13008. if (num < 0)
  13009. continue;
  13010. let gap = Math.sin(Math.acos(num)) * dis;
  13011. if (gap < this.ballSize) {
  13012. outArr.push({
  13013. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  13014. disHon: Math.cos(Math.acos(num)) * dis,
  13015. disVer: Math.sin(Math.acos(num)) * dis,
  13016. src: balls[index],
  13017. dir: this.tempDir1
  13018. });
  13019. }
  13020. }
  13021. if (outArr.length > 0) {
  13022. outArr.sort((a, b) => { return a.dis - b.dis; });
  13023. return outArr[0];
  13024. }
  13025. }
  13026. AngleBetween(vector1, vector2) {
  13027. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  13028. return rad * (180 / Math.PI);
  13029. }
  13030. getSecretaryScale() {
  13031. if (this.secretary.spineName == "mishu") {
  13032. return 1.28;
  13033. }
  13034. else {
  13035. return 1.024;
  13036. }
  13037. }
  13038. signAwardContainsRod(arr) {
  13039. let temp;
  13040. for (let index = 0; index < arr.length; index++) {
  13041. temp = arr[index].split('-')[0];
  13042. if (parseInt(temp) > 2) {
  13043. return true;
  13044. }
  13045. }
  13046. }
  13047. judgeSameDay() {
  13048. let lastTime = DataMgr.getSignTime();
  13049. let curTime = new Date().getTime();
  13050. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  13051. return true;
  13052. }
  13053. return false;
  13054. }
  13055. getAward(arr, callback) {
  13056. let showTriple = arr[0].type <= 2;
  13057. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  13058. let temp;
  13059. for (let index = 0; index < arr.length; index++) {
  13060. temp = arr[index];
  13061. switch (temp.type) {
  13062. case 1:
  13063. this.playObjFlyAnim(temp.num, temp.type);
  13064. break;
  13065. case 2:
  13066. this.playObjFlyAnim(temp.num, temp.type);
  13067. break;
  13068. case 3:
  13069. case 4:
  13070. case 5:
  13071. case 6:
  13072. DataMgr.setBallRod(temp.type - 2, 1);
  13073. DataMgr.setCurBallRod(temp.type - 2);
  13074. break;
  13075. default:
  13076. break;
  13077. }
  13078. }
  13079. callback && callback(watchVideo);
  13080. });
  13081. }
  13082. getMoneyNode() {
  13083. let moneyNode;
  13084. let sign = xGame.uiMgr.getUI(UISign);
  13085. let draw = xGame.uiMgr.getUI(UIDraw);
  13086. let end = xGame.uiMgr.getUI(UIGameEnd);
  13087. let skill = xGame.uiMgr.getUI(UISkill);
  13088. if (sign && !sign.isHide)
  13089. moneyNode = sign.ui.moneyNode;
  13090. if (draw && !draw.isHide)
  13091. moneyNode = draw.ui.moneyNode;
  13092. if (end && !end.isHide)
  13093. moneyNode = end.ui.moneyNode;
  13094. if (skill && !skill.isHide)
  13095. moneyNode = skill.ui.moneyNode;
  13096. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13097. let main = xGame.uiMgr.getUI(UIMain);
  13098. if (condition1 && main && !main.isHide) {
  13099. moneyNode = main.ui.moneyNode;
  13100. }
  13101. return moneyNode;
  13102. }
  13103. playObjFlyAnim(num, type, callback = null) {
  13104. this.stPos.x = Laya.stage.width / 2;
  13105. this.stPos.y = Laya.stage.height / 2;
  13106. let moneyNode = this.getMoneyNode();
  13107. switch (type) {
  13108. case Prop.diamond:
  13109. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13110. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13111. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13112. this.edPos.x /= 2;
  13113. this.edPos.y /= 2;
  13114. break;
  13115. case Prop.coin:
  13116. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13117. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13118. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13119. this.edPos.x /= 2;
  13120. this.edPos.y /= 2;
  13121. break;
  13122. default:
  13123. break;
  13124. }
  13125. xGame.soundMgr.playSound("coinbag");
  13126. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13127. switch (type) {
  13128. case Prop.diamond:
  13129. DataMgr.setDiamond(num);
  13130. break;
  13131. case Prop.coin:
  13132. DataMgr.setCoin(num);
  13133. break;
  13134. default:
  13135. break;
  13136. }
  13137. callback && callback();
  13138. });
  13139. }
  13140. autoPopUIView() {
  13141. let arr = [];
  13142. let sign = this.judgeSameDay() ? false : true;
  13143. if (sign)
  13144. arr.push("sign");
  13145. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13146. if (draw)
  13147. arr.push("draw");
  13148. if (arr.length <= 0)
  13149. return;
  13150. let str = this.getRandArrEle(arr);
  13151. switch (str) {
  13152. case "sign":
  13153. xGame.uiMgr.Show(UISign);
  13154. break;
  13155. case "draw":
  13156. xGame.uiMgr.Show(UIDraw);
  13157. break;
  13158. default:
  13159. break;
  13160. }
  13161. }
  13162. getMSTime(time) {
  13163. let min = Math.floor(time / 60);
  13164. let sec = Math.floor((time - min * 60));
  13165. if (sec < 10)
  13166. sec = "0" + sec;
  13167. if (min < 10)
  13168. min = "0" + min;
  13169. return `${min}:${sec}`;
  13170. }
  13171. testPower() {
  13172. DataMgr.setPower(0, false);
  13173. }
  13174. getAllStarNum() {
  13175. let data = DataMgr.getPlaceBallLevelList();
  13176. let out = 0;
  13177. for (let index = 0; index < data.length; index++) {
  13178. out += data[index].star;
  13179. }
  13180. return out;
  13181. }
  13182. recoverCameraView() {
  13183. Laya.timer.once(900, this, () => {
  13184. xGame.common.showOneCamera("mainCamera");
  13185. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13186. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13187. xGame.common.gameUI.ui.border.alpha = 0;
  13188. if (Laya.physicsTimer.scale < 1) {
  13189. Laya.physicsTimer.scale = 1;
  13190. }
  13191. }
  13192. });
  13193. }
  13194. getClassicLevel() {
  13195. let successTimes = DataMgr.getClassicTimes();
  13196. let needKey = "";
  13197. let lastKey = "";
  13198. let cfg = cfgTable.classictimesData;
  13199. let data;
  13200. for (const key in cfg) {
  13201. data = cfg[key];
  13202. if (successTimes <= data.times) {
  13203. needKey = key;
  13204. }
  13205. lastKey = key;
  13206. }
  13207. if (needKey == "")
  13208. needKey = lastKey;
  13209. return cfg[needKey];
  13210. }
  13211. }
  13212. Common._instance = null;
  13213. class ui_Component92 extends fgui.GComponent {
  13214. static createInstance() {
  13215. return (fgui.UIPackage.createObject("game", "Component92"));
  13216. }
  13217. onConstruct() {
  13218. this.n0 = (this.getChild("n0"));
  13219. }
  13220. }
  13221. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13222. class ui_Component129 extends fgui.GProgressBar {
  13223. static createInstance() {
  13224. return (fgui.UIPackage.createObject("game", "Component129"));
  13225. }
  13226. onConstruct() {
  13227. this.bar_v = (this.getChild("bar_v"));
  13228. this.n84 = (this.getChild("n84"));
  13229. }
  13230. }
  13231. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13232. class ui_Component130 extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "Component130"));
  13235. }
  13236. onConstruct() {
  13237. this.ani = (this.getChild("ani"));
  13238. this.t0 = this.getTransition("t0");
  13239. }
  13240. }
  13241. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13242. class ui_powerEft extends fgui.GComponent {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "powerEft"));
  13245. }
  13246. onConstruct() {
  13247. this.ani = (this.getChild("ani"));
  13248. this.n88 = (this.getChild("n88"));
  13249. this.n89 = (this.getChild("n89"));
  13250. }
  13251. }
  13252. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13253. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13254. static createInstance() {
  13255. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13256. }
  13257. onConstruct() {
  13258. this.c1 = this.getController("c1");
  13259. this.n2 = (this.getChild("n2"));
  13260. this.n22 = (this.getChild("n22"));
  13261. this.n23 = (this.getChild("n23"));
  13262. this.n15 = (this.getChild("n15"));
  13263. this.challenge = (this.getChild("challenge"));
  13264. this.n17 = (this.getChild("n17"));
  13265. this.n3 = (this.getChild("n3"));
  13266. this.starNode = (this.getChild("starNode"));
  13267. this.levelTxt = (this.getChild("levelTxt"));
  13268. this.n14 = (this.getChild("n14"));
  13269. this.n19 = (this.getChild("n19"));
  13270. this.n20 = (this.getChild("n20"));
  13271. this.n21 = (this.getChild("n21"));
  13272. this.special = (this.getChild("special"));
  13273. }
  13274. }
  13275. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13276. class ui_Component79 extends fgui.GComponent {
  13277. static createInstance() {
  13278. return (fgui.UIPackage.createObject("game", "Component79"));
  13279. }
  13280. onConstruct() {
  13281. this.c1 = this.getController("c1");
  13282. this.n7 = (this.getChild("n7"));
  13283. this.n8 = (this.getChild("n8"));
  13284. this.n9 = (this.getChild("n9"));
  13285. this.n10 = (this.getChild("n10"));
  13286. this.n11 = (this.getChild("n11"));
  13287. this.n12 = (this.getChild("n12"));
  13288. }
  13289. }
  13290. ui_Component79.URL = "ui://isxx5ak7avag477";
  13291. class ui_Component80 extends fgui.GComponent {
  13292. static createInstance() {
  13293. return (fgui.UIPackage.createObject("game", "Component80"));
  13294. }
  13295. onConstruct() {
  13296. this.n0 = (this.getChild("n0"));
  13297. this.n1 = (this.getChild("n1"));
  13298. this.myList = (this.getChild("myList"));
  13299. this.guide2 = (this.getChild("guide2"));
  13300. this.yd = (this.getChild("yd"));
  13301. this.yd_zzq_btn = (this.getChild("yd_zzq_btn"));
  13302. this.n_yd_lxms_2 = (this.getChild("n_yd_lxms_2"));
  13303. this.t0 = this.getTransition("t0");
  13304. }
  13305. }
  13306. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13307. class ui_SignNormal extends fgui.GComponent {
  13308. static createInstance() {
  13309. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13310. }
  13311. onConstruct() {
  13312. this.c1 = this.getController("c1");
  13313. this.n7 = (this.getChild("n7"));
  13314. this.n15 = (this.getChild("n15"));
  13315. this.titleTxt = (this.getChild("titleTxt"));
  13316. this.n8 = (this.getChild("n8"));
  13317. this.myIcon = (this.getChild("myIcon"));
  13318. this.numTxt = (this.getChild("numTxt"));
  13319. this.n12 = (this.getChild("n12"));
  13320. this.n13 = (this.getChild("n13"));
  13321. this.n17 = (this.getChild("n17"));
  13322. this.n14 = (this.getChild("n14"));
  13323. }
  13324. }
  13325. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13326. class ui_Button_reg extends fgui.GButton {
  13327. static createInstance() {
  13328. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13329. }
  13330. onConstruct() {
  13331. this.button = this.getController("button");
  13332. this.n6 = (this.getChild("n6"));
  13333. }
  13334. }
  13335. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13336. class ui_screenNode extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "screenNode"));
  13339. }
  13340. onConstruct() {
  13341. this.n9 = (this.getChild("n9"));
  13342. this.screenImg = (this.getChild("screenImg"));
  13343. }
  13344. }
  13345. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13346. class ui_GetAwrad_com1 extends fgui.GComponent {
  13347. static createInstance() {
  13348. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13349. }
  13350. onConstruct() {
  13351. this.n38 = (this.getChild("n38"));
  13352. this.n39 = (this.getChild("n39"));
  13353. this.n40 = (this.getChild("n40"));
  13354. this.t0 = this.getTransition("t0");
  13355. this.t1 = this.getTransition("t1");
  13356. }
  13357. }
  13358. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13359. class ui_GetAwrad_com2 extends fgui.GComponent {
  13360. static createInstance() {
  13361. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13362. }
  13363. onConstruct() {
  13364. this.n39 = (this.getChild("n39"));
  13365. this.n40 = (this.getChild("n40"));
  13366. this.t0 = this.getTransition("t0");
  13367. }
  13368. }
  13369. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13370. class ui_Component128 extends fgui.GComponent {
  13371. static createInstance() {
  13372. return (fgui.UIPackage.createObject("game", "Component128"));
  13373. }
  13374. onConstruct() {
  13375. this.n38 = (this.getChild("n38"));
  13376. this.n40 = (this.getChild("n40"));
  13377. }
  13378. }
  13379. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13380. class ui_Component100_1 extends fgui.GComponent {
  13381. static createInstance() {
  13382. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13383. }
  13384. onConstruct() {
  13385. this.myNode = (this.getChild("myNode"));
  13386. this.t0 = this.getTransition("t0");
  13387. }
  13388. }
  13389. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13390. class ui_Component142 extends fgui.GComponent {
  13391. static createInstance() {
  13392. return (fgui.UIPackage.createObject("game", "Component142"));
  13393. }
  13394. onConstruct() {
  13395. this.n41 = (this.getChild("n41"));
  13396. this.n42 = (this.getChild("n42"));
  13397. }
  13398. }
  13399. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13400. class ui_main_guang extends fgui.GComponent {
  13401. static createInstance() {
  13402. return (fgui.UIPackage.createObject("game", "main_guang"));
  13403. }
  13404. onConstruct() {
  13405. this.n1 = (this.getChild("n1"));
  13406. this.n2 = (this.getChild("n2"));
  13407. this.n3 = (this.getChild("n3"));
  13408. this.n4 = (this.getChild("n4"));
  13409. this.n5 = (this.getChild("n5"));
  13410. this.n6 = (this.getChild("n6"));
  13411. this.n8 = (this.getChild("n8"));
  13412. this.t0 = this.getTransition("t0");
  13413. }
  13414. }
  13415. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13416. class ui_try_com1 extends fgui.GComponent {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "try_com1"));
  13419. }
  13420. onConstruct() {
  13421. this.c1 = this.getController("c1");
  13422. this.n0 = (this.getChild("n0"));
  13423. this.n2 = (this.getChild("n2"));
  13424. this.cancelBtn = (this.getChild("cancelBtn"));
  13425. this.videoBtn = (this.getChild("videoBtn"));
  13426. this.n9 = (this.getChild("n9"));
  13427. this.n24 = (this.getChild("n24"));
  13428. this.titleTxt = (this.getChild("titleTxt"));
  13429. this.n32 = (this.getChild("n32"));
  13430. this.n29 = (this.getChild("n29"));
  13431. this.n36 = (this.getChild("n36"));
  13432. this.txtTime = (this.getChild("txtTime"));
  13433. this.t0 = this.getTransition("t0");
  13434. }
  13435. }
  13436. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13437. class ui_try_com2 extends fgui.GComponent {
  13438. static createInstance() {
  13439. return (fgui.UIPackage.createObject("game", "try_com2"));
  13440. }
  13441. onConstruct() {
  13442. this.skillicon = (this.getChild("skillicon"));
  13443. this.n35 = (this.getChild("n35"));
  13444. this.n31 = (this.getChild("n31"));
  13445. this.n32 = (this.getChild("n32"));
  13446. this.n33 = (this.getChild("n33"));
  13447. this.n34 = (this.getChild("n34"));
  13448. }
  13449. }
  13450. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13451. class ui_try_com3 extends fgui.GComponent {
  13452. static createInstance() {
  13453. return (fgui.UIPackage.createObject("game", "try_com3"));
  13454. }
  13455. onConstruct() {
  13456. this.n33 = (this.getChild("n33"));
  13457. this.n34 = (this.getChild("n34"));
  13458. this.n35 = (this.getChild("n35"));
  13459. this.t0 = this.getTransition("t0");
  13460. }
  13461. }
  13462. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13463. class ui_huihe1 extends fgui.GComponent {
  13464. static createInstance() {
  13465. return (fgui.UIPackage.createObject("game", "huihe1"));
  13466. }
  13467. onConstruct() {
  13468. this.n0 = (this.getChild("n0"));
  13469. this.n1 = (this.getChild("n1"));
  13470. this.t0 = this.getTransition("t0");
  13471. }
  13472. }
  13473. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13474. class ui_huihe2 extends fgui.GComponent {
  13475. static createInstance() {
  13476. return (fgui.UIPackage.createObject("game", "huihe2"));
  13477. }
  13478. onConstruct() {
  13479. this.n0 = (this.getChild("n0"));
  13480. this.n1 = (this.getChild("n1"));
  13481. this.t0 = this.getTransition("t0");
  13482. }
  13483. }
  13484. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13485. class ui_Component143 extends fgui.GComponent {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "Component143"));
  13488. }
  13489. onConstruct() {
  13490. this.n3 = (this.getChild("n3"));
  13491. this.n4 = (this.getChild("n4"));
  13492. this.n5 = (this.getChild("n5"));
  13493. this.n6 = (this.getChild("n6"));
  13494. this.n7 = (this.getChild("n7"));
  13495. this.n8 = (this.getChild("n8"));
  13496. this.n9 = (this.getChild("n9"));
  13497. this.n10 = (this.getChild("n10"));
  13498. this.t0 = this.getTransition("t0");
  13499. }
  13500. }
  13501. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13502. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13503. static createInstance() {
  13504. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13505. }
  13506. onConstruct() {
  13507. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13508. }
  13509. }
  13510. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13511. class ui_dh_jingbi2 extends fgui.GComponent {
  13512. static createInstance() {
  13513. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13514. }
  13515. onConstruct() {
  13516. this.n0 = (this.getChild("n0"));
  13517. this.n1 = (this.getChild("n1"));
  13518. this.n2 = (this.getChild("n2"));
  13519. this.n3 = (this.getChild("n3"));
  13520. this.n4 = (this.getChild("n4"));
  13521. this.n5 = (this.getChild("n5"));
  13522. this.n6 = (this.getChild("n6"));
  13523. this.n8 = (this.getChild("n8"));
  13524. this.n10 = (this.getChild("n10"));
  13525. this.t0 = this.getTransition("t0");
  13526. }
  13527. }
  13528. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13529. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13530. static createInstance() {
  13531. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13532. }
  13533. onConstruct() {
  13534. this.n1 = (this.getChild("n1"));
  13535. this.n4 = (this.getChild("n4"));
  13536. this.t0 = this.getTransition("t0");
  13537. }
  13538. }
  13539. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13540. class ui_dh_jingbi3 extends fgui.GComponent {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13543. }
  13544. onConstruct() {
  13545. this.n0 = (this.getChild("n0"));
  13546. this.n1 = (this.getChild("n1"));
  13547. this.n2 = (this.getChild("n2"));
  13548. this.n3 = (this.getChild("n3"));
  13549. this.n4 = (this.getChild("n4"));
  13550. this.n5 = (this.getChild("n5"));
  13551. this.n6 = (this.getChild("n6"));
  13552. this.n8 = (this.getChild("n8"));
  13553. this.n10 = (this.getChild("n10"));
  13554. this.t0 = this.getTransition("t0");
  13555. }
  13556. }
  13557. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13558. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13559. static createInstance() {
  13560. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13561. }
  13562. onConstruct() {
  13563. this.n3 = (this.getChild("n3"));
  13564. this.n1 = (this.getChild("n1"));
  13565. this.t0 = this.getTransition("t0");
  13566. }
  13567. }
  13568. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13569. class ui_hb_jinbi1 extends fgui.GButton {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13572. }
  13573. onConstruct() {
  13574. this.n20 = (this.getChild("n20"));
  13575. this.n25 = (this.getChild("n25"));
  13576. this.coinTxt = (this.getChild("coinTxt"));
  13577. this.n28 = (this.getChild("n28"));
  13578. this.n32 = (this.getChild("n32"));
  13579. this.n38 = (this.getChild("n38"));
  13580. this.n45 = (this.getChild("n45"));
  13581. this.getTips = (this.getChild("getTips"));
  13582. this.n39 = (this.getChild("n39"));
  13583. this.diamondTxt = (this.getChild("diamondTxt"));
  13584. this.n41 = (this.getChild("n41"));
  13585. this.n42 = (this.getChild("n42"));
  13586. this.n46 = (this.getChild("n46"));
  13587. this.n47 = (this.getChild("n47"));
  13588. this.n48 = (this.getChild("n48"));
  13589. this.t0 = this.getTransition("t0");
  13590. }
  13591. }
  13592. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13593. class ui_hb_jinbi2 extends fgui.GButton {
  13594. static createInstance() {
  13595. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13596. }
  13597. onConstruct() {
  13598. this.n20 = (this.getChild("n20"));
  13599. this.n25 = (this.getChild("n25"));
  13600. this.coinTxt = (this.getChild("coinTxt"));
  13601. this.n28 = (this.getChild("n28"));
  13602. this.n32 = (this.getChild("n32"));
  13603. this.n38 = (this.getChild("n38"));
  13604. this.n39 = (this.getChild("n39"));
  13605. this.diamondTxt = (this.getChild("diamondTxt"));
  13606. this.n41 = (this.getChild("n41"));
  13607. this.n42 = (this.getChild("n42"));
  13608. this.n43 = (this.getChild("n43"));
  13609. this.n44 = (this.getChild("n44"));
  13610. this.n45 = (this.getChild("n45"));
  13611. this.t0 = this.getTransition("t0");
  13612. }
  13613. }
  13614. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13615. class ui_hb_jinbi3 extends fgui.GButton {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13618. }
  13619. onConstruct() {
  13620. this.n20 = (this.getChild("n20"));
  13621. this.n25 = (this.getChild("n25"));
  13622. this.coinTxt = (this.getChild("coinTxt"));
  13623. this.n28 = (this.getChild("n28"));
  13624. this.n32 = (this.getChild("n32"));
  13625. this.n38 = (this.getChild("n38"));
  13626. this.n39 = (this.getChild("n39"));
  13627. this.diamondTxt = (this.getChild("diamondTxt"));
  13628. this.n41 = (this.getChild("n41"));
  13629. this.n42 = (this.getChild("n42"));
  13630. this.n43 = (this.getChild("n43"));
  13631. this.n44 = (this.getChild("n44"));
  13632. this.n45 = (this.getChild("n45"));
  13633. this.t0 = this.getTransition("t0");
  13634. }
  13635. }
  13636. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13637. class ui_Component104 extends fgui.GComponent {
  13638. static createInstance() {
  13639. return (fgui.UIPackage.createObject("game", "Component104"));
  13640. }
  13641. onConstruct() {
  13642. this.c1 = this.getController("c1");
  13643. this.n12 = (this.getChild("n12"));
  13644. this.coinBtn = (this.getChild("coinBtn"));
  13645. this.diamondBtn = (this.getChild("diamondBtn"));
  13646. this.node3 = (this.getChild("node3"));
  13647. this.node4 = (this.getChild("node4"));
  13648. this.node5 = (this.getChild("node5"));
  13649. this.node1 = (this.getChild("node1"));
  13650. this.node2 = (this.getChild("node2"));
  13651. this.node6 = (this.getChild("node6"));
  13652. this.t0 = this.getTransition("t0");
  13653. }
  13654. }
  13655. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13656. class ui_Component105 extends fgui.GButton {
  13657. static createInstance() {
  13658. return (fgui.UIPackage.createObject("game", "Component105"));
  13659. }
  13660. onConstruct() {
  13661. this.c1 = this.getController("c1");
  13662. this.n49 = (this.getChild("n49"));
  13663. this.n18 = (this.getChild("n18"));
  13664. this.n46 = (this.getChild("n46"));
  13665. this.n48 = (this.getChild("n48"));
  13666. }
  13667. }
  13668. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13669. class ui_Component106 extends fgui.GButton {
  13670. static createInstance() {
  13671. return (fgui.UIPackage.createObject("game", "Component106"));
  13672. }
  13673. onConstruct() {
  13674. this.c1 = this.getController("c1");
  13675. this.n49 = (this.getChild("n49"));
  13676. this.n18 = (this.getChild("n18"));
  13677. this.n46 = (this.getChild("n46"));
  13678. this.n48 = (this.getChild("n48"));
  13679. }
  13680. }
  13681. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13682. class ui_hb_zs1 extends fgui.GButton {
  13683. static createInstance() {
  13684. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13685. }
  13686. onConstruct() {
  13687. this.c1 = this.getController("c1");
  13688. this.n20 = (this.getChild("n20"));
  13689. this.n21 = (this.getChild("n21"));
  13690. this.n26 = (this.getChild("n26"));
  13691. this.n27 = (this.getChild("n27"));
  13692. this.shareTxt = (this.getChild("shareTxt"));
  13693. this.n32 = (this.getChild("n32"));
  13694. this.n38 = (this.getChild("n38"));
  13695. this.n39 = (this.getChild("n39"));
  13696. this.n44 = (this.getChild("n44"));
  13697. this.diamondTxt = (this.getChild("diamondTxt"));
  13698. this.n41 = (this.getChild("n41"));
  13699. this.n45 = (this.getChild("n45"));
  13700. this.n47 = (this.getChild("n47"));
  13701. this.n48 = (this.getChild("n48"));
  13702. this.randTxt = (this.getChild("randTxt"));
  13703. this.n50 = (this.getChild("n50"));
  13704. this.t0 = this.getTransition("t0");
  13705. }
  13706. }
  13707. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13708. class ui_dh_zs1 extends fgui.GComponent {
  13709. static createInstance() {
  13710. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13711. }
  13712. onConstruct() {
  13713. this.n10 = (this.getChild("n10"));
  13714. this.n9 = (this.getChild("n9"));
  13715. this.n1 = (this.getChild("n1"));
  13716. this.n2 = (this.getChild("n2"));
  13717. this.n3 = (this.getChild("n3"));
  13718. this.n4 = (this.getChild("n4"));
  13719. this.n5 = (this.getChild("n5"));
  13720. this.n6 = (this.getChild("n6"));
  13721. this.n8 = (this.getChild("n8"));
  13722. this.n11 = (this.getChild("n11"));
  13723. this.t0 = this.getTransition("t0");
  13724. }
  13725. }
  13726. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13727. class ui_dh_zs1_1 extends fgui.GComponent {
  13728. static createInstance() {
  13729. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13730. }
  13731. onConstruct() {
  13732. this.n3 = (this.getChild("n3"));
  13733. this.n1 = (this.getChild("n1"));
  13734. this.t0 = this.getTransition("t0");
  13735. }
  13736. }
  13737. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13738. class ui_hb_zs2 extends fgui.GButton {
  13739. static createInstance() {
  13740. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13741. }
  13742. onConstruct() {
  13743. this.n20 = (this.getChild("n20"));
  13744. this.n21 = (this.getChild("n21"));
  13745. this.n26 = (this.getChild("n26"));
  13746. this.n27 = (this.getChild("n27"));
  13747. this.n32 = (this.getChild("n32"));
  13748. this.n38 = (this.getChild("n38"));
  13749. this.n39 = (this.getChild("n39"));
  13750. this.n44 = (this.getChild("n44"));
  13751. this.diamondTxt = (this.getChild("diamondTxt"));
  13752. this.n41 = (this.getChild("n41"));
  13753. this.n45 = (this.getChild("n45"));
  13754. this.t0 = this.getTransition("t0");
  13755. }
  13756. }
  13757. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13758. class ui_hb_zs3 extends fgui.GButton {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13761. }
  13762. onConstruct() {
  13763. this.n20 = (this.getChild("n20"));
  13764. this.n21 = (this.getChild("n21"));
  13765. this.n26 = (this.getChild("n26"));
  13766. this.n27 = (this.getChild("n27"));
  13767. this.n32 = (this.getChild("n32"));
  13768. this.n38 = (this.getChild("n38"));
  13769. this.n47 = (this.getChild("n47"));
  13770. this.t0 = this.getTransition("t0");
  13771. }
  13772. }
  13773. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13774. class ui_dh_zs2 extends fgui.GComponent {
  13775. static createInstance() {
  13776. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13777. }
  13778. onConstruct() {
  13779. this.n10 = (this.getChild("n10"));
  13780. this.n9 = (this.getChild("n9"));
  13781. this.n1 = (this.getChild("n1"));
  13782. this.n2 = (this.getChild("n2"));
  13783. this.n3 = (this.getChild("n3"));
  13784. this.n4 = (this.getChild("n4"));
  13785. this.n5 = (this.getChild("n5"));
  13786. this.n6 = (this.getChild("n6"));
  13787. this.n8 = (this.getChild("n8"));
  13788. this.n11 = (this.getChild("n11"));
  13789. this.t0 = this.getTransition("t0");
  13790. }
  13791. }
  13792. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13793. class ui_dh_zs2_1 extends fgui.GComponent {
  13794. static createInstance() {
  13795. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13796. }
  13797. onConstruct() {
  13798. this.n3 = (this.getChild("n3"));
  13799. this.n1 = (this.getChild("n1"));
  13800. this.t0 = this.getTransition("t0");
  13801. }
  13802. }
  13803. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13804. class ui_dh_zs3 extends fgui.GComponent {
  13805. static createInstance() {
  13806. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13807. }
  13808. onConstruct() {
  13809. this.n10 = (this.getChild("n10"));
  13810. this.n9 = (this.getChild("n9"));
  13811. this.n1 = (this.getChild("n1"));
  13812. this.n2 = (this.getChild("n2"));
  13813. this.n3 = (this.getChild("n3"));
  13814. this.n4 = (this.getChild("n4"));
  13815. this.n5 = (this.getChild("n5"));
  13816. this.n6 = (this.getChild("n6"));
  13817. this.n8 = (this.getChild("n8"));
  13818. this.n11 = (this.getChild("n11"));
  13819. this.t0 = this.getTransition("t0");
  13820. }
  13821. }
  13822. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13823. class ui_dh_zs3_1 extends fgui.GComponent {
  13824. static createInstance() {
  13825. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13826. }
  13827. onConstruct() {
  13828. this.n3 = (this.getChild("n3"));
  13829. this.n1 = (this.getChild("n1"));
  13830. this.t0 = this.getTransition("t0");
  13831. }
  13832. }
  13833. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13834. class ui_Component107 extends fgui.GComponent {
  13835. static createInstance() {
  13836. return (fgui.UIPackage.createObject("game", "Component107"));
  13837. }
  13838. onConstruct() {
  13839. this.n18 = (this.getChild("n18"));
  13840. this.n19 = (this.getChild("n19"));
  13841. this.n20 = (this.getChild("n20"));
  13842. this.n21 = (this.getChild("n21"));
  13843. this.n22 = (this.getChild("n22"));
  13844. this.levelTxt = (this.getChild("levelTxt"));
  13845. this.t0 = this.getTransition("t0");
  13846. }
  13847. }
  13848. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13849. class ui_box_com1 extends fgui.GComponent {
  13850. static createInstance() {
  13851. return (fgui.UIPackage.createObject("game", "box_com1"));
  13852. }
  13853. onConstruct() {
  13854. this.n14 = (this.getChild("n14"));
  13855. this.n6 = (this.getChild("n6"));
  13856. this.t0 = this.getTransition("t0");
  13857. }
  13858. }
  13859. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13860. class ui_box_com2 extends fgui.GProgressBar {
  13861. static createInstance() {
  13862. return (fgui.UIPackage.createObject("game", "box_com2"));
  13863. }
  13864. onConstruct() {
  13865. this.bg0 = (this.getChild("bg0"));
  13866. this.bg = (this.getChild("bg"));
  13867. this.bar = (this.getChild("bar"));
  13868. this.n7 = (this.getChild("n7"));
  13869. this.n8 = (this.getChild("n8"));
  13870. this.n10 = (this.getChild("n10"));
  13871. this.n11 = (this.getChild("n11"));
  13872. this.n12 = (this.getChild("n12"));
  13873. }
  13874. }
  13875. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13876. class ui_box_com4 extends fgui.GComponent {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "box_com4"));
  13879. }
  13880. onConstruct() {
  13881. this.n8 = (this.getChild("n8"));
  13882. this.t0 = this.getTransition("t0");
  13883. }
  13884. }
  13885. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13886. class ui_box_com3 extends fgui.GComponent {
  13887. static createInstance() {
  13888. return (fgui.UIPackage.createObject("game", "box_com3"));
  13889. }
  13890. onConstruct() {
  13891. this.n2 = (this.getChild("n2"));
  13892. this.n3 = (this.getChild("n3"));
  13893. this.n4 = (this.getChild("n4"));
  13894. this.n5 = (this.getChild("n5"));
  13895. this.t0 = this.getTransition("t0");
  13896. this.t1 = this.getTransition("t1");
  13897. }
  13898. }
  13899. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13900. class ui_Component97 extends fgui.GComponent {
  13901. static createInstance() {
  13902. return (fgui.UIPackage.createObject("game", "Component97"));
  13903. }
  13904. onConstruct() {
  13905. this.c1 = this.getController("c1");
  13906. this.n46 = (this.getChild("n46"));
  13907. this.diamondNode = (this.getChild("diamondNode"));
  13908. this.coinNode = (this.getChild("coinNode"));
  13909. this.t0 = this.getTransition("t0");
  13910. }
  13911. }
  13912. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13913. class ui_Component98 extends fgui.GButton {
  13914. static createInstance() {
  13915. return (fgui.UIPackage.createObject("game", "Component98"));
  13916. }
  13917. onConstruct() {
  13918. this.n8 = (this.getChild("n8"));
  13919. this.n40 = (this.getChild("n40"));
  13920. }
  13921. }
  13922. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13923. class ui_Component28_11 extends fgui.GButton {
  13924. static createInstance() {
  13925. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13926. }
  13927. onConstruct() {
  13928. this.c1 = this.getController("c1");
  13929. this.n12 = (this.getChild("n12"));
  13930. this.n17 = (this.getChild("n17"));
  13931. this.n13 = (this.getChild("n13"));
  13932. this.diamondTxt = (this.getChild("diamondTxt"));
  13933. this.n15 = (this.getChild("n15"));
  13934. this.n16 = (this.getChild("n16"));
  13935. }
  13936. }
  13937. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13938. class ui_Component58_11 extends fgui.GComponent {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13941. }
  13942. onConstruct() {
  13943. this.c1 = this.getController("c1");
  13944. this.n23 = (this.getChild("n23"));
  13945. this.n41 = (this.getChild("n41"));
  13946. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13947. this.n_daoju = (this.getChild("n_daoju"));
  13948. this.myList = (this.getChild("myList"));
  13949. this.djList = (this.getChild("djList"));
  13950. this.t0 = this.getTransition("t0");
  13951. }
  13952. }
  13953. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13954. class ui_Component100 extends fgui.GComponent {
  13955. static createInstance() {
  13956. return (fgui.UIPackage.createObject("game", "Component100"));
  13957. }
  13958. onConstruct() {
  13959. this.c1 = this.getController("c1");
  13960. this.n75 = (this.getChild("n75"));
  13961. this.n76 = (this.getChild("n76"));
  13962. this.n80 = (this.getChild("n80"));
  13963. this.txt = (this.getChild("txt"));
  13964. this.spineRoot = (this.getChild("spineRoot"));
  13965. }
  13966. }
  13967. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13968. class ui_Component101 extends fgui.GComponent {
  13969. static createInstance() {
  13970. return (fgui.UIPackage.createObject("game", "Component101"));
  13971. }
  13972. onConstruct() {
  13973. this.c1 = this.getController("c1");
  13974. this.n36 = (this.getChild("n36"));
  13975. this.n35 = (this.getChild("n35"));
  13976. this.n33 = (this.getChild("n33"));
  13977. this.n34 = (this.getChild("n34"));
  13978. }
  13979. }
  13980. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13981. class ui_Component53 extends fgui.GComponent {
  13982. static createInstance() {
  13983. return (fgui.UIPackage.createObject("game", "Component53"));
  13984. }
  13985. onConstruct() {
  13986. this.n0 = (this.getChild("n0"));
  13987. this.n1 = (this.getChild("n1"));
  13988. this.n2 = (this.getChild("n2"));
  13989. this.n3 = (this.getChild("n3"));
  13990. this.n4 = (this.getChild("n4"));
  13991. this.n5 = (this.getChild("n5"));
  13992. this.n6 = (this.getChild("n6"));
  13993. this.n7 = (this.getChild("n7"));
  13994. this.n8 = (this.getChild("n8"));
  13995. this.n9 = (this.getChild("n9"));
  13996. this.n10 = (this.getChild("n10"));
  13997. this.n11 = (this.getChild("n11"));
  13998. this.n12 = (this.getChild("n12"));
  13999. this.n13 = (this.getChild("n13"));
  14000. this.n14 = (this.getChild("n14"));
  14001. this.n15 = (this.getChild("n15"));
  14002. this.n16 = (this.getChild("n16"));
  14003. this.n19 = (this.getChild("n19"));
  14004. this.n20 = (this.getChild("n20"));
  14005. this.n21 = (this.getChild("n21"));
  14006. this.n22 = (this.getChild("n22"));
  14007. this.n23 = (this.getChild("n23"));
  14008. this.n24 = (this.getChild("n24"));
  14009. this.n25 = (this.getChild("n25"));
  14010. this.n26 = (this.getChild("n26"));
  14011. this.n27 = (this.getChild("n27"));
  14012. this.n28 = (this.getChild("n28"));
  14013. this.n29 = (this.getChild("n29"));
  14014. this.n30 = (this.getChild("n30"));
  14015. this.n31 = (this.getChild("n31"));
  14016. this.n32 = (this.getChild("n32"));
  14017. this.n33 = (this.getChild("n33"));
  14018. this.n34 = (this.getChild("n34"));
  14019. this.n35 = (this.getChild("n35"));
  14020. this.t0 = this.getTransition("t0");
  14021. }
  14022. }
  14023. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  14024. class ui_Component58 extends fgui.GComponent {
  14025. static createInstance() {
  14026. return (fgui.UIPackage.createObject("game", "Component58"));
  14027. }
  14028. onConstruct() {
  14029. this.n23 = (this.getChild("n23"));
  14030. this.n41 = (this.getChild("n41"));
  14031. this.n8 = (this.getChild("n8"));
  14032. this.skillList = (this.getChild("skillList"));
  14033. this.t0 = this.getTransition("t0");
  14034. }
  14035. }
  14036. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  14037. class ui_Component59 extends fgui.GComponent {
  14038. static createInstance() {
  14039. return (fgui.UIPackage.createObject("game", "Component59"));
  14040. }
  14041. onConstruct() {
  14042. this.n3 = (this.getChild("n3"));
  14043. this.msgTxt = (this.getChild("msgTxt"));
  14044. this.t0 = this.getTransition("t0");
  14045. }
  14046. }
  14047. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  14048. class ui_Component_lc2 extends fgui.GComponent {
  14049. static createInstance() {
  14050. return (fgui.UIPackage.createObject("game", "Component_lc2"));
  14051. }
  14052. onConstruct() {
  14053. this.n0 = (this.getChild("n0"));
  14054. this.n1_bai = (this.getChild("n1_bai"));
  14055. }
  14056. }
  14057. ui_Component_lc2.URL = "ui://isxx5ak7ggd1v5ay";
  14058. class ui_Component_shou2 extends fgui.GComponent {
  14059. static createInstance() {
  14060. return (fgui.UIPackage.createObject("game", "Component_shou2"));
  14061. }
  14062. onConstruct() {
  14063. this.n57 = (this.getChild("n57"));
  14064. this.n54 = (this.getChild("n54"));
  14065. this.n55 = (this.getChild("n55"));
  14066. this.n56 = (this.getChild("n56"));
  14067. this.t1 = this.getTransition("t1");
  14068. }
  14069. }
  14070. ui_Component_shou2.URL = "ui://isxx5ak7ggd1v5b0";
  14071. class ui_RulerNode extends fgui.GComponent {
  14072. static createInstance() {
  14073. return (fgui.UIPackage.createObject("game", "RulerNode"));
  14074. }
  14075. onConstruct() {
  14076. this.n6 = (this.getChild("n6"));
  14077. this.n4 = (this.getChild("n4"));
  14078. this.img1 = (this.getChild("img1"));
  14079. this.img2 = (this.getChild("img2"));
  14080. }
  14081. }
  14082. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  14083. class ui_Component108 extends fgui.GComponent {
  14084. static createInstance() {
  14085. return (fgui.UIPackage.createObject("game", "Component108"));
  14086. }
  14087. onConstruct() {
  14088. this.n19 = (this.getChild("n19"));
  14089. this.t0 = this.getTransition("t0");
  14090. }
  14091. }
  14092. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14093. class ui_Component63 extends fgui.GComponent {
  14094. static createInstance() {
  14095. return (fgui.UIPackage.createObject("game", "Component63"));
  14096. }
  14097. onConstruct() {
  14098. this.n66 = (this.getChild("n66"));
  14099. this.n56 = (this.getChild("n56"));
  14100. this.n63 = (this.getChild("n63"));
  14101. this.n65 = (this.getChild("n65"));
  14102. this.t0 = this.getTransition("t0");
  14103. }
  14104. }
  14105. ui_Component63.URL = "ui://isxx5ak7h657452";
  14106. class ui_topNode extends fgui.GComponent {
  14107. static createInstance() {
  14108. return (fgui.UIPackage.createObject("game", "topNode"));
  14109. }
  14110. onConstruct() {
  14111. this.selfProgress = (this.getChild("selfProgress"));
  14112. this.aiProgress = (this.getChild("aiProgress"));
  14113. this.selfKuang = (this.getChild("selfKuang"));
  14114. this.aiKuang = (this.getChild("aiKuang"));
  14115. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14116. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14117. this.n33 = (this.getChild("n33"));
  14118. this.n34 = (this.getChild("n34"));
  14119. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14120. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14121. this.selfBallList = (this.getChild("selfBallList"));
  14122. this.aiBallList = (this.getChild("aiBallList"));
  14123. this.middleNode = (this.getChild("middleNode"));
  14124. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14125. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14126. this.scoreNode = (this.getChild("scoreNode"));
  14127. this.selfTips = (this.getChild("selfTips"));
  14128. this.aiTips = (this.getChild("aiTips"));
  14129. }
  14130. }
  14131. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14132. class ui_selfProgress extends fgui.GProgressBar {
  14133. static createInstance() {
  14134. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14135. }
  14136. onConstruct() {
  14137. this.n3 = (this.getChild("n3"));
  14138. this.bar = (this.getChild("bar"));
  14139. }
  14140. }
  14141. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14142. class ui_aiProgress extends fgui.GProgressBar {
  14143. static createInstance() {
  14144. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14145. }
  14146. onConstruct() {
  14147. this.n3 = (this.getChild("n3"));
  14148. this.bar = (this.getChild("bar"));
  14149. }
  14150. }
  14151. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14152. class ui_ballDisplay extends fgui.GComponent {
  14153. static createInstance() {
  14154. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14155. }
  14156. onConstruct() {
  14157. this.myImg = (this.getChild("myImg"));
  14158. }
  14159. }
  14160. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14161. class ui_moveNode extends fgui.GComponent {
  14162. static createInstance() {
  14163. return (fgui.UIPackage.createObject("game", "moveNode"));
  14164. }
  14165. onConstruct() {
  14166. this.n8 = (this.getChild("n8"));
  14167. this.finger = (this.getChild("finger"));
  14168. }
  14169. }
  14170. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14171. class ui_cancelBtn extends fgui.GButton {
  14172. static createInstance() {
  14173. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14174. }
  14175. onConstruct() {
  14176. this.c1 = this.getController("c1");
  14177. this.n0 = (this.getChild("n0"));
  14178. this.n1 = (this.getChild("n1"));
  14179. }
  14180. }
  14181. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14182. class ui_shareBtn extends fgui.GButton {
  14183. static createInstance() {
  14184. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14185. }
  14186. onConstruct() {
  14187. this.c1 = this.getController("c1");
  14188. this.n2 = (this.getChild("n2"));
  14189. this.n1 = (this.getChild("n1"));
  14190. this.n3 = (this.getChild("n3"));
  14191. this.n4 = (this.getChild("n4"));
  14192. this.n5 = (this.getChild("n5"));
  14193. this.n6 = (this.getChild("n6"));
  14194. }
  14195. }
  14196. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14197. class ui_share2Btn extends fgui.GButton {
  14198. static createInstance() {
  14199. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14200. }
  14201. onConstruct() {
  14202. this.n3 = (this.getChild("n3"));
  14203. }
  14204. }
  14205. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14206. class ui_rodMethodNode extends fgui.GComponent {
  14207. static createInstance() {
  14208. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14209. }
  14210. onConstruct() {
  14211. this.bg = (this.getChild("bg"));
  14212. this.dot = (this.getChild("dot"));
  14213. }
  14214. }
  14215. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14216. class ui_sureBtn extends fgui.GButton {
  14217. static createInstance() {
  14218. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14219. }
  14220. onConstruct() {
  14221. this.n2 = (this.getChild("n2"));
  14222. this.n1 = (this.getChild("n1"));
  14223. }
  14224. }
  14225. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14226. class ui_Component18 extends fgui.GComponent {
  14227. static createInstance() {
  14228. return (fgui.UIPackage.createObject("game", "Component18"));
  14229. }
  14230. onConstruct() {
  14231. this.c1 = this.getController("c1");
  14232. this.nameTxt = (this.getChild("nameTxt"));
  14233. this.headImg = (this.getChild("headImg"));
  14234. this.n24 = (this.getChild("n24"));
  14235. this.skillImg = (this.getChild("skillImg"));
  14236. this.skillTxt = (this.getChild("skillTxt"));
  14237. }
  14238. }
  14239. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14240. class ui_Component45 extends fgui.GComponent {
  14241. static createInstance() {
  14242. return (fgui.UIPackage.createObject("game", "Component45"));
  14243. }
  14244. onConstruct() {
  14245. this.c1 = this.getController("c1");
  14246. this.n40 = (this.getChild("n40"));
  14247. this.n41 = (this.getChild("n41"));
  14248. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14249. this.n42 = (this.getChild("n42"));
  14250. this.awardTxt = (this.getChild("awardTxt"));
  14251. this.n44 = (this.getChild("n44"));
  14252. this.t0 = this.getTransition("t0");
  14253. }
  14254. }
  14255. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14256. class ui_emotionDisplay extends fgui.GButton {
  14257. static createInstance() {
  14258. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14259. }
  14260. onConstruct() {
  14261. this.myIcon = (this.getChild("myIcon"));
  14262. }
  14263. }
  14264. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14265. class ui_Component49 extends fgui.GButton {
  14266. static createInstance() {
  14267. return (fgui.UIPackage.createObject("game", "Component49"));
  14268. }
  14269. onConstruct() {
  14270. this.n69 = (this.getChild("n69"));
  14271. this.n56 = (this.getChild("n56"));
  14272. }
  14273. }
  14274. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14275. class ui_Component50 extends fgui.GButton {
  14276. static createInstance() {
  14277. return (fgui.UIPackage.createObject("game", "Component50"));
  14278. }
  14279. onConstruct() {
  14280. this.n54 = (this.getChild("n54"));
  14281. this.n65 = (this.getChild("n65"));
  14282. }
  14283. }
  14284. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14285. class ui_Component51 extends fgui.GButton {
  14286. static createInstance() {
  14287. return (fgui.UIPackage.createObject("game", "Component51"));
  14288. }
  14289. onConstruct() {
  14290. this.c1 = this.getController("c1");
  14291. this.n51 = (this.getChild("n51"));
  14292. this.n54 = (this.getChild("n54"));
  14293. }
  14294. }
  14295. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14296. class ui_Button5 extends fgui.GButton {
  14297. static createInstance() {
  14298. return (fgui.UIPackage.createObject("game", "Button5"));
  14299. }
  14300. onConstruct() {
  14301. this.c1 = this.getController("c1");
  14302. this.n0 = (this.getChild("n0"));
  14303. this.n2 = (this.getChild("n2"));
  14304. }
  14305. }
  14306. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14307. class ui_Component124 extends fgui.GComponent {
  14308. static createInstance() {
  14309. return (fgui.UIPackage.createObject("game", "Component124"));
  14310. }
  14311. onConstruct() {
  14312. this.n22 = (this.getChild("n22"));
  14313. this.shareNode = (this.getChild("shareNode"));
  14314. }
  14315. }
  14316. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14317. class ui_Component125 extends fgui.GComponent {
  14318. static createInstance() {
  14319. return (fgui.UIPackage.createObject("game", "Component125"));
  14320. }
  14321. onConstruct() {
  14322. this.n29 = (this.getChild("n29"));
  14323. this.coinTxt = (this.getChild("coinTxt"));
  14324. }
  14325. }
  14326. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14327. class ui_Component52 extends fgui.GButton {
  14328. static createInstance() {
  14329. return (fgui.UIPackage.createObject("game", "Component52"));
  14330. }
  14331. onConstruct() {
  14332. this.n35 = (this.getChild("n35"));
  14333. this.n36 = (this.getChild("n36"));
  14334. }
  14335. }
  14336. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14337. class ui_Component_denglu extends fgui.GComponent {
  14338. static createInstance() {
  14339. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14340. }
  14341. onConstruct() {
  14342. this.c1 = this.getController("c1");
  14343. this.n102 = (this.getChild("n102"));
  14344. this.n103 = (this.getChild("n103"));
  14345. }
  14346. }
  14347. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14348. class ui_UIFuli1 extends fgui.GComponent {
  14349. static createInstance() {
  14350. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14351. }
  14352. onConstruct() {
  14353. this.n1 = (this.getChild("n1"));
  14354. this.n2 = (this.getChild("n2"));
  14355. }
  14356. }
  14357. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14358. class ui_Component_fl_1 extends fgui.GComponent {
  14359. static createInstance() {
  14360. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14361. }
  14362. onConstruct() {
  14363. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14364. this.txt_price = (this.getChild("txt_price"));
  14365. this.n_no = (this.getChild("n_no"));
  14366. this.n_buy = (this.getChild("n_buy"));
  14367. }
  14368. }
  14369. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14370. class ui_Component_fl_2 extends fgui.GComponent {
  14371. static createInstance() {
  14372. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14373. }
  14374. onConstruct() {
  14375. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14376. this.txt_price = (this.getChild("txt_price"));
  14377. this.n_no = (this.getChild("n_no"));
  14378. this.n_buy = (this.getChild("n_buy"));
  14379. }
  14380. }
  14381. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14382. class ui_UIFuli2 extends fgui.GComponent {
  14383. static createInstance() {
  14384. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14385. }
  14386. onConstruct() {
  14387. this.n1 = (this.getChild("n1"));
  14388. this.n2 = (this.getChild("n2"));
  14389. }
  14390. }
  14391. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14392. class ui_drawBtn extends fgui.GButton {
  14393. static createInstance() {
  14394. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14395. }
  14396. onConstruct() {
  14397. this.c1 = this.getController("c1");
  14398. this.n2 = (this.getChild("n2"));
  14399. this.n1 = (this.getChild("n1"));
  14400. this.n5 = (this.getChild("n5"));
  14401. }
  14402. }
  14403. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14404. class ui_Component43 extends fgui.GButton {
  14405. static createInstance() {
  14406. return (fgui.UIPackage.createObject("game", "Component43"));
  14407. }
  14408. onConstruct() {
  14409. this.n49 = (this.getChild("n49"));
  14410. }
  14411. }
  14412. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14413. class ui_wordsDisplay extends fgui.GComponent {
  14414. static createInstance() {
  14415. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14416. }
  14417. onConstruct() {
  14418. this.txt = (this.getChild("txt"));
  14419. this.n63 = (this.getChild("n63"));
  14420. }
  14421. }
  14422. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14423. class ui_Component_phb extends fgui.GComponent {
  14424. static createInstance() {
  14425. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14426. }
  14427. onConstruct() {
  14428. this.n3 = (this.getChild("n3"));
  14429. this.n4 = (this.getChild("n4"));
  14430. }
  14431. }
  14432. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14433. class ui_Component3 extends fgui.GComponent {
  14434. static createInstance() {
  14435. return (fgui.UIPackage.createObject("game", "Component3"));
  14436. }
  14437. onConstruct() {
  14438. this.n26 = (this.getChild("n26"));
  14439. this.n24 = (this.getChild("n24"));
  14440. this.nameTxt = (this.getChild("nameTxt"));
  14441. this.headRoot = (this.getChild("headRoot"));
  14442. }
  14443. }
  14444. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14445. class ui_Component4 extends fgui.GComponent {
  14446. static createInstance() {
  14447. return (fgui.UIPackage.createObject("game", "Component4"));
  14448. }
  14449. onConstruct() {
  14450. this.headImg = (this.getChild("headImg"));
  14451. }
  14452. }
  14453. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14454. class ui_Component7 extends fgui.GButton {
  14455. static createInstance() {
  14456. return (fgui.UIPackage.createObject("game", "Component7"));
  14457. }
  14458. onConstruct() {
  14459. this.n17 = (this.getChild("n17"));
  14460. }
  14461. }
  14462. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14463. class ui_Component8 extends fgui.GButton {
  14464. static createInstance() {
  14465. return (fgui.UIPackage.createObject("game", "Component8"));
  14466. }
  14467. onConstruct() {
  14468. this.n19 = (this.getChild("n19"));
  14469. }
  14470. }
  14471. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14472. class ui_Component10 extends fgui.GButton {
  14473. static createInstance() {
  14474. return (fgui.UIPackage.createObject("game", "Component10"));
  14475. }
  14476. onConstruct() {
  14477. this.c1 = this.getController("c1");
  14478. this.n40 = (this.getChild("n40"));
  14479. }
  14480. }
  14481. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14482. class ui_Component11 extends fgui.GButton {
  14483. static createInstance() {
  14484. return (fgui.UIPackage.createObject("game", "Component11"));
  14485. }
  14486. onConstruct() {
  14487. this.n34 = (this.getChild("n34"));
  14488. }
  14489. }
  14490. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14491. class ui_Component12 extends fgui.GButton {
  14492. static createInstance() {
  14493. return (fgui.UIPackage.createObject("game", "Component12"));
  14494. }
  14495. onConstruct() {
  14496. this.n35 = (this.getChild("n35"));
  14497. }
  14498. }
  14499. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14500. class ui_Component13 extends fgui.GButton {
  14501. static createInstance() {
  14502. return (fgui.UIPackage.createObject("game", "Component13"));
  14503. }
  14504. onConstruct() {
  14505. this.n27 = (this.getChild("n27"));
  14506. this.n36 = (this.getChild("n36"));
  14507. }
  14508. }
  14509. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14510. class ui_dh_js_tuowei extends fgui.GComponent {
  14511. static createInstance() {
  14512. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14513. }
  14514. onConstruct() {
  14515. this.n19 = (this.getChild("n19"));
  14516. this.n18 = (this.getChild("n18"));
  14517. this.n0 = (this.getChild("n0"));
  14518. this.n3 = (this.getChild("n3"));
  14519. this.n4 = (this.getChild("n4"));
  14520. this.n5 = (this.getChild("n5"));
  14521. this.n6 = (this.getChild("n6"));
  14522. this.n8 = (this.getChild("n8"));
  14523. this.n9 = (this.getChild("n9"));
  14524. this.n10 = (this.getChild("n10"));
  14525. this.n11 = (this.getChild("n11"));
  14526. this.n12 = (this.getChild("n12"));
  14527. this.n13 = (this.getChild("n13"));
  14528. this.n14 = (this.getChild("n14"));
  14529. this.n15 = (this.getChild("n15"));
  14530. this.n20 = (this.getChild("n20"));
  14531. this.t0 = this.getTransition("t0");
  14532. this.t1 = this.getTransition("t1");
  14533. }
  14534. }
  14535. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14536. class ui_dh_js_tw_g extends fgui.GComponent {
  14537. static createInstance() {
  14538. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14539. }
  14540. onConstruct() {
  14541. this.n0 = (this.getChild("n0"));
  14542. this.n1 = (this.getChild("n1"));
  14543. this.t0 = this.getTransition("t0");
  14544. }
  14545. }
  14546. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14547. class ui_dh_js_xingxing extends fgui.GComponent {
  14548. static createInstance() {
  14549. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14550. }
  14551. onConstruct() {
  14552. this.n1 = (this.getChild("n1"));
  14553. this.n2 = (this.getChild("n2"));
  14554. this.n3 = (this.getChild("n3"));
  14555. this.n4 = (this.getChild("n4"));
  14556. this.n0 = (this.getChild("n0"));
  14557. this.t2 = this.getTransition("t2");
  14558. this.t1 = this.getTransition("t1");
  14559. }
  14560. }
  14561. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14562. class ui_dh_zy_jiazai extends fgui.GComponent {
  14563. static createInstance() {
  14564. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14565. }
  14566. onConstruct() {
  14567. this.c1 = this.getController("c1");
  14568. this.n0 = (this.getChild("n0"));
  14569. this.n1 = (this.getChild("n1"));
  14570. this.n2 = (this.getChild("n2"));
  14571. this.n4 = (this.getChild("n4"));
  14572. this.n5 = (this.getChild("n5"));
  14573. this.n6 = (this.getChild("n6"));
  14574. this.n8 = (this.getChild("n8"));
  14575. this.n7 = (this.getChild("n7"));
  14576. this.t0 = this.getTransition("t0");
  14577. }
  14578. }
  14579. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14580. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14581. static createInstance() {
  14582. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14583. }
  14584. onConstruct() {
  14585. this.c1 = this.getController("c1");
  14586. this.n3 = (this.getChild("n3"));
  14587. this.n5 = (this.getChild("n5"));
  14588. this.n4 = (this.getChild("n4"));
  14589. this.n0 = (this.getChild("n0"));
  14590. this.n1 = (this.getChild("n1"));
  14591. this.n2 = (this.getChild("n2"));
  14592. }
  14593. }
  14594. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14595. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14596. static createInstance() {
  14597. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14598. }
  14599. onConstruct() {
  14600. this.n19 = (this.getChild("n19"));
  14601. this.n21 = (this.getChild("n21"));
  14602. this.n0 = (this.getChild("n0"));
  14603. this.n3 = (this.getChild("n3"));
  14604. this.n4 = (this.getChild("n4"));
  14605. this.n5 = (this.getChild("n5"));
  14606. this.n6 = (this.getChild("n6"));
  14607. this.n8 = (this.getChild("n8"));
  14608. this.n9 = (this.getChild("n9"));
  14609. this.n10 = (this.getChild("n10"));
  14610. this.n11 = (this.getChild("n11"));
  14611. this.n12 = (this.getChild("n12"));
  14612. this.n13 = (this.getChild("n13"));
  14613. this.n14 = (this.getChild("n14"));
  14614. this.n15 = (this.getChild("n15"));
  14615. this.n23 = (this.getChild("n23"));
  14616. this.t0 = this.getTransition("t0");
  14617. this.t1 = this.getTransition("t1");
  14618. }
  14619. }
  14620. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14621. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14622. static createInstance() {
  14623. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14624. }
  14625. onConstruct() {
  14626. this.n1 = (this.getChild("n1"));
  14627. this.n2 = (this.getChild("n2"));
  14628. this.t0 = this.getTransition("t0");
  14629. }
  14630. }
  14631. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14632. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14633. static createInstance() {
  14634. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14635. }
  14636. onConstruct() {
  14637. this.n4 = (this.getChild("n4"));
  14638. this.n2 = (this.getChild("n2"));
  14639. this.n3 = (this.getChild("n3"));
  14640. this.idle = this.getTransition("idle");
  14641. this.attack = this.getTransition("attack");
  14642. }
  14643. }
  14644. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14645. class ui_special extends fgui.GComponent {
  14646. static createInstance() {
  14647. return (fgui.UIPackage.createObject("game", "special"));
  14648. }
  14649. onConstruct() {
  14650. this.n18 = (this.getChild("n18"));
  14651. this.n19 = (this.getChild("n19"));
  14652. this.n20 = (this.getChild("n20"));
  14653. this.n21 = (this.getChild("n21"));
  14654. this.n22 = (this.getChild("n22"));
  14655. this.levelTxt = (this.getChild("levelTxt"));
  14656. this.n24 = (this.getChild("n24"));
  14657. this.n25 = (this.getChild("n25"));
  14658. this.t0 = this.getTransition("t0");
  14659. }
  14660. }
  14661. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14662. class ui_Component145 extends fgui.GComponent {
  14663. static createInstance() {
  14664. return (fgui.UIPackage.createObject("game", "Component145"));
  14665. }
  14666. onConstruct() {
  14667. this.guanyuNode = (this.getChild("guanyuNode"));
  14668. }
  14669. }
  14670. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14671. class ui_longBtn extends fgui.GButton {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("game", "longBtn"));
  14674. }
  14675. onConstruct() {
  14676. this.c1 = this.getController("c1");
  14677. this.n2 = (this.getChild("n2"));
  14678. this.n1 = (this.getChild("n1"));
  14679. this.n4 = (this.getChild("n4"));
  14680. }
  14681. }
  14682. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14683. class ui_Component146 extends fgui.GComponent {
  14684. static createInstance() {
  14685. return (fgui.UIPackage.createObject("game", "Component146"));
  14686. }
  14687. onConstruct() {
  14688. this.n89 = (this.getChild("n89"));
  14689. this.n90 = (this.getChild("n90"));
  14690. this.guideBtn = (this.getChild("guideBtn"));
  14691. }
  14692. }
  14693. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14694. class ui_Component146_11 extends fgui.GComponent {
  14695. static createInstance() {
  14696. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14697. }
  14698. onConstruct() {
  14699. this.n89 = (this.getChild("n89"));
  14700. this.n90 = (this.getChild("n90"));
  14701. this.guideBtn = (this.getChild("guideBtn"));
  14702. }
  14703. }
  14704. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14705. class ui_Component111_1 extends fgui.GComponent {
  14706. static createInstance() {
  14707. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14708. }
  14709. onConstruct() {
  14710. this.n68 = (this.getChild("n68"));
  14711. this.myMask = (this.getChild("myMask"));
  14712. }
  14713. }
  14714. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14715. class ui_Component64_1 extends fgui.GComponent {
  14716. static createInstance() {
  14717. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14718. }
  14719. onConstruct() {
  14720. this.n57 = (this.getChild("n57"));
  14721. this.n54 = (this.getChild("n54"));
  14722. this.n55 = (this.getChild("n55"));
  14723. this.n56 = (this.getChild("n56"));
  14724. this.t1 = this.getTransition("t1");
  14725. }
  14726. }
  14727. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14728. class ui_ModeSelection_com123 extends fgui.GComponent {
  14729. static createInstance() {
  14730. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14731. }
  14732. onConstruct() {
  14733. this.type1 = (this.getChild("type1"));
  14734. this.type2 = (this.getChild("type2"));
  14735. this.type3 = (this.getChild("type3"));
  14736. this.n38 = (this.getChild("n38"));
  14737. this.t0 = this.getTransition("t0");
  14738. }
  14739. }
  14740. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14741. class ui_Component132_2 extends fgui.GComponent {
  14742. static createInstance() {
  14743. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14744. }
  14745. onConstruct() {
  14746. this.n25 = (this.getChild("n25"));
  14747. this.n26 = (this.getChild("n26"));
  14748. this.n27 = (this.getChild("n27"));
  14749. this.t0 = this.getTransition("t0");
  14750. }
  14751. }
  14752. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14753. class ui_UIPower$1 extends fgui.GComponent {
  14754. static createInstance() {
  14755. return (fgui.UIPackage.createObject("game", "UIPower"));
  14756. }
  14757. onConstruct() {
  14758. this.n11 = (this.getChild("n11"));
  14759. this.myNode = (this.getChild("myNode"));
  14760. this.t0 = this.getTransition("t0");
  14761. }
  14762. }
  14763. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14764. class ui_Component133 extends fgui.GComponent {
  14765. static createInstance() {
  14766. return (fgui.UIPackage.createObject("game", "Component133"));
  14767. }
  14768. onConstruct() {
  14769. this.n29 = (this.getChild("n29"));
  14770. this.n30 = (this.getChild("n30"));
  14771. }
  14772. }
  14773. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14774. class ui_Component134 extends fgui.GComponent {
  14775. static createInstance() {
  14776. return (fgui.UIPackage.createObject("game", "Component134"));
  14777. }
  14778. onConstruct() {
  14779. this.n30 = (this.getChild("n30"));
  14780. this.n31 = (this.getChild("n31"));
  14781. this.t0 = this.getTransition("t0");
  14782. }
  14783. }
  14784. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14785. class ui_Component135 extends fgui.GComponent {
  14786. static createInstance() {
  14787. return (fgui.UIPackage.createObject("game", "Component135"));
  14788. }
  14789. onConstruct() {
  14790. this.n30 = (this.getChild("n30"));
  14791. this.t0 = this.getTransition("t0");
  14792. }
  14793. }
  14794. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14795. class ui_Component137 extends fgui.GComponent {
  14796. static createInstance() {
  14797. return (fgui.UIPackage.createObject("game", "Component137"));
  14798. }
  14799. onConstruct() {
  14800. this.n28 = (this.getChild("n28"));
  14801. this.n29 = (this.getChild("n29"));
  14802. this.n30 = (this.getChild("n30"));
  14803. this.n32 = (this.getChild("n32"));
  14804. }
  14805. }
  14806. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14807. class ui_dh_zuanshi extends fgui.GButton {
  14808. static createInstance() {
  14809. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14810. }
  14811. onConstruct() {
  14812. this.n1 = (this.getChild("n1"));
  14813. this.n2 = (this.getChild("n2"));
  14814. this.n0 = (this.getChild("n0"));
  14815. this.n3 = (this.getChild("n3"));
  14816. this.n4 = (this.getChild("n4"));
  14817. }
  14818. }
  14819. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14820. class ui_Component138 extends fgui.GComponent {
  14821. static createInstance() {
  14822. return (fgui.UIPackage.createObject("game", "Component138"));
  14823. }
  14824. onConstruct() {
  14825. this.n1 = (this.getChild("n1"));
  14826. this.n2 = (this.getChild("n2"));
  14827. this.t0 = this.getTransition("t0");
  14828. }
  14829. }
  14830. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14831. class ui_Component139 extends fgui.GComponent {
  14832. static createInstance() {
  14833. return (fgui.UIPackage.createObject("game", "Component139"));
  14834. }
  14835. onConstruct() {
  14836. this.n0 = (this.getChild("n0"));
  14837. this.t0 = this.getTransition("t0");
  14838. }
  14839. }
  14840. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14841. class ui_Component140 extends fgui.GComponent {
  14842. static createInstance() {
  14843. return (fgui.UIPackage.createObject("game", "Component140"));
  14844. }
  14845. onConstruct() {
  14846. this.n2 = (this.getChild("n2"));
  14847. this.n3 = (this.getChild("n3"));
  14848. this.t0 = this.getTransition("t0");
  14849. }
  14850. }
  14851. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14852. class ui_Component141 extends fgui.GComponent {
  14853. static createInstance() {
  14854. return (fgui.UIPackage.createObject("game", "Component141"));
  14855. }
  14856. onConstruct() {
  14857. this.n0 = (this.getChild("n0"));
  14858. this.t0 = this.getTransition("t0");
  14859. }
  14860. }
  14861. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14862. class ui_powerNode extends fgui.GProgressBar {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("game", "powerNode"));
  14865. }
  14866. onConstruct() {
  14867. this.n2 = (this.getChild("n2"));
  14868. this.bar_v = (this.getChild("bar_v"));
  14869. this.showImg = (this.getChild("showImg"));
  14870. this.n12 = (this.getChild("n12"));
  14871. }
  14872. }
  14873. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14874. class ui_dh_jingbi1 extends fgui.GComponent {
  14875. static createInstance() {
  14876. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14877. }
  14878. onConstruct() {
  14879. this.n0 = (this.getChild("n0"));
  14880. this.n1 = (this.getChild("n1"));
  14881. this.n2 = (this.getChild("n2"));
  14882. this.n3 = (this.getChild("n3"));
  14883. this.n4 = (this.getChild("n4"));
  14884. this.n5 = (this.getChild("n5"));
  14885. this.n6 = (this.getChild("n6"));
  14886. this.n8 = (this.getChild("n8"));
  14887. this.t0 = this.getTransition("t0");
  14888. }
  14889. }
  14890. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14891. class ui_Component94 extends fgui.GButton {
  14892. static createInstance() {
  14893. return (fgui.UIPackage.createObject("game", "Component94"));
  14894. }
  14895. onConstruct() {
  14896. this.n77 = (this.getChild("n77"));
  14897. }
  14898. }
  14899. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14900. class ui_Component95 extends fgui.GButton {
  14901. static createInstance() {
  14902. return (fgui.UIPackage.createObject("game", "Component95"));
  14903. }
  14904. onConstruct() {
  14905. this.n77 = (this.getChild("n77"));
  14906. }
  14907. }
  14908. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14909. class ui_Component126 extends fgui.GComponent {
  14910. static createInstance() {
  14911. return (fgui.UIPackage.createObject("game", "Component126"));
  14912. }
  14913. onConstruct() {
  14914. this.c1 = this.getController("c1");
  14915. this.normalBtn = (this.getChild("normalBtn"));
  14916. this.tripleBtn = (this.getChild("tripleBtn"));
  14917. }
  14918. }
  14919. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14920. class ui_Component60 extends fgui.GComponent {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("game", "Component60"));
  14923. }
  14924. onConstruct() {
  14925. this.c1 = this.getController("c1");
  14926. this.n48 = (this.getChild("n48"));
  14927. this.womanTxt = (this.getChild("womanTxt"));
  14928. this.t0 = this.getTransition("t0");
  14929. }
  14930. }
  14931. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14932. class ui_Button_h extends fgui.GButton {
  14933. static createInstance() {
  14934. return (fgui.UIPackage.createObject("game", "Button_h"));
  14935. }
  14936. onConstruct() {
  14937. this.button = this.getController("button");
  14938. this.n0 = (this.getChild("n0"));
  14939. }
  14940. }
  14941. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14942. class ui_Button_lv extends fgui.GButton {
  14943. static createInstance() {
  14944. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14945. }
  14946. onConstruct() {
  14947. this.button = this.getController("button");
  14948. this.n0 = (this.getChild("n0"));
  14949. }
  14950. }
  14951. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14952. class ui_Component98_3 extends fgui.GButton {
  14953. static createInstance() {
  14954. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14955. }
  14956. onConstruct() {
  14957. this.c1 = this.getController("c1");
  14958. this.n8 = (this.getChild("n8"));
  14959. this.n41 = (this.getChild("n41"));
  14960. this.n40 = (this.getChild("n40"));
  14961. }
  14962. }
  14963. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14964. class ui_ModeSelection_com1 extends fgui.GButton {
  14965. static createInstance() {
  14966. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14967. }
  14968. onConstruct() {
  14969. this.n34 = (this.getChild("n34"));
  14970. this.n36 = (this.getChild("n36"));
  14971. this.n22 = (this.getChild("n22"));
  14972. this.n20 = (this.getChild("n20"));
  14973. this.n23 = (this.getChild("n23"));
  14974. this.n24 = (this.getChild("n24"));
  14975. this.n26 = (this.getChild("n26"));
  14976. this.n33 = (this.getChild("n33"));
  14977. this.coinImg = (this.getChild("coinImg"));
  14978. this.need = (this.getChild("need"));
  14979. this.n35 = (this.getChild("n35"));
  14980. this.n29 = (this.getChild("n29"));
  14981. this.tipsTxt = (this.getChild("tipsTxt"));
  14982. this.n30 = (this.getChild("n30"));
  14983. this.peopleTxt = (this.getChild("peopleTxt"));
  14984. this.t0 = this.getTransition("t0");
  14985. }
  14986. }
  14987. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14988. class ui_ModeSelection_com2 extends fgui.GButton {
  14989. static createInstance() {
  14990. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14991. }
  14992. onConstruct() {
  14993. this.n36 = (this.getChild("n36"));
  14994. this.n34 = (this.getChild("n34"));
  14995. this.n22 = (this.getChild("n22"));
  14996. this.n20 = (this.getChild("n20"));
  14997. this.n23 = (this.getChild("n23"));
  14998. this.n24 = (this.getChild("n24"));
  14999. this.n26 = (this.getChild("n26"));
  15000. this.n33 = (this.getChild("n33"));
  15001. this.coinImg = (this.getChild("coinImg"));
  15002. this.need = (this.getChild("need"));
  15003. this.n35 = (this.getChild("n35"));
  15004. this.n29 = (this.getChild("n29"));
  15005. this.tipsTxt = (this.getChild("tipsTxt"));
  15006. this.n30 = (this.getChild("n30"));
  15007. this.peopleTxt = (this.getChild("peopleTxt"));
  15008. this.t0 = this.getTransition("t0");
  15009. }
  15010. }
  15011. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  15012. class ui_ModeSelection_com3 extends fgui.GButton {
  15013. static createInstance() {
  15014. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  15015. }
  15016. onConstruct() {
  15017. this.n34 = (this.getChild("n34"));
  15018. this.n36 = (this.getChild("n36"));
  15019. this.n22 = (this.getChild("n22"));
  15020. this.n20 = (this.getChild("n20"));
  15021. this.n23 = (this.getChild("n23"));
  15022. this.n24 = (this.getChild("n24"));
  15023. this.n26 = (this.getChild("n26"));
  15024. this.n33 = (this.getChild("n33"));
  15025. this.coinImg = (this.getChild("coinImg"));
  15026. this.need = (this.getChild("need"));
  15027. this.n35 = (this.getChild("n35"));
  15028. this.n29 = (this.getChild("n29"));
  15029. this.tipsTxt = (this.getChild("tipsTxt"));
  15030. this.n30 = (this.getChild("n30"));
  15031. this.peopleTxt = (this.getChild("peopleTxt"));
  15032. this.t0 = this.getTransition("t0");
  15033. }
  15034. }
  15035. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  15036. class ui_Invitation_com1 extends fgui.GComponent {
  15037. static createInstance() {
  15038. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  15039. }
  15040. onConstruct() {
  15041. this.n14 = (this.getChild("n14"));
  15042. this.n13 = (this.getChild("n13"));
  15043. this.n3 = (this.getChild("n3"));
  15044. this.n1 = (this.getChild("n1"));
  15045. this.n6 = (this.getChild("n6"));
  15046. this.n7 = (this.getChild("n7"));
  15047. this.enterBtn = (this.getChild("enterBtn"));
  15048. this.n11 = (this.getChild("n11"));
  15049. this.n12 = (this.getChild("n12"));
  15050. this.n15 = (this.getChild("n15"));
  15051. this.t0 = this.getTransition("t0");
  15052. this.t1 = this.getTransition("t1");
  15053. }
  15054. }
  15055. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  15056. class ui_Component87_1 extends fgui.GComponent {
  15057. static createInstance() {
  15058. return (fgui.UIPackage.createObject("game", "Component87_1"));
  15059. }
  15060. onConstruct() {
  15061. this.n74 = (this.getChild("n74"));
  15062. this.n73 = (this.getChild("n73"));
  15063. this.ballTxt = (this.getChild("ballTxt"));
  15064. this.n76 = (this.getChild("n76"));
  15065. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15066. this.levelTxt = (this.getChild("levelTxt"));
  15067. this.n87 = (this.getChild("n87"));
  15068. this.n84 = (this.getChild("n84"));
  15069. this.hpTxt = (this.getChild("hpTxt"));
  15070. this.n89 = (this.getChild("n89"));
  15071. this.tipsTxt = (this.getChild("tipsTxt"));
  15072. }
  15073. }
  15074. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  15075. class ui_Component_lc3 extends fgui.GComponent {
  15076. static createInstance() {
  15077. return (fgui.UIPackage.createObject("game", "Component_lc3"));
  15078. }
  15079. onConstruct() {
  15080. this.n0 = (this.getChild("n0"));
  15081. this.n2 = (this.getChild("n2"));
  15082. this.n1_bai = (this.getChild("n1_bai"));
  15083. }
  15084. }
  15085. ui_Component_lc3.URL = "ui://isxx5ak7lvbnv5b1";
  15086. class ui_Component_shou3 extends fgui.GComponent {
  15087. static createInstance() {
  15088. return (fgui.UIPackage.createObject("game", "Component_shou3"));
  15089. }
  15090. onConstruct() {
  15091. this.n57 = (this.getChild("n57"));
  15092. this.n54 = (this.getChild("n54"));
  15093. this.n55 = (this.getChild("n55"));
  15094. this.n56 = (this.getChild("n56"));
  15095. this.t1 = this.getTransition("t1");
  15096. }
  15097. }
  15098. ui_Component_shou3.URL = "ui://isxx5ak7lvbnv5b2";
  15099. class ui_sqg1 extends fgui.GComponent {
  15100. static createInstance() {
  15101. return (fgui.UIPackage.createObject("game", "sqg1"));
  15102. }
  15103. onConstruct() {
  15104. this.n1 = (this.getChild("n1"));
  15105. this.n0 = (this.getChild("n0"));
  15106. }
  15107. }
  15108. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  15109. class ui_sqg2 extends fgui.GComponent {
  15110. static createInstance() {
  15111. return (fgui.UIPackage.createObject("game", "sqg2"));
  15112. }
  15113. onConstruct() {
  15114. this.n1 = (this.getChild("n1"));
  15115. this.n0 = (this.getChild("n0"));
  15116. }
  15117. }
  15118. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15119. class ui_sqg3 extends fgui.GComponent {
  15120. static createInstance() {
  15121. return (fgui.UIPackage.createObject("game", "sqg3"));
  15122. }
  15123. onConstruct() {
  15124. this.n1 = (this.getChild("n1"));
  15125. this.n0 = (this.getChild("n0"));
  15126. }
  15127. }
  15128. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15129. class ui_sqg4 extends fgui.GComponent {
  15130. static createInstance() {
  15131. return (fgui.UIPackage.createObject("game", "sqg4"));
  15132. }
  15133. onConstruct() {
  15134. this.n1 = (this.getChild("n1"));
  15135. this.n0 = (this.getChild("n0"));
  15136. }
  15137. }
  15138. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15139. class ui_Component36 extends fgui.GButton {
  15140. static createInstance() {
  15141. return (fgui.UIPackage.createObject("game", "Component36"));
  15142. }
  15143. onConstruct() {
  15144. this.c1 = this.getController("c1");
  15145. this.n53 = (this.getChild("n53"));
  15146. this.n56 = (this.getChild("n56"));
  15147. }
  15148. }
  15149. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15150. class ui_Component37 extends fgui.GButton {
  15151. static createInstance() {
  15152. return (fgui.UIPackage.createObject("game", "Component37"));
  15153. }
  15154. onConstruct() {
  15155. this.c1 = this.getController("c1");
  15156. this.n52 = (this.getChild("n52"));
  15157. this.n54 = (this.getChild("n54"));
  15158. }
  15159. }
  15160. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15161. class ui_UISetting extends fgui.GComponent {
  15162. static createInstance() {
  15163. return (fgui.UIPackage.createObject("game", "UISetting"));
  15164. }
  15165. onConstruct() {
  15166. this.c1 = this.getController("c1");
  15167. this.n4 = (this.getChild("n4"));
  15168. this.soundBtn = (this.getChild("soundBtn"));
  15169. this.shakeBtn = (this.getChild("shakeBtn"));
  15170. this.clickNode = (this.getChild("clickNode"));
  15171. this.xyBtn = (this.getChild("xyBtn"));
  15172. }
  15173. }
  15174. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15175. class ui_Component39 extends fgui.GComponent {
  15176. static createInstance() {
  15177. return (fgui.UIPackage.createObject("game", "Component39"));
  15178. }
  15179. onConstruct() {
  15180. this.n5 = (this.getChild("n5"));
  15181. this.n6 = (this.getChild("n6"));
  15182. this.n7 = (this.getChild("n7"));
  15183. this.t0 = this.getTransition("t0");
  15184. }
  15185. }
  15186. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15187. class ui_Component40 extends fgui.GButton {
  15188. static createInstance() {
  15189. return (fgui.UIPackage.createObject("game", "Component40"));
  15190. }
  15191. onConstruct() {
  15192. this.n46 = (this.getChild("n46"));
  15193. this.n47 = (this.getChild("n47"));
  15194. }
  15195. }
  15196. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15197. class ui_Component41 extends fgui.GComponent {
  15198. static createInstance() {
  15199. return (fgui.UIPackage.createObject("game", "Component41"));
  15200. }
  15201. onConstruct() {
  15202. this.c1 = this.getController("c1");
  15203. this.n0 = (this.getChild("n0"));
  15204. this.titleTxt = (this.getChild("titleTxt"));
  15205. this.n2 = (this.getChild("n2"));
  15206. this.msgTips = (this.getChild("msgTips"));
  15207. this.numTxt = (this.getChild("numTxt"));
  15208. this.n18 = (this.getChild("n18"));
  15209. this.cancelBtn = (this.getChild("cancelBtn"));
  15210. this.videoBtn = (this.getChild("videoBtn"));
  15211. this.n10 = (this.getChild("n10"));
  15212. }
  15213. }
  15214. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15215. class ui_Component42 extends fgui.GComponent {
  15216. static createInstance() {
  15217. return (fgui.UIPackage.createObject("game", "Component42"));
  15218. }
  15219. onConstruct() {
  15220. this.c1 = this.getController("c1");
  15221. this.n1 = (this.getChild("n1"));
  15222. this.n2 = (this.getChild("n2"));
  15223. this.n3 = (this.getChild("n3"));
  15224. this.tipsTxt = (this.getChild("tipsTxt"));
  15225. this.cancelBtn = (this.getChild("cancelBtn"));
  15226. this.sureBtn = (this.getChild("sureBtn"));
  15227. this.n11 = (this.getChild("n11"));
  15228. this.n13 = (this.getChild("n13"));
  15229. this.n14 = (this.getChild("n14"));
  15230. this.womanTxt = (this.getChild("womanTxt"));
  15231. this.t0 = this.getTransition("t0");
  15232. }
  15233. }
  15234. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15235. class ui_dh_js_shengli extends fgui.GComponent {
  15236. static createInstance() {
  15237. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15238. }
  15239. onConstruct() {
  15240. this.n3 = (this.getChild("n3"));
  15241. this.n4 = (this.getChild("n4"));
  15242. this.n1 = (this.getChild("n1"));
  15243. this.n2 = (this.getChild("n2"));
  15244. this.n5 = (this.getChild("n5"));
  15245. this.n6 = (this.getChild("n6"));
  15246. this.n7 = (this.getChild("n7"));
  15247. this.n8 = (this.getChild("n8"));
  15248. this.attack = this.getTransition("attack");
  15249. this.idle = this.getTransition("idle");
  15250. }
  15251. }
  15252. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15253. class ui_dh_js_shengli_g extends fgui.GComponent {
  15254. static createInstance() {
  15255. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15256. }
  15257. onConstruct() {
  15258. this.n3 = (this.getChild("n3"));
  15259. this.n1 = (this.getChild("n1"));
  15260. this.t0 = this.getTransition("t0");
  15261. }
  15262. }
  15263. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15264. class ui_dh_js_shibai extends fgui.GComponent {
  15265. static createInstance() {
  15266. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15267. }
  15268. onConstruct() {
  15269. this.n0 = (this.getChild("n0"));
  15270. this.n1 = (this.getChild("n1"));
  15271. this.n2 = (this.getChild("n2"));
  15272. this.n3 = (this.getChild("n3"));
  15273. this.idle = this.getTransition("idle");
  15274. this.attack = this.getTransition("attack");
  15275. }
  15276. }
  15277. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15278. class ui_dh_zy_ganfa extends fgui.GButton {
  15279. static createInstance() {
  15280. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15281. }
  15282. onConstruct() {
  15283. this.n0 = (this.getChild("n0"));
  15284. }
  15285. }
  15286. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15287. class ui_dh_zy_sc_guang extends fgui.GButton {
  15288. static createInstance() {
  15289. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15290. }
  15291. onConstruct() {
  15292. this.n0 = (this.getChild("n0"));
  15293. this.n2 = (this.getChild("n2"));
  15294. }
  15295. }
  15296. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15297. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15298. static createInstance() {
  15299. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15300. }
  15301. onConstruct() {
  15302. this.n0 = (this.getChild("n0"));
  15303. this.n3 = (this.getChild("n3"));
  15304. }
  15305. }
  15306. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15307. class ui_dh_zy_wanfa extends fgui.GButton {
  15308. static createInstance() {
  15309. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15310. }
  15311. onConstruct() {
  15312. this.n0 = (this.getChild("n0"));
  15313. }
  15314. }
  15315. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15316. class ui_Button_login extends fgui.GButton {
  15317. static createInstance() {
  15318. return (fgui.UIPackage.createObject("game", "Button_login"));
  15319. }
  15320. onConstruct() {
  15321. this.button = this.getController("button");
  15322. this.n5 = (this.getChild("n5"));
  15323. }
  15324. }
  15325. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15326. class ui_Component53_1 extends fgui.GComponent {
  15327. static createInstance() {
  15328. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15329. }
  15330. onConstruct() {
  15331. this.n0 = (this.getChild("n0"));
  15332. this.n1 = (this.getChild("n1"));
  15333. this.n2 = (this.getChild("n2"));
  15334. this.n3 = (this.getChild("n3"));
  15335. this.n4 = (this.getChild("n4"));
  15336. this.n5 = (this.getChild("n5"));
  15337. this.n6 = (this.getChild("n6"));
  15338. this.n7 = (this.getChild("n7"));
  15339. this.n8 = (this.getChild("n8"));
  15340. this.n9 = (this.getChild("n9"));
  15341. this.n10 = (this.getChild("n10"));
  15342. this.n11 = (this.getChild("n11"));
  15343. this.n12 = (this.getChild("n12"));
  15344. this.n13 = (this.getChild("n13"));
  15345. this.n14 = (this.getChild("n14"));
  15346. this.n15 = (this.getChild("n15"));
  15347. this.n16 = (this.getChild("n16"));
  15348. this.n19 = (this.getChild("n19"));
  15349. this.n20 = (this.getChild("n20"));
  15350. this.n21 = (this.getChild("n21"));
  15351. this.n22 = (this.getChild("n22"));
  15352. this.n23 = (this.getChild("n23"));
  15353. this.n24 = (this.getChild("n24"));
  15354. this.n25 = (this.getChild("n25"));
  15355. this.n26 = (this.getChild("n26"));
  15356. this.n27 = (this.getChild("n27"));
  15357. this.n28 = (this.getChild("n28"));
  15358. this.n29 = (this.getChild("n29"));
  15359. this.n30 = (this.getChild("n30"));
  15360. this.n31 = (this.getChild("n31"));
  15361. this.n32 = (this.getChild("n32"));
  15362. this.n33 = (this.getChild("n33"));
  15363. this.n34 = (this.getChild("n34"));
  15364. this.n35 = (this.getChild("n35"));
  15365. this.t0 = this.getTransition("t0");
  15366. }
  15367. }
  15368. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15369. class ui_Component30 extends fgui.GComponent {
  15370. static createInstance() {
  15371. return (fgui.UIPackage.createObject("game", "Component30"));
  15372. }
  15373. onConstruct() {
  15374. this.c1 = this.getController("c1");
  15375. this.n46 = (this.getChild("n46"));
  15376. this.n47 = (this.getChild("n47"));
  15377. this.numTxt = (this.getChild("numTxt"));
  15378. this.n50 = (this.getChild("n50"));
  15379. this.n53 = (this.getChild("n53"));
  15380. this.n54 = (this.getChild("n54"));
  15381. this.n55 = (this.getChild("n55"));
  15382. this.n56 = (this.getChild("n56"));
  15383. }
  15384. }
  15385. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15386. class ui_Component30_1 extends fgui.GComponent {
  15387. static createInstance() {
  15388. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15389. }
  15390. onConstruct() {
  15391. this.c1 = this.getController("c1");
  15392. this.n46 = (this.getChild("n46"));
  15393. this.n47 = (this.getChild("n47"));
  15394. this.numTxt = (this.getChild("numTxt"));
  15395. this.n50 = (this.getChild("n50"));
  15396. this.n51 = (this.getChild("n51"));
  15397. this.n52 = (this.getChild("n52"));
  15398. this.n53 = (this.getChild("n53"));
  15399. this.n54 = (this.getChild("n54"));
  15400. }
  15401. }
  15402. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15403. class ui_Component31 extends fgui.GComponent {
  15404. static createInstance() {
  15405. return (fgui.UIPackage.createObject("game", "Component31"));
  15406. }
  15407. onConstruct() {
  15408. this.n55 = (this.getChild("n55"));
  15409. this.n54 = (this.getChild("n54"));
  15410. this.conditionTxt = (this.getChild("conditionTxt"));
  15411. this.n57 = (this.getChild("n57"));
  15412. this.t0 = this.getTransition("t0");
  15413. }
  15414. }
  15415. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15416. class ui_Component32 extends fgui.GComponent {
  15417. static createInstance() {
  15418. return (fgui.UIPackage.createObject("game", "Component32"));
  15419. }
  15420. onConstruct() {
  15421. this.n5 = (this.getChild("n5"));
  15422. this.n6 = (this.getChild("n6"));
  15423. this.n7 = (this.getChild("n7"));
  15424. this.t0 = this.getTransition("t0");
  15425. }
  15426. }
  15427. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15428. class ui_AwardItem extends fgui.GComponent {
  15429. static createInstance() {
  15430. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15431. }
  15432. onConstruct() {
  15433. this.n9 = (this.getChild("n9"));
  15434. this.myIcon = (this.getChild("myIcon"));
  15435. this.numTxt = (this.getChild("numTxt"));
  15436. this.nameTxt = (this.getChild("nameTxt"));
  15437. this.n16 = (this.getChild("n16"));
  15438. this.n17 = (this.getChild("n17"));
  15439. }
  15440. }
  15441. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15442. class ui_ranking_com1 extends fgui.GButton {
  15443. static createInstance() {
  15444. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15445. }
  15446. onConstruct() {
  15447. this.c1 = this.getController("c1");
  15448. this.n49 = (this.getChild("n49"));
  15449. this.n18 = (this.getChild("n18"));
  15450. this.n46 = (this.getChild("n46"));
  15451. this.n48 = (this.getChild("n48"));
  15452. this.n50 = (this.getChild("n50"));
  15453. }
  15454. }
  15455. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15456. class ui_ranking_com2 extends fgui.GButton {
  15457. static createInstance() {
  15458. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15459. }
  15460. onConstruct() {
  15461. this.c1 = this.getController("c1");
  15462. this.n49 = (this.getChild("n49"));
  15463. this.n18 = (this.getChild("n18"));
  15464. this.n46 = (this.getChild("n46"));
  15465. this.n48 = (this.getChild("n48"));
  15466. this.n50 = (this.getChild("n50"));
  15467. }
  15468. }
  15469. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15470. class ui_ranking_com3 extends fgui.GComponent {
  15471. static createInstance() {
  15472. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15473. }
  15474. onConstruct() {
  15475. this.n17 = (this.getChild("n17"));
  15476. this.myIcon = (this.getChild("myIcon"));
  15477. }
  15478. }
  15479. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15480. class ui_ranking_com4 extends fgui.GComponent {
  15481. static createInstance() {
  15482. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15483. }
  15484. onConstruct() {
  15485. this.n16 = (this.getChild("n16"));
  15486. this.head = (this.getChild("head"));
  15487. }
  15488. }
  15489. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15490. class ui_ranking_com5 extends fgui.GComponent {
  15491. static createInstance() {
  15492. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15493. }
  15494. onConstruct() {
  15495. this.c1 = this.getController("c1");
  15496. this.c2 = this.getController("c2");
  15497. this.n2 = (this.getChild("n2"));
  15498. this.n3 = (this.getChild("n3"));
  15499. this.levelBtn = (this.getChild("levelBtn"));
  15500. this.starBtn = (this.getChild("starBtn"));
  15501. this.n23 = (this.getChild("n23"));
  15502. this.n24 = (this.getChild("n24"));
  15503. this.n25 = (this.getChild("n25"));
  15504. this.myList = (this.getChild("myList"));
  15505. this.selfNode = (this.getChild("selfNode"));
  15506. this.n9 = (this.getChild("n9"));
  15507. this.n12 = (this.getChild("n12"));
  15508. this.n13 = (this.getChild("n13"));
  15509. this.n14 = (this.getChild("n14"));
  15510. this.n39 = (this.getChild("n39"));
  15511. this.n41 = (this.getChild("n41"));
  15512. this.n42 = (this.getChild("n42"));
  15513. this.n45 = (this.getChild("n45"));
  15514. this.changeBtn = (this.getChild("changeBtn"));
  15515. this.closeBtn = (this.getChild("closeBtn"));
  15516. this.t0 = this.getTransition("t0");
  15517. }
  15518. }
  15519. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15520. class ui_RankItem extends fgui.GComponent {
  15521. static createInstance() {
  15522. return (fgui.UIPackage.createObject("game", "RankItem"));
  15523. }
  15524. onConstruct() {
  15525. this.n10 = (this.getChild("n10"));
  15526. this.n11 = (this.getChild("n11"));
  15527. this.rankTxt = (this.getChild("rankTxt"));
  15528. this.headNode = (this.getChild("headNode"));
  15529. this.nameTxt = (this.getChild("nameTxt"));
  15530. this.n19 = (this.getChild("n19"));
  15531. this.valueTxt = (this.getChild("valueTxt"));
  15532. this.img1 = (this.getChild("img1"));
  15533. this.img2 = (this.getChild("img2"));
  15534. this.img3 = (this.getChild("img3"));
  15535. }
  15536. }
  15537. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15538. class ui_ranking_com9 extends fgui.GComponent {
  15539. static createInstance() {
  15540. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15541. }
  15542. onConstruct() {
  15543. this.c1 = this.getController("c1");
  15544. this.n27 = (this.getChild("n27"));
  15545. this.n28 = (this.getChild("n28"));
  15546. this.headNode = (this.getChild("headNode"));
  15547. this.rankTxt = (this.getChild("rankTxt"));
  15548. this.nameTxt = (this.getChild("nameTxt"));
  15549. this.n34 = (this.getChild("n34"));
  15550. this.valueTxt = (this.getChild("valueTxt"));
  15551. this.n36 = (this.getChild("n36"));
  15552. this.n37 = (this.getChild("n37"));
  15553. this.n38 = (this.getChild("n38"));
  15554. this.n39 = (this.getChild("n39"));
  15555. this.n40 = (this.getChild("n40"));
  15556. }
  15557. }
  15558. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15559. class ui_ranking_com10 extends fgui.GComponent {
  15560. static createInstance() {
  15561. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15562. }
  15563. onConstruct() {
  15564. this.n23 = (this.getChild("n23"));
  15565. this.n24 = (this.getChild("n24"));
  15566. }
  15567. }
  15568. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15569. class ui_ranking_com11 extends fgui.GComponent {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15572. }
  15573. onConstruct() {
  15574. this.n24 = (this.getChild("n24"));
  15575. this.n25 = (this.getChild("n25"));
  15576. this.t0 = this.getTransition("t0");
  15577. }
  15578. }
  15579. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15580. class ui_ranking_com13 extends fgui.GButton {
  15581. static createInstance() {
  15582. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15583. }
  15584. onConstruct() {
  15585. this.c1 = this.getController("c1");
  15586. this.n44 = (this.getChild("n44"));
  15587. this.n45 = (this.getChild("n45"));
  15588. this.n46 = (this.getChild("n46"));
  15589. }
  15590. }
  15591. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15592. class ui_Component122 extends fgui.GComponent {
  15593. static createInstance() {
  15594. return (fgui.UIPackage.createObject("game", "Component122"));
  15595. }
  15596. onConstruct() {
  15597. this.gameNode3 = (this.getChild("gameNode3"));
  15598. }
  15599. }
  15600. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15601. class ui_skillItem extends fgui.GComponent {
  15602. static createInstance() {
  15603. return (fgui.UIPackage.createObject("game", "skillItem"));
  15604. }
  15605. onConstruct() {
  15606. this.c1 = this.getController("c1");
  15607. this.n31 = (this.getChild("n31"));
  15608. this.n6 = (this.getChild("n6"));
  15609. this.skillImg = (this.getChild("skillImg"));
  15610. this.nameTxt = (this.getChild("nameTxt"));
  15611. this.levelTxt = (this.getChild("levelTxt"));
  15612. this.n28 = (this.getChild("n28"));
  15613. this.describeTxt = (this.getChild("describeTxt"));
  15614. this.n32 = (this.getChild("n32"));
  15615. this.mutiBtn = (this.getChild("mutiBtn"));
  15616. this.tryNode = (this.getChild("tryNode"));
  15617. this.normalBtn = (this.getChild("normalBtn"));
  15618. this.startBtn = (this.getChild("startBtn"));
  15619. this.n42 = (this.getChild("n42"));
  15620. this.n43 = (this.getChild("n43"));
  15621. this.n44 = (this.getChild("n44"));
  15622. }
  15623. }
  15624. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15625. class ui_Component26 extends fgui.GButton {
  15626. static createInstance() {
  15627. return (fgui.UIPackage.createObject("game", "Component26"));
  15628. }
  15629. onConstruct() {
  15630. this.n11 = (this.getChild("n11"));
  15631. this.n30 = (this.getChild("n30"));
  15632. this.n34 = (this.getChild("n34"));
  15633. }
  15634. }
  15635. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15636. class ui_Component28 extends fgui.GButton {
  15637. static createInstance() {
  15638. return (fgui.UIPackage.createObject("game", "Component28"));
  15639. }
  15640. onConstruct() {
  15641. this.n12 = (this.getChild("n12"));
  15642. this.n31 = (this.getChild("n31"));
  15643. this.curTxt = (this.getChild("curTxt"));
  15644. this.n33 = (this.getChild("n33"));
  15645. }
  15646. }
  15647. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15648. class ui_Component1302 extends fgui.GComponent {
  15649. static createInstance() {
  15650. return (fgui.UIPackage.createObject("game", "Component1302"));
  15651. }
  15652. onConstruct() {
  15653. this.n2 = (this.getChild("n2"));
  15654. this.n3 = (this.getChild("n3"));
  15655. }
  15656. }
  15657. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15658. class ui_Component113 extends fgui.GComponent {
  15659. static createInstance() {
  15660. return (fgui.UIPackage.createObject("game", "Component113"));
  15661. }
  15662. onConstruct() {
  15663. this.n85 = (this.getChild("n85"));
  15664. this.n86 = (this.getChild("n86"));
  15665. this.n77 = (this.getChild("n77"));
  15666. this.n79 = (this.getChild("n79"));
  15667. this.n80 = (this.getChild("n80"));
  15668. this.n81 = (this.getChild("n81"));
  15669. this.n82 = (this.getChild("n82"));
  15670. this.n84 = (this.getChild("n84"));
  15671. this.n87 = (this.getChild("n87"));
  15672. this.t0 = this.getTransition("t0");
  15673. }
  15674. }
  15675. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15676. class ui_Component114 extends fgui.GComponent {
  15677. static createInstance() {
  15678. return (fgui.UIPackage.createObject("game", "Component114"));
  15679. }
  15680. onConstruct() {
  15681. this.n77 = (this.getChild("n77"));
  15682. this.t0 = this.getTransition("t0");
  15683. }
  15684. }
  15685. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15686. class ui_Component115 extends fgui.GComponent {
  15687. static createInstance() {
  15688. return (fgui.UIPackage.createObject("game", "Component115"));
  15689. }
  15690. onConstruct() {
  15691. this.n83 = (this.getChild("n83"));
  15692. this.fingerNode = (this.getChild("fingerNode"));
  15693. this.n84 = (this.getChild("n84"));
  15694. }
  15695. }
  15696. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15697. class ui_Component117 extends fgui.GComponent {
  15698. static createInstance() {
  15699. return (fgui.UIPackage.createObject("game", "Component117"));
  15700. }
  15701. onConstruct() {
  15702. this.n87 = (this.getChild("n87"));
  15703. this.n88 = (this.getChild("n88"));
  15704. this.n84 = (this.getChild("n84"));
  15705. this.n85 = (this.getChild("n85"));
  15706. this.n86 = (this.getChild("n86"));
  15707. this.t0 = this.getTransition("t0");
  15708. }
  15709. }
  15710. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15711. class ui_Component98_1 extends fgui.GButton {
  15712. static createInstance() {
  15713. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15714. }
  15715. onConstruct() {
  15716. this.c1 = this.getController("c1");
  15717. this.n8 = (this.getChild("n8"));
  15718. this.n41 = (this.getChild("n41"));
  15719. this.n40 = (this.getChild("n40"));
  15720. }
  15721. }
  15722. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15723. class ui_Component61 extends fgui.GComponent {
  15724. static createInstance() {
  15725. return (fgui.UIPackage.createObject("game", "Component61"));
  15726. }
  15727. onConstruct() {
  15728. this.n14 = (this.getChild("n14"));
  15729. this.n6 = (this.getChild("n6"));
  15730. this.t0 = this.getTransition("t0");
  15731. }
  15732. }
  15733. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15734. class ui_Component62 extends fgui.GComponent {
  15735. static createInstance() {
  15736. return (fgui.UIPackage.createObject("game", "Component62"));
  15737. }
  15738. onConstruct() {
  15739. this.n66 = (this.getChild("n66"));
  15740. this.n56 = (this.getChild("n56"));
  15741. this.n63 = (this.getChild("n63"));
  15742. this.n65 = (this.getChild("n65"));
  15743. this.t0 = this.getTransition("t0");
  15744. }
  15745. }
  15746. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15747. class ui_d3Root extends fgui.GComponent {
  15748. static createInstance() {
  15749. return (fgui.UIPackage.createObject("game", "d3Root"));
  15750. }
  15751. onConstruct() {
  15752. }
  15753. }
  15754. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15755. class ui_d2Root extends fgui.GComponent {
  15756. static createInstance() {
  15757. return (fgui.UIPackage.createObject("game", "d2Root"));
  15758. }
  15759. onConstruct() {
  15760. }
  15761. }
  15762. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15763. class ui_ballNode extends fgui.GComponent {
  15764. static createInstance() {
  15765. return (fgui.UIPackage.createObject("game", "ballNode"));
  15766. }
  15767. onConstruct() {
  15768. }
  15769. }
  15770. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15771. class ui_border extends fgui.GComponent {
  15772. static createInstance() {
  15773. return (fgui.UIPackage.createObject("game", "border"));
  15774. }
  15775. onConstruct() {
  15776. this.bar1 = (this.getChild("bar1"));
  15777. this.bar2 = (this.getChild("bar2"));
  15778. this.bar3 = (this.getChild("bar3"));
  15779. this.bar4 = (this.getChild("bar4"));
  15780. this.bar5 = (this.getChild("bar5"));
  15781. this.bar6 = (this.getChild("bar6"));
  15782. this.circle1 = (this.getChild("circle1"));
  15783. this.circle2 = (this.getChild("circle2"));
  15784. this.circle3 = (this.getChild("circle3"));
  15785. this.circle4 = (this.getChild("circle4"));
  15786. this.circle5 = (this.getChild("circle5"));
  15787. this.circle6 = (this.getChild("circle6"));
  15788. this.n28 = (this.getChild("n28"));
  15789. }
  15790. }
  15791. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15792. class ui_btn_buy extends fgui.GButton {
  15793. static createInstance() {
  15794. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15795. }
  15796. onConstruct() {
  15797. this.button = this.getController("button");
  15798. this.n0 = (this.getChild("n0"));
  15799. this.n1 = (this.getChild("n1"));
  15800. this.n2 = (this.getChild("n2"));
  15801. }
  15802. }
  15803. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15804. class ui_Component41_2 extends fgui.GComponent {
  15805. static createInstance() {
  15806. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15807. }
  15808. onConstruct() {
  15809. this.c1 = this.getController("c1");
  15810. this.n0 = (this.getChild("n0"));
  15811. this.n2 = (this.getChild("n2"));
  15812. this.n19 = (this.getChild("n19"));
  15813. this.cancelBtn = (this.getChild("cancelBtn"));
  15814. this.videoBtn = (this.getChild("videoBtn"));
  15815. this.n9 = (this.getChild("n9"));
  15816. this.n22 = (this.getChild("n22"));
  15817. this.tipsTxt = (this.getChild("tipsTxt"));
  15818. this.n23 = (this.getChild("n23"));
  15819. this.n24 = (this.getChild("n24"));
  15820. this.n26 = (this.getChild("n26"));
  15821. this.n27 = (this.getChild("n27"));
  15822. this.titleTxt = (this.getChild("titleTxt"));
  15823. }
  15824. }
  15825. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15826. class ui_Component41_1 extends fgui.GComponent {
  15827. static createInstance() {
  15828. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15829. }
  15830. onConstruct() {
  15831. this.c1 = this.getController("c1");
  15832. this.n0 = (this.getChild("n0"));
  15833. this.n2 = (this.getChild("n2"));
  15834. this.cancelBtn = (this.getChild("cancelBtn"));
  15835. this.videoBtn = (this.getChild("videoBtn"));
  15836. this.n27 = (this.getChild("n27"));
  15837. this.n30 = (this.getChild("n30"));
  15838. this.n31 = (this.getChild("n31"));
  15839. this.n32 = (this.getChild("n32"));
  15840. this.n33 = (this.getChild("n33"));
  15841. this.n34 = (this.getChild("n34"));
  15842. this.n35 = (this.getChild("n35"));
  15843. this.n36 = (this.getChild("n36"));
  15844. this.n1 = (this.getChild("n1"));
  15845. this.n37 = (this.getChild("n37"));
  15846. this.t0 = this.getTransition("t0");
  15847. this.t1 = this.getTransition("t1");
  15848. this.t2 = this.getTransition("t2");
  15849. this.t3 = this.getTransition("t3");
  15850. }
  15851. }
  15852. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15853. class ui_againBtn extends fgui.GButton {
  15854. static createInstance() {
  15855. return (fgui.UIPackage.createObject("game", "againBtn"));
  15856. }
  15857. onConstruct() {
  15858. this.n2 = (this.getChild("n2"));
  15859. this.n1 = (this.getChild("n1"));
  15860. this.n5 = (this.getChild("n5"));
  15861. }
  15862. }
  15863. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15864. class ui_Component118 extends fgui.GButton {
  15865. static createInstance() {
  15866. return (fgui.UIPackage.createObject("game", "Component118"));
  15867. }
  15868. onConstruct() {
  15869. this.c1 = this.getController("c1");
  15870. this.n14 = (this.getChild("n14"));
  15871. this.n9 = (this.getChild("n9"));
  15872. this.n10 = (this.getChild("n10"));
  15873. this.diamondTxt = (this.getChild("diamondTxt"));
  15874. this.n13 = (this.getChild("n13"));
  15875. this.n15 = (this.getChild("n15"));
  15876. }
  15877. }
  15878. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15879. class ui_Component119 extends fgui.GComponent {
  15880. static createInstance() {
  15881. return (fgui.UIPackage.createObject("game", "Component119"));
  15882. }
  15883. onConstruct() {
  15884. this.n1 = (this.getChild("n1"));
  15885. this.n2 = (this.getChild("n2"));
  15886. this.n13 = (this.getChild("n13"));
  15887. this.n6 = (this.getChild("n6"));
  15888. this.screenNode = (this.getChild("screenNode"));
  15889. this.n15 = (this.getChild("n15"));
  15890. this.closeBtn = (this.getChild("closeBtn"));
  15891. this.share2Btn = (this.getChild("share2Btn"));
  15892. this.shareBtn = (this.getChild("shareBtn"));
  15893. this.tipsNode = (this.getChild("tipsNode"));
  15894. this.awardNode = (this.getChild("awardNode"));
  15895. }
  15896. }
  15897. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15898. class ui_Component_yd1 extends fgui.GComponent {
  15899. static createInstance() {
  15900. return (fgui.UIPackage.createObject("game", "Component_yd1"));
  15901. }
  15902. onConstruct() {
  15903. this.n83 = (this.getChild("n83"));
  15904. this.fingerNode = (this.getChild("fingerNode"));
  15905. this.n84 = (this.getChild("n84"));
  15906. }
  15907. }
  15908. ui_Component_yd1.URL = "ui://isxx5ak7uc2qv5b3";
  15909. class ui_Component_yd2 extends fgui.GComponent {
  15910. static createInstance() {
  15911. return (fgui.UIPackage.createObject("game", "Component_yd2"));
  15912. }
  15913. onConstruct() {
  15914. this.n85 = (this.getChild("n85"));
  15915. this.n86 = (this.getChild("n86"));
  15916. this.n77 = (this.getChild("n77"));
  15917. this.n79 = (this.getChild("n79"));
  15918. this.n80 = (this.getChild("n80"));
  15919. this.n81 = (this.getChild("n81"));
  15920. this.n82 = (this.getChild("n82"));
  15921. this.n84 = (this.getChild("n84"));
  15922. this.n87 = (this.getChild("n87"));
  15923. this.t0 = this.getTransition("t0");
  15924. }
  15925. }
  15926. ui_Component_yd2.URL = "ui://isxx5ak7uc2qv5b5";
  15927. class ui_Component_yd3 extends fgui.GComponent {
  15928. static createInstance() {
  15929. return (fgui.UIPackage.createObject("game", "Component_yd3"));
  15930. }
  15931. onConstruct() {
  15932. this.n87 = (this.getChild("n87"));
  15933. this.n88 = (this.getChild("n88"));
  15934. this.n84 = (this.getChild("n84"));
  15935. this.n85 = (this.getChild("n85"));
  15936. this.n86 = (this.getChild("n86"));
  15937. this.t0 = this.getTransition("t0");
  15938. }
  15939. }
  15940. ui_Component_yd3.URL = "ui://isxx5ak7uc2qv5b6";
  15941. class ui_daoJuDisplay extends fgui.GComponent {
  15942. static createInstance() {
  15943. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15944. }
  15945. onConstruct() {
  15946. this.n6 = (this.getChild("n6"));
  15947. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15948. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15949. this.btn_buy = (this.getChild("btn_buy"));
  15950. this.nameTxt = (this.getChild("nameTxt"));
  15951. this.zsImg = (this.getChild("zsImg"));
  15952. }
  15953. }
  15954. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15955. class ui_Component132_1 extends fgui.GComponent {
  15956. static createInstance() {
  15957. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15958. }
  15959. onConstruct() {
  15960. this.n25 = (this.getChild("n25"));
  15961. this.n26 = (this.getChild("n26"));
  15962. this.n27 = (this.getChild("n27"));
  15963. this.t0 = this.getTransition("t0");
  15964. }
  15965. }
  15966. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15967. class ui_Component_lc_challenge1 extends fgui.GComponent {
  15968. static createInstance() {
  15969. return (fgui.UIPackage.createObject("game", "Component_lc_challenge1"));
  15970. }
  15971. onConstruct() {
  15972. this.n0 = (this.getChild("n0"));
  15973. this.n1_bai = (this.getChild("n1_bai"));
  15974. }
  15975. }
  15976. ui_Component_lc_challenge1.URL = "ui://isxx5ak7um3xv5as";
  15977. class ui_Component_shou extends fgui.GComponent {
  15978. static createInstance() {
  15979. return (fgui.UIPackage.createObject("game", "Component_shou"));
  15980. }
  15981. onConstruct() {
  15982. this.n57 = (this.getChild("n57"));
  15983. this.n54 = (this.getChild("n54"));
  15984. this.n55 = (this.getChild("n55"));
  15985. this.n56 = (this.getChild("n56"));
  15986. this.t1 = this.getTransition("t1");
  15987. }
  15988. }
  15989. ui_Component_shou.URL = "ui://isxx5ak7um3xv5aw";
  15990. class ui_SecretaryDisplay extends fgui.GComponent {
  15991. static createInstance() {
  15992. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15993. }
  15994. onConstruct() {
  15995. this.n2 = (this.getChild("n2"));
  15996. this.levelTxt = (this.getChild("levelTxt"));
  15997. this.n4 = (this.getChild("n4"));
  15998. this.secretary = (this.getChild("secretary"));
  15999. this.purchaseBtn = (this.getChild("purchaseBtn"));
  16000. this.n16 = (this.getChild("n16"));
  16001. this.n37 = (this.getChild("n37"));
  16002. this.n41 = (this.getChild("n41"));
  16003. this.n14 = (this.getChild("n14"));
  16004. this.n17 = (this.getChild("n17"));
  16005. this.heightTxt = (this.getChild("heightTxt"));
  16006. this.n46 = (this.getChild("n46"));
  16007. this.n36 = (this.getChild("n36"));
  16008. this.n38 = (this.getChild("n38"));
  16009. this.foodTxt = (this.getChild("foodTxt"));
  16010. this.n47 = (this.getChild("n47"));
  16011. this.n40 = (this.getChild("n40"));
  16012. this.n42 = (this.getChild("n42"));
  16013. this.historyTxt = (this.getChild("historyTxt"));
  16014. this.n48 = (this.getChild("n48"));
  16015. this.nameImg = (this.getChild("nameImg"));
  16016. this.n12 = (this.getChild("n12"));
  16017. this.n49 = (this.getChild("n49"));
  16018. this.t0 = this.getTransition("t0");
  16019. }
  16020. }
  16021. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  16022. class ui_BallRodDisplay extends fgui.GComponent {
  16023. static createInstance() {
  16024. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  16025. }
  16026. onConstruct() {
  16027. this.c1 = this.getController("c1");
  16028. this.n31 = (this.getChild("n31"));
  16029. this.n6 = (this.getChild("n6"));
  16030. this.nameTxt = (this.getChild("nameTxt"));
  16031. this.rodImg = (this.getChild("rodImg"));
  16032. this.eftRod = (this.getChild("eftRod"));
  16033. this.levelNode = (this.getChild("levelNode"));
  16034. this.purchaseBtn = (this.getChild("purchaseBtn"));
  16035. }
  16036. }
  16037. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  16038. class ui_Component111_11 extends fgui.GComponent {
  16039. static createInstance() {
  16040. return (fgui.UIPackage.createObject("game", "Component111_11"));
  16041. }
  16042. onConstruct() {
  16043. this.n68 = (this.getChild("n68"));
  16044. this.n69 = (this.getChild("n69"));
  16045. }
  16046. }
  16047. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  16048. class ui_Component112 extends fgui.GComponent {
  16049. static createInstance() {
  16050. return (fgui.UIPackage.createObject("game", "Component112"));
  16051. }
  16052. onConstruct() {
  16053. this.n68 = (this.getChild("n68"));
  16054. this.myMask = (this.getChild("myMask"));
  16055. }
  16056. }
  16057. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  16058. class ui_Component111 extends fgui.GComponent {
  16059. static createInstance() {
  16060. return (fgui.UIPackage.createObject("game", "Component111"));
  16061. }
  16062. onConstruct() {
  16063. this.n68 = (this.getChild("n68"));
  16064. this.myMask = (this.getChild("myMask"));
  16065. }
  16066. }
  16067. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  16068. class ui_Component144 extends fgui.GButton {
  16069. static createInstance() {
  16070. return (fgui.UIPackage.createObject("game", "Component144"));
  16071. }
  16072. onConstruct() {
  16073. this.n8 = (this.getChild("n8"));
  16074. }
  16075. }
  16076. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  16077. class ui_Sign_com2 extends fgui.GComponent {
  16078. static createInstance() {
  16079. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  16080. }
  16081. onConstruct() {
  16082. this.n0 = (this.getChild("n0"));
  16083. this.n1 = (this.getChild("n1"));
  16084. this.t0 = this.getTransition("t0");
  16085. }
  16086. }
  16087. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  16088. class ui_Sign_guang extends fgui.GComponent {
  16089. static createInstance() {
  16090. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  16091. }
  16092. onConstruct() {
  16093. this.n1 = (this.getChild("n1"));
  16094. this.n2 = (this.getChild("n2"));
  16095. this.n3 = (this.getChild("n3"));
  16096. this.n4 = (this.getChild("n4"));
  16097. this.n5 = (this.getChild("n5"));
  16098. this.n6 = (this.getChild("n6"));
  16099. this.n8 = (this.getChild("n8"));
  16100. }
  16101. }
  16102. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  16103. class ui_SignMax extends fgui.GComponent {
  16104. static createInstance() {
  16105. return (fgui.UIPackage.createObject("game", "SignMax"));
  16106. }
  16107. onConstruct() {
  16108. this.c1 = this.getController("c1");
  16109. this.n7 = (this.getChild("n7"));
  16110. this.n15 = (this.getChild("n15"));
  16111. this.n8 = (this.getChild("n8"));
  16112. this.titleTxt = (this.getChild("titleTxt"));
  16113. this.myIcon1 = (this.getChild("myIcon1"));
  16114. this.numTxt1 = (this.getChild("numTxt1"));
  16115. this.myIcon2 = (this.getChild("myIcon2"));
  16116. this.n20 = (this.getChild("n20"));
  16117. this.n17 = (this.getChild("n17"));
  16118. this.numTxt2 = (this.getChild("numTxt2"));
  16119. this.n12 = (this.getChild("n12"));
  16120. this.n13 = (this.getChild("n13"));
  16121. this.n21 = (this.getChild("n21"));
  16122. this.n14 = (this.getChild("n14"));
  16123. }
  16124. }
  16125. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  16126. class ui_Sign_com2_1 extends fgui.GComponent {
  16127. static createInstance() {
  16128. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  16129. }
  16130. onConstruct() {
  16131. this.n0 = (this.getChild("n0"));
  16132. this.n1 = (this.getChild("n1"));
  16133. this.t0 = this.getTransition("t0");
  16134. }
  16135. }
  16136. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  16137. class ui_Sign_com5 extends fgui.GComponent {
  16138. static createInstance() {
  16139. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  16140. }
  16141. onConstruct() {
  16142. this.n3 = (this.getChild("n3"));
  16143. this.n29 = (this.getChild("n29"));
  16144. this.n4 = (this.getChild("n4"));
  16145. this.day1 = (this.getChild("day1"));
  16146. this.day2 = (this.getChild("day2"));
  16147. this.day3 = (this.getChild("day3"));
  16148. this.day4 = (this.getChild("day4"));
  16149. this.day5 = (this.getChild("day5"));
  16150. this.day6 = (this.getChild("day6"));
  16151. this.day7 = (this.getChild("day7"));
  16152. this.t0 = this.getTransition("t0");
  16153. }
  16154. }
  16155. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  16156. class ui_Sign_com8 extends fgui.GComponent {
  16157. static createInstance() {
  16158. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  16159. }
  16160. onConstruct() {
  16161. this.n48 = (this.getChild("n48"));
  16162. this.womanTxt = (this.getChild("womanTxt"));
  16163. this.t0 = this.getTransition("t0");
  16164. }
  16165. }
  16166. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  16167. class ui_Sign_com6 extends fgui.GComponent {
  16168. static createInstance() {
  16169. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  16170. }
  16171. onConstruct() {
  16172. this.n2 = (this.getChild("n2"));
  16173. this.n3 = (this.getChild("n3"));
  16174. this.t0 = this.getTransition("t0");
  16175. }
  16176. }
  16177. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  16178. class ui_Sign_com7 extends fgui.GComponent {
  16179. static createInstance() {
  16180. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16181. }
  16182. onConstruct() {
  16183. this.n29 = (this.getChild("n29"));
  16184. this.n2 = (this.getChild("n2"));
  16185. }
  16186. }
  16187. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16188. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16189. static createInstance() {
  16190. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16191. }
  16192. onConstruct() {
  16193. this.n5 = (this.getChild("n5"));
  16194. this.n4 = (this.getChild("n4"));
  16195. this.t0 = this.getTransition("t0");
  16196. }
  16197. }
  16198. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16199. class ui_UITurntable_com2 extends fgui.GComponent {
  16200. static createInstance() {
  16201. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16202. }
  16203. onConstruct() {
  16204. this.c1 = this.getController("c1");
  16205. this.n4 = (this.getChild("n4"));
  16206. this.n6 = (this.getChild("n6"));
  16207. this.n10 = (this.getChild("n10"));
  16208. this.n11 = (this.getChild("n11"));
  16209. this.n12 = (this.getChild("n12"));
  16210. this.n13 = (this.getChild("n13"));
  16211. this.n14 = (this.getChild("n14"));
  16212. this.n15 = (this.getChild("n15"));
  16213. this.n16 = (this.getChild("n16"));
  16214. this.n17 = (this.getChild("n17"));
  16215. this.n18 = (this.getChild("n18"));
  16216. this.n19 = (this.getChild("n19"));
  16217. this.n20 = (this.getChild("n20"));
  16218. this.n21 = (this.getChild("n21"));
  16219. this.n22 = (this.getChild("n22"));
  16220. this.n23 = (this.getChild("n23"));
  16221. this.n24 = (this.getChild("n24"));
  16222. this.n25 = (this.getChild("n25"));
  16223. this.n26 = (this.getChild("n26"));
  16224. this.n27 = (this.getChild("n27"));
  16225. this.n28 = (this.getChild("n28"));
  16226. this.n29 = (this.getChild("n29"));
  16227. this.n30 = (this.getChild("n30"));
  16228. this.n31 = (this.getChild("n31"));
  16229. this.n32 = (this.getChild("n32"));
  16230. this.n33 = (this.getChild("n33"));
  16231. }
  16232. }
  16233. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16234. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16235. static createInstance() {
  16236. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16237. }
  16238. onConstruct() {
  16239. this.n5 = (this.getChild("n5"));
  16240. this.n4 = (this.getChild("n4"));
  16241. this.t0 = this.getTransition("t0");
  16242. }
  16243. }
  16244. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16245. class ui_UITurntable_com5 extends fgui.GComponent {
  16246. static createInstance() {
  16247. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16248. }
  16249. onConstruct() {
  16250. this.flashNode = (this.getChild("flashNode"));
  16251. this.rotNode = (this.getChild("rotNode"));
  16252. this.n3 = (this.getChild("n3"));
  16253. this.n21 = (this.getChild("n21"));
  16254. this.t0 = this.getTransition("t0");
  16255. }
  16256. }
  16257. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16258. class ui_UITurntable_com7 extends fgui.GComponent {
  16259. static createInstance() {
  16260. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16261. }
  16262. onConstruct() {
  16263. this.n2 = (this.getChild("n2"));
  16264. this.n35 = (this.getChild("n35"));
  16265. this.img1 = (this.getChild("img1"));
  16266. this.img2 = (this.getChild("img2"));
  16267. this.img3 = (this.getChild("img3"));
  16268. this.img4 = (this.getChild("img4"));
  16269. this.img6 = (this.getChild("img6"));
  16270. this.img5 = (this.getChild("img5"));
  16271. this.txt1 = (this.getChild("txt1"));
  16272. this.txt2 = (this.getChild("txt2"));
  16273. this.txt3 = (this.getChild("txt3"));
  16274. this.txt4 = (this.getChild("txt4"));
  16275. this.txt5 = (this.getChild("txt5"));
  16276. this.txt6 = (this.getChild("txt6"));
  16277. }
  16278. }
  16279. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16280. class ui_UITurntable_com9 extends fgui.GComponent {
  16281. static createInstance() {
  16282. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16283. }
  16284. onConstruct() {
  16285. this.n38 = (this.getChild("n38"));
  16286. this.n39 = (this.getChild("n39"));
  16287. }
  16288. }
  16289. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16290. class ui_UITurntable_com10 extends fgui.GComponent {
  16291. static createInstance() {
  16292. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16293. }
  16294. onConstruct() {
  16295. this.n39 = (this.getChild("n39"));
  16296. this.n40 = (this.getChild("n40"));
  16297. this.t0 = this.getTransition("t0");
  16298. }
  16299. }
  16300. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16301. class ui_UITurntable_com11 extends fgui.GComponent {
  16302. static createInstance() {
  16303. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16304. }
  16305. onConstruct() {
  16306. this.n38 = (this.getChild("n38"));
  16307. this.n39 = (this.getChild("n39"));
  16308. this.n40 = (this.getChild("n40"));
  16309. this.t0 = this.getTransition("t0");
  16310. }
  16311. }
  16312. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16313. class ui_UITurntable_com12 extends fgui.GComponent {
  16314. static createInstance() {
  16315. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16316. }
  16317. onConstruct() {
  16318. this.n43 = (this.getChild("n43"));
  16319. this.barNode = (this.getChild("barNode"));
  16320. this.tipsTxt = (this.getChild("tipsTxt"));
  16321. this.n45 = (this.getChild("n45"));
  16322. this.boxBtn = (this.getChild("boxBtn"));
  16323. }
  16324. }
  16325. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16326. class ui_UITurntable_com1 extends fgui.GButton {
  16327. static createInstance() {
  16328. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16329. }
  16330. onConstruct() {
  16331. this.n41 = (this.getChild("n41"));
  16332. this.n42 = (this.getChild("n42"));
  16333. this.t0 = this.getTransition("t0");
  16334. }
  16335. }
  16336. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16337. class ui_UITurntable_com3 extends fgui.GComponent {
  16338. static createInstance() {
  16339. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16340. }
  16341. onConstruct() {
  16342. this.n48 = (this.getChild("n48"));
  16343. this.womanTxt = (this.getChild("womanTxt"));
  16344. this.t0 = this.getTransition("t0");
  16345. }
  16346. }
  16347. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16348. class ui_cancelBtn2 extends fgui.GButton {
  16349. static createInstance() {
  16350. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16351. }
  16352. onConstruct() {
  16353. this.c1 = this.getController("c1");
  16354. this.n0 = (this.getChild("n0"));
  16355. this.n1 = (this.getChild("n1"));
  16356. this.n2 = (this.getChild("n2"));
  16357. this.n3 = (this.getChild("n3"));
  16358. this.n4 = (this.getChild("n4"));
  16359. this.n5 = (this.getChild("n5"));
  16360. this.n6 = (this.getChild("n6"));
  16361. this.n7 = (this.getChild("n7"));
  16362. this.n8 = (this.getChild("n8"));
  16363. this.powerEft = (this.getChild("powerEft"));
  16364. }
  16365. }
  16366. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16367. class ui_shareBtn2 extends fgui.GButton {
  16368. static createInstance() {
  16369. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16370. }
  16371. onConstruct() {
  16372. this.c1 = this.getController("c1");
  16373. this.n2 = (this.getChild("n2"));
  16374. this.n24 = (this.getChild("n24"));
  16375. this.n1 = (this.getChild("n1"));
  16376. this.n3 = (this.getChild("n3"));
  16377. this.n23 = (this.getChild("n23"));
  16378. this.n4 = (this.getChild("n4"));
  16379. this.n5 = (this.getChild("n5"));
  16380. this.n6 = (this.getChild("n6"));
  16381. this.n20 = (this.getChild("n20"));
  16382. this.n21 = (this.getChild("n21"));
  16383. this.n22 = (this.getChild("n22"));
  16384. this.powerEft = (this.getChild("powerEft"));
  16385. }
  16386. }
  16387. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16388. class ui_UIMoney extends fgui.GComponent {
  16389. static createInstance() {
  16390. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16391. }
  16392. onConstruct() {
  16393. this.c1 = this.getController("c1");
  16394. this.n4 = (this.getChild("n4"));
  16395. this.coinImg = (this.getChild("coinImg"));
  16396. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16397. this.coinTxt = (this.getChild("coinTxt"));
  16398. this.n7 = (this.getChild("n7"));
  16399. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16400. this.diamondTxt = (this.getChild("diamondTxt"));
  16401. this.diamondImg = (this.getChild("diamondImg"));
  16402. this.n12 = (this.getChild("n12"));
  16403. this.powerImg = (this.getChild("powerImg"));
  16404. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16405. this.powerTxt = (this.getChild("powerTxt"));
  16406. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16407. }
  16408. }
  16409. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16410. class ui_backBtn extends fgui.GButton {
  16411. static createInstance() {
  16412. return (fgui.UIPackage.createObject("game", "backBtn"));
  16413. }
  16414. onConstruct() {
  16415. this.n0 = (this.getChild("n0"));
  16416. this.t0 = this.getTransition("t0");
  16417. this.t1 = this.getTransition("t1");
  16418. }
  16419. }
  16420. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16421. class ui_MoneyBtn extends fgui.GButton {
  16422. static createInstance() {
  16423. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16424. }
  16425. onConstruct() {
  16426. this.button = this.getController("button");
  16427. this.n0 = (this.getChild("n0"));
  16428. }
  16429. }
  16430. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16431. class ui_UIMoneyBtn extends fgui.GComponent {
  16432. static createInstance() {
  16433. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16434. }
  16435. onConstruct() {
  16436. this.n1 = (this.getChild("n1"));
  16437. this.closeBtn = (this.getChild("closeBtn"));
  16438. }
  16439. }
  16440. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16441. class ui_Component64 extends fgui.GComponent {
  16442. static createInstance() {
  16443. return (fgui.UIPackage.createObject("game", "Component64"));
  16444. }
  16445. onConstruct() {
  16446. this.n57 = (this.getChild("n57"));
  16447. this.n54 = (this.getChild("n54"));
  16448. this.n55 = (this.getChild("n55"));
  16449. this.n56 = (this.getChild("n56"));
  16450. this.t1 = this.getTransition("t1");
  16451. }
  16452. }
  16453. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16454. class ui_Component41_3 extends fgui.GComponent {
  16455. static createInstance() {
  16456. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16457. }
  16458. onConstruct() {
  16459. this.c1 = this.getController("c1");
  16460. this.n0 = (this.getChild("n0"));
  16461. this.n2 = (this.getChild("n2"));
  16462. this.cancelBtn = (this.getChild("cancelBtn"));
  16463. this.videoBtn = (this.getChild("videoBtn"));
  16464. this.n9 = (this.getChild("n9"));
  16465. this.n24 = (this.getChild("n24"));
  16466. this.n27 = (this.getChild("n27"));
  16467. this.titleTxt = (this.getChild("titleTxt"));
  16468. this.n28 = (this.getChild("n28"));
  16469. this.t0 = this.getTransition("t0");
  16470. }
  16471. }
  16472. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16473. class ui_dh_zs_4 extends fgui.GComponent {
  16474. static createInstance() {
  16475. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16476. }
  16477. onConstruct() {
  16478. this.n1 = (this.getChild("n1"));
  16479. this.n2 = (this.getChild("n2"));
  16480. this.n3 = (this.getChild("n3"));
  16481. this.n4 = (this.getChild("n4"));
  16482. this.n5 = (this.getChild("n5"));
  16483. this.n6 = (this.getChild("n6"));
  16484. this.n8 = (this.getChild("n8"));
  16485. this.t0 = this.getTransition("t0");
  16486. }
  16487. }
  16488. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16489. class ui_Component71_1 extends fgui.GButton {
  16490. static createInstance() {
  16491. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16492. }
  16493. onConstruct() {
  16494. this.n17 = (this.getChild("n17"));
  16495. this.t0 = this.getTransition("t0");
  16496. }
  16497. }
  16498. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16499. class ui_Component83 extends fgui.GComponent {
  16500. static createInstance() {
  16501. return (fgui.UIPackage.createObject("game", "Component83"));
  16502. }
  16503. onConstruct() {
  16504. this.c1 = this.getController("c1");
  16505. this.n17 = (this.getChild("n17"));
  16506. this.n19 = (this.getChild("n19"));
  16507. this.n20 = (this.getChild("n20"));
  16508. }
  16509. }
  16510. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16511. class ui_Component84 extends fgui.GComponent {
  16512. static createInstance() {
  16513. return (fgui.UIPackage.createObject("game", "Component84"));
  16514. }
  16515. onConstruct() {
  16516. this.c1 = this.getController("c1");
  16517. this.n4 = (this.getChild("n4"));
  16518. this.n22 = (this.getChild("n22"));
  16519. this.n23 = (this.getChild("n23"));
  16520. this.numTxt = (this.getChild("numTxt"));
  16521. this.n25 = (this.getChild("n25"));
  16522. this.n26 = (this.getChild("n26"));
  16523. }
  16524. }
  16525. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16526. class ui_Component84_1 extends fgui.GComponent {
  16527. static createInstance() {
  16528. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16529. }
  16530. onConstruct() {
  16531. this.c1 = this.getController("c1");
  16532. this.n4 = (this.getChild("n4"));
  16533. this.n22 = (this.getChild("n22"));
  16534. this.n23 = (this.getChild("n23"));
  16535. this.numTxt = (this.getChild("numTxt"));
  16536. this.n25 = (this.getChild("n25"));
  16537. this.n26 = (this.getChild("n26"));
  16538. }
  16539. }
  16540. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16541. class ui_Component85 extends fgui.GComponent {
  16542. static createInstance() {
  16543. return (fgui.UIPackage.createObject("game", "Component85"));
  16544. }
  16545. onConstruct() {
  16546. this.n1 = (this.getChild("n1"));
  16547. this.n6 = (this.getChild("n6"));
  16548. this.n2 = (this.getChild("n2"));
  16549. this.n3 = (this.getChild("n3"));
  16550. this.levelTxt = (this.getChild("levelTxt"));
  16551. this.n10 = (this.getChild("n10"));
  16552. this.n11 = (this.getChild("n11"));
  16553. this.n12 = (this.getChild("n12"));
  16554. this.n13 = (this.getChild("n13"));
  16555. this.n14 = (this.getChild("n14"));
  16556. this.modeNode = (this.getChild("modeNode"));
  16557. this.n18 = (this.getChild("n18"));
  16558. this.conditionTxt = (this.getChild("conditionTxt"));
  16559. this.diamondNode = (this.getChild("diamondNode"));
  16560. this.coinNode = (this.getChild("coinNode"));
  16561. this.startBtn = (this.getChild("startBtn"));
  16562. this.n28 = (this.getChild("n28"));
  16563. this.displayRoot = (this.getChild("displayRoot"));
  16564. this.n32 = (this.getChild("n32"));
  16565. this.n33 = (this.getChild("n33"));
  16566. this.n_yd_zzq_btn3 = (this.getChild("n_yd_zzq_btn3"));
  16567. this.n_yd_lxms_3 = (this.getChild("n_yd_lxms_3"));
  16568. this.t0 = this.getTransition("t0");
  16569. }
  16570. }
  16571. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16572. class ui_Component86 extends fgui.GButton {
  16573. static createInstance() {
  16574. return (fgui.UIPackage.createObject("game", "Component86"));
  16575. }
  16576. onConstruct() {
  16577. this.n15 = (this.getChild("n15"));
  16578. this.t0 = this.getTransition("t0");
  16579. }
  16580. }
  16581. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16582. class ui_Component87 extends fgui.GComponent {
  16583. static createInstance() {
  16584. return (fgui.UIPackage.createObject("game", "Component87"));
  16585. }
  16586. onConstruct() {
  16587. this.n66 = (this.getChild("n66"));
  16588. this.myProgress = (this.getChild("myProgress"));
  16589. this.starAni = (this.getChild("starAni"));
  16590. this.hpTxt = (this.getChild("hpTxt"));
  16591. this.n74 = (this.getChild("n74"));
  16592. this.n73 = (this.getChild("n73"));
  16593. this.ballTxt = (this.getChild("ballTxt"));
  16594. this.n76 = (this.getChild("n76"));
  16595. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16596. this.levelTxt = (this.getChild("levelTxt"));
  16597. this.star1 = (this.getChild("star1"));
  16598. this.star2 = (this.getChild("star2"));
  16599. this.star3 = (this.getChild("star3"));
  16600. }
  16601. }
  16602. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16603. class ui_Component88 extends fgui.GProgressBar {
  16604. static createInstance() {
  16605. return (fgui.UIPackage.createObject("game", "Component88"));
  16606. }
  16607. onConstruct() {
  16608. this.n68 = (this.getChild("n68"));
  16609. this.bar = (this.getChild("bar"));
  16610. }
  16611. }
  16612. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16613. class ui_Component89 extends fgui.GComponent {
  16614. static createInstance() {
  16615. return (fgui.UIPackage.createObject("game", "Component89"));
  16616. }
  16617. onConstruct() {
  16618. this.c1 = this.getController("c1");
  16619. this.n71 = (this.getChild("n71"));
  16620. this.n72 = (this.getChild("n72"));
  16621. }
  16622. }
  16623. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16624. class ui_Component90 extends fgui.GComponent {
  16625. static createInstance() {
  16626. return (fgui.UIPackage.createObject("game", "Component90"));
  16627. }
  16628. onConstruct() {
  16629. this.c1 = this.getController("c1");
  16630. this.n64 = (this.getChild("n64"));
  16631. this.n65 = (this.getChild("n65"));
  16632. this.n66 = (this.getChild("n66"));
  16633. this.t0 = this.getTransition("t0");
  16634. }
  16635. }
  16636. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16637. class ui_Component127 extends fgui.GButton {
  16638. static createInstance() {
  16639. return (fgui.UIPackage.createObject("game", "Component127"));
  16640. }
  16641. onConstruct() {
  16642. this.n5 = (this.getChild("n5"));
  16643. }
  16644. }
  16645. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16646. class gameBinder {
  16647. static bindAll() {
  16648. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16649. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16650. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16651. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16652. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16653. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16654. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16655. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16656. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16657. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16658. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16659. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16660. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16661. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16662. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16663. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16664. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16665. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16666. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16667. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16668. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16669. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16670. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16671. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16672. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16673. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16674. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16675. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16676. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16677. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16678. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16679. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16680. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16681. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16682. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16683. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16684. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16685. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16686. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16687. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16688. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16689. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16690. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16691. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16692. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16693. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16694. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16695. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16696. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16697. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16698. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16699. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16700. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16701. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16702. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16703. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16704. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16705. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16706. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16707. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16708. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16709. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16710. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16711. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16712. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16713. fgui.UIObjectFactory.setExtension(ui_Component_lc2.URL, ui_Component_lc2);
  16714. fgui.UIObjectFactory.setExtension(ui_Component_shou2.URL, ui_Component_shou2);
  16715. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16716. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16717. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16718. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16719. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16720. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16721. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16722. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16723. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16724. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16725. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16726. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16727. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16728. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16729. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16730. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16731. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16732. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16733. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16734. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16735. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16736. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16737. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16738. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16739. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16740. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16741. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16742. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16743. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16744. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16745. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16746. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16747. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16748. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16749. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16750. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16751. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16752. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16753. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16754. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16755. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16756. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16757. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16758. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16759. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16760. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16761. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16762. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16763. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16764. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16765. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16766. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16767. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16768. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16769. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16770. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16771. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16772. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16773. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16774. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16775. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16776. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16777. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16778. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16779. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16780. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16781. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16782. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16783. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16784. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16785. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16786. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16787. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16788. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16789. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16790. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16791. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16792. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16793. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16794. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16795. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16796. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16797. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16798. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16799. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16800. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16801. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16802. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16803. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16804. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16805. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16806. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16807. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16808. fgui.UIObjectFactory.setExtension(ui_Component_lc3.URL, ui_Component_lc3);
  16809. fgui.UIObjectFactory.setExtension(ui_Component_shou3.URL, ui_Component_shou3);
  16810. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16811. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16812. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16813. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16814. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16815. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16816. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16817. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16818. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16819. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16820. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16821. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16822. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16823. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16824. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16825. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16826. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16827. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16828. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16829. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16830. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16831. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16832. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16833. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16834. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16835. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16836. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16837. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16838. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16839. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16840. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16841. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16842. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16843. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16844. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16845. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16846. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16847. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16848. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16849. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16850. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16851. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16852. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16853. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16854. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16855. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16856. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16857. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16858. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16859. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16860. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16861. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16862. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16863. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16864. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16865. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16866. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16867. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16868. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16869. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16870. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16871. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16872. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16873. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16874. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16875. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16876. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16877. fgui.UIObjectFactory.setExtension(ui_Component_yd1.URL, ui_Component_yd1);
  16878. fgui.UIObjectFactory.setExtension(ui_Component_yd2.URL, ui_Component_yd2);
  16879. fgui.UIObjectFactory.setExtension(ui_Component_yd3.URL, ui_Component_yd3);
  16880. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16881. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16882. fgui.UIObjectFactory.setExtension(ui_Component_lc_challenge1.URL, ui_Component_lc_challenge1);
  16883. fgui.UIObjectFactory.setExtension(ui_Component_shou.URL, ui_Component_shou);
  16884. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16885. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16886. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16887. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16888. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16889. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16890. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16891. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16892. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16893. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16894. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16895. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16896. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16897. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16898. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16899. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16900. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16901. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16902. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16903. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16904. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16905. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16906. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16907. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16908. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16909. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16910. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16911. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16912. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16913. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16914. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16915. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16916. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16917. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16918. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16919. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16920. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16921. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16922. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16923. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16924. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16925. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16926. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16927. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16928. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16929. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16930. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16931. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16932. }
  16933. }
  16934. class ui_btn6 extends fgui.GButton {
  16935. static createInstance() {
  16936. return (fgui.UIPackage.createObject("loading", "btn6"));
  16937. }
  16938. onConstruct() {
  16939. this.n6 = (this.getChild("n6"));
  16940. this.n1 = (this.getChild("n1"));
  16941. }
  16942. }
  16943. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16944. class ui_xyItem extends fgui.GComponent {
  16945. static createInstance() {
  16946. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16947. }
  16948. onConstruct() {
  16949. this.xyItem = (this.getChild("xyItem"));
  16950. }
  16951. }
  16952. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16953. class ui_loadinfo extends fgui.GProgressBar {
  16954. static createInstance() {
  16955. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16956. }
  16957. onConstruct() {
  16958. this.bg = (this.getChild("bg"));
  16959. this.bar = (this.getChild("bar"));
  16960. this.title = (this.getChild("title"));
  16961. this.ani = (this.getChild("ani"));
  16962. }
  16963. }
  16964. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16965. class ui_xyNode extends fgui.GComponent {
  16966. static createInstance() {
  16967. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16968. }
  16969. onConstruct() {
  16970. this.n0 = (this.getChild("n0"));
  16971. this.btnYes = (this.getChild("btnYes"));
  16972. this.btnNo = (this.getChild("btnNo"));
  16973. this.btnKnown = (this.getChild("btnKnown"));
  16974. this.btnSure = (this.getChild("btnSure"));
  16975. this.txtWelcom = (this.getChild("txtWelcom"));
  16976. this.txtXy = (this.getChild("txtXy"));
  16977. this.n75 = (this.getChild("n75"));
  16978. this.btnXy1 = (this.getChild("btnXy1"));
  16979. this.btnXy3 = (this.getChild("btnXy3"));
  16980. this.btnXy2 = (this.getChild("btnXy2"));
  16981. this.n74 = (this.getChild("n74"));
  16982. this.xy1 = (this.getChild("xy1"));
  16983. this.txtTitle = (this.getChild("txtTitle"));
  16984. this.btnBack = (this.getChild("btnBack"));
  16985. this.xyList = (this.getChild("xyList"));
  16986. this.xy2 = (this.getChild("xy2"));
  16987. this.xyNode = (this.getChild("xyNode"));
  16988. }
  16989. }
  16990. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16991. class ui_ageNode extends fgui.GComponent {
  16992. static createInstance() {
  16993. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16994. }
  16995. onConstruct() {
  16996. this.n3 = (this.getChild("n3"));
  16997. this.n7 = (this.getChild("n7"));
  16998. this.n4 = (this.getChild("n4"));
  16999. this.btnAge = (this.getChild("btnAge"));
  17000. this.ageNode = (this.getChild("ageNode"));
  17001. }
  17002. }
  17003. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  17004. class ui_rnNode extends fgui.GComponent {
  17005. static createInstance() {
  17006. return (fgui.UIPackage.createObject("loading", "rnNode"));
  17007. }
  17008. onConstruct() {
  17009. this.n28 = (this.getChild("n28"));
  17010. this.n30 = (this.getChild("n30"));
  17011. this.n33 = (this.getChild("n33"));
  17012. this.rn1 = (this.getChild("rn1"));
  17013. this.n40 = (this.getChild("n40"));
  17014. this.n41 = (this.getChild("n41"));
  17015. this.rn3 = (this.getChild("rn3"));
  17016. this.n37 = (this.getChild("n37"));
  17017. this.n39 = (this.getChild("n39"));
  17018. this.rn2 = (this.getChild("rn2"));
  17019. this.n47 = (this.getChild("n47"));
  17020. this.n49 = (this.getChild("n49"));
  17021. this.n44 = (this.getChild("n44"));
  17022. this.inputCode = (this.getChild("inputCode"));
  17023. this.inputName = (this.getChild("inputName"));
  17024. this.n48 = (this.getChild("n48"));
  17025. this.n50 = (this.getChild("n50"));
  17026. this.rn4 = (this.getChild("rn4"));
  17027. this.btnCheck = (this.getChild("btnCheck"));
  17028. this.btnExit = (this.getChild("btnExit"));
  17029. this.btnDone = (this.getChild("btnDone"));
  17030. this.rnNode = (this.getChild("rnNode"));
  17031. }
  17032. }
  17033. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  17034. class ui_tipNode extends fgui.GComponent {
  17035. static createInstance() {
  17036. return (fgui.UIPackage.createObject("loading", "tipNode"));
  17037. }
  17038. onConstruct() {
  17039. this.bg = (this.getChild("bg"));
  17040. this.n55 = (this.getChild("n55"));
  17041. this.n56 = (this.getChild("n56"));
  17042. this.tipNode = (this.getChild("tipNode"));
  17043. }
  17044. }
  17045. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  17046. class ui_fcmNode extends fgui.GComponent {
  17047. static createInstance() {
  17048. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  17049. }
  17050. onConstruct() {
  17051. this.n63 = (this.getChild("n63"));
  17052. this.n62 = (this.getChild("n62"));
  17053. this.btnRn = (this.getChild("btnRn"));
  17054. this.n61 = (this.getChild("n61"));
  17055. this.n58 = (this.getChild("n58"));
  17056. this.fcmNode = (this.getChild("fcmNode"));
  17057. }
  17058. }
  17059. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  17060. class ui_msgNode extends fgui.GComponent {
  17061. static createInstance() {
  17062. return (fgui.UIPackage.createObject("loading", "msgNode"));
  17063. }
  17064. onConstruct() {
  17065. this.n69 = (this.getChild("n69"));
  17066. this.txtMsg = (this.getChild("txtMsg"));
  17067. this.msgNode = (this.getChild("msgNode"));
  17068. }
  17069. }
  17070. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  17071. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  17072. static createInstance() {
  17073. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  17074. }
  17075. onConstruct() {
  17076. this.n1 = (this.getChild("n1"));
  17077. this.n13 = (this.getChild("n13"));
  17078. this.n14 = (this.getChild("n14"));
  17079. this.n15 = (this.getChild("n15"));
  17080. this.n3 = (this.getChild("n3"));
  17081. this.n4 = (this.getChild("n4"));
  17082. this.n5 = (this.getChild("n5"));
  17083. this.n6 = (this.getChild("n6"));
  17084. this.n7 = (this.getChild("n7"));
  17085. this.n8 = (this.getChild("n8"));
  17086. this.n9 = (this.getChild("n9"));
  17087. this.n10 = (this.getChild("n10"));
  17088. this.n12 = (this.getChild("n12"));
  17089. this.n11 = (this.getChild("n11"));
  17090. this.n16 = (this.getChild("n16"));
  17091. this.n17 = (this.getChild("n17"));
  17092. this.n18 = (this.getChild("n18"));
  17093. this.n20 = (this.getChild("n20"));
  17094. this.n21 = (this.getChild("n21"));
  17095. this.t0 = this.getTransition("t0");
  17096. }
  17097. }
  17098. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  17099. class ui_btn5 extends fgui.GButton {
  17100. static createInstance() {
  17101. return (fgui.UIPackage.createObject("loading", "btn5"));
  17102. }
  17103. onConstruct() {
  17104. this.n9 = (this.getChild("n9"));
  17105. this.n1 = (this.getChild("n1"));
  17106. }
  17107. }
  17108. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  17109. class ui_UILoading extends fgui.GComponent {
  17110. static createInstance() {
  17111. return (fgui.UIPackage.createObject("loading", "UILoading"));
  17112. }
  17113. onConstruct() {
  17114. this.n12 = (this.getChild("n12"));
  17115. this.loadinfo = (this.getChild("loadinfo"));
  17116. this.n13 = (this.getChild("n13"));
  17117. this.txtLoad = (this.getChild("txtLoad"));
  17118. this.n18 = (this.getChild("n18"));
  17119. }
  17120. }
  17121. ui_UILoading.URL = "ui://37nctnhwphc33";
  17122. class ui_AgeItem extends fgui.GComponent {
  17123. static createInstance() {
  17124. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  17125. }
  17126. onConstruct() {
  17127. this.txtAge = (this.getChild("txtAge"));
  17128. }
  17129. }
  17130. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  17131. class ui_btn1 extends fgui.GButton {
  17132. static createInstance() {
  17133. return (fgui.UIPackage.createObject("loading", "btn1"));
  17134. }
  17135. onConstruct() {
  17136. this.n6 = (this.getChild("n6"));
  17137. this.n1 = (this.getChild("n1"));
  17138. }
  17139. }
  17140. ui_btn1.URL = "ui://37nctnhwxe622p";
  17141. class ui_btn3 extends fgui.GButton {
  17142. static createInstance() {
  17143. return (fgui.UIPackage.createObject("loading", "btn3"));
  17144. }
  17145. onConstruct() {
  17146. this.n9 = (this.getChild("n9"));
  17147. this.n1 = (this.getChild("n1"));
  17148. }
  17149. }
  17150. ui_btn3.URL = "ui://37nctnhwxe622s";
  17151. class ui_btn2 extends fgui.GButton {
  17152. static createInstance() {
  17153. return (fgui.UIPackage.createObject("loading", "btn2"));
  17154. }
  17155. onConstruct() {
  17156. this.n6 = (this.getChild("n6"));
  17157. this.n1 = (this.getChild("n1"));
  17158. }
  17159. }
  17160. ui_btn2.URL = "ui://37nctnhwxe622t";
  17161. class ui_btnBack extends fgui.GButton {
  17162. static createInstance() {
  17163. return (fgui.UIPackage.createObject("loading", "btnBack"));
  17164. }
  17165. onConstruct() {
  17166. this.n6 = (this.getChild("n6"));
  17167. this.n7 = (this.getChild("n7"));
  17168. }
  17169. }
  17170. ui_btnBack.URL = "ui://37nctnhwxe622u";
  17171. class ui_btnXy1 extends fgui.GButton {
  17172. static createInstance() {
  17173. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  17174. }
  17175. onConstruct() {
  17176. this.n1 = (this.getChild("n1"));
  17177. }
  17178. }
  17179. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  17180. class ui_btnXy2 extends fgui.GButton {
  17181. static createInstance() {
  17182. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  17183. }
  17184. onConstruct() {
  17185. this.n1 = (this.getChild("n1"));
  17186. }
  17187. }
  17188. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17189. class ui_btnXy3 extends fgui.GButton {
  17190. static createInstance() {
  17191. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17192. }
  17193. onConstruct() {
  17194. this.n1 = (this.getChild("n1"));
  17195. }
  17196. }
  17197. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17198. class ui_btn4 extends fgui.GButton {
  17199. static createInstance() {
  17200. return (fgui.UIPackage.createObject("loading", "btn4"));
  17201. }
  17202. onConstruct() {
  17203. this.n9 = (this.getChild("n9"));
  17204. this.n1 = (this.getChild("n1"));
  17205. }
  17206. }
  17207. ui_btn4.URL = "ui://37nctnhwxe622z";
  17208. class loadingBinder {
  17209. static bindAll() {
  17210. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17211. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17212. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17213. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17214. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17215. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17216. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17217. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17218. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17219. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17220. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17221. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17222. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17223. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17224. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17225. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17226. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17227. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17228. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17229. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17230. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17231. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17232. }
  17233. }
  17234. class UIMgr {
  17235. constructor() {
  17236. this._stage = null;
  17237. this._uiList = [];
  17238. this._showList = [];
  17239. this._bindPkgList = [];
  17240. this.uiIndex = 0;
  17241. }
  17242. static get inst() {
  17243. if (UIMgr._inst == null) {
  17244. UIMgr._inst = new UIMgr();
  17245. }
  17246. return UIMgr._inst;
  17247. }
  17248. setStage(s) {
  17249. if (this._stage) {
  17250. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17251. return;
  17252. }
  17253. this._stage = s;
  17254. }
  17255. clearTempData() {
  17256. console.log('zh:clearTempData start');
  17257. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17258. console.log('zh:clearTempData end');
  17259. }
  17260. init() {
  17261. this.setStage(Laya.stage);
  17262. fairygui.UIConfig.defaultFont = "arial";
  17263. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17264. fairygui.UIConfig.packageFileExtension = "obj";
  17265. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17266. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17267. fairygui.GRoot.inst.width = Laya.stage.width;
  17268. fairygui.GRoot.inst.height = Laya.stage.height;
  17269. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17270. }
  17271. addAllUpdate() {
  17272. this.uiIndex = 0;
  17273. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17274. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17275. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17276. }
  17277. }
  17278. }
  17279. bindFUI(pkgname) {
  17280. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17281. return;
  17282. }
  17283. switch (pkgname) {
  17284. case fguiRes.loading:
  17285. fairygui.UIPackage.addPackage(pkgname);
  17286. loadingBinder.bindAll();
  17287. this._bindPkgList.push(pkgname);
  17288. break;
  17289. case fguiRes.game:
  17290. fairygui.UIPackage.addPackage(pkgname);
  17291. gameBinder.bindAll();
  17292. this._bindPkgList.push(pkgname);
  17293. break;
  17294. default:
  17295. break;
  17296. }
  17297. }
  17298. Show(cls, ...param) {
  17299. let nameStr = cls.uiName;
  17300. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17301. let temp = this._uiList[i];
  17302. let str = temp.className;
  17303. if (str == nameStr) {
  17304. if (temp.isMuti) {
  17305. if (temp.isHide) {
  17306. temp.show(...param);
  17307. this._uiList.splice(i, 1);
  17308. this._uiList.push(temp);
  17309. return temp;
  17310. }
  17311. }
  17312. else {
  17313. temp.show(...param);
  17314. this._uiList.splice(i, 1);
  17315. this._uiList.push(temp);
  17316. return temp;
  17317. }
  17318. }
  17319. }
  17320. let ui = new cls();
  17321. ui.className = nameStr;
  17322. this._showUI(ui, param);
  17323. return ui;
  17324. }
  17325. destroyUI(ui) {
  17326. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17327. let temp = this._uiList[i].className;
  17328. if (temp == ui.className) {
  17329. this._uiList.splice(i, 1);
  17330. break;
  17331. }
  17332. }
  17333. this.checkUIState();
  17334. }
  17335. _showUI(ui, param) {
  17336. this._uiList.push(ui);
  17337. ui.show(...param);
  17338. }
  17339. Hide(uiClass) {
  17340. let ui = this.getUI(uiClass);
  17341. if (ui && !ui.isHide) {
  17342. ui.hide();
  17343. }
  17344. }
  17345. getUI(ui) {
  17346. let nameStr = ui.uiName;
  17347. for (let index = 0; index < this._uiList.length; index++) {
  17348. let temp = this._uiList[index];
  17349. if (temp.className == nameStr) {
  17350. return temp;
  17351. }
  17352. }
  17353. return null;
  17354. }
  17355. isShow(cls) {
  17356. for (var i of this._uiList) {
  17357. if (i instanceof cls) {
  17358. return i.isShowing;
  17359. }
  17360. }
  17361. return false;
  17362. }
  17363. showUINum() {
  17364. let num = 0;
  17365. for (var i of this._uiList) {
  17366. if (i.isShowing) {
  17367. num++;
  17368. }
  17369. }
  17370. return num;
  17371. }
  17372. checkUIState() {
  17373. Laya.timer.clear(this, this._uiCheck);
  17374. Laya.timer.once(400, this, this._uiCheck);
  17375. }
  17376. _uiCheck() {
  17377. let showList = [];
  17378. for (var i of this._uiList) {
  17379. if (!i.isHide) {
  17380. showList.push(i);
  17381. }
  17382. }
  17383. for (let index = 0; index < showList.length; index++) {
  17384. if (index == showList.length - 1) {
  17385. showList[index].checkActive(true);
  17386. }
  17387. else {
  17388. showList[index].checkActive(false);
  17389. }
  17390. }
  17391. }
  17392. showTip(msg, time = 600, size = 30) {
  17393. }
  17394. }
  17395. class UIShowList {
  17396. }
  17397. class SoundMgr {
  17398. constructor() {
  17399. this.soundMax = 4;
  17400. this.isLoad = false;
  17401. this.soundMap = {};
  17402. this.isSound = true;
  17403. this.openShake = true;
  17404. SoundMgr._instance = this;
  17405. }
  17406. static getInstance() {
  17407. if (!this._instance) {
  17408. this._instance = new SoundMgr();
  17409. }
  17410. return this._instance;
  17411. }
  17412. init() {
  17413. console.log('zh:sm init 1');
  17414. Laya.SoundManager.autoReleaseSound = true;
  17415. Laya.SoundManager.autoStopMusic = true;
  17416. Laya.SoundManager.musicVolume = 0.3;
  17417. Laya.SoundManager.soundVolume = 0.5;
  17418. this.musicPlayed = false;
  17419. this.audioUrl = "asset/sound/ogg/";
  17420. console.log('zh:sm init 2');
  17421. console.log('zh:dev type ');
  17422. if (Laya.Browser.onAndroid) {
  17423. console.log('zh:dev type android');
  17424. this.audioUrl = "asset/sound/ogg/";
  17425. this.isLoad = true;
  17426. }
  17427. else {
  17428. console.log('zh:dev type not android');
  17429. this.audioUrl = "asset/sound/mp3/";
  17430. this.isLoad = true;
  17431. }
  17432. }
  17433. onSetting(isS) {
  17434. this.isSound = isS;
  17435. this.mute(!this.isSound);
  17436. }
  17437. clearCount() {
  17438. for (var key in this.soundMap) {
  17439. delete this.soundMap[key];
  17440. }
  17441. }
  17442. playMusic(path, loop = 0) {
  17443. console.log('zh:playMusic 1 PATH=' + path);
  17444. this.musicPath = path;
  17445. if (!this.isLoad) {
  17446. return;
  17447. }
  17448. if (!path || path == "") {
  17449. return;
  17450. }
  17451. if (!this.isSound) {
  17452. return;
  17453. }
  17454. this.musicPlayed = true;
  17455. let url = this.getUrl(path);
  17456. if (!Laya.Browser.onAndroid) {
  17457. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17458. this.play(url, loop);
  17459. }));
  17460. }
  17461. else {
  17462. this.play(url, loop);
  17463. }
  17464. }
  17465. play(url, loop) {
  17466. Laya.SoundManager.playMusic(url, loop);
  17467. }
  17468. getUrl(path) {
  17469. let url = this.audioUrl + path;
  17470. if (Laya.Browser.onAndroid) {
  17471. url += ".ogg";
  17472. }
  17473. else {
  17474. url += ".mp3";
  17475. }
  17476. return url;
  17477. }
  17478. pauseMusic(pause) {
  17479. if (pause) {
  17480. this.mute(true);
  17481. }
  17482. else if (this.isSound)
  17483. this.mute(false);
  17484. }
  17485. stopMusic() {
  17486. Laya.SoundManager.stopMusic();
  17487. if (Moyu.isNeedPlatAudio) {
  17488. Moyu.stopMusic();
  17489. }
  17490. }
  17491. mute(mute) {
  17492. if (Moyu.isNeedPlatAudio) {
  17493. Moyu.pauseMusic(mute);
  17494. }
  17495. else {
  17496. Laya.SoundManager.musicMuted = mute;
  17497. if (!mute && !this.musicPlayed && this.musicPath) {
  17498. this.playMusic(this.musicPath);
  17499. }
  17500. }
  17501. }
  17502. stopSound(path) {
  17503. let url = this.getUrl(path);
  17504. Laya.SoundManager.stopSound(url);
  17505. }
  17506. playSound(path, loop = 1, soundMax = this.soundMax) {
  17507. if (!this.isLoad)
  17508. return;
  17509. if (!this.isSound)
  17510. return;
  17511. if (!path || path == "")
  17512. return;
  17513. let url = this.getUrl(path);
  17514. if (Moyu.isNeedPlatAudio) {
  17515. Moyu.playSound(path, loop == 0);
  17516. }
  17517. else {
  17518. let count = 1;
  17519. if (this.soundMap[path])
  17520. count = this.soundMap[path] + 1;
  17521. if (count > soundMax)
  17522. return;
  17523. this.soundMap[path] = count;
  17524. Laya.SoundManager.playSound(url, loop);
  17525. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17526. }
  17527. }
  17528. removePath(path) {
  17529. if (this.soundMap[path]) {
  17530. let count = this.soundMap[path];
  17531. count--;
  17532. if (count < 1)
  17533. delete this.soundMap[path];
  17534. else
  17535. this.soundMap[path] = count;
  17536. }
  17537. }
  17538. playBtnSound() {
  17539. this.playSound("btn");
  17540. }
  17541. playGetSound() {
  17542. }
  17543. playCloseUISound() {
  17544. }
  17545. }
  17546. SoundMgr._instance = null;
  17547. var Handler$1 = Laya.Handler;
  17548. var EResType;
  17549. (function (EResType) {
  17550. EResType[EResType["none"] = 0] = "none";
  17551. EResType[EResType["nromal"] = 1] = "nromal";
  17552. EResType[EResType["td"] = 2] = "td";
  17553. EResType[EResType["sk"] = 3] = "sk";
  17554. })(EResType || (EResType = {}));
  17555. class CResLoader {
  17556. constructor(doneCall, proCall) {
  17557. this.completrCall = doneCall;
  17558. this.progressCall = proCall;
  17559. this.progressHander = new Handler$1(this, this.onProgress);
  17560. this.tdResMap = {};
  17561. }
  17562. load(resList) {
  17563. this.resCount = 0;
  17564. this.loadCount = 0;
  17565. for (let i = 0; i < resList.length; i++) {
  17566. let path = resList[i];
  17567. if (!path)
  17568. continue;
  17569. this.resCount++;
  17570. let type = this.getResType(path);
  17571. if (type == EResType.nromal)
  17572. this.loadNromal(path);
  17573. else if (type == EResType.td)
  17574. this.loadTd(path);
  17575. }
  17576. }
  17577. getRes(path) {
  17578. let type = this.getResType(path);
  17579. if (type == EResType.nromal)
  17580. return Laya.loader.getRes(path);
  17581. else if (type == EResType.td) {
  17582. let res = this.tdResMap[path];
  17583. if (res)
  17584. return res.clone();
  17585. return null;
  17586. }
  17587. }
  17588. destroy() {
  17589. this.progressHander.clear();
  17590. this.progressHander = null;
  17591. }
  17592. clearRes(path) {
  17593. let type = this.getResType(path);
  17594. if (type == EResType.nromal)
  17595. Laya.loader.clearRes(path);
  17596. else if (type == EResType.td) {
  17597. let obj = this.tdResMap[path];
  17598. if (obj)
  17599. obj.destroy();
  17600. delete this.tdResMap[path];
  17601. }
  17602. }
  17603. getResType(path) {
  17604. let exs = this.getExtension(path);
  17605. if (exs == "sk")
  17606. return EResType.sk;
  17607. if (exs == "ls" || exs == "lh" || exs == "lm")
  17608. return EResType.td;
  17609. else
  17610. return EResType.nromal;
  17611. }
  17612. getExtension(res) {
  17613. var index = res.lastIndexOf(".");
  17614. return res.substr(index + 1);
  17615. }
  17616. loadNromal(path) {
  17617. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17618. if (res) {
  17619. this.onLoad();
  17620. }
  17621. else
  17622. console.log("load res fail:" + path);
  17623. }), this.progressHander);
  17624. }
  17625. loadSk() {
  17626. }
  17627. loadTd(path) {
  17628. if (this.tdResMap[path]) {
  17629. this.onLoad();
  17630. return;
  17631. }
  17632. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17633. if (res) {
  17634. this.tdResMap[path] = res;
  17635. this.onLoad();
  17636. }
  17637. else
  17638. console.log("load res fail:" + path);
  17639. }));
  17640. }
  17641. onLoad() {
  17642. this.loadCount++;
  17643. this.onProgress(1);
  17644. if (this.loadCount >= this.resCount) {
  17645. this.completrCall.run();
  17646. }
  17647. }
  17648. onProgress(pro) {
  17649. let progress = (this.loadCount + pro) / this.resCount;
  17650. this.progressCall.runWith(progress);
  17651. }
  17652. }
  17653. var Handler$2 = Laya.Handler;
  17654. class ResInfo {
  17655. constructor() {
  17656. this.index = 0;
  17657. }
  17658. }
  17659. class ResMgr {
  17660. constructor() {
  17661. this.resList = [];
  17662. this.doneList = [];
  17663. this.resMap = {};
  17664. this.currentLoad = null;
  17665. this.completeHandler = new Handler$2(this, this.onComplete);
  17666. this.progressHandler = new Handler$2(this, this.onProgress);
  17667. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17668. }
  17669. static getInstance() {
  17670. if (ResMgr._instance == null) {
  17671. ResMgr._instance = new ResMgr();
  17672. }
  17673. return ResMgr._instance;
  17674. }
  17675. loadList(list, completeHandler, progressHandler) {
  17676. if (list.length < 1) {
  17677. completeHandler.run();
  17678. return;
  17679. }
  17680. let info = this.getResInfo();
  17681. info.resList = list;
  17682. info.completeHandler = completeHandler;
  17683. info.progressHandler = progressHandler;
  17684. this.resList.push(info);
  17685. this.startLoad();
  17686. }
  17687. loadFguiRes(list, completeHandler, progressHandler) {
  17688. Laya.loader.load(list, completeHandler, progressHandler);
  17689. }
  17690. loadAny(list, completeHandler, progressHandler) {
  17691. Laya.loader.load(list, completeHandler, progressHandler);
  17692. }
  17693. load(path, completeHandler, progressHandler) {
  17694. let count = this.resMap[path];
  17695. if (count && count > 0) {
  17696. if (completeHandler)
  17697. completeHandler.run();
  17698. }
  17699. else
  17700. this.loadList([path], completeHandler, progressHandler);
  17701. }
  17702. getRes(path) {
  17703. let res = this.resMap[path];
  17704. if (!res)
  17705. this.showLog("资源不存在:" + path);
  17706. else
  17707. return this.loader.getRes(path);
  17708. }
  17709. clearList(list, force = false) {
  17710. if (!list || list.length < 1)
  17711. return;
  17712. let cr = () => {
  17713. for (const k in list) {
  17714. let v = list[k];
  17715. if (!v)
  17716. continue;
  17717. if (force) {
  17718. this.loader.clearRes(v);
  17719. delete this.resMap[v];
  17720. }
  17721. else {
  17722. let count = this.resMap[v];
  17723. if (count && count > 1) {
  17724. count--;
  17725. this.resMap[v] = count;
  17726. }
  17727. else {
  17728. this.loader.clearRes(v);
  17729. delete this.resMap[v];
  17730. }
  17731. }
  17732. }
  17733. if (!window.hasOwnProperty("ks"))
  17734. Laya.Resource.destroyUnusedResources();
  17735. };
  17736. Laya.timer.clearAll(this);
  17737. Laya.timer.once(2000, this, cr);
  17738. }
  17739. clear3D() {
  17740. for (const k in this.loader.tdResMap) {
  17741. this.loader.clearRes(k);
  17742. if (this.resMap[k])
  17743. delete this.resMap[k];
  17744. }
  17745. if (!window.hasOwnProperty("ks"))
  17746. Laya.Resource.destroyUnusedResources();
  17747. }
  17748. clear(path, force = false) {
  17749. this.clearList([path], force);
  17750. }
  17751. getResInfo() {
  17752. if (this.doneList.length > 0)
  17753. return this.doneList.pop();
  17754. else
  17755. return new ResInfo();
  17756. }
  17757. startLoad() {
  17758. if (this.currentLoad)
  17759. return;
  17760. this.currentLoad = this.resList.pop();
  17761. if (this.currentLoad) {
  17762. this.loader.load(this.currentLoad.resList);
  17763. }
  17764. }
  17765. onComplete() {
  17766. if (!this.currentLoad)
  17767. return;
  17768. for (const k in this.currentLoad.resList) {
  17769. let v = this.currentLoad.resList[k];
  17770. let count = this.resMap[v];
  17771. if (count)
  17772. count++;
  17773. else
  17774. count = 1;
  17775. this.resMap[v] = count;
  17776. }
  17777. if (this.currentLoad.completeHandler)
  17778. this.currentLoad.completeHandler.run();
  17779. this.doneList.push(this.currentLoad);
  17780. this.currentLoad = null;
  17781. this.startLoad();
  17782. }
  17783. onProgress(pro) {
  17784. if (!this.currentLoad)
  17785. return;
  17786. if (this.currentLoad.progressHandler)
  17787. this.currentLoad.progressHandler.runWith(pro);
  17788. }
  17789. showLog(str, ...args) {
  17790. console.log("[ResLoader] " + str);
  17791. }
  17792. }
  17793. ResMgr._instance = null;
  17794. class EventMgr extends Laya.EventDispatcher {
  17795. }
  17796. let eventMgr = new EventMgr();
  17797. /*! *****************************************************************************
  17798. Copyright (c) Microsoft Corporation. All rights reserved.
  17799. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17800. this file except in compliance with the License. You may obtain a copy of the
  17801. License at http://www.apache.org/licenses/LICENSE-2.0
  17802. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17803. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17804. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17805. MERCHANTABLITY OR NON-INFRINGEMENT.
  17806. See the Apache Version 2.0 License for specific language governing permissions
  17807. and limitations under the License.
  17808. ***************************************************************************** */
  17809. /* global Reflect, Promise */
  17810. var extendStatics = function(d, b) {
  17811. extendStatics = Object.setPrototypeOf ||
  17812. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17813. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17814. return extendStatics(d, b);
  17815. };
  17816. function __extends(d, b) {
  17817. extendStatics(d, b);
  17818. function __() { this.constructor = d; }
  17819. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17820. }
  17821. var __assign = function() {
  17822. __assign = Object.assign || function __assign(t) {
  17823. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17824. s = arguments[i];
  17825. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17826. }
  17827. return t;
  17828. };
  17829. return __assign.apply(this, arguments);
  17830. };
  17831. function __rest(s, e) {
  17832. var t = {};
  17833. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17834. t[p] = s[p];
  17835. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17836. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17837. t[p[i]] = s[p[i]];
  17838. return t;
  17839. }
  17840. function __decorate(decorators, target, key, desc) {
  17841. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17842. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17843. 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;
  17844. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17845. }
  17846. function __param(paramIndex, decorator) {
  17847. return function (target, key) { decorator(target, key, paramIndex); }
  17848. }
  17849. function __metadata(metadataKey, metadataValue) {
  17850. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17851. }
  17852. function __awaiter(thisArg, _arguments, P, generator) {
  17853. return new (P || (P = Promise))(function (resolve, reject) {
  17854. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17855. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17856. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17857. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17858. });
  17859. }
  17860. function __generator(thisArg, body) {
  17861. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17862. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17863. function verb(n) { return function (v) { return step([n, v]); }; }
  17864. function step(op) {
  17865. if (f) throw new TypeError("Generator is already executing.");
  17866. while (_) try {
  17867. 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;
  17868. if (y = 0, t) op = [op[0] & 2, t.value];
  17869. switch (op[0]) {
  17870. case 0: case 1: t = op; break;
  17871. case 4: _.label++; return { value: op[1], done: false };
  17872. case 5: _.label++; y = op[1]; op = [0]; continue;
  17873. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17874. default:
  17875. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17876. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17877. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17878. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17879. if (t[2]) _.ops.pop();
  17880. _.trys.pop(); continue;
  17881. }
  17882. op = body.call(thisArg, _);
  17883. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17884. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17885. }
  17886. }
  17887. function __exportStar(m, exports) {
  17888. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17889. }
  17890. function __values(o) {
  17891. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17892. if (m) return m.call(o);
  17893. return {
  17894. next: function () {
  17895. if (o && i >= o.length) o = void 0;
  17896. return { value: o && o[i++], done: !o };
  17897. }
  17898. };
  17899. }
  17900. function __read(o, n) {
  17901. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17902. if (!m) return o;
  17903. var i = m.call(o), r, ar = [], e;
  17904. try {
  17905. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17906. }
  17907. catch (error) { e = { error: error }; }
  17908. finally {
  17909. try {
  17910. if (r && !r.done && (m = i["return"])) m.call(i);
  17911. }
  17912. finally { if (e) throw e.error; }
  17913. }
  17914. return ar;
  17915. }
  17916. function __spread() {
  17917. for (var ar = [], i = 0; i < arguments.length; i++)
  17918. ar = ar.concat(__read(arguments[i]));
  17919. return ar;
  17920. }
  17921. function __await(v) {
  17922. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17923. }
  17924. function __asyncGenerator(thisArg, _arguments, generator) {
  17925. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17926. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17927. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17928. 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); }); }; }
  17929. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17930. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17931. function fulfill(value) { resume("next", value); }
  17932. function reject(value) { resume("throw", value); }
  17933. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17934. }
  17935. function __asyncDelegator(o) {
  17936. var i, p;
  17937. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17938. 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; }
  17939. }
  17940. function __asyncValues(o) {
  17941. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17942. var m = o[Symbol.asyncIterator], i;
  17943. 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);
  17944. 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); }); }; }
  17945. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17946. }
  17947. function __makeTemplateObject(cooked, raw) {
  17948. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17949. return cooked;
  17950. };
  17951. function __importStar(mod) {
  17952. if (mod && mod.__esModule) return mod;
  17953. var result = {};
  17954. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17955. result.default = mod;
  17956. return result;
  17957. }
  17958. function __importDefault(mod) {
  17959. return (mod && mod.__esModule) ? mod : { default: mod };
  17960. }
  17961. class CustomAlert {
  17962. static show(title, content, buttons) {
  17963. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17964. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17965. return;
  17966. }
  17967. const bg = new Laya.Box();
  17968. bg.alpha = 0;
  17969. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17970. Laya.stage.addChild(bg);
  17971. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17972. const panel = new Laya.Box();
  17973. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17974. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17975. bg.addChild(panel);
  17976. const titleText = new Laya.Text();
  17977. titleText.text = title;
  17978. titleText.fontSize = 32;
  17979. titleText.color = "#333333";
  17980. titleText.bold = true;
  17981. titleText.pos(20, 20);
  17982. titleText.width = 360;
  17983. titleText.align = "center";
  17984. panel.addChild(titleText);
  17985. const contentText = new Laya.Text();
  17986. contentText.text = content;
  17987. contentText.fontSize = 21;
  17988. contentText.color = "#555555";
  17989. contentText.pos(20, 70);
  17990. contentText.width = 360;
  17991. contentText.wordWrap = true;
  17992. contentText.align = "center";
  17993. panel.addChild(contentText);
  17994. const buttonContainer = new Laya.Box();
  17995. buttonContainer.pos(20, 160);
  17996. panel.addChild(buttonContainer);
  17997. const btnWidth = 120;
  17998. const spacing = 30;
  17999. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  18000. buttons.forEach((btn, index) => {
  18001. const button = new Laya.Button();
  18002. button.label = btn.label;
  18003. button.size(btnWidth, 40);
  18004. button.labelSize = 22;
  18005. button.pos(index * (btnWidth + spacing), 0);
  18006. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  18007. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  18008. button.on(Laya.Event.MOUSE_OVER, this, () => {
  18009. button.alpha = 0.9;
  18010. });
  18011. button.on(Laya.Event.MOUSE_OUT, this, () => {
  18012. button.alpha = 1;
  18013. });
  18014. button.on(Laya.Event.CLICK, this, () => {
  18015. btn.handler();
  18016. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  18017. bg.removeSelf();
  18018. }));
  18019. });
  18020. buttonContainer.addChild(button);
  18021. });
  18022. buttonContainer.x = (panel.width - totalWidth) / 2;
  18023. }
  18024. }
  18025. class ConfigMgr {
  18026. constructor() {
  18027. this.httpReqCount = 4;
  18028. this.httpReqOkCount = 0;
  18029. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  18030. try {
  18031. this.httpReqOkCount = 0;
  18032. let reqData = xGame.httpMgr.getReqData();
  18033. console.log('zh:第1个请求getClassicCfg');
  18034. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  18035. this.classicCfg = classicCfg;
  18036. this.httpReqOkCount++;
  18037. console.log('zh:第2个请求getLevelCfg');
  18038. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  18039. this.levelCfg = levelCfg;
  18040. this.httpReqOkCount++;
  18041. console.log('zh:第3个请求 getPlaceBallCfg');
  18042. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  18043. this.placeBallCfg = placeBallCfg;
  18044. this.httpReqOkCount++;
  18045. console.log('zh:第4个请求 npc');
  18046. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  18047. this.npcJson = npc.Data;
  18048. this.httpReqOkCount++;
  18049. console.log('zh:所有配置加载完成');
  18050. xGame.eventMgr.event("gameConfigReadyMark");
  18051. }
  18052. catch (error) {
  18053. console.error('zh:❌请求失败:', error);
  18054. Laya.timer.once(5000, this, () => {
  18055. let retryCount = 0;
  18056. const maxRetries = 3;
  18057. const tryFetchConfig = () => {
  18058. try {
  18059. xGame.cfgMgr.getConfigFromServer();
  18060. }
  18061. catch (error) {
  18062. if (retryCount < maxRetries) {
  18063. retryCount++;
  18064. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  18065. Laya.timer.once(5000, this, tryFetchConfig);
  18066. }
  18067. else {
  18068. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  18069. }
  18070. }
  18071. };
  18072. tryFetchConfig();
  18073. });
  18074. }
  18075. finally {
  18076. if (this.httpReqCount > this.httpReqOkCount) {
  18077. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  18078. label: "Okay", handler: () => {
  18079. JSBridgeUtils.instance.exitAndCloseGame();
  18080. }
  18081. }]);
  18082. }
  18083. }
  18084. });
  18085. this.sendPostAsync = (action, reqData) => {
  18086. return new Promise((resolve, reject) => {
  18087. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  18088. try {
  18089. let code = res.code;
  18090. if (code == 200) {
  18091. const parsedData = JSON.parse(res.msg);
  18092. resolve(parsedData);
  18093. }
  18094. else {
  18095. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  18096. reject(new Error(`Request failed with code: ${code}`));
  18097. }
  18098. }
  18099. catch (error) {
  18100. console.error(`ERROR=${error}`);
  18101. alert("Please check your network connection.");
  18102. reject(error);
  18103. }
  18104. finally {
  18105. console.log(`zh:${action}的请求处理完毕`);
  18106. }
  18107. });
  18108. });
  18109. };
  18110. }
  18111. static getInstance() {
  18112. if (!this._instance) {
  18113. this._instance = new ConfigMgr();
  18114. }
  18115. return this._instance;
  18116. }
  18117. init() {
  18118. this.getConfigFromServer();
  18119. }
  18120. test() {
  18121. let reqData = xGame.httpMgr.getReqData();
  18122. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  18123. console.log('zh:1s');
  18124. try {
  18125. let code = res.code;
  18126. let data = res.data;
  18127. if (code == 200) {
  18128. const parsedData = JSON.parse(data);
  18129. this.classicCfg = parsedData;
  18130. }
  18131. else {
  18132. console.log('zh:res = ' + JSON.stringify(res));
  18133. }
  18134. }
  18135. catch (error) {
  18136. console.log('error=' + error);
  18137. alert("Please check your network connection.");
  18138. }
  18139. finally {
  18140. console.log('zh:1');
  18141. }
  18142. });
  18143. }
  18144. getUserInfoByIndex(index) {
  18145. return this.npcJson[index];
  18146. }
  18147. getRandomUserInfo() {
  18148. let index = xGame.tools.random(0, this.npcJson.length);
  18149. let rs = this.npcJson[index];
  18150. return rs;
  18151. }
  18152. getMaxBigMoveLength() {
  18153. return Object.keys(this.levelCfg).length;
  18154. }
  18155. getBigMoveLevelByIndex(index) {
  18156. let cfg = this.levelCfg;
  18157. cfg = cfg[index];
  18158. return cfg;
  18159. }
  18160. getRandomClassicLevel() {
  18161. let cfg = this.classicCfg;
  18162. let num = Object.keys(cfg).length;
  18163. let rand = xGame.common.randomNum(1, num);
  18164. return cfg[rand];
  18165. }
  18166. getPlaceBallByLevel(level) {
  18167. return this.placeBallCfg[level];
  18168. }
  18169. getMaxPlaceBall() {
  18170. return Object.keys(this.placeBallCfg).length;
  18171. }
  18172. }
  18173. class PoolD3Mgr {
  18174. constructor() {
  18175. this.pool = {};
  18176. }
  18177. static get ins() {
  18178. return this._ins || (this._ins = new PoolD3Mgr);
  18179. }
  18180. createList(key, prefab, parent) {
  18181. if (!this.pool[key]) {
  18182. this.pool[key] = {};
  18183. this.pool[key].prefab = prefab;
  18184. this.pool[key].list = [];
  18185. this.pool[key].parent = parent;
  18186. }
  18187. }
  18188. getItem(key) {
  18189. if (!this.pool[key]) {
  18190. return;
  18191. }
  18192. let temp;
  18193. if (this.pool[key].list.length > 0) {
  18194. temp = this.pool[key].list.pop();
  18195. }
  18196. else {
  18197. temp = this.pool[key].prefab.clone();
  18198. if (this.pool[key].parent) {
  18199. this.pool[key].parent.addChild(temp);
  18200. }
  18201. }
  18202. temp.active = true;
  18203. return temp;
  18204. }
  18205. putItem(key, obj) {
  18206. if (!this.pool[key]) {
  18207. return;
  18208. }
  18209. obj.active = false;
  18210. this.pool[key].list.push(obj);
  18211. }
  18212. }
  18213. let context$1 = context;
  18214. let uiMgr = UIMgr.inst;
  18215. let soundMgr = SoundMgr.getInstance();
  18216. let resMgr = ResMgr.getInstance();
  18217. let httpMgr = HttpMgr.getInstance();
  18218. let common = Common.getInstance();
  18219. let cfgMgr = ConfigMgr.getInstance();
  18220. let poolD3Mgr = PoolD3Mgr.ins;
  18221. let d3TexUrl = "res/d3Res/";
  18222. let d3ModeUrl = "res/unityRes/";
  18223. function setStageSize(view) {
  18224. if (view.width) {
  18225. view.width = Laya.stage.width;
  18226. view.height = Laya.stage.height;
  18227. }
  18228. }
  18229. function filledBg(view) {
  18230. let wh = Laya.stage.height / Laya.stage.width;
  18231. if (wh > 16 / 9) {
  18232. view.height = Laya.stage.height;
  18233. view.width = Laya.stage.height / 1334 * 750;
  18234. }
  18235. else {
  18236. view.width = Laya.stage.width;
  18237. view.height = Laya.stage.width / 750 * 1334;
  18238. }
  18239. }
  18240. function setNotch(view) {
  18241. if (view.height) {
  18242. view.y += context$1.notchHeight;
  18243. }
  18244. }
  18245. function showTip(str) {
  18246. uiMgr.Show(UIMsg, str);
  18247. }
  18248. function log(...args) {
  18249. console.log(args);
  18250. }
  18251. let xGame = {
  18252. context: context$1,
  18253. eventMgr,
  18254. resMgr,
  18255. uiMgr,
  18256. soundMgr,
  18257. define,
  18258. tools,
  18259. httpMgr,
  18260. d3TexUrl,
  18261. d3ModeUrl,
  18262. common,
  18263. cfgMgr,
  18264. poolD3Mgr,
  18265. setStageSize,
  18266. filledBg,
  18267. setNotch,
  18268. showTip,
  18269. log,
  18270. };
  18271. window["xGame"] = xGame;
  18272. let dataName = 'tBall_';
  18273. class UserData {
  18274. constructor() {
  18275. this.userId = "";
  18276. this.isAgree = false;
  18277. this.coinNum = 0;
  18278. this.gemNum = 0;
  18279. this.sound = true;
  18280. this.vibration = true;
  18281. this.currentDate = 0;
  18282. this.createTime = 0;
  18283. this.awardTime = 0;
  18284. this.roleId = 1;
  18285. this.roleList = [];
  18286. this.roleAds = [];
  18287. this.dressId = 101;
  18288. this.itemId = 201;
  18289. this.bigSkills = [1, 1, 1, 1, 1];
  18290. this.coin = 4000;
  18291. this.diamond = 0;
  18292. this.skillSuccessTimes = 0;
  18293. this.skillGuide = 0;
  18294. this.lianXiGuide = 0;
  18295. this.guideDefaultGameMode = 1;
  18296. this.skillAccTimes = 0;
  18297. this.placeBallData = [];
  18298. this.shareDiamondTimes = 0;
  18299. this.dailyVideoShareTimes = 3;
  18300. this.secretary = [1, 0];
  18301. this.curSecretary = 0;
  18302. this.ballRod = [1, 0, 0, 0, 0, 1];
  18303. this.curBallRod = 5;
  18304. this.signData = 0;
  18305. this.signTime = 0;
  18306. this.drawTimes = 0;
  18307. this.drawAwardTimes = 0;
  18308. this.dailyfreeDrawTimes = 1;
  18309. this.power = 5;
  18310. this.powerTime = 0;
  18311. this.challengeTimes = 0;
  18312. this.extraSign = 0;
  18313. this.classicTimes = 0;
  18314. this.guideHelpLine = 0;
  18315. this.newUser = true;
  18316. this.rootBallFoul = 0;
  18317. this.timeoutFoul = 0;
  18318. this.roleList = [1];
  18319. }
  18320. saveData() {
  18321. let data = {};
  18322. for (let k in this) {
  18323. data[k.toString()] = this[k];
  18324. }
  18325. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18326. }
  18327. getData() {
  18328. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18329. if (ld) {
  18330. let localData = JSON.parse(ld);
  18331. if (localData) {
  18332. for (let k in this) {
  18333. let key = k.toString();
  18334. let data = localData[key];
  18335. if (data != undefined) {
  18336. this[k] = data;
  18337. }
  18338. }
  18339. }
  18340. }
  18341. }
  18342. }
  18343. class ItemData {
  18344. constructor() {
  18345. this.itemList = {};
  18346. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18347. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18348. }
  18349. saveData() {
  18350. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18351. }
  18352. getData() {
  18353. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18354. if (ld) {
  18355. let localData = JSON.parse(ld);
  18356. if (localData) {
  18357. this.itemList = localData;
  18358. }
  18359. }
  18360. }
  18361. }
  18362. class GameData {
  18363. constructor() {
  18364. this.curLevel = 0;
  18365. this.gameType = 1;
  18366. this.signIdx = 0;
  18367. this.signMax = 0;
  18368. this.rotaryTime = 0;
  18369. this.rotaryCount = 0;
  18370. this.rotaryList = [];
  18371. this.diyCount = 3;
  18372. this.awardIdx = 0;
  18373. this.shareNum = 2;
  18374. this.rankWeek = 0;
  18375. this.rankScore = 0;
  18376. this.gameCount = 0;
  18377. this.trySkill = -1;
  18378. this.tryTime = 0;
  18379. }
  18380. saveData() {
  18381. let data = {};
  18382. for (let k in this) {
  18383. data[k.toString()] = this[k];
  18384. }
  18385. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18386. }
  18387. getData() {
  18388. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18389. if (ld) {
  18390. let localData = JSON.parse(ld);
  18391. if (localData) {
  18392. for (let k in this) {
  18393. let key = k.toString();
  18394. let data = localData[key];
  18395. if (data != undefined) {
  18396. this[k] = data;
  18397. }
  18398. }
  18399. }
  18400. }
  18401. }
  18402. }
  18403. class Diy2025GameData {
  18404. constructor() {
  18405. this.challengeMode_overLev = 0;
  18406. this.xszyForClassic = false;
  18407. this.xszyForChallenge = false;
  18408. }
  18409. saveData() {
  18410. let data = {};
  18411. for (let k in this) {
  18412. data[k.toString()] = this[k];
  18413. }
  18414. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18415. }
  18416. getData() {
  18417. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18418. if (ld) {
  18419. let localData = JSON.parse(ld);
  18420. if (localData) {
  18421. for (let k in this) {
  18422. let key = k.toString();
  18423. let data = localData[key];
  18424. if (data != undefined) {
  18425. this[k] = data;
  18426. }
  18427. }
  18428. }
  18429. }
  18430. }
  18431. }
  18432. class UIFuli1 extends UIBase {
  18433. constructor() {
  18434. super();
  18435. this.jiage = 4.99;
  18436. }
  18437. onConstructor() {
  18438. this.ui = ui_UIFuli1.createInstance();
  18439. this.contentPane = this.ui;
  18440. this.isEject = false;
  18441. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18442. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18443. }
  18444. show() {
  18445. super.show();
  18446. this.x = (Laya.stage.width - this.width) / 2;
  18447. this.y = (Laya.stage.height - this.height) / 2;
  18448. this.ui.n2.txt_price.text = "$" + this.jiage;
  18449. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18450. this.setGlobalFont(this.ui);
  18451. }
  18452. closeSelf() {
  18453. DataMgr.loadUserSpOrderForAd();
  18454. this.hide();
  18455. }
  18456. gotoBuy() {
  18457. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18458. if (userInfo != null) {
  18459. let token = userInfo.token;
  18460. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18461. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18462. DataMgr.loadUserSpOrderForAd();
  18463. return;
  18464. }
  18465. else {
  18466. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18467. }
  18468. }
  18469. gotoBuy2() {
  18470. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18471. if (userInfo == null) {
  18472. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18473. return;
  18474. }
  18475. let reqData = xGame.httpMgr.getReqData();
  18476. let pd = JSON.parse(reqData);
  18477. pd.productId = 1;
  18478. reqData = JSON.stringify(pd);
  18479. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18480. try {
  18481. console.log('zh:buySp res = ' + JSON.stringify(res));
  18482. let code = res.code;
  18483. let msg = res.msg;
  18484. if (code == 401) {
  18485. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18486. alert(TIP_MSG_key.loginTimeOut);
  18487. xGame.uiMgr.Show(UIMsg, msg);
  18488. return;
  18489. }
  18490. if (code == 200) {
  18491. xGame.uiMgr.Show(UIMsg, msg);
  18492. DataMgr.loadUserSpOrderForAd();
  18493. DataMgr.getUserZiChanInfo(false);
  18494. this.closeSelf();
  18495. }
  18496. else {
  18497. xGame.uiMgr.Show(UIMsg, msg);
  18498. }
  18499. }
  18500. catch (error) {
  18501. console.log('error=' + error);
  18502. alert(error);
  18503. }
  18504. finally {
  18505. }
  18506. });
  18507. }
  18508. }
  18509. UIFuli1.uiName = "UIFuli1";
  18510. class UIFuli2 extends UIBase {
  18511. constructor() {
  18512. super();
  18513. this.jiage = 14.99;
  18514. }
  18515. onConstructor() {
  18516. this.ui = ui_UIFuli2.createInstance();
  18517. this.contentPane = this.ui;
  18518. this.isEject = false;
  18519. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18520. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18521. }
  18522. show() {
  18523. super.show();
  18524. this.x = (Laya.stage.width - this.width) / 2;
  18525. this.y = (Laya.stage.height - this.height) / 2;
  18526. this.ui.n2.txt_price.text = "$" + this.jiage;
  18527. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18528. this.setGlobalFont(this.ui);
  18529. }
  18530. closeSelf() {
  18531. DataMgr.loadUserSpOrderForAd();
  18532. this.hide();
  18533. }
  18534. gotoBuy() {
  18535. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18536. if (userInfo != null) {
  18537. let token = userInfo.token;
  18538. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18539. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18540. DataMgr.loadUserSpOrderForAd();
  18541. return;
  18542. }
  18543. else {
  18544. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18545. }
  18546. }
  18547. gotoBuy1() {
  18548. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18549. if (userInfo == null) {
  18550. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18551. return;
  18552. }
  18553. let reqData = xGame.httpMgr.getReqData();
  18554. let pd = JSON.parse(reqData);
  18555. pd.productId = 2;
  18556. reqData = JSON.stringify(pd);
  18557. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18558. try {
  18559. console.log('zh:buySp res = ' + JSON.stringify(res));
  18560. let code = res.code;
  18561. let msg = res.msg;
  18562. if (code == 401) {
  18563. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18564. alert(TIP_MSG_key.loginTimeOut);
  18565. xGame.uiMgr.Show(UIMsg, msg);
  18566. return;
  18567. }
  18568. if (code == 200) {
  18569. xGame.uiMgr.Show(UIMsg, msg);
  18570. DataMgr.loadUserSpOrderForAd();
  18571. DataMgr.getUserZiChanInfo(false);
  18572. this.closeSelf();
  18573. }
  18574. else {
  18575. xGame.uiMgr.Show(UIMsg, msg);
  18576. }
  18577. }
  18578. catch (error) {
  18579. console.log('error=' + error);
  18580. alert(error);
  18581. }
  18582. finally {
  18583. }
  18584. });
  18585. }
  18586. }
  18587. UIFuli2.uiName = "UIFuli2";
  18588. class DataMgr {
  18589. static Init() {
  18590. this.userData = new UserData();
  18591. this.gameData = new GameData();
  18592. this.itemData = new ItemData();
  18593. this.diyGameData = new Diy2025GameData();
  18594. this.userData.getData();
  18595. this.gameData.getData();
  18596. this.itemData.getData();
  18597. this.diyGameData.getData();
  18598. this.roleId = this.userData.roleId;
  18599. this.resetUse();
  18600. }
  18601. static isNewDay() {
  18602. Moyu.isNewDay(this, (isnew) => {
  18603. xGame.common.isNewDay = isnew;
  18604. if (!isnew)
  18605. return;
  18606. DataMgr.setShareDiamondTimes(0, false);
  18607. DataMgr.setDailyVideoShareTimes(0, false);
  18608. DataMgr.setDailyfreeDrawTimes(1);
  18609. DataMgr.setExtraSign(0);
  18610. });
  18611. }
  18612. static deletData() {
  18613. Laya.LocalStorage.clear();
  18614. }
  18615. static upRankData() {
  18616. let num = xGame.common.getAllStarNum();
  18617. if (num > 0)
  18618. Moyu.upRankData(xGame.common.curRankID, num);
  18619. }
  18620. static addItem(id, count = 1) {
  18621. let v = this.itemData.itemList[id];
  18622. if (!v)
  18623. v = { id: id, count: count, adnum: 0, active: true };
  18624. else {
  18625. if (v.active) {
  18626. v.count += count;
  18627. }
  18628. else {
  18629. v.count = count;
  18630. v.active = true;
  18631. }
  18632. }
  18633. this.itemData.itemList[id] = v;
  18634. xGame.soundMgr.playGetSound();
  18635. this.saveItemData();
  18636. }
  18637. static hasItem(id) {
  18638. let v = this.itemData.itemList[id];
  18639. if (v && v.active)
  18640. return true;
  18641. return false;
  18642. }
  18643. static getItem(id) {
  18644. let v = this.itemData.itemList[id];
  18645. return v;
  18646. }
  18647. static getItemCount(id) {
  18648. let v = this.itemData.itemList[id];
  18649. if (v && v.active)
  18650. return v.count;
  18651. return 0;
  18652. }
  18653. static getItemAd(id) {
  18654. let v = this.itemData.itemList[id];
  18655. if (v) {
  18656. return v.adnum;
  18657. }
  18658. return 0;
  18659. }
  18660. static onItemAd(id, num = 1) {
  18661. let v = this.itemData.itemList[id];
  18662. if (!v)
  18663. v = { id: id, count: 1, adnum: num, active: false };
  18664. else
  18665. v.adnum += num;
  18666. this.itemData.itemList[id] = v;
  18667. this.saveItemData();
  18668. }
  18669. static costItem(id, count) {
  18670. let v = this.itemData.itemList[id];
  18671. if (v && v.active) {
  18672. if (v.count < count)
  18673. return false;
  18674. else {
  18675. v.count -= count;
  18676. this.itemData.itemList[id] = v;
  18677. return true;
  18678. }
  18679. }
  18680. return false;
  18681. }
  18682. static resetUse() {
  18683. this.dressId = this.userData.dressId;
  18684. this.itemId = this.userData.itemId;
  18685. }
  18686. static passLevel() {
  18687. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18688. this.gameData.curLevel++;
  18689. this.curLevel = this.gameData.curLevel;
  18690. this.saveGameData();
  18691. }
  18692. static useRole(id) {
  18693. this.roleId = id;
  18694. if (this.hasRole(id)) {
  18695. this.userData.roleId = id;
  18696. this.saveUserData();
  18697. }
  18698. }
  18699. static addRole(id) {
  18700. if (this.hasRole(id))
  18701. return;
  18702. this.userData.roleList.push(id);
  18703. this.saveUserData();
  18704. }
  18705. static hasRole(id) {
  18706. return this.userData.roleList.indexOf(id) >= 0;
  18707. }
  18708. static gemEnough(num) {
  18709. return this.userData.gemNum >= num;
  18710. }
  18711. static roleHasAd(id) {
  18712. let count = this.userData.roleAds[id];
  18713. if (count != undefined && count >= 0)
  18714. return true;
  18715. else
  18716. return false;
  18717. }
  18718. static saveUserData(time = 500, event, arg) {
  18719. if (this.userSaving)
  18720. return;
  18721. this.userSaving = true;
  18722. Laya.timer.once(time, this, () => {
  18723. this.userSaving = false;
  18724. this.userData.saveData();
  18725. if (event)
  18726. xGame.eventMgr.event(event, arg);
  18727. });
  18728. }
  18729. static updateUserNickName(loginUserName) {
  18730. let kyeStr = 'moyudata_180';
  18731. console.log('zh:################### kyeStr=' + kyeStr);
  18732. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18733. if (moyudata) {
  18734. const obj = JSON.parse(moyudata);
  18735. obj.nickName = loginUserName;
  18736. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18737. console.log('zh:################### updateUserNickName');
  18738. }
  18739. }
  18740. static saveGameData() {
  18741. if (this.gameSaving)
  18742. return;
  18743. this.gameSaving = true;
  18744. Laya.timer.once(1000, this, () => {
  18745. this.gameSaving = false;
  18746. this.gameData.saveData();
  18747. });
  18748. }
  18749. static saveItemData() {
  18750. let fun = () => {
  18751. this.itemData.saveData();
  18752. };
  18753. Laya.timer.clear(this, fun);
  18754. Laya.timer.once(500, this, fun);
  18755. }
  18756. static saveData() {
  18757. this.saveUserData();
  18758. this.saveGameData();
  18759. }
  18760. static getBigSkillList() {
  18761. return this.userData.bigSkills;
  18762. }
  18763. static getBigSkillByIndex(index) {
  18764. return this.userData.bigSkills[index];
  18765. }
  18766. static setBigSkill(index, val, addUp = true) {
  18767. if (addUp) {
  18768. this.userData.bigSkills[index] += val;
  18769. }
  18770. else {
  18771. this.userData.bigSkills[index] = val;
  18772. }
  18773. this.saveUserData();
  18774. console.log("zh:大技能更新");
  18775. this.updateUserInfo2Server("bigSkills");
  18776. }
  18777. static setBigSkillFormServer(jsonStr) {
  18778. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18779. this.userData.bigSkills = JSON.parse(jsonStr);
  18780. this.saveUserData();
  18781. }
  18782. static coinEnough(need) {
  18783. if (typeof need != "number") {
  18784. console.error("金币格式错误");
  18785. return;
  18786. }
  18787. return this.userData.coin >= need;
  18788. }
  18789. static setCoin(val) {
  18790. if (typeof val != "number") {
  18791. return;
  18792. }
  18793. this.userData.coin += val;
  18794. this.saveUserData();
  18795. xGame.eventMgr.event(COIN_CHANGE);
  18796. this.updateUserInfo2Server("jb");
  18797. }
  18798. static setCoin2(val) {
  18799. if (typeof val != "number") {
  18800. return;
  18801. }
  18802. this.userData.coin = val;
  18803. this.saveUserData();
  18804. xGame.eventMgr.event(COIN_CHANGE);
  18805. }
  18806. static setCoinFormServer(val) {
  18807. if (typeof val != "number") {
  18808. return;
  18809. }
  18810. this.userData.coin = val;
  18811. this.saveUserData();
  18812. console.log('zh:通知更新金币变化' + val);
  18813. xGame.eventMgr.event(COIN_CHANGE);
  18814. }
  18815. static getCoin() {
  18816. return this.userData.coin;
  18817. }
  18818. static diamondEnough(need) {
  18819. if (typeof need != "number") {
  18820. console.error("金币格式错误");
  18821. return;
  18822. }
  18823. return this.userData.diamond >= need;
  18824. }
  18825. static setDiamond(val) {
  18826. if (typeof val != "number") {
  18827. return;
  18828. }
  18829. this.userData.diamond += val;
  18830. this.saveUserData();
  18831. xGame.eventMgr.event(DIAMOND_CHANGE);
  18832. this.updateUserInfo2Server("zs");
  18833. }
  18834. static setDiamond2(val) {
  18835. if (typeof val != "number") {
  18836. return;
  18837. }
  18838. this.userData.diamond = val;
  18839. this.saveUserData();
  18840. xGame.eventMgr.event(DIAMOND_CHANGE);
  18841. }
  18842. static setDiamondFormServer(val) {
  18843. if (typeof val != "number") {
  18844. return;
  18845. }
  18846. this.userData.diamond = val;
  18847. this.saveUserData();
  18848. console.log('zh:通知更新钻石变化' + val);
  18849. xGame.eventMgr.event(DIAMOND_CHANGE);
  18850. }
  18851. static getDiamond() {
  18852. return this.userData.diamond;
  18853. }
  18854. static getSkillSuccessTimes() {
  18855. return this.userData.skillSuccessTimes;
  18856. }
  18857. static setSkillSuccessTimes(val, addUp = true) {
  18858. if (addUp)
  18859. this.userData.skillSuccessTimes += val;
  18860. else
  18861. this.userData.skillSuccessTimes = val;
  18862. this.saveUserData();
  18863. }
  18864. static getSkillAccTimes() {
  18865. return this.userData.skillAccTimes;
  18866. }
  18867. static setSkillAccTimes(val) {
  18868. this.userData.skillAccTimes += val;
  18869. this.saveUserData();
  18870. }
  18871. static getGuideDefaultModel() {
  18872. return this.userData.guideDefaultGameMode;
  18873. }
  18874. static getSkillGuide() {
  18875. if (!xGame.common.openGuide) {
  18876. return 1;
  18877. }
  18878. return this.userData.skillGuide;
  18879. }
  18880. static setSkillGuide(val) {
  18881. this.userData.skillGuide = val;
  18882. this.saveUserData();
  18883. }
  18884. static setLianXiGuide(val) {
  18885. this.userData.lianXiGuide = val;
  18886. this.saveUserData();
  18887. }
  18888. static getLianXiGuide() {
  18889. return this.userData.lianXiGuide;
  18890. }
  18891. static getPlaceBallLevelList() {
  18892. return this.userData.placeBallData;
  18893. }
  18894. static setPlaceBallLevelList(objStr) {
  18895. if (objStr) {
  18896. let obj = JSON.parse(objStr);
  18897. this.userData.placeBallData = obj;
  18898. let cd = obj.length;
  18899. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18900. xGame.common.placeBallCurLevel = cd;
  18901. DataMgr.setChallengeMode_overLev(cd);
  18902. this.saveUserData();
  18903. }
  18904. else {
  18905. this.userData.placeBallData = [];
  18906. this.saveUserData();
  18907. }
  18908. }
  18909. static getPlaceBallLevel(level) {
  18910. let arr = this.userData.placeBallData;
  18911. let index = level - 1;
  18912. let out;
  18913. if (arr[index]) {
  18914. out = arr[index];
  18915. }
  18916. else {
  18917. let max = arr.length;
  18918. if (max == index) {
  18919. out = {
  18920. star: 0,
  18921. play: true,
  18922. isCur: true,
  18923. getAward: false
  18924. };
  18925. }
  18926. else {
  18927. out = {
  18928. star: 0,
  18929. play: false,
  18930. getAward: false
  18931. };
  18932. }
  18933. }
  18934. return out;
  18935. }
  18936. static setPlaceBallLevel(level, star) {
  18937. let arr = this.userData.placeBallData;
  18938. let index = level - 1;
  18939. if (arr[index]) {
  18940. arr[index].star = Math.max(arr[index].star, star);
  18941. }
  18942. else {
  18943. let max = arr.length;
  18944. if (max == index) {
  18945. arr.push({
  18946. star: star,
  18947. play: true,
  18948. getAward: false
  18949. });
  18950. }
  18951. else {
  18952. console.error("关卡存储出错");
  18953. }
  18954. }
  18955. this.saveUserData();
  18956. }
  18957. static setPlaceBallAward(level) {
  18958. let arr = this.userData.placeBallData;
  18959. let index = level - 1;
  18960. if (arr[index]) {
  18961. arr[index].getAward = true;
  18962. }
  18963. this.saveUserData();
  18964. }
  18965. static getShareDiamondTimes() {
  18966. return this.userData.shareDiamondTimes;
  18967. }
  18968. static setShareDiamondTimes(val, addUp = true) {
  18969. if (addUp) {
  18970. this.userData.shareDiamondTimes += val;
  18971. }
  18972. else {
  18973. this.userData.shareDiamondTimes = val;
  18974. }
  18975. this.saveUserData();
  18976. }
  18977. static getDailyVideoShareTimes() {
  18978. return this.userData.dailyVideoShareTimes;
  18979. }
  18980. static setDailyVideoShareTimes(val, addUp = true) {
  18981. if (addUp) {
  18982. this.userData.dailyVideoShareTimes += val;
  18983. }
  18984. else {
  18985. this.userData.dailyVideoShareTimes = val;
  18986. }
  18987. this.saveUserData();
  18988. }
  18989. static getSecretary(index) {
  18990. return this.userData.secretary[index];
  18991. }
  18992. static setSecretary(index, val) {
  18993. this.userData.secretary[index] = val;
  18994. this.saveUserData();
  18995. }
  18996. static getCurSecretary() {
  18997. return this.userData.curSecretary;
  18998. }
  18999. static setCurSecretary(index) {
  19000. this.userData.curSecretary = index;
  19001. this.saveUserData();
  19002. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  19003. }
  19004. static getBallRod(index) {
  19005. return this.userData.ballRod[index];
  19006. }
  19007. static setBallRod(index, val) {
  19008. this.userData.ballRod[index] = val;
  19009. this.saveUserData();
  19010. }
  19011. static setBallRodFormServer(haveQiuGanJsonStr) {
  19012. if (!haveQiuGanJsonStr) {
  19013. console.log("setBallRodFormServer数据为空或未定义");
  19014. return;
  19015. }
  19016. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  19017. const keys = Object.keys(haveQiuGanJsonObj);
  19018. keys.forEach(key => {
  19019. let v = haveQiuGanJsonObj[key];
  19020. let k = parseInt(key);
  19021. let idx = k - 1;
  19022. this.userData.ballRod[idx] = v;
  19023. });
  19024. }
  19025. static getCurBallRod() {
  19026. return this.userData.curBallRod;
  19027. }
  19028. static setCurBallRod(index) {
  19029. this.userData.curBallRod = index;
  19030. this.saveUserData();
  19031. }
  19032. static setSignData(val) {
  19033. this.userData.signData = val;
  19034. this.saveUserData();
  19035. }
  19036. static getSignData() {
  19037. return this.userData.signData;
  19038. }
  19039. static setSignTime(val) {
  19040. this.userData.signTime = val;
  19041. this.saveUserData();
  19042. }
  19043. static getSignTime() {
  19044. return this.userData.signTime;
  19045. }
  19046. static getDrawTimes() {
  19047. return this.userData.drawTimes;
  19048. }
  19049. static setDrawTimes(val, addUp = true) {
  19050. if (addUp) {
  19051. this.userData.drawTimes += val;
  19052. }
  19053. else {
  19054. this.userData.drawTimes = val;
  19055. }
  19056. this.saveUserData();
  19057. }
  19058. static getDrawAwardTimes() {
  19059. return this.userData.drawAwardTimes;
  19060. }
  19061. static setDrawAwardTimes(val) {
  19062. this.userData.drawAwardTimes = val;
  19063. this.saveUserData();
  19064. }
  19065. static getDailyfreeDrawTimes() {
  19066. return this.userData.dailyfreeDrawTimes;
  19067. }
  19068. static setDailyfreeDrawTimes(val) {
  19069. this.userData.dailyfreeDrawTimes = val;
  19070. this.saveUserData();
  19071. }
  19072. static setPower(val, addUp = true) {
  19073. if (addUp)
  19074. this.userData.power += val;
  19075. else
  19076. this.userData.power = val;
  19077. if (this.userData.power >= xGame.common.maxPower) {
  19078. this.userData.power = xGame.common.maxPower;
  19079. }
  19080. xGame.eventMgr.event(POWER_CHANGE, val);
  19081. this.saveUserData();
  19082. this.updateUserInfo2Server("power");
  19083. }
  19084. static getPower() {
  19085. return this.userData.power;
  19086. }
  19087. static setPowerTime(val) {
  19088. this.userData.powerTime = val;
  19089. this.saveUserData();
  19090. }
  19091. static getPowerTime() {
  19092. return this.userData.powerTime;
  19093. }
  19094. static powerEnough() {
  19095. return this.getPower() > 0;
  19096. }
  19097. static getChallengeTimes() {
  19098. return this.userData.challengeTimes;
  19099. }
  19100. static setChallengeTimes(val) {
  19101. this.userData.challengeTimes += val;
  19102. this.saveUserData();
  19103. }
  19104. static getExtraSign() {
  19105. return this.userData.extraSign;
  19106. }
  19107. static setExtraSign(val) {
  19108. this.userData.extraSign = val;
  19109. this.saveUserData();
  19110. }
  19111. static getClassicTimes() {
  19112. return this.userData.classicTimes;
  19113. }
  19114. static setClassicTimes() {
  19115. this.userData.classicTimes += 1;
  19116. this.saveUserData();
  19117. }
  19118. static getGuideHelpLine() {
  19119. return this.userData.guideHelpLine;
  19120. }
  19121. static setGuideHelpLine() {
  19122. this.userData.guideHelpLine = 1;
  19123. this.saveUserData();
  19124. }
  19125. static getNewUser() {
  19126. return this.userData.newUser;
  19127. }
  19128. static setNewUser() {
  19129. this.userData.newUser = false;
  19130. this.saveUserData();
  19131. }
  19132. static getRootBallFoul() {
  19133. return this.userData.rootBallFoul;
  19134. }
  19135. static setRootBallFoul() {
  19136. this.userData.rootBallFoul = 1;
  19137. this.saveUserData();
  19138. }
  19139. static getTimeoutFoul() {
  19140. return this.userData.timeoutFoul;
  19141. }
  19142. static setTimeoutFoul() {
  19143. this.userData.timeoutFoul = 1;
  19144. this.saveUserData();
  19145. }
  19146. static saveDiyGameData() {
  19147. if (this.diyGameSaving)
  19148. return;
  19149. this.diyGameSaving = true;
  19150. Laya.timer.once(500, this, () => {
  19151. this.diyGameSaving = false;
  19152. this.diyGameData.saveData();
  19153. });
  19154. }
  19155. static getChallengeMode_overLev() {
  19156. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  19157. return this.challengeMode_overLev;
  19158. }
  19159. static setChallengeMode_overLev(levNum) {
  19160. this.diyGameData.challengeMode_overLev = levNum;
  19161. this.saveDiyGameData();
  19162. }
  19163. static updateUserInfo2Server(type, count = 0) {
  19164. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19165. if (userInfoData == null) {
  19166. return;
  19167. }
  19168. let reqData = xGame.httpMgr.getReqData();
  19169. let rd = JSON.parse(reqData);
  19170. rd.dataType = type;
  19171. let dataValue = 0;
  19172. if (type == "zs") {
  19173. dataValue = this.getDiamond();
  19174. }
  19175. if (type == "jb") {
  19176. dataValue = this.getCoin();
  19177. }
  19178. if (type == "power") {
  19179. dataValue = this.getPower();
  19180. }
  19181. rd.dataValue = dataValue;
  19182. if (type == "bigSkills") {
  19183. let dataValueStr = this.userData.bigSkills;
  19184. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  19185. rd.dataValueStr = JSON.stringify(dvsJson);
  19186. }
  19187. reqData = JSON.stringify(rd);
  19188. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  19189. try {
  19190. let code = res.code;
  19191. let data = res.data;
  19192. if (code == 401) {
  19193. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19194. console.log('zh:保存资产信息失败,请重新登录 ');
  19195. return;
  19196. }
  19197. if (code == 200) {
  19198. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  19199. }
  19200. else {
  19201. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  19202. }
  19203. }
  19204. catch (error) {
  19205. console.log('error=' + error);
  19206. alert("Please check your network connection.");
  19207. }
  19208. finally {
  19209. }
  19210. });
  19211. }
  19212. static getUserZiChanInfo(winTip = false) {
  19213. console.log('zh:getUserZCI');
  19214. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19215. console.log('zh:userInfoData=' + userInfoData);
  19216. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  19217. if (winTip) {
  19218. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19219. }
  19220. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19221. return;
  19222. }
  19223. let reqData = xGame.httpMgr.getReqData();
  19224. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  19225. try {
  19226. console.log('zh:buySp res = ' + JSON.stringify(res));
  19227. let code = res.code;
  19228. let msg = res.msg;
  19229. if (code == 401) {
  19230. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19231. if (winTip) {
  19232. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19233. }
  19234. return;
  19235. }
  19236. if (code == 200) {
  19237. let d = res.data;
  19238. let zuanShi = d.zuanShi;
  19239. let jinBi = d.jinBi;
  19240. let haveQiuGanJson = d.haveQiuGanJson;
  19241. let signData = d.signData;
  19242. let placeBallData = d.placeBallData;
  19243. let bigSkills = d.bigSkills;
  19244. DataMgr.setDiamondFormServer(zuanShi);
  19245. DataMgr.setCoinFormServer(jinBi);
  19246. DataMgr.setBallRodFormServer(haveQiuGanJson);
  19247. DataMgr.setPlaceBallLevelList(placeBallData);
  19248. if (signData && signData > 0) {
  19249. DataMgr.setSignData(signData);
  19250. }
  19251. DataMgr.setBigSkillFormServer(bigSkills);
  19252. }
  19253. else {
  19254. console.log("zh:更新用户资产信息error" + msg);
  19255. if (winTip) {
  19256. xGame.uiMgr.Show(UIMsg, msg);
  19257. }
  19258. }
  19259. }
  19260. catch (error) {
  19261. console.log('error=' + error);
  19262. if (winTip) {
  19263. alert(error);
  19264. }
  19265. }
  19266. finally {
  19267. console.log("zh:更新用户资产信息结束");
  19268. }
  19269. });
  19270. }
  19271. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  19272. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19273. console.log('zh:updateLocalUserData=' + userInfo);
  19274. if (userInfo != null) {
  19275. if (!userInfo.buySpids) {
  19276. userInfo.buySpids = { 1: false, 7: false };
  19277. }
  19278. else {
  19279. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  19280. }
  19281. userInfo.buySpids[spid] = isBuyOk;
  19282. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  19283. }
  19284. else {
  19285. }
  19286. }
  19287. static loadUserSpOrderForAd() {
  19288. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19289. if (userInfo == null) {
  19290. return;
  19291. }
  19292. console.log('zh:重新加载更新广告权利');
  19293. let reqData = xGame.httpMgr.getReqData();
  19294. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  19295. try {
  19296. console.log('zh:getOrderListForNoChongFuBuy res = ' + JSON.stringify(res));
  19297. let code = res.code;
  19298. let msg = res.msg;
  19299. if (code == 401) {
  19300. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19301. return;
  19302. }
  19303. if (code == 200) {
  19304. let data = res.data;
  19305. let buy_spid1 = false;
  19306. let buy_spid7 = false;
  19307. for (let index = 0; index < data.length; index++) {
  19308. let element = data[index];
  19309. console.log('zh:list element.spid = ' + element.spid);
  19310. if (element.spid == 1) {
  19311. buy_spid1 = true;
  19312. }
  19313. if (element.spid == 7) {
  19314. buy_spid7 = true;
  19315. }
  19316. }
  19317. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  19318. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  19319. }
  19320. else {
  19321. }
  19322. }
  19323. catch (error) {
  19324. console.log('error=' + error);
  19325. alert(error);
  19326. }
  19327. finally {
  19328. }
  19329. });
  19330. }
  19331. static checkForShowFuLi17AndAlert(alert_spid) {
  19332. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19333. if (userInfo == null) {
  19334. if (alert_spid === 1) {
  19335. xGame.uiMgr.Show(UIFuli1);
  19336. }
  19337. if (alert_spid === 7) {
  19338. xGame.uiMgr.Show(UIFuli2);
  19339. }
  19340. return;
  19341. }
  19342. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  19343. let reqData = xGame.httpMgr.getReqData();
  19344. let pd = JSON.parse(reqData);
  19345. pd.productId = alert_spid;
  19346. reqData = JSON.stringify(pd);
  19347. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  19348. try {
  19349. let code = res.code;
  19350. let msg = res.msg;
  19351. if (code == 401) {
  19352. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19353. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19354. return;
  19355. }
  19356. if (code == 200) {
  19357. let data = res.data;
  19358. let buyOkSpid = [];
  19359. for (let i = 0; i < data.length; i++) {
  19360. let item = data[i];
  19361. let temp_spid = item.spid;
  19362. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19363. buyOkSpid.push(temp_spid);
  19364. }
  19365. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19366. if (isBuyOk7) {
  19367. return;
  19368. }
  19369. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19370. if (isBuyOk && alert_spid === 1) {
  19371. return;
  19372. }
  19373. else {
  19374. if (isBuyOk === false) {
  19375. if (alert_spid === 1) {
  19376. xGame.uiMgr.Show(UIFuli1);
  19377. }
  19378. if (alert_spid === 7) {
  19379. xGame.uiMgr.Show(UIFuli2);
  19380. }
  19381. }
  19382. else {
  19383. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19384. }
  19385. }
  19386. }
  19387. else {
  19388. xGame.uiMgr.Show(UIMsg, msg);
  19389. }
  19390. }
  19391. catch (error) {
  19392. console.log('error=' + error);
  19393. alert(error);
  19394. }
  19395. finally {
  19396. }
  19397. });
  19398. }
  19399. }
  19400. DataMgr.isNewUser = false;
  19401. DataMgr.fristEnter = true;
  19402. DataMgr.levelType = 0;
  19403. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19404. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19405. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19406. DataMgr.challengeMode_overLev = 0;
  19407. DataMgr.xszyForClassic = false;
  19408. DataMgr.xszyForChallenge = false;
  19409. DataMgr.awardId = 0;
  19410. DataMgr.awardCoin = 0;
  19411. DataMgr.sceneId = -1;
  19412. DataMgr.tryId = 0;
  19413. DataMgr.curLevel = 1;
  19414. DataMgr.vipLevel = 0;
  19415. DataMgr.maxLevel = 0;
  19416. DataMgr.awardRatio = 1;
  19417. DataMgr.gameList = [];
  19418. DataMgr.rankList = [];
  19419. DataMgr.recoverTime = 480000;
  19420. DataMgr.minScore = 0;
  19421. DataMgr.rankDis = 0;
  19422. DataMgr.userSaving = false;
  19423. DataMgr.gameSaving = false;
  19424. DataMgr.diyGameSaving = false;
  19425. class D3Tween extends Laya.Script3D {
  19426. constructor() {
  19427. super();
  19428. this.isInited = false;
  19429. }
  19430. ;
  19431. init() {
  19432. if (this.isInited)
  19433. return;
  19434. this.isInited = true;
  19435. this.gameObj = this.owner;
  19436. this.transform = this.gameObj.transform;
  19437. }
  19438. get rotX() {
  19439. return this.transform.localRotationEulerX;
  19440. }
  19441. set rotX(v) {
  19442. this.transform.localRotationEulerX = v;
  19443. }
  19444. get rotY() {
  19445. return this.transform.localRotationEulerY;
  19446. }
  19447. set rotY(v) {
  19448. this.transform.localRotationEulerY = v;
  19449. }
  19450. get rotZ() {
  19451. return this.transform.localRotationEulerZ;
  19452. }
  19453. set rotZ(v) {
  19454. this.transform.localRotationEulerZ = v;
  19455. }
  19456. get posX() {
  19457. return this.transform.localPositionX;
  19458. }
  19459. set posX(v) {
  19460. this.transform.localPositionX = v;
  19461. }
  19462. get posY() {
  19463. return this.transform.localPositionY;
  19464. }
  19465. set posY(v) {
  19466. this.transform.localPositionY = v;
  19467. }
  19468. get posZ() {
  19469. return this.transform.localPositionZ;
  19470. }
  19471. set posZ(v) {
  19472. this.transform.localPositionZ = v;
  19473. }
  19474. get rotation() {
  19475. return this.transform.localRotation;
  19476. }
  19477. set rotation(v) {
  19478. this.transform.localRotation = v;
  19479. }
  19480. }
  19481. class D2Hole extends Laya.Script {
  19482. constructor() { super(); }
  19483. onTriggerEnter(collider) {
  19484. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19485. return;
  19486. }
  19487. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19488. if (collider.owner["mySrc"].isRunSkillAni) {
  19489. return;
  19490. }
  19491. if (collider.owner["mySrc"].number != 0) {
  19492. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19493. }
  19494. xGame.common.ballColliHole(collider);
  19495. xGame.common.recoverCameraView();
  19496. }
  19497. }
  19498. }
  19499. class Table extends Laya.Script3D {
  19500. constructor() {
  19501. super();
  19502. this.isSetBorder = false;
  19503. this.inited = false;
  19504. }
  19505. ;
  19506. onAwake() {
  19507. this.init();
  19508. }
  19509. init() {
  19510. if (this.inited)
  19511. return;
  19512. this.inited = true;
  19513. this.gameObj = this.owner;
  19514. this.border = this.gameObj.getChildByName("border");
  19515. }
  19516. setBorderPos() {
  19517. if (this.isSetBorder)
  19518. return;
  19519. this.isSetBorder = true;
  19520. let ui = xGame.common.gameUI.ui;
  19521. let bar1 = this.border.getChildByName("bar1");
  19522. let bar2 = this.border.getChildByName("bar2");
  19523. let bar3 = this.border.getChildByName("bar3");
  19524. let bar4 = this.border.getChildByName("bar4");
  19525. let bar5 = this.border.getChildByName("bar5");
  19526. let bar6 = this.border.getChildByName("bar6");
  19527. this.setInfo(bar1, ui.border.bar1, "box");
  19528. this.setInfo(bar2, ui.border.bar2, "box");
  19529. this.setInfo(bar3, ui.border.bar3, "box");
  19530. this.setInfo(bar4, ui.border.bar4, "box");
  19531. this.setInfo(bar5, ui.border.bar5, "box");
  19532. this.setInfo(bar6, ui.border.bar6, "box");
  19533. let circle1 = this.border.getChildByName("circle1");
  19534. let circle2 = this.border.getChildByName("circle2");
  19535. let circle3 = this.border.getChildByName("circle3");
  19536. let circle4 = this.border.getChildByName("circle4");
  19537. let circle5 = this.border.getChildByName("circle5");
  19538. let circle6 = this.border.getChildByName("circle6");
  19539. this.setInfo(circle1, ui.border.circle1, "circle");
  19540. this.setInfo(circle2, ui.border.circle2, "circle");
  19541. this.setInfo(circle3, ui.border.circle3, "circle");
  19542. this.setInfo(circle4, ui.border.circle4, "circle");
  19543. this.setInfo(circle5, ui.border.circle5, "circle");
  19544. this.setInfo(circle6, ui.border.circle6, "circle");
  19545. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19546. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19547. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19548. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19549. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19550. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19551. let arr = xGame.common.gameMgr.holePosList;
  19552. xGame.common.gameMgr.posObj = {
  19553. "1": arr[0],
  19554. "3": arr[2],
  19555. "4": arr[3],
  19556. "6": arr[5]
  19557. };
  19558. }
  19559. initHolePos(x, y) {
  19560. if (x < 300)
  19561. x += 25;
  19562. else if (x > 1000)
  19563. x -= 25;
  19564. else if (y > 200)
  19565. y -= 10;
  19566. else
  19567. y += 10;
  19568. if (y < 200)
  19569. y += 30;
  19570. else if (y > 500)
  19571. y -= 30;
  19572. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19573. }
  19574. setInfo(d3Obj, d2Obj, type) {
  19575. let ui = xGame.common.gameUI.ui;
  19576. let sprite = new Laya.Sprite();
  19577. ui.border.displayObject.addChild(sprite);
  19578. let colli = xGame.common.getCollider(type);
  19579. sprite.addComponentIntance(colli);
  19580. let rigy = xGame.common.getRigbody();
  19581. rigy.type = "static";
  19582. sprite.addComponentIntance(rigy);
  19583. let d3Pos = d3Obj.transform.position;
  19584. xGame.common.pos3to2Convert(d3Pos);
  19585. let scaleX = d3Obj.transform.localScaleX;
  19586. let scaleZ = d3Obj.transform.localScaleZ;
  19587. let width = xGame.common.scale3to2Convert(scaleZ);
  19588. let height = xGame.common.scale3to2Convert(scaleX);
  19589. sprite.pivotX = width / 2;
  19590. sprite.pivotY = height / 2;
  19591. sprite.x = d3Pos.x;
  19592. sprite.y = d3Pos.y;
  19593. sprite.width = width;
  19594. sprite.height = height;
  19595. d2Obj.x = d3Pos.x;
  19596. d2Obj.y = d3Pos.y;
  19597. d2Obj.width = width;
  19598. d2Obj.height = height;
  19599. if (type == "box") {
  19600. colli.width = width;
  19601. colli.height = height;
  19602. colli.isSensor = false;
  19603. colli.label = "border";
  19604. }
  19605. else {
  19606. colli.radius = width / 2;
  19607. colli.isSensor = true;
  19608. colli.label = "hole";
  19609. sprite.addComponent(D2Hole);
  19610. }
  19611. }
  19612. }
  19613. class D3World extends Laya.Script3D {
  19614. constructor() {
  19615. super();
  19616. this.loadNum = 0;
  19617. this.setLoadNum = 7;
  19618. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19619. }
  19620. onAwake() {
  19621. }
  19622. loadScene() {
  19623. this.scene = this.owner;
  19624. let url = `res/unityRes/root.lh`;
  19625. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19626. this.scene.addChild(prefab);
  19627. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19628. this.putCameraInfo();
  19629. this.camera.enableHDR = false;
  19630. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19631. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19632. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19633. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19634. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19635. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19636. this.knife.active = false;
  19637. this.loadD3Obj();
  19638. }));
  19639. }
  19640. putCameraInfo() {
  19641. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19642. this.cameraObj = new cameraType();
  19643. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19644. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19645. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19646. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19647. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19648. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19649. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19650. this.visitAngleChild.init();
  19651. this.visitRootObj.posX = this.visitAngleChild.posX;
  19652. this.visitRootObj.posY = this.visitAngleChild.posY;
  19653. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19654. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19655. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19656. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19657. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19658. xGame.common.showOneCamera("mainCamera");
  19659. }
  19660. loadD3Obj() {
  19661. this.loadTable();
  19662. this.loadRoom();
  19663. this.loadInHoleParticial();
  19664. this.loadIceParticial();
  19665. this.loadHitParticial();
  19666. this.loadFireworksParticial();
  19667. this.loadBall();
  19668. }
  19669. loadInHoleParticial() {
  19670. this.loadD3Res("inHoleEft", "", (prefab) => {
  19671. prefab.addComponent(Partical);
  19672. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19673. });
  19674. }
  19675. loadIceParticial() {
  19676. this.loadD3Res("iceEft", "", (prefab) => {
  19677. prefab.addComponent(Partical);
  19678. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19679. });
  19680. }
  19681. loadHitParticial() {
  19682. this.loadD3Res("hitEft", "", (prefab) => {
  19683. prefab.addComponent(Partical);
  19684. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19685. });
  19686. }
  19687. loadFireworksParticial() {
  19688. this.loadD3Res("fireworksEft", "", (prefab) => {
  19689. prefab.addComponent(Partical);
  19690. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19691. });
  19692. }
  19693. loadBall(index = 1) {
  19694. this.loadD3Res("ball", index, (prefab) => {
  19695. this.ballPrefab = prefab;
  19696. this.ballPrefab.addComponent(Ball);
  19697. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19698. });
  19699. }
  19700. loadTable(index = 1) {
  19701. this.loadD3Res("table", index, (prefab) => {
  19702. this.tableSrc = prefab.addComponent(Table);
  19703. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19704. this.d3Hand.init();
  19705. this.tableRoot.addChild(prefab);
  19706. });
  19707. }
  19708. loadRoom(index = 1) {
  19709. this.loadD3Res("room", index, (prefab) => {
  19710. this.roomRoot.addChild(prefab);
  19711. });
  19712. }
  19713. loadD3Res(type, index, callback) {
  19714. let url = `res/unityRes/${type}${index}.lh`;
  19715. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19716. callback && callback(prefab);
  19717. this.checkResLoad();
  19718. }));
  19719. }
  19720. checkResLoad() {
  19721. this.loadNum++;
  19722. if (this.loadNum >= this.setLoadNum) {
  19723. xGame.eventMgr.event(D3RES_LOADED);
  19724. }
  19725. }
  19726. prePlayEft() {
  19727. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19728. eft.transform.localPositionX = 0;
  19729. eft.transform.localPositionY = -5;
  19730. eft.transform.localPositionZ = 0;
  19731. eft.active = true;
  19732. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19733. ice.transform.localPositionX = 0;
  19734. ice.transform.localPositionY = -5;
  19735. ice.transform.localPositionZ = 0;
  19736. ice.active = true;
  19737. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19738. hit.transform.localPositionX = 0;
  19739. hit.transform.localPositionY = -5;
  19740. hit.transform.localPositionZ = 0;
  19741. hit.active = true;
  19742. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19743. fireworks.transform.localPositionX = 0;
  19744. fireworks.transform.localPositionY = -5;
  19745. fireworks.transform.localPositionZ = 0;
  19746. fireworks.active = true;
  19747. }
  19748. }
  19749. class cameraType {
  19750. }
  19751. class MoyuMgr$1 {
  19752. static initMoyu() {
  19753. this.moyuView = new MoyuView$1();
  19754. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19755. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19756. this.moyuView.ui.displayObject.zOrder = 1000;
  19757. this.moyuView.init();
  19758. this.moyuView.showTip(true);
  19759. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19760. window['XApk'] = this;
  19761. }
  19762. static showAge(show) {
  19763. if (this.moyuView)
  19764. this.moyuView.showAge(show);
  19765. }
  19766. static onPlatMsg(idx) {
  19767. if (!MoyuMgr$1.moyuView)
  19768. return;
  19769. if (idx == '0') {
  19770. MoyuMgr$1.moyuView.showTip(false);
  19771. }
  19772. }
  19773. static showAgree(call) {
  19774. if (this.moyuView)
  19775. this.moyuView.showAgree(call);
  19776. else
  19777. call && call();
  19778. }
  19779. static showXy(type = 1) {
  19780. if (this.moyuView)
  19781. this.moyuView.showXy(type);
  19782. }
  19783. }
  19784. MoyuMgr$1.isAdvise = false;
  19785. class MoyuView$1 {
  19786. constructor() {
  19787. this.ysxyNum = 1;
  19788. this.ysJson = null;
  19789. this.ui = ui_UIMoyu.createInstance();
  19790. }
  19791. init() {
  19792. this.ui.mainBg.visible = false;
  19793. this.ui.xyNode.visible = false;
  19794. this.ui.ageNode.visible = false;
  19795. this.ui.tipNode.visible = false;
  19796. this.ui.rnNode.visible = false;
  19797. this.ui.fcmNode.visible = false;
  19798. this.ui.ageTip.visible = false;
  19799. this.ui.msgNode.visible = false;
  19800. this.ui.visible = false;
  19801. this.ui.xyNode.xyList.setVirtual();
  19802. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19803. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19804. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19805. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19806. this.ui.xyNode.btnKnown.visible = false;
  19807. this.ui.xyNode.xy1.visible = false;
  19808. this.ui.xyNode.xy2.visible = false;
  19809. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19810. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19811. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19812. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19813. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19814. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19815. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19816. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19817. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19818. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19819. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19820. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19821. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19822. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19823. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19824. this.ysxyNum = 2;
  19825. }
  19826. }
  19827. onClick(obj) {
  19828. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19829. switch (obj) {
  19830. case this.ui.ageTip:
  19831. if (Moyu.isTTApk) {
  19832. this.ui.ageNode.visible = true;
  19833. this.ui.mainBg.visible = true;
  19834. }
  19835. break;
  19836. case this.ui.tipNode:
  19837. this.showTip(false);
  19838. break;
  19839. case this.ui.ageNode.btnAge:
  19840. this.ui.ageNode.visible = false;
  19841. this.ui.mainBg.visible = false;
  19842. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19843. this.ui.visible = false;
  19844. break;
  19845. case this.ui.xyNode.btnXy3:
  19846. case this.ui.xyNode.btnXy1:
  19847. this.loadXy(1);
  19848. break;
  19849. case this.ui.xyNode.btnXy2:
  19850. this.loadXy(2);
  19851. break;
  19852. case this.ui.xyNode.btnBack:
  19853. this.ui.xyNode.xy1.visible = true;
  19854. this.ui.xyNode.xy2.visible = false;
  19855. break;
  19856. case this.ui.xyNode.btnKnown:
  19857. this.ui.xyNode.visible = false;
  19858. this.ui.mainBg.visible = false;
  19859. this.ui.visible = false;
  19860. break;
  19861. case this.ui.rnNode.btnCheck:
  19862. this.check();
  19863. break;
  19864. case this.ui.rnNode.btnExit:
  19865. case this.ui.xyNode.btnNo:
  19866. this.ysxyNum--;
  19867. if (this.ysxyNum > 0)
  19868. this.showMsg("Refuse to quit the game once again");
  19869. else {
  19870. Moyu.userAgree(false);
  19871. Moyu.exit();
  19872. }
  19873. break;
  19874. case this.ui.xyNode.btnSure:
  19875. case this.ui.xyNode.btnYes:
  19876. DataMgr.userData.isAgree = true;
  19877. DataMgr.saveUserData();
  19878. this.onAgree();
  19879. break;
  19880. case this.ui.rnNode.btnDone:
  19881. this.ui.rnNode.visible = false;
  19882. this.ui.visible = false;
  19883. break;
  19884. case this.ui.fcmNode.btnRn:
  19885. this.showRn();
  19886. break;
  19887. }
  19888. }
  19889. showTip(show) {
  19890. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19891. return;
  19892. if (show) {
  19893. MoyuMgr$1.isAdvise = true;
  19894. this.ui.visible = true;
  19895. this.ui.tipNode.visible = true;
  19896. this.ui.tipNode.alpha = 1;
  19897. Laya.timer.once(1000, this, this.showTip, [false]);
  19898. }
  19899. else {
  19900. this.ui.tipNode.alpha = 1;
  19901. this.ui.tipNode.visible = true;
  19902. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19903. this.ui.tipNode.visible = false;
  19904. MoyuMgr$1.isAdvise = false;
  19905. }), 1000);
  19906. }
  19907. }
  19908. showAge(show, px = 0, py = 0) {
  19909. if (Moyu.platType > 10 && !Moyu.isIos) {
  19910. this.ui.ageTip.x = px;
  19911. this.ui.ageTip.y = py;
  19912. this.ui.ageTip.visible = show;
  19913. if (show)
  19914. this.ui.visible = true;
  19915. }
  19916. }
  19917. showAgree(call) {
  19918. this.agreeCall = call;
  19919. this.onAgree();
  19920. return;
  19921. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19922. this.showXy(0);
  19923. }
  19924. else
  19925. this.onAgree();
  19926. }
  19927. onAgree() {
  19928. if (!this.ui.ageNode.visible)
  19929. this.ui.visible = false;
  19930. this.ui.xyNode.visible = false;
  19931. Moyu.userAgree(true);
  19932. this.showAge(false);
  19933. this.agreeCall && this.agreeCall();
  19934. this.showRn();
  19935. }
  19936. showMsg(txt) {
  19937. this.ui.msgNode.txtMsg.text = txt;
  19938. this.ui.msgNode.visible = true;
  19939. this.ui.msgNode.alpha = 1;
  19940. this.ui.visible = true;
  19941. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19942. this.ui.msgNode.visible = false;
  19943. }), 2500, true);
  19944. }
  19945. showRn() {
  19946. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19947. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19948. this.ui.rnNode.rn1.visible = true;
  19949. this.ui.rnNode.rn2.visible = false;
  19950. this.ui.rnNode.rn3.visible = false;
  19951. this.ui.rnNode.rn4.visible = false;
  19952. this.ui.rnNode.visible = true;
  19953. this.ui.mainBg.visible = true;
  19954. this.ui.rnNode.btnDone.visible = false;
  19955. this.ui.rnNode.btnExit.visible = true;
  19956. this.ui.rnNode.btnCheck.visible = true;
  19957. this.ui.fcmNode.visible = false;
  19958. this.ui.visible = true;
  19959. return;
  19960. }
  19961. }
  19962. this.showFcm();
  19963. }
  19964. showFcm() {
  19965. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19966. Moyu.initFCM(true);
  19967. if (Moyu.gameTime < 1)
  19968. this.fcmLoop();
  19969. else if (Moyu.gameTime < 999)
  19970. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19971. }
  19972. }
  19973. fcmLoop() {
  19974. if (Moyu.gameTime < 1) {
  19975. this.ui.rnNode.visible = false;
  19976. this.ui.fcmNode.visible = true;
  19977. this.ui.mainBg.visible = true;
  19978. this.ui.visible = true;
  19979. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19980. Laya.timer.clear(this.ui, this.fcmLoop);
  19981. }
  19982. }
  19983. check() {
  19984. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19985. this.ui.rnNode.rn1.visible = false;
  19986. this.ui.rnNode.rn2.visible = false;
  19987. this.ui.rnNode.rn4.visible = true;
  19988. }
  19989. else if (this.ui.rnNode.rn4.visible) {
  19990. let name = this.ui.rnNode.inputName.text;
  19991. let code = this.ui.rnNode.inputCode.text;
  19992. if (code && code.length == 18) {
  19993. this.ui.rnNode.rn1.visible = false;
  19994. this.ui.rnNode.rn4.visible = false;
  19995. Moyu.authenticate(name, code, (res) => {
  19996. this.ui.rnNode.rn2.visible = !res;
  19997. this.ui.rnNode.rn3.visible = res;
  19998. this.ui.rnNode.btnDone.visible = res;
  19999. this.ui.rnNode.btnExit.visible = !res;
  20000. this.ui.rnNode.btnCheck.visible = !res;
  20001. if (res)
  20002. this.showFcm();
  20003. });
  20004. }
  20005. else
  20006. this.showMsg("信息填写不完整");
  20007. }
  20008. }
  20009. loadXy(type = 0) {
  20010. this.ui.xyNode.xy1.visible = false;
  20011. this.ui.xyNode.xy2.visible = true;
  20012. this.ui.xyNode.xyList.scrollToView(0);
  20013. if (type == 1) {
  20014. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  20015. }
  20016. else if (type == 2) {
  20017. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  20018. }
  20019. }
  20020. showXy(type = 0) {
  20021. this.xyBtn();
  20022. if (type == 0) {
  20023. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  20024. this.ui.xyNode.btnSure.visible = true;
  20025. }
  20026. else {
  20027. this.ui.xyNode.btnYes.visible = true;
  20028. this.ui.xyNode.btnNo.visible = true;
  20029. }
  20030. }
  20031. else {
  20032. this.ui.xyNode.btnKnown.visible = true;
  20033. this.ui.mainBg.visible = true;
  20034. }
  20035. this.ui.xyNode.xy1.visible = true;
  20036. this.ui.xyNode.xy2.visible = false;
  20037. this.ui.xyNode.visible = true;
  20038. this.ui.visible = true;
  20039. }
  20040. xyBtn() {
  20041. this.ui.xyNode.btnSure.visible = false;
  20042. this.ui.xyNode.btnYes.visible = false;
  20043. this.ui.xyNode.btnNo.visible = false;
  20044. this.ui.xyNode.btnKnown.visible = false;
  20045. {
  20046. this.ui.xyNode.btnXy3.visible = false;
  20047. this.ui.xyNode.btnXy2.visible = true;
  20048. this.ui.xyNode.btnXy1.visible = true;
  20049. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  20050. }
  20051. }
  20052. createXY(json) {
  20053. this.ysJson = json.content;
  20054. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  20055. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  20056. this.ui.xyNode.xy2.visible = true;
  20057. }
  20058. renderListItem(idx, cell) {
  20059. let xy = this.ysJson[idx];
  20060. cell.height = xy.line * 30;
  20061. cell.xyItem.text = xy.text;
  20062. }
  20063. onDestroy() {
  20064. this.agreeCall = null;
  20065. }
  20066. }
  20067. class UILoading extends UIBase {
  20068. constructor() {
  20069. super();
  20070. this.accTime = 0;
  20071. this.curNum = 0;
  20072. this.rate = 1;
  20073. this.loadSubOk = false;
  20074. this.loadResOK = false;
  20075. this.openLoading = true;
  20076. this.beginLoadRes = false;
  20077. this.finishD2 = false;
  20078. this.finishD3 = false;
  20079. }
  20080. onConstructor() {
  20081. this.ui = ui_UILoading.createInstance();
  20082. this.contentPane = this.ui;
  20083. this.isEject = false;
  20084. this._initUI();
  20085. this._addEvent();
  20086. }
  20087. _initUI() {
  20088. MoyuMgr$1.initMoyu();
  20089. }
  20090. _addEvent() {
  20091. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  20092. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  20093. }
  20094. show() {
  20095. super.show();
  20096. console.log('zh:加载分包资源');
  20097. loadSubRes(this.subResProgress.bind(this));
  20098. this.ui.txtLoad.text = "Loading...";
  20099. this.setGlobalFont(this.ui);
  20100. }
  20101. subResProgress(pro, finish) {
  20102. this.curNum = pro;
  20103. if (finish) {
  20104. this.curNum = 1;
  20105. this.loadSubOk = true;
  20106. }
  20107. }
  20108. laodD3Res() {
  20109. let scene3D = new Laya.Scene3D();
  20110. xGame.common.d3Scene = scene3D;
  20111. xGame.common.d3World = scene3D.addComponent(D3World);
  20112. xGame.common.d3World.loadScene();
  20113. }
  20114. loadD2Res() {
  20115. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  20116. this.finishD2 = true;
  20117. this.checkLoadAll();
  20118. this.curNum = 1;
  20119. }), Laya.Handler.create(this, (pro) => {
  20120. this.curNum = pro;
  20121. }, null, false));
  20122. }
  20123. d3ResFinish() {
  20124. this.finishD3 = true;
  20125. this.checkLoadAll();
  20126. }
  20127. checkLoadAll() {
  20128. if (this.finishD2 && this.finishD3) {
  20129. this.loadResOK = true;
  20130. }
  20131. }
  20132. loadRes() {
  20133. this.laodD3Res();
  20134. this.loadD2Res();
  20135. }
  20136. myUpdate(dt) {
  20137. if (!this.openLoading)
  20138. return;
  20139. this.accTime += dt * this.rate;
  20140. if (this.accTime >= this.curNum)
  20141. this.accTime = this.curNum;
  20142. this.ui.loadinfo.value = this.accTime * 100;
  20143. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  20144. if (!this.beginLoadRes) {
  20145. this.beginLoadRes = true;
  20146. this.ui.txtLoad.text = "Loading...";
  20147. this.curNum = 0;
  20148. this.accTime = 0;
  20149. this.loadRes();
  20150. }
  20151. if (this.loadResOK) {
  20152. this.openLoading = false;
  20153. Laya.timer.once(300, this, () => {
  20154. xGame.common.d3Scene.active = false;
  20155. MoyuMgr$1.showAgree(enterGame);
  20156. });
  20157. }
  20158. }
  20159. }
  20160. release() {
  20161. }
  20162. hide() {
  20163. super.hide();
  20164. this.release();
  20165. }
  20166. onClose() {
  20167. this.hide();
  20168. }
  20169. }
  20170. UILoading.uiName = "UILoading";
  20171. class UIRepentProp$1 extends UIBase {
  20172. constructor() {
  20173. super();
  20174. this.viewType = 0;
  20175. this.regretType = 0;
  20176. }
  20177. onConstructor() {
  20178. this.ui = ui_UIRepentProp.createInstance();
  20179. this.contentPane = this.ui;
  20180. this.isEject = false;
  20181. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  20182. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  20183. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  20184. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  20185. }
  20186. show(viewType, regretType, callback) {
  20187. PlatMgr.showInsert(true);
  20188. this.viewType = viewType;
  20189. this.regretType = regretType;
  20190. this.callback = callback;
  20191. super.show();
  20192. this.ui.t0.play();
  20193. this.ui.c1.selectedIndex = this.viewType;
  20194. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  20195. if (this.viewType == 0) {
  20196. let guide = DataMgr.getGuideHelpLine();
  20197. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  20198. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  20199. }
  20200. xGame.common.gameMgr.gamePause = true;
  20201. this.setGlobalFont(this.ui);
  20202. }
  20203. hideSelf() {
  20204. xGame.common.gameMgr.gamePause = false;
  20205. this.callback && this.callback(false);
  20206. this.hide();
  20207. }
  20208. videoRegret() {
  20209. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  20210. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  20211. }
  20212. else {
  20213. console.log('zh:AD 失败,直接发放奖励');
  20214. this.qjff_AD_for_UIrepentProp_videoRegret();
  20215. }
  20216. }
  20217. qjff_AD_for_UIrepentProp_videoRegret() {
  20218. this.callback && this.callback(true);
  20219. this.hideSelf();
  20220. }
  20221. videoAddHelpLine() {
  20222. let guide = DataMgr.getGuideHelpLine();
  20223. if (guide == 0) {
  20224. this.callback && this.callback(true);
  20225. this.hideSelf();
  20226. DataMgr.setGuideHelpLine();
  20227. xGame.common.gameUI.ui.guideNode.visible = false;
  20228. }
  20229. else {
  20230. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  20231. if (Laya.Browser.onAndroid) {
  20232. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20233. if (!boo) {
  20234. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20235. return;
  20236. }
  20237. }
  20238. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  20239. }
  20240. else {
  20241. console.log('zh:AD 失败,直接发放奖励');
  20242. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20243. }
  20244. }
  20245. }
  20246. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  20247. this.callback && this.callback(true);
  20248. this.hideSelf();
  20249. }
  20250. }
  20251. UIRepentProp$1.uiName = "UIRepentProp";
  20252. class UIRodMethod$1 extends UIBase {
  20253. constructor() {
  20254. super();
  20255. this.isPressd = false;
  20256. }
  20257. onConstructor() {
  20258. this.ui = ui_UIRodMethod.createInstance();
  20259. this.contentPane = this.ui;
  20260. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  20261. this.moveDir = new Laya.Vector2();
  20262. this.moveDest = new Laya.Vector2();
  20263. this.centerPos = new Laya.Vector2();
  20264. xGame.common.uiRodMethod = this;
  20265. }
  20266. show() {
  20267. super.show();
  20268. xGame.common.gameMgr.gamePause = true;
  20269. this.openPressDotEvent();
  20270. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  20271. this.centerPos.x = this.ui.white.x;
  20272. this.centerPos.y = this.ui.white.y;
  20273. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  20274. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  20275. this.setDot();
  20276. this.setGlobalFont(this.ui);
  20277. }
  20278. setDot() {
  20279. this.ui.dot.x = this.moveDest.x;
  20280. this.ui.dot.y = this.moveDest.y;
  20281. }
  20282. closeSelf() {
  20283. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  20284. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  20285. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  20286. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  20287. xGame.common.gameMgr.gamePause = false;
  20288. this.hide();
  20289. }
  20290. openPressDotEvent() {
  20291. this.closePressDotEvent();
  20292. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20293. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20294. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20295. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20296. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20297. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20298. }
  20299. closePressDotEvent() {
  20300. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20301. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20302. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20303. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20304. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20305. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20306. }
  20307. onDown(e) {
  20308. if (e.type == Laya.Event.MOUSE_DOWN)
  20309. this.isPressd = true;
  20310. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  20311. this.isPressd = false;
  20312. if (!this.isPressd)
  20313. return;
  20314. this.moveDest.x = e.stageX;
  20315. this.moveDest.y = e.stageY;
  20316. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  20317. if (dis > 6724) {
  20318. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  20319. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  20320. }
  20321. this.setDot();
  20322. }
  20323. resetRod() {
  20324. this.ui.dot.x = this.ui.white.x;
  20325. this.ui.dot.y = this.ui.white.y;
  20326. this.gameRod.dot.x = this.gameRod.bg.x;
  20327. this.gameRod.dot.y = this.gameRod.bg.y;
  20328. xGame.common.rodOffest.x = 0;
  20329. xGame.common.rodOffest.y = 0;
  20330. }
  20331. }
  20332. UIRodMethod$1.uiName = "UIRodMethod";
  20333. class UIMsg$1 extends UIBase {
  20334. constructor() {
  20335. super();
  20336. }
  20337. onConstructor() {
  20338. this.ui = ui_UIMsg.createInstance();
  20339. this.contentPane = this.ui;
  20340. this.isEject = false;
  20341. this.isMuti = true;
  20342. }
  20343. show(msg, callback) {
  20344. super.show();
  20345. this.ui.tipsNode.msgTxt.text = msg;
  20346. this.ui.alpha = 1;
  20347. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  20348. this.hide();
  20349. callback && callback();
  20350. }), 1000);
  20351. this.setGlobalFont(this.ui);
  20352. }
  20353. }
  20354. UIMsg$1.uiName = "UIMsg";
  20355. class UITips$1 extends UIBase {
  20356. constructor() {
  20357. super();
  20358. this.type = 0;
  20359. }
  20360. onConstructor() {
  20361. this.ui = ui_UITips.createInstance();
  20362. this.contentPane = this.ui;
  20363. this.isEject = false;
  20364. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20365. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20366. }
  20367. show(tipsTxt, womanTxt, type) {
  20368. super.show();
  20369. this.ui.t0.play();
  20370. this.ui.myNode.tipsTxt.text = tipsTxt;
  20371. this.ui.myNode.womanTxt.text = womanTxt;
  20372. PlatMgr.showInsert(true);
  20373. this.ui.myNode.c1.selectedIndex = type;
  20374. this.type = type;
  20375. switch (this.type) {
  20376. case TipsType.exitGame:
  20377. xGame.common.gameMgr.gamePause = true;
  20378. break;
  20379. case TipsType.foul:
  20380. Laya.timer.once(200, this, () => {
  20381. if (xGame.common.gameMgr) {
  20382. xGame.common.gameMgr.gamePause = true;
  20383. }
  20384. else {
  20385. console.log("zh:gameMgr is null");
  20386. }
  20387. });
  20388. break;
  20389. default:
  20390. break;
  20391. }
  20392. this.setGlobalFont(this.ui);
  20393. }
  20394. clickLeftBtn() {
  20395. this.hide();
  20396. xGame.common.gameMgr.gamePause = false;
  20397. switch (this.type) {
  20398. case TipsType.exitGame:
  20399. break;
  20400. case TipsType.foul:
  20401. break;
  20402. default:
  20403. break;
  20404. }
  20405. }
  20406. clickRightBtn() {
  20407. this.hide();
  20408. switch (this.type) {
  20409. case TipsType.exitGame:
  20410. xGame.eventMgr.event(RESET_GAME);
  20411. xGame.uiMgr.Show(UIMain$1);
  20412. Moyu.recordEnd(this, null);
  20413. xGame.common.longHelpLine = false;
  20414. break;
  20415. case TipsType.foul:
  20416. if (xGame.common.gameMgr) {
  20417. xGame.common.gameMgr.gamePause = false;
  20418. }
  20419. Laya.timer.clearAll(this);
  20420. break;
  20421. default:
  20422. break;
  20423. }
  20424. }
  20425. }
  20426. UITips$1.uiName = "UITips";
  20427. class UIGame$1 extends UIBase {
  20428. constructor() {
  20429. super();
  20430. this.powerNum = 0;
  20431. this.isD3Inited = false;
  20432. this.isPrePlay = false;
  20433. this.isMoveRod = false;
  20434. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20435. this.rulerDis = 20;
  20436. this.rulerOffset = 0;
  20437. }
  20438. onConstructor() {
  20439. this.ui = ui_UIGame.createInstance();
  20440. this.contentPane = this.ui;
  20441. this.ui.x += xGame.common.sysOffestNum;
  20442. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20443. this.isEject = false;
  20444. xGame.common.gameUI = this;
  20445. this.initSelf();
  20446. }
  20447. isTurnSelf() {
  20448. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20449. return true;
  20450. }
  20451. }
  20452. initSelf() {
  20453. let topUI = this.ui.topNode;
  20454. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20455. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20456. this.barInfo = {};
  20457. this.barInfo.curY = 0;
  20458. this.barInfo.height = this.ui.powerNode.height;
  20459. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20460. this.barInfo.powerStartY = this.ui.powerNode.y;
  20461. xGame.common.aiPlayer = new AIPlayer();
  20462. xGame.common.gameMgr = new GameMgr();
  20463. xGame.common.skillMgr = new SkillMgr();
  20464. xGame.common.wordsMgr = new WordsMgr();
  20465. xGame.common.talkMgr = new TalkMgr();
  20466. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20467. });
  20468. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20469. });
  20470. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20471. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20472. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20473. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20474. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20475. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20476. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20477. }
  20478. getGanZiImg() {
  20479. let index = DataMgr.getCurBallRod();
  20480. let data = cfgTable.ballrodData[index + 1];
  20481. let gan_url = xGame.common.getGameIconUrl(data.img);
  20482. this.ui.powerNode.showImg.url = gan_url;
  20483. }
  20484. returnHome() {
  20485. let tips = "Are you sure to exit the game?";
  20486. let woman = "Boss, why don't you play for a while longer?";
  20487. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20488. }
  20489. addRodMethodClick() {
  20490. if (this.isTurnSelf()) {
  20491. xGame.uiMgr.Show(UIRodMethod$1);
  20492. }
  20493. }
  20494. clickHelpLineBtn(force = false) {
  20495. if (!this.isTurnSelf())
  20496. return;
  20497. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20498. if (success) {
  20499. xGame.common.longHelpLine = true;
  20500. xGame.common.d2World.getHelpLine();
  20501. Moyu.sendDataEvent("guideNum");
  20502. }
  20503. else {
  20504. }
  20505. });
  20506. }
  20507. renderSelfDisplayBalls(index, target) {
  20508. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20509. target.myImg.url = xGame.common.getGameIconUrl(str);
  20510. }
  20511. renderAIDisplayBalls(index, target) {
  20512. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20513. target.myImg.url = xGame.common.getGameIconUrl(str);
  20514. ;
  20515. }
  20516. updateMode() {
  20517. if (xGame.common.gameMode == GameMode.classic) {
  20518. this.ui.topNode.scoreNode.visible = false;
  20519. }
  20520. else if (xGame.common.gameMode == GameMode.bigMove) {
  20521. this.ui.topNode.scoreNode.visible = true;
  20522. }
  20523. }
  20524. show() {
  20525. super.show();
  20526. this.ui.alpha = 0;
  20527. this.updateSelf();
  20528. xGame.common.gameMgr.gamePause = false;
  20529. xGame.common.gameUI.ui.blackAni.visible = false;
  20530. xGame.common.gameUI.ui.whiteAni.visible = false;
  20531. this.ui.powerEft.visible = false;
  20532. this.ui.colorNode.visible = false;
  20533. this.updateHead();
  20534. let curUse = DataMgr.getCurBallRod();
  20535. this.getGanZiImg();
  20536. if (DataMgr.getGuideDefaultModel() === 1) {
  20537. Laya.timer.once(3000, this, () => {
  20538. this.yinDaoForLianxi();
  20539. });
  20540. }
  20541. else {
  20542. }
  20543. this.setGlobalFont(this.ui);
  20544. }
  20545. yinDaoForLianxi() {
  20546. let lianXiGuide = DataMgr.getLianXiGuide();
  20547. console.log('zh:lianXiGuide=', lianXiGuide);
  20548. if (lianXiGuide === 0) {
  20549. this.ui.n_lxms_yd1.visible = true;
  20550. console.log('zh:yinDaoForLianxi 111 set ok');
  20551. }
  20552. else {
  20553. this.ui.n_lxms_yd1.visible = false;
  20554. console.log('zh:无需引导11');
  20555. }
  20556. }
  20557. updateSelf() {
  20558. if (xGame.common.gameMode == GameMode.classic) {
  20559. this.ui.c1.selectedIndex = 0;
  20560. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20561. this.ui.topNode.middleNode.visible = true;
  20562. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20563. }
  20564. else if (xGame.common.gameMode == GameMode.bigMove) {
  20565. this.ui.c1.selectedIndex = 0;
  20566. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20567. this.ui.topNode.middleNode.visible = false;
  20568. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20569. let rand = xGame.common.randomNum(1, max);
  20570. let guide = DataMgr.getSkillGuide();
  20571. if (guide == 0)
  20572. rand = 1;
  20573. xGame.common.bigMoveLevelIndex = rand;
  20574. }
  20575. else if (xGame.common.gameMode == GameMode.placeBall) {
  20576. console.log('zh:练习模式...');
  20577. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20578. this.ui.c1.selectedIndex = 1 + data.type;
  20579. this.ui.alpha = 1;
  20580. this.startGame();
  20581. }
  20582. this.updateMode();
  20583. this.initD3world();
  20584. this.initD2world();
  20585. }
  20586. startGame() {
  20587. this.ui.snowNode.visible = Math.random() <= 0.1;
  20588. this.ui.d2Node.visible = false;
  20589. xGame.common.d3World.d3Hand.gameObj.active = false;
  20590. xGame.common.d3World.tableSrc.init();
  20591. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20592. this.cameraViewChange(() => {
  20593. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20594. switch (xGame.common.gameMode) {
  20595. case GameMode.classic:
  20596. xGame.common.d3World.d3Hand.gameObj.active = true;
  20597. this.playPutBallD3Ani();
  20598. break;
  20599. case GameMode.bigMove:
  20600. this.enterGame();
  20601. Laya.timer.once(500, this, () => {
  20602. this.ui.topNode.middleNode.visible = true;
  20603. this.ui.topNode.middleNode.t0.play();
  20604. });
  20605. break;
  20606. case GameMode.placeBall:
  20607. this.enterGame();
  20608. break;
  20609. default:
  20610. break;
  20611. }
  20612. });
  20613. PlatMgr.showBanner(false);
  20614. }
  20615. enterGame() {
  20616. this.ui.d2Node.visible = true;
  20617. xGame.common.d3World.d3Hand.gameObj.active = false;
  20618. xGame.common.showOneCamera("mainCamera");
  20619. Moyu.recordGame(30, true);
  20620. if (!this.isPrePlay) {
  20621. this.isPrePlay = true;
  20622. xGame.common.d3World.prePlayEft();
  20623. }
  20624. xGame.common.gameMgr.gameReady();
  20625. this.openAllEvent();
  20626. this.ui.snowNode.visible = false;
  20627. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20628. this.ui.helpBtn.visible = condition;
  20629. }
  20630. showHelpLineGuide() {
  20631. let longGuide = DataMgr.getGuideHelpLine();
  20632. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20633. this.ui.helpBtn.visible = true;
  20634. this.ui.guideNode.visible = true;
  20635. }
  20636. }
  20637. setTurnAlpha(alpha) {
  20638. this.ui.keduNode.alpha = alpha;
  20639. this.ui.ganNode.alpha = alpha;
  20640. this.ui.rodMethodNode.alpha = alpha;
  20641. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20642. }
  20643. cameraViewChange(callback) {
  20644. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20645. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20646. xGame.common.showOneCamera("visitAngle");
  20647. cameraSrc.localRotationEulerY = 180;
  20648. cameraSrc.localRotationEulerZ = 0;
  20649. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20650. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20651. callback && callback();
  20652. }));
  20653. }));
  20654. }
  20655. playPutBallD3Ani() {
  20656. xGame.common.showOneCamera("mainCamera");
  20657. let handSrc = xGame.common.d3World.d3Hand;
  20658. handSrc.gameObj.active = true;
  20659. handSrc.transform.localPositionZ = 3;
  20660. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20661. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20662. handSrc.gameObj.active = false;
  20663. this.enterGame();
  20664. }), 400);
  20665. }));
  20666. }
  20667. updateHead() {
  20668. let user = Moyu.getUserInfo();
  20669. this.ui.topNode.selfNameTxt.text = user.nickName;
  20670. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20671. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20672. if (DataMgr.getSkillGuide() < 1) {
  20673. this.ui.topNode.aiNameTxt.text = 'billiards';
  20674. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20675. }
  20676. else {
  20677. this.ui.topNode.aiNameTxt.text = aiData.name;
  20678. let randNo = Math.floor(Math.random() * 10) + 1;
  20679. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20680. }
  20681. }
  20682. initD2world() {
  20683. let node = this.ui.d2Root.displayObject;
  20684. let src = node.getComponent(D2World);
  20685. if (!src) {
  20686. xGame.common.d2World = node.addComponent(D2World);
  20687. }
  20688. xGame.common.d2World.initSelf();
  20689. }
  20690. initD3world() {
  20691. if (this.isD3Inited)
  20692. return;
  20693. this.isD3Inited = true;
  20694. let scene3D = xGame.common.d3Scene;
  20695. this.ui.d3Root.displayObject.addChild(scene3D);
  20696. scene3D.active = true;
  20697. xGame.common.d3World.tableSrc.setBorderPos();
  20698. }
  20699. onRootMove(e) {
  20700. let rootBall = xGame.common.d2World.rootBall;
  20701. this.ui.moveNode.x = e.x;
  20702. this.ui.moveNode.y = e.y;
  20703. rootBall.gameObj.x = e.x;
  20704. rootBall.gameObj.y = e.y;
  20705. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20706. }
  20707. aiRootMove(move) {
  20708. if (move)
  20709. this.hideBallUI();
  20710. else {
  20711. this.showBallUI();
  20712. xGame.common.d2World.getHelpLine();
  20713. }
  20714. }
  20715. aiForce(type, force = 0) {
  20716. this.pressTarget = PressType.powerNode;
  20717. if (type == 1)
  20718. this.onEventUp({ force: true });
  20719. else if (type == 2)
  20720. this.onEventMove({ stageY: force, force: true });
  20721. }
  20722. onEventPress(e) {
  20723. if (e.stopPropagation)
  20724. e.stopPropagation();
  20725. if (!this.isTurnSelf())
  20726. return;
  20727. let target = e.target;
  20728. switch (target) {
  20729. case this.ui.myPowerNode.displayObject:
  20730. this.pressTarget = PressType.powerNode;
  20731. this.barInfo.curY = e.stageY;
  20732. this.updateBarInfo();
  20733. break;
  20734. case this.ui.moveNode.displayObject:
  20735. this.pressTarget = PressType.moveNode;
  20736. this.hideBallUI();
  20737. this.eventObj.curX = this.ui.moveNode.x;
  20738. this.eventObj.curY = this.ui.moveNode.y;
  20739. this.ui.moveNode.finger.visible = false;
  20740. this.eventObj.lastX = e.stageX;
  20741. this.eventObj.lastY = e.stageY;
  20742. break;
  20743. case this.ui.rulerClickNode.displayObject:
  20744. this.pressTarget = PressType.rulerNode;
  20745. this.eventObj.lastY = e.stageY;
  20746. break;
  20747. case this.ui.d2Root.displayObject:
  20748. this.pressTarget = PressType.d2Root;
  20749. this.eventObj.lastX = e.stageX;
  20750. this.eventObj.lastY = e.stageY;
  20751. this.eventObj.starX = e.stageX;
  20752. this.eventObj.starY = e.stageY;
  20753. this.eventObj.curX = 0;
  20754. this.eventObj.curY = 0;
  20755. xGame.common.d2World.d2Gan.setGanLastInfo();
  20756. this.rulerOffset = 0;
  20757. break;
  20758. default:
  20759. break;
  20760. }
  20761. }
  20762. onEventMove(e) {
  20763. if (e.stopPropagation)
  20764. e.stopPropagation();
  20765. if (e && e.force) {
  20766. }
  20767. else {
  20768. if (!this.isTurnSelf())
  20769. return;
  20770. }
  20771. switch (this.pressTarget) {
  20772. case PressType.powerNode:
  20773. this.barInfo.curY = e.stageY;
  20774. this.updateBarInfo();
  20775. this.isMoveRod = true;
  20776. break;
  20777. case PressType.moveNode:
  20778. let rootBall = xGame.common.d2World.rootBall;
  20779. let radius = rootBall.gameObj.width / 2;
  20780. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20781. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20782. let border = xGame.common.d2World.borderRect;
  20783. if (curX <= border.x + radius)
  20784. curX = border.x + radius;
  20785. else if (curX >= border.x + border.width - radius)
  20786. curX = border.x + border.width - radius;
  20787. if (curY <= border.y + radius)
  20788. curY = border.y + radius;
  20789. else if (curY >= border.y + border.height - radius)
  20790. curY = border.y + border.height - radius;
  20791. if (xGame.common.gameMgr.isOpenBall) {
  20792. if (curX >= border.x + border.openBallW - radius)
  20793. curX = border.x + border.openBallW - radius;
  20794. }
  20795. this.ui.moveNode.x = curX;
  20796. this.ui.moveNode.y = curY;
  20797. rootBall.gameObj.x = curX;
  20798. rootBall.gameObj.y = curY;
  20799. rootBall.d3BallSrc.setTransPos(curX, curY);
  20800. this.isMoveRod = true;
  20801. break;
  20802. case PressType.rulerNode:
  20803. let yy = e.stageY - this.eventObj.lastY;
  20804. this.eventObj.lastY = e.stageY;
  20805. let ruler1 = this.ui.rulerNode.img1;
  20806. let ruler2 = this.ui.rulerNode.img2;
  20807. ruler1.y += yy;
  20808. ruler2.y += yy;
  20809. this.rulerOffset += yy;
  20810. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20811. this.rulerOffset = 0;
  20812. xGame.soundMgr.playSound("inch", 1, 10);
  20813. }
  20814. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20815. let h = ruler1.height;
  20816. if (DataMgr.getGuideDefaultModel() === 1) {
  20817. this.checkGuideForLxms();
  20818. }
  20819. else {
  20820. this.checkGuide();
  20821. }
  20822. this.isMoveRod = true;
  20823. if (ruler1.y >= h) {
  20824. ruler1.y = -h;
  20825. ruler2.y = 0;
  20826. return;
  20827. }
  20828. else if (ruler1.y <= -h) {
  20829. ruler1.y = h;
  20830. ruler2.y = 0;
  20831. return;
  20832. }
  20833. if (ruler2.y >= h) {
  20834. ruler2.y = -h;
  20835. ruler1.y = 0;
  20836. return;
  20837. }
  20838. else if (ruler2.y <= -h) {
  20839. ruler2.y = h;
  20840. ruler1.y = 0;
  20841. return;
  20842. }
  20843. break;
  20844. case PressType.d2Root:
  20845. this.eventObj.curX = e.stageX;
  20846. this.eventObj.curY = e.stageY;
  20847. let offset = this.checkRodMoveDir();
  20848. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20849. this.eventObj.lastX = e.stageX;
  20850. this.eventObj.lastY = e.stageY;
  20851. break;
  20852. default:
  20853. break;
  20854. }
  20855. }
  20856. onEventUp(e) {
  20857. if (e.stopPropagation)
  20858. e.stopPropagation();
  20859. if (e && e.force) {
  20860. }
  20861. else {
  20862. if (!this.isTurnSelf())
  20863. return;
  20864. }
  20865. switch (this.pressTarget) {
  20866. case PressType.powerNode:
  20867. this.ui.powerNode.value = 0;
  20868. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20869. this.ui.powerTxt.text = "";
  20870. if (this.powerNum > 0) {
  20871. xGame.eventMgr.event(BALL_SHOOT);
  20872. xGame.common.d2World.shoot(this.powerNum);
  20873. xGame.common.d2World.d2Gan.shoot();
  20874. xGame.common.d2World.d2HelpLine.shoot();
  20875. if (DataMgr.getGuideDefaultModel() === 1) {
  20876. this.finishGuideForLxms();
  20877. }
  20878. else {
  20879. this.finishGuide();
  20880. }
  20881. this.ui.powerEft.visible = false;
  20882. this.ui.colorNode.visible = false;
  20883. let ganStr = "";
  20884. if (this.powerNum <= 30) {
  20885. ganStr = "gan_30";
  20886. }
  20887. else if (this.powerNum <= 60) {
  20888. ganStr = "gan_50";
  20889. }
  20890. else {
  20891. ganStr = "gan_80";
  20892. }
  20893. xGame.soundMgr.playSound(ganStr);
  20894. }
  20895. break;
  20896. case PressType.moveNode:
  20897. let rootBall = xGame.common.d2World.rootBall;
  20898. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20899. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20900. let isIntersect = this.judgeBallIntersect();
  20901. if (isIntersect) {
  20902. this.ui.moveNode.x = lastX;
  20903. this.ui.moveNode.y = lastY;
  20904. rootBall.gameObj.x = lastX;
  20905. rootBall.gameObj.y = lastY;
  20906. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20907. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20908. }
  20909. else {
  20910. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20911. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20912. }
  20913. this.showBallUI();
  20914. this.ui.moveNode.finger.visible = true;
  20915. xGame.common.d2World.getHelpLine();
  20916. break;
  20917. case PressType.rulerNode:
  20918. break;
  20919. case PressType.d2Root:
  20920. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20921. if (dis <= 25) {
  20922. this.moveToClickDot(e);
  20923. }
  20924. break;
  20925. default:
  20926. break;
  20927. }
  20928. this.pressTarget = -1;
  20929. }
  20930. checkGuide() {
  20931. console.log('zh:111111111111aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafFFFFFFFFFFFFFFFFFF');
  20932. let guide = DataMgr.getSkillGuide();
  20933. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20934. xGame.common.guideStep++;
  20935. xGame.common.gameUI.ui.guide2.visible = false;
  20936. xGame.common.gameUI.ui.guide3.visible = true;
  20937. }
  20938. }
  20939. checkGuideForLxms() {
  20940. let guide = DataMgr.getLianXiGuide();
  20941. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  20942. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  20943. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20944. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  20945. xGame.common.guideStepForLianXi = 3;
  20946. }
  20947. }
  20948. finishGuide() {
  20949. let guide = DataMgr.getSkillGuide();
  20950. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20951. xGame.common.guideStep = 10;
  20952. this.closeAllGuide();
  20953. console.log('zh: 新手引导完毕');
  20954. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20955. }
  20956. }
  20957. finishGuideForLxms() {
  20958. let guide = DataMgr.getLianXiGuide();
  20959. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  20960. xGame.common.guideStepForLianXi = 3;
  20961. DataMgr.setLianXiGuide(1);
  20962. this.closeAllGuideForLxms();
  20963. console.log('zh: lxms新手引导完毕');
  20964. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20965. }
  20966. }
  20967. closeAllGuide() {
  20968. xGame.common.gameUI.ui.guide1.visible = false;
  20969. xGame.common.gameUI.ui.guide2.visible = false;
  20970. xGame.common.gameUI.ui.guide3.visible = false;
  20971. }
  20972. closeAllGuideForLxms() {
  20973. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  20974. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20975. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  20976. }
  20977. updateBarInfo() {
  20978. let star = this.ui.powerNode.y;
  20979. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20980. if (rate >= 1)
  20981. rate = 1;
  20982. if (rate <= 0)
  20983. rate = 0;
  20984. this.powerNum = Math.ceil(rate * 100);
  20985. this.ui.powerNode.value = this.powerNum;
  20986. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20987. this.ui.colorNode.value = this.powerNum;
  20988. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20989. this.ui.powerEft.visible = this.powerNum != 0;
  20990. this.ui.colorNode.visible = this.powerNum != 0;
  20991. this.ui.powerTxt.text = this.powerNum + "";
  20992. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20993. }
  20994. forceCancel() {
  20995. this.ui.powerNode.value = 0;
  20996. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20997. this.ui.powerTxt.text = "";
  20998. }
  20999. checkRodMoveDir() {
  21000. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  21001. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  21002. if (tempX >= 0 && tempY <= 0) {
  21003. return this.checkDir();
  21004. }
  21005. else if (tempX < 0 && tempY < 0) {
  21006. return this.checkDir(1, -1);
  21007. }
  21008. else if (tempX < 0 && tempY > 0) {
  21009. return this.checkDir(-1, -1);
  21010. }
  21011. else {
  21012. return this.checkDir(-1, 1);
  21013. }
  21014. }
  21015. checkDir(flagX = 1, flagY = 1) {
  21016. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  21017. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  21018. if (offsetY == 0) {
  21019. return offsetX * flagX;
  21020. }
  21021. if (offsetX == 0) {
  21022. return offsetY * flagY;
  21023. }
  21024. let angle = offsetY / offsetX;
  21025. if (Math.abs(angle) >= 1) {
  21026. return offsetY * flagY;
  21027. }
  21028. else {
  21029. return offsetX * flagX;
  21030. }
  21031. }
  21032. judgeBallIntersect() {
  21033. let rootBall = xGame.common.d2World.rootBall;
  21034. let ballArr = xGame.common.d2World.ballArr;
  21035. let radius = rootBall.gameObj.width / 2;
  21036. let temp;
  21037. let isIntersect = false;
  21038. for (let index = 0; index < ballArr.length; index++) {
  21039. temp = ballArr[index];
  21040. if (temp.number == rootBall.number)
  21041. continue;
  21042. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  21043. if (isIntersect) {
  21044. break;
  21045. }
  21046. }
  21047. return isIntersect;
  21048. }
  21049. hideBallUI() {
  21050. let d2Gan = xGame.common.d2World.d2Gan;
  21051. if (!d2Gan.ui.isDisposed)
  21052. d2Gan.ui.visible = false;
  21053. let d2Help = xGame.common.d2World.d2HelpLine;
  21054. if (!d2Help.ui.isDisposed)
  21055. d2Help.ui.visible = false;
  21056. let rootBall = xGame.common.d2World.rootBall;
  21057. if (!rootBall.destroyed) {
  21058. rootBall.gameObj.active = false;
  21059. }
  21060. }
  21061. showBallUI() {
  21062. let d2Gan = xGame.common.d2World.d2Gan;
  21063. if (!d2Gan.ui.isDisposed)
  21064. d2Gan.ui.visible = true;
  21065. let d2Help = xGame.common.d2World.d2HelpLine;
  21066. if (!d2Help.ui.isDisposed)
  21067. d2Help.ui.visible = true;
  21068. let rootBall = xGame.common.d2World.rootBall;
  21069. if (!rootBall.destroyed) {
  21070. rootBall.gameObj.active = true;
  21071. }
  21072. }
  21073. moveToClickDot(e) {
  21074. if (!this.isMoveRod && !xGame.common.clickedBall) {
  21075. let root = xGame.common.d2World.rootBall.gameObj;
  21076. let xx = e.stageX - xGame.common.sysOffestNum;
  21077. let yy = e.stageY;
  21078. let x = xx - root.x;
  21079. let y = yy - root.y;
  21080. let angle = xGame.common.getfguiRotation(x, y);
  21081. xGame.common.d2World.d2Gan.ui.rotation = angle;
  21082. xGame.common.d2World.getHelpLine();
  21083. }
  21084. this.isMoveRod = false;
  21085. xGame.common.clickedBall = false;
  21086. }
  21087. openAllEvent() {
  21088. this.closeAllEvent();
  21089. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21090. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21091. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21092. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21093. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21094. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21095. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21096. }
  21097. closeAllEvent() {
  21098. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21099. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21100. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21101. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21102. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21103. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21104. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21105. }
  21106. resetGame() {
  21107. this.closeAllEvent();
  21108. this.hideBallUI();
  21109. xGame.common.gameMgr.gamePause = true;
  21110. }
  21111. }
  21112. UIGame$1.uiName = "UIGame";
  21113. class UIAddCoin$1 extends UIBase {
  21114. constructor() {
  21115. super();
  21116. this.coinNum = 2000;
  21117. }
  21118. onConstructor() {
  21119. this.ui = ui_UIAddCoin.createInstance();
  21120. this.contentPane = this.ui;
  21121. this.isEject = false;
  21122. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21123. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  21124. }
  21125. show() {
  21126. super.show();
  21127. this.ui.t0.play();
  21128. this.setGlobalFont(this.ui);
  21129. }
  21130. videoAddCoin() {
  21131. console.log('zh:qjff_AD_for_UIAddCoin');
  21132. if (Laya.Browser.onAndroid) {
  21133. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21134. if (!boo) {
  21135. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21136. return;
  21137. }
  21138. }
  21139. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  21140. }
  21141. else {
  21142. console.log('zh:AD 失败,直接发放奖励');
  21143. this.qjff_AD_for_UIAddCoin();
  21144. }
  21145. }
  21146. qjff_AD_for_UIAddCoin() {
  21147. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  21148. this.hide();
  21149. }
  21150. }
  21151. UIAddCoin$1.uiName = "UIAddCoin";
  21152. class UIInvitation$1 extends UIBase {
  21153. constructor() {
  21154. super();
  21155. }
  21156. onConstructor() {
  21157. this.ui = ui_UIInvitation.createInstance();
  21158. this.contentPane = this.ui;
  21159. this.isEject = false;
  21160. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  21161. }
  21162. show() {
  21163. super.show();
  21164. this.setGlobalFont(this.ui);
  21165. }
  21166. enterGame() {
  21167. xGame.common.gameMode = GameMode.classic;
  21168. DataMgr.setChallengeTimes(1);
  21169. xGame.common.passAwardCoin = 2000;
  21170. let need = xGame.common.classicNiceNeddCoin;
  21171. if (DataMgr.coinEnough(need)) {
  21172. DataMgr.setCoin(-need);
  21173. xGame.eventMgr.event(RESTART_GAME, true);
  21174. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  21175. }
  21176. else {
  21177. xGame.eventMgr.event(RESTART_GAME, true);
  21178. }
  21179. this.hide();
  21180. }
  21181. hide() {
  21182. super.hide();
  21183. }
  21184. }
  21185. UIInvitation$1.uiName = "UIInvitation";
  21186. class UIPower$1 extends UIBase {
  21187. constructor() {
  21188. super();
  21189. }
  21190. onConstructor() {
  21191. this.ui = ui_UIPower.createInstance();
  21192. this.contentPane = this.ui;
  21193. this.isEject = false;
  21194. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21195. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  21196. }
  21197. show() {
  21198. super.show();
  21199. this.ui.t0.play();
  21200. this.setGlobalFont(this.ui);
  21201. }
  21202. videoGetPower() {
  21203. console.log('zh:qjff_AD_for_uipower');
  21204. if (Laya.Browser.onAndroid) {
  21205. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21206. if (!boo) {
  21207. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21208. return;
  21209. }
  21210. }
  21211. if (Laya.Browser.onAndroid) {
  21212. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  21213. }
  21214. else {
  21215. console.log('zh:AD 失败,直接发放奖励');
  21216. this.qjff_AD_for_uipower();
  21217. }
  21218. }
  21219. else {
  21220. this.qjff_AD_for_uipower();
  21221. }
  21222. }
  21223. qjff_AD_for_uipower() {
  21224. DataMgr.setPower(xGame.common.videoPower, true);
  21225. xGame.eventMgr.event(POWER_TIME);
  21226. this.hide();
  21227. }
  21228. }
  21229. UIPower$1.uiName = "UIPower";
  21230. class UIGameEnd$1 extends UIBase {
  21231. constructor() {
  21232. super();
  21233. this.success = false;
  21234. this.awardCoinNum = 1000;
  21235. this.awardDiamondNum = 10;
  21236. }
  21237. onConstructor() {
  21238. this.ui = ui_UIGameEnd.createInstance();
  21239. this.contentPane = this.ui;
  21240. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  21241. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  21242. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  21243. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21244. this.ui.talkNode.visible = false;
  21245. if (Moyu.isKs)
  21246. this.ui.closeNode.closeBtn.x += 100;
  21247. }
  21248. updateType() {
  21249. switch (xGame.common.gameMode) {
  21250. case GameMode.classic:
  21251. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21252. this.ui.coinNode.visible = this.success;
  21253. if (!this.success) {
  21254. Laya.timer.once(500, this, () => {
  21255. xGame.uiMgr.Show(UIAddCoin$1);
  21256. });
  21257. }
  21258. else {
  21259. this.logEventForClassic_win();
  21260. }
  21261. this.logEventForClassic_complete();
  21262. this.ui.isGetAward.visible = false;
  21263. this.ui.leftBtn.c1.selectedIndex = 3;
  21264. this.ui.rightBtn.c1.selectedIndex = 0;
  21265. this.moneyNode.ui.c1.selectedIndex = 1;
  21266. break;
  21267. case GameMode.bigMove:
  21268. console.log('zh:招法模式 aaaaaa bigMove');
  21269. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21270. this.ui.coinNode.visible = this.success;
  21271. if (xGame.common.gameMode == GameMode.bigMove) {
  21272. if (this.success) {
  21273. DataMgr.setSkillSuccessTimes(1, true);
  21274. DataMgr.setSkillAccTimes(1);
  21275. }
  21276. else {
  21277. DataMgr.setSkillSuccessTimes(0, false);
  21278. }
  21279. }
  21280. this.logEventForRod_complete_N();
  21281. if (!this.success) {
  21282. Laya.timer.once(500, this, () => {
  21283. xGame.uiMgr.Show(UIAddCoin$1);
  21284. });
  21285. }
  21286. else {
  21287. this.logEventForRod_win();
  21288. }
  21289. this.ui.isGetAward.visible = false;
  21290. this.ui.leftBtn.c1.selectedIndex = 3;
  21291. this.ui.rightBtn.c1.selectedIndex = 0;
  21292. this.moneyNode.ui.c1.selectedIndex = 1;
  21293. break;
  21294. case GameMode.placeBall:
  21295. this.ui.coinNode.visible = false;
  21296. if (this.success) {
  21297. if (xGame.common.placeBallStarNum == 3) {
  21298. this.ui.c1.selectedIndex = 2;
  21299. }
  21300. else {
  21301. this.ui.c1.selectedIndex = 3;
  21302. }
  21303. let level = xGame.common.placeBallCurLevel;
  21304. if (level > 59) {
  21305. this.logEventForChallenge_level_complete(level);
  21306. }
  21307. else {
  21308. this.logEventForChallenge_level_N(level);
  21309. }
  21310. }
  21311. else {
  21312. this.ui.c1.selectedIndex = 4;
  21313. }
  21314. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  21315. if (cfg.type == PlaceBallType.challenge) {
  21316. this.ui.c1.selectedIndex = 2;
  21317. }
  21318. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  21319. this.updatePlaceBallBtn();
  21320. this.updatePlaceBallStarNum();
  21321. this.updatePlaceBallAwardState();
  21322. this.moneyNode.ui.c1.selectedIndex = 2;
  21323. this.moneyNode.checkPowerTime();
  21324. this.moneyNode.powerChange();
  21325. DataMgr.upRankData();
  21326. break;
  21327. default:
  21328. break;
  21329. }
  21330. }
  21331. logEventForRod_complete_N() {
  21332. let gfmsIdx = xGame.common.curPlayerSkillType;
  21333. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  21334. let gfmc = 'Skyfall Shot';
  21335. if (gfmsIdx == 0) {
  21336. gfmc = 'Skyfall Shot';
  21337. }
  21338. if (gfmsIdx == 1) {
  21339. gfmc = 'Surging break';
  21340. }
  21341. if (gfmsIdx == 2) {
  21342. gfmc = 'Frost Lock';
  21343. }
  21344. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21345. console.log('zh:logEventForRod_complete_N level = ' + level);
  21346. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21347. let jsonStr = {
  21348. "count": 0,
  21349. "name": gfmc
  21350. };
  21351. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21352. const d = LocalStorageManager.getItem(keyStr);
  21353. jsonStr.count = d.count + 1;
  21354. LocalStorageManager.setItem(keyStr, jsonStr);
  21355. }
  21356. else {
  21357. LocalStorageManager.setItem(keyStr, jsonStr);
  21358. }
  21359. const d2 = LocalStorageManager.getItem(keyStr);
  21360. let count = d2.count;
  21361. console.log('zh:logEventForRod_complete_N count = ' + count);
  21362. if (count % 5 == 0) {
  21363. const reqStr = JSON.stringify(jsonStr);
  21364. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  21365. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  21366. }
  21367. }
  21368. logEventForRod_win() {
  21369. console.log('zh:logEventForRod_win,胜利');
  21370. let gfmsIdx = xGame.common.curPlayerSkillType;
  21371. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  21372. let gfmc = 'Skyfall Shot';
  21373. if (gfmsIdx == 0) {
  21374. gfmc = 'Skyfall Shot';
  21375. }
  21376. if (gfmsIdx == 1) {
  21377. gfmc = 'Surging break';
  21378. }
  21379. if (gfmsIdx == 2) {
  21380. gfmc = 'Frost Lock';
  21381. }
  21382. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21383. console.log('zh:logEventForRod_win level = ' + level);
  21384. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  21385. let jsonStr = {
  21386. "count": 1,
  21387. "name": gfmc + ' Lev' + level
  21388. };
  21389. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21390. const d = LocalStorageManager.getItem(keyStr);
  21391. jsonStr.count = d.count + 1;
  21392. LocalStorageManager.setItem(keyStr, jsonStr);
  21393. }
  21394. else {
  21395. LocalStorageManager.setItem(keyStr, jsonStr);
  21396. }
  21397. const reqStr = JSON.stringify(jsonStr);
  21398. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  21399. }
  21400. logEventForClassic_win() {
  21401. console.log('zh:logEventForClassic_win,胜利');
  21402. let rtype = xGame.common.classicRoomType;
  21403. let msmc = '';
  21404. if (rtype == 1) {
  21405. msmc = 'beginner';
  21406. }
  21407. if (rtype == 2) {
  21408. msmc = 'expert';
  21409. }
  21410. if (rtype == 3) {
  21411. msmc = 'master';
  21412. }
  21413. let keyStr = 'sjmd_classic_win_' + rtype;
  21414. let jsonStr = {
  21415. "difficulty": msmc,
  21416. "classic_count": 1,
  21417. "difficulty_count": 1
  21418. };
  21419. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21420. const d = LocalStorageManager.getItem(keyStr);
  21421. jsonStr.classic_count = d.classic_count + 1;
  21422. jsonStr.difficulty_count = d.difficulty_count + 1;
  21423. LocalStorageManager.setItem(keyStr, jsonStr);
  21424. }
  21425. else {
  21426. LocalStorageManager.setItem(keyStr, jsonStr);
  21427. }
  21428. const reqStr = JSON.stringify(jsonStr);
  21429. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21430. }
  21431. logEventForClassic_complete() {
  21432. console.log('zh:logEventForClassic_complete,胜利');
  21433. let rtype = xGame.common.classicRoomType;
  21434. let msmc = '';
  21435. if (rtype == 1) {
  21436. msmc = 'beginner';
  21437. }
  21438. if (rtype == 2) {
  21439. msmc = 'expert';
  21440. }
  21441. if (rtype == 3) {
  21442. msmc = 'master';
  21443. }
  21444. let keyStr = 'sjmd_classic_complete_' + rtype;
  21445. let jsonStr = {
  21446. "msmc": msmc,
  21447. "count": 0
  21448. };
  21449. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21450. const d = LocalStorageManager.getItem(keyStr);
  21451. jsonStr.count = d.count + 1;
  21452. LocalStorageManager.setItem(keyStr, jsonStr);
  21453. }
  21454. else {
  21455. LocalStorageManager.setItem(keyStr, jsonStr);
  21456. }
  21457. if (jsonStr.count % 5 == 0) {
  21458. const reqStr = JSON.stringify(jsonStr);
  21459. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21460. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21461. }
  21462. }
  21463. updatePlaceBallBtn() {
  21464. this.ui.leftBtn.c1.selectedIndex = 5;
  21465. if (this.success) {
  21466. this.ui.rightBtn.c1.selectedIndex = 14;
  21467. }
  21468. else {
  21469. if (xGame.common.placeBallStarNum == 3) {
  21470. this.ui.rightBtn.c1.selectedIndex = 14;
  21471. }
  21472. else {
  21473. this.ui.rightBtn.c1.selectedIndex = 1;
  21474. }
  21475. }
  21476. }
  21477. updatePlaceBallStarNum() {
  21478. let starNum = xGame.common.placeBallStarNum;
  21479. if (starNum == 0)
  21480. this.ui.starNumNode.c1.selectedIndex = 3;
  21481. else {
  21482. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21483. }
  21484. }
  21485. updatePlaceBallAwardState() {
  21486. let level = xGame.common.placeBallCurLevel;
  21487. let starNum = xGame.common.placeBallStarNum;
  21488. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21489. let data = cfgTable.placeballData[level].award;
  21490. let cfg = cfgTable.placeballData[level];
  21491. this.awardDiamondNum = data[1];
  21492. this.awardCoinNum = data[0];
  21493. if (cfg.type == PlaceBallType.challenge) {
  21494. this.awardDiamondNum = 0;
  21495. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21496. }
  21497. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21498. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21499. if (cfg.type == PlaceBallType.challenge) {
  21500. this.ui.awardNode.coinNode.visible = true;
  21501. }
  21502. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21503. this.ui.awardNode.diamondNode.x = 265;
  21504. this.ui.awardNode.coinNode.x = 354;
  21505. }
  21506. else {
  21507. this.ui.awardNode.diamondNode.x = 291;
  21508. this.ui.awardNode.coinNode.x = 291;
  21509. }
  21510. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21511. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21512. if (this.awardCoinNum == 0) {
  21513. this.ui.awardNode.coinNode.numTxt.text = "";
  21514. }
  21515. if (getAward) {
  21516. this.ui.isGetAward.visible = true;
  21517. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21518. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21519. }
  21520. else {
  21521. this.ui.isGetAward.visible = false;
  21522. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21523. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21524. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21525. }
  21526. else {
  21527. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21528. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21529. }
  21530. }
  21531. }
  21532. show(success) {
  21533. super.show();
  21534. xGame.eventMgr.event(RESET_GAME);
  21535. this.success = success;
  21536. Laya.timer.clearAll(this);
  21537. this.playSecretaryAni();
  21538. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21539. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21540. offsetTime = Math.floor(offsetTime / 1000);
  21541. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21542. this.updateType();
  21543. Laya.timer.once(200, this, () => {
  21544. this.addAward(() => {
  21545. this.updateType();
  21546. Laya.timer.once(500, this, () => {
  21547. this.showChallengeLevel();
  21548. });
  21549. });
  21550. });
  21551. if (this.success) {
  21552. JSBridgeUtils.instance.showInternAd('gameend_success');
  21553. console.log('zh:game end 成功');
  21554. xGame.soundMgr.playSound('slots_roll01');
  21555. xGame.soundMgr.playSound("s_win");
  21556. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21557. this.diyGameDataUtilForGameWin();
  21558. this.updateGamePlaceBallData2Server();
  21559. }
  21560. else {
  21561. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21562. console.log('zh:game end失败');
  21563. xGame.soundMgr.playSound('matchwin01');
  21564. xGame.soundMgr.playSound("s_lose");
  21565. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21566. }
  21567. console.log('zh:开始弹出福利框2个');
  21568. Laya.timer.once(1000, this, () => {
  21569. console.log('zh: 1秒后 showFuLiSp1');
  21570. DataMgr.checkForShowFuLi17AndAlert(1);
  21571. });
  21572. let challengeNum = DataMgr.getChallengeTimes();
  21573. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21574. DataMgr.setChallengeTimes(1);
  21575. }
  21576. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21577. DataMgr.setClassicTimes();
  21578. }
  21579. this.setGlobalFont(this.ui);
  21580. }
  21581. diyGameDataUtilForGameWin() {
  21582. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21583. switch (xGame.common.gameMode) {
  21584. case GameMode.classic:
  21585. console.log('zh:DiyGameDataUtilForGameWin 111');
  21586. case GameMode.bigMove:
  21587. console.log('zh:DiyGameDataUtilForGameWin 222');
  21588. this.restartGame();
  21589. break;
  21590. case GameMode.placeBall:
  21591. console.log('zh:DiyGameDataUtilForGameWin 333');
  21592. var level = xGame.common.placeBallCurLevel;
  21593. console.log('zh:练习模式 联系了多少LEV=' + level);
  21594. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21595. if (level > db_over_lev) {
  21596. DataMgr.setChallengeMode_overLev(level);
  21597. }
  21598. break;
  21599. default:
  21600. console.log('zh:DiyGameDataUtilForGameWin 444');
  21601. break;
  21602. }
  21603. }
  21604. updateGamePlaceBallData2Server() {
  21605. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21606. if (userInfo == null) {
  21607. return;
  21608. }
  21609. let pbdObj = DataMgr.getPlaceBallLevelList();
  21610. let reqData = xGame.httpMgr.getReqData();
  21611. let pd = JSON.parse(reqData);
  21612. pd.placeBallData = JSON.stringify(pbdObj);
  21613. reqData = JSON.stringify(pd);
  21614. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21615. try {
  21616. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21617. let code = res.code;
  21618. let msg = res.msg;
  21619. if (code == 401) {
  21620. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21621. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21622. return;
  21623. }
  21624. if (code == 200) {
  21625. let data = res.data;
  21626. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21627. }
  21628. else {
  21629. xGame.uiMgr.Show(UIMsg$1, msg);
  21630. }
  21631. }
  21632. catch (error) {
  21633. console.log('error=' + error);
  21634. alert(error);
  21635. }
  21636. finally {
  21637. }
  21638. });
  21639. }
  21640. showChallengeLevel() {
  21641. if (DataMgr.getChallengeTimes() != 0)
  21642. return;
  21643. let skill = DataMgr.getSkillAccTimes();
  21644. let put = DataMgr.getPlaceBallLevelList().length;
  21645. if (skill >= 3 || put >= 5) {
  21646. xGame.uiMgr.Show(UIInvitation$1);
  21647. this.hide();
  21648. }
  21649. }
  21650. addAward(callback) {
  21651. if (!this.success) {
  21652. callback && callback();
  21653. return;
  21654. }
  21655. switch (xGame.common.gameMode) {
  21656. case GameMode.classic:
  21657. this.awardCoinNum = xGame.common.passAwardCoin;
  21658. this.awardDiamondNum = 0;
  21659. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21660. break;
  21661. case GameMode.bigMove:
  21662. this.awardCoinNum = xGame.common.passAwardCoin;
  21663. this.awardDiamondNum = 0;
  21664. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21665. callback && callback();
  21666. break;
  21667. case GameMode.placeBall:
  21668. let level = xGame.common.placeBallCurLevel;
  21669. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21670. if (xGame.common.placeBallStarNum != 3) {
  21671. callback && callback();
  21672. return;
  21673. }
  21674. else {
  21675. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21676. if (getAward) {
  21677. callback && callback();
  21678. return;
  21679. }
  21680. }
  21681. let cfg = cfgTable.placeballData[level];
  21682. let data = cfgTable.placeballData[level].award;
  21683. this.awardCoinNum = data[0];
  21684. this.awardDiamondNum = data[1];
  21685. if (cfg.type == PlaceBallType.challenge) {
  21686. this.awardDiamondNum = 0;
  21687. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21688. }
  21689. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21690. let diamondAward;
  21691. if (this.awardDiamondNum > 0) {
  21692. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21693. xGame.common.getAward([diamondAward, coinAward], callback);
  21694. }
  21695. else {
  21696. xGame.common.getAward([coinAward], callback);
  21697. }
  21698. if (cfg.type == PlaceBallType.normal) {
  21699. DataMgr.setPlaceBallAward(level);
  21700. }
  21701. break;
  21702. default:
  21703. break;
  21704. }
  21705. }
  21706. playSecretaryAni_old() {
  21707. let parent = this.ui.secretary.displayObject;
  21708. parent.destroyChildren();
  21709. let xx = this.ui.secretary.width / 2;
  21710. let yy = this.ui.secretary.height;
  21711. let scale = xGame.common.getSecretaryScale();
  21712. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21713. if (this.success) {
  21714. let rand = Math.random() <= 0.5 ? 2 : 3;
  21715. xGame.common.secretary.play(data, rand, false, parent, () => {
  21716. xGame.common.secretary.play(data, 1, true, parent);
  21717. });
  21718. }
  21719. else {
  21720. xGame.common.secretary.play(data, 0, true, parent);
  21721. }
  21722. }
  21723. playSecretaryAni() {
  21724. let parent = this.ui.secretary.displayObject;
  21725. parent.destroyChildren();
  21726. let xx = this.ui.secretary.width / 2;
  21727. let yy = this.ui.secretary.height;
  21728. let scale = xGame.common.getSecretaryScale();
  21729. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21730. if (this.success) {
  21731. let rand = 0;
  21732. xGame.common.secretary.play(data, 0, true, parent);
  21733. }
  21734. else {
  21735. xGame.common.secretary.play(data, 0, true, parent);
  21736. }
  21737. }
  21738. restartGame() {
  21739. switch (xGame.common.gameMode) {
  21740. case GameMode.classic:
  21741. xGame.eventMgr.event(RESTART_GAME);
  21742. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21743. break;
  21744. case GameMode.bigMove:
  21745. this.hide();
  21746. xGame.eventMgr.event(RESTART_GAME);
  21747. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21748. break;
  21749. default:
  21750. break;
  21751. }
  21752. }
  21753. hide() {
  21754. super.hide();
  21755. xGame.common.stopGirlPop(this.ui.talkNode);
  21756. PlatMgr.showBanner(false);
  21757. }
  21758. returnHome() {
  21759. this.hide();
  21760. let showFailWords = !this.success;
  21761. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21762. }
  21763. clickLeftBtn() {
  21764. switch (xGame.common.gameMode) {
  21765. case GameMode.classic:
  21766. case GameMode.bigMove:
  21767. this.returnHome();
  21768. break;
  21769. case GameMode.placeBall:
  21770. let level = xGame.common.placeBallCurLevel;
  21771. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21772. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21773. break;
  21774. default:
  21775. break;
  21776. }
  21777. }
  21778. powerStartPlaceBallLevel(level, btn) {
  21779. if (DataMgr.powerEnough()) {
  21780. btn.touchable = false;
  21781. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21782. btn.touchable = true;
  21783. DataMgr.setPower(-1);
  21784. xGame.eventMgr.event(POWER_TIME);
  21785. this.startPlaceBallLevel(level);
  21786. this.logEventForChallenge_level_start(level);
  21787. }));
  21788. }
  21789. else {
  21790. xGame.uiMgr.Show(UIPower$1, 0);
  21791. }
  21792. }
  21793. clickRightBtn() {
  21794. switch (xGame.common.gameMode) {
  21795. case GameMode.classic:
  21796. console.log('zh:clickRightBtn 111');
  21797. case GameMode.bigMove:
  21798. console.log('zh:clickRightBtn 222');
  21799. this.restartGame();
  21800. break;
  21801. case GameMode.placeBall:
  21802. console.log('zh:clickRightBtn 333');
  21803. let level = xGame.common.placeBallCurLevel;
  21804. let data = DataMgr.getPlaceBallLevel(level);
  21805. let curPss = data.play && !data.isCur;
  21806. if (curPss) {
  21807. console.log('zh:clickRightBtn 333-111');
  21808. console.log('zh:当前LV=' + level);
  21809. if (level == 60) {
  21810. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21811. Laya.timer.once(3000, this, () => {
  21812. this.returnHome();
  21813. });
  21814. }
  21815. else {
  21816. let lev = level + 1;
  21817. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21818. }
  21819. }
  21820. else {
  21821. console.log('zh:clickRightBtn 333-000');
  21822. Moyu.sendDataEvent("placeBallNextLevel");
  21823. console.log('zh:qjff_AD_for_uiGameEnd');
  21824. if (Laya.Browser.onAndroid) {
  21825. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21826. if (!boo) {
  21827. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21828. return;
  21829. }
  21830. }
  21831. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21832. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21833. }
  21834. else {
  21835. console.log('zh:AD 失败,直接发放奖励');
  21836. this.qjff_AD_for_uiGameEnd(level);
  21837. }
  21838. }
  21839. break;
  21840. default:
  21841. console.log('zh:clickRightBtn 444');
  21842. break;
  21843. }
  21844. }
  21845. logEventForChallenge_level_start(level) {
  21846. let keyStr = 'sjmd_challenge_level_start';
  21847. let jsonStr = {
  21848. "count": 0,
  21849. "gold_balance ": DataMgr.getCoin(),
  21850. "level": level,
  21851. "diamond_balance ": DataMgr.getDiamond()
  21852. };
  21853. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21854. const d = LocalStorageManager.getItem(keyStr);
  21855. if (level > d.level) {
  21856. jsonStr.count = d.count + 1;
  21857. LocalStorageManager.setItem(keyStr, jsonStr);
  21858. }
  21859. else {
  21860. }
  21861. }
  21862. else {
  21863. LocalStorageManager.setItem(keyStr, jsonStr);
  21864. }
  21865. const reqStr = JSON.stringify(jsonStr);
  21866. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21867. }
  21868. qjff_AD_for_uiGameEnd(level) {
  21869. DataMgr.setPlaceBallLevel(level, 1);
  21870. this.startPlaceBallLevel(level + 1);
  21871. }
  21872. startPlaceBallLevel(level) {
  21873. xGame.common.gameMode = GameMode.placeBall;
  21874. xGame.common.placeBallCurLevel = level;
  21875. xGame.uiMgr.Show(UIGame$1);
  21876. this.hide();
  21877. }
  21878. logEventForChallenge_level_complete(level) {
  21879. let keyStr = 'sjmd_challenge_level_complete';
  21880. let jsonStr = {
  21881. "count": 1,
  21882. "gold_balance ": DataMgr.getCoin(),
  21883. "level": level,
  21884. "diamond_balance ": DataMgr.getDiamond()
  21885. };
  21886. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21887. const d = LocalStorageManager.getItem(keyStr);
  21888. jsonStr.count = d.count + 1;
  21889. LocalStorageManager.setItem(keyStr, jsonStr);
  21890. }
  21891. else {
  21892. LocalStorageManager.setItem(keyStr, jsonStr);
  21893. }
  21894. const reqStr = JSON.stringify(jsonStr);
  21895. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21896. }
  21897. logEventForChallenge_level_N(level) {
  21898. console.log('zh:logEventForChallenge_level_N ' + level);
  21899. let keyStr = 'sjmd_challenge_level_N';
  21900. if (LocalStorageManager.hasKey(keyStr)) {
  21901. let lev = LocalStorageManager.getItem(keyStr);
  21902. if (level > lev) {
  21903. LocalStorageManager.setItem(keyStr, level);
  21904. }
  21905. if ((level) % 5 == 0) {
  21906. console.log('zh:每5关上报1次');
  21907. let sjmc = 'challenge_level_' + level;
  21908. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21909. let sjmcForFirebase = 'challenge_level_' + level;
  21910. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21911. }
  21912. else {
  21913. console.log('zh:5 no 上报');
  21914. }
  21915. }
  21916. else {
  21917. LocalStorageManager.setItem(keyStr, level);
  21918. }
  21919. }
  21920. }
  21921. UIGameEnd$1.uiName = "UIGameEnd";
  21922. class ShowItem$1 {
  21923. constructor() {
  21924. this.ui = ui_ShowItem.createInstance();
  21925. }
  21926. destroySelf() {
  21927. if (!this.ui.isDisposed) {
  21928. this.ui.removeFromParent();
  21929. this.ui.dispose();
  21930. }
  21931. }
  21932. setParent(parent) {
  21933. parent.addChild(this.ui);
  21934. }
  21935. setPos(x, y) {
  21936. this.ui.x = x;
  21937. this.ui.y = y;
  21938. }
  21939. setUrl(index) {
  21940. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21941. }
  21942. }
  21943. class UILevelProp$1 extends UIBase {
  21944. constructor() {
  21945. super();
  21946. this.firstPos = 385;
  21947. this.secondPos = 467;
  21948. this.showItemArr = [];
  21949. }
  21950. onConstructor() {
  21951. this.ui = ui_UILevelProp.createInstance();
  21952. this.contentPane = this.ui;
  21953. this.isEject = false;
  21954. this.addUIClick(this.ui.closeBtn, this.hideWin);
  21955. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21956. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21957. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  21958. }
  21959. show(level) {
  21960. console.log('zh:show.');
  21961. super.show();
  21962. this.ui.t1.play();
  21963. this.level = level;
  21964. this.data = cfgTable.placeballData[this.level];
  21965. this.updateSelf();
  21966. this.showPreView();
  21967. this.moneyNode.ui.c1.selectedIndex = 2;
  21968. this.moneyNode.checkPowerTime();
  21969. this.moneyNode.powerChange();
  21970. this.yinDaoForLianxi();
  21971. this.setGlobalFont(this.ui);
  21972. }
  21973. yinDaoForLianxi() {
  21974. let lianXiGuide = DataMgr.getLianXiGuide();
  21975. console.log('zh:lianXiGuide=', lianXiGuide);
  21976. if (lianXiGuide === 0) {
  21977. this.ui.myNode.n_yd_lxms_3.visible = true;
  21978. console.log('zh:yinDaoForLianxi 333 set ok');
  21979. }
  21980. else {
  21981. this.ui.myNode.n_yd_lxms_3.visible = false;
  21982. console.log('zh:无需引导33');
  21983. }
  21984. }
  21985. showPreView() {
  21986. let item;
  21987. let data;
  21988. for (let index = 0; index < this.showItemArr.length; index++) {
  21989. item = this.showItemArr[index];
  21990. item.destroySelf();
  21991. }
  21992. this.showItemArr = [];
  21993. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21994. for (const key in cfgData) {
  21995. data = cfgData[key];
  21996. item = new ShowItem$1();
  21997. item.setParent(this.ui.myNode.displayRoot);
  21998. item.setPos(data.x, data.y);
  21999. item.setUrl(data.value);
  22000. this.showItemArr.push(item);
  22001. }
  22002. }
  22003. updateSelf() {
  22004. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  22005. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  22006. if (this.data.ball == -1) {
  22007. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  22008. }
  22009. else {
  22010. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  22011. }
  22012. let localData = DataMgr.getPlaceBallLevel(this.level);
  22013. let getAward = localData.getAward;
  22014. let cfg = cfgTable.placeballData[this.level];
  22015. let coin = this.data.award[0];
  22016. let diamond = this.data.award[1];
  22017. if (cfg.type == PlaceBallType.challenge) {
  22018. diamond = 0;
  22019. coin = 100;
  22020. }
  22021. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  22022. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  22023. this.ui.myNode.coinNode.numTxt.text = coin + "";
  22024. if (cfg.type == PlaceBallType.challenge) {
  22025. this.ui.myNode.coinNode.numTxt.text = "";
  22026. }
  22027. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  22028. if (coin > 0 && diamond > 0) {
  22029. this.ui.myNode.diamondNode.x = 385;
  22030. this.ui.myNode.coinNode.x = 467;
  22031. }
  22032. else {
  22033. this.ui.myNode.diamondNode.x = 385;
  22034. this.ui.myNode.coinNode.x = 385;
  22035. }
  22036. if (!getAward) {
  22037. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  22038. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  22039. }
  22040. else {
  22041. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  22042. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  22043. }
  22044. }
  22045. startGame() {
  22046. console.log("zh:startGame");
  22047. if (DataMgr.powerEnough()) {
  22048. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  22049. this.ui.myNode.startBtn.touchable = false;
  22050. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  22051. console.log('zh:startGame dh ');
  22052. this.ui.myNode.startBtn.touchable = true;
  22053. DataMgr.setPower(-1);
  22054. xGame.eventMgr.event(POWER_TIME);
  22055. xGame.common.gameMode = GameMode.placeBall;
  22056. xGame.common.placeBallCurLevel = this.level;
  22057. xGame.uiMgr.Show(UIGame$1);
  22058. xGame.uiMgr.Hide(UILevelDisplay$1);
  22059. xGame.uiMgr.Hide(UIMain$1);
  22060. this.logEventForChallenge_level_start(this.level);
  22061. this.hideWin();
  22062. }));
  22063. console.log('zh:eeeee');
  22064. }
  22065. else {
  22066. let guide = DataMgr.getLianXiGuide();
  22067. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  22068. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  22069. DataMgr.setPower(2);
  22070. }
  22071. console.log('zh:guide = ' + guide);
  22072. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  22073. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  22074. xGame.uiMgr.Show(UIPower$1);
  22075. }
  22076. }
  22077. logEventForChallenge_level_start(level) {
  22078. let keyStr = 'sjmd_challenge_level_start';
  22079. let jsonStr = {
  22080. "count": 1,
  22081. "gold_balance ": DataMgr.getCoin(),
  22082. "level": level,
  22083. "diamond_balance ": DataMgr.getDiamond()
  22084. };
  22085. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22086. const d = LocalStorageManager.getItem(keyStr);
  22087. if (level > d.level) {
  22088. jsonStr.count = d.count + 1;
  22089. LocalStorageManager.setItem(keyStr, jsonStr);
  22090. }
  22091. else {
  22092. }
  22093. }
  22094. else {
  22095. LocalStorageManager.setItem(keyStr, jsonStr);
  22096. }
  22097. const reqStr = JSON.stringify(jsonStr);
  22098. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  22099. }
  22100. hideWin() {
  22101. super.hide();
  22102. if (this.ui.myNode.startBtn) {
  22103. this.ui.myNode.startBtn.touchable = true;
  22104. if (this.ui.myNode.startBtn.powerEft.t0) {
  22105. this.ui.myNode.startBtn.powerEft.t0.stop();
  22106. }
  22107. }
  22108. }
  22109. }
  22110. UILevelProp$1.uiName = "UILevelProp";
  22111. class PutBallLevelDisplay$1 {
  22112. constructor(ui, index) {
  22113. this.index = 0;
  22114. this.ui = ui;
  22115. this.index = index;
  22116. this.ui.onClick(this, this.clickSelf);
  22117. this.updateSelf();
  22118. this.ui.levelTxt.text = (this.index + 1) + "";
  22119. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  22120. this.ui.special.levelTxt.text = (this.index + 1) + "";
  22121. }
  22122. updateSelf() {
  22123. let level = this.index + 1;
  22124. this.data = DataMgr.getPlaceBallLevel(level);
  22125. this.ui.starNode.c1.selectedIndex = this.data.star;
  22126. let isChallenge = cfgTable.placeballData[level].type;
  22127. if (this.data.isCur) {
  22128. if (isChallenge) {
  22129. this.ui.c1.selectedIndex = 5;
  22130. }
  22131. else {
  22132. this.ui.c1.selectedIndex = 2;
  22133. }
  22134. }
  22135. else {
  22136. if (this.data.play) {
  22137. if (this.data.star == 3) {
  22138. this.ui.c1.selectedIndex = 0;
  22139. }
  22140. else {
  22141. this.ui.c1.selectedIndex = 1;
  22142. }
  22143. }
  22144. else {
  22145. if (isChallenge) {
  22146. this.ui.c1.selectedIndex = 4;
  22147. }
  22148. else {
  22149. this.ui.c1.selectedIndex = 3;
  22150. }
  22151. }
  22152. }
  22153. }
  22154. clickSelf() {
  22155. console.log("zh:lev clickSelf");
  22156. if (!this.data.play)
  22157. return;
  22158. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22159. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  22160. }
  22161. }
  22162. class UILevelDisplay$1 extends UIBase {
  22163. constructor() {
  22164. super();
  22165. }
  22166. onConstructor() {
  22167. this.ui = ui_UILevelDisplay.createInstance();
  22168. this.contentPane = this.ui;
  22169. this.isEject = false;
  22170. this.myList = this.ui.myNode.myList;
  22171. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  22172. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  22173. this.levelItemArr = [];
  22174. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  22175. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  22176. this.myList.numItems = levelNum;
  22177. }
  22178. levelItemRender(index, target) {
  22179. let item = new PutBallLevelDisplay$1(target, index);
  22180. this.levelItemArr.push(item);
  22181. }
  22182. show() {
  22183. super.show();
  22184. this.updateLevel();
  22185. this.scrollToPlace();
  22186. this.yinDaoForLianxi();
  22187. this.setGlobalFont(this.ui);
  22188. }
  22189. yinDaoForLianxi() {
  22190. let lianXiGuide = DataMgr.getLianXiGuide();
  22191. console.log('zh:lianXiGuide=', lianXiGuide);
  22192. if (lianXiGuide === 0) {
  22193. this.ui.myNode.n_yd_lxms_2.visible = true;
  22194. console.log('zh:yinDaoForLianxi 222 set ok');
  22195. }
  22196. else {
  22197. this.ui.myNode.n_yd_lxms_2.visible = false;
  22198. console.log('zh:无需引导');
  22199. }
  22200. }
  22201. showLevelTipWindows() {
  22202. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22203. xGame.uiMgr.Show(UILevelProp$1, 1);
  22204. }
  22205. updateLevel() {
  22206. let temp;
  22207. for (let index = 0; index < this.levelItemArr.length; index++) {
  22208. temp = this.levelItemArr[index];
  22209. temp.updateSelf();
  22210. }
  22211. }
  22212. scrollToPlace() {
  22213. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  22214. let passArr = DataMgr.getPlaceBallLevelList();
  22215. let offest = passArr.length;
  22216. if (offest >= maxNum - 1)
  22217. offest = maxNum - 1;
  22218. this.myList.scrollToView(offest, true, true);
  22219. }
  22220. hide() {
  22221. super.hide();
  22222. }
  22223. }
  22224. UILevelDisplay$1.uiName = "UILevelDisplay";
  22225. class UIMatching$1 extends UIBase {
  22226. constructor() {
  22227. super();
  22228. }
  22229. onConstructor() {
  22230. this.ui = ui_UIMatching.createInstance();
  22231. this.contentPane = this.ui;
  22232. this.isEject = false;
  22233. }
  22234. show(callback) {
  22235. super.show();
  22236. PlatMgr.showBanner(true);
  22237. this.callback = callback;
  22238. let user = Moyu.getUserInfo();
  22239. if (!this.selfPot) {
  22240. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  22241. }
  22242. if (!this.aiPot) {
  22243. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  22244. }
  22245. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  22246. this.ui.selfHead.nameTxt.text = user.nickName;
  22247. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  22248. this.ui.aiHead.nameTxt.text = "???";
  22249. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  22250. this.ui.selfHead.c1.selectedIndex = 0;
  22251. this.ui.aiHead.c1.selectedIndex = 0;
  22252. this.ui.selfHead.x = this.selfPot.x;
  22253. this.ui.selfHead.y = this.selfPot.y;
  22254. this.ui.aiHead.x = this.aiPot.x;
  22255. this.ui.aiHead.y = this.aiPot.y;
  22256. switch (xGame.common.gameMode) {
  22257. case GameMode.classic:
  22258. break;
  22259. case GameMode.bigMove:
  22260. this.initSkillData();
  22261. break;
  22262. default:
  22263. break;
  22264. }
  22265. this.ui.t1.play(Laya.Handler.create(this, () => {
  22266. this.ui.t2.play(Laya.Handler.create(this, () => {
  22267. switch (xGame.common.gameMode) {
  22268. case GameMode.classic:
  22269. this.waitingPeople();
  22270. break;
  22271. case GameMode.bigMove:
  22272. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  22273. break;
  22274. default:
  22275. break;
  22276. }
  22277. }));
  22278. }));
  22279. this.setGlobalFont(this.ui);
  22280. }
  22281. initSkillData() {
  22282. this.skillSelectData = [];
  22283. let skillUrl = xGame.common.skillIconList;
  22284. let skillName = xGame.common.skillNameList;
  22285. let skillLevel = DataMgr.getBigSkillList();
  22286. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  22287. for (let index = 0; index < 5; index++) {
  22288. let obj = {};
  22289. obj.skillImg = skillUrl[index];
  22290. obj.skillName = skillName[index];
  22291. obj.skillType = skillType[index];
  22292. obj.skillLevel = skillLevel[index];
  22293. this.skillSelectData.push(obj);
  22294. }
  22295. }
  22296. getAISkillLevel(myLevel) {
  22297. let video = xGame.common.upSkillLevel;
  22298. let aiLevel;
  22299. let temp;
  22300. if (video) {
  22301. temp = xGame.common.randomNum(-2, -1);
  22302. }
  22303. else {
  22304. if (myLevel <= 5) {
  22305. temp = xGame.common.randomNum(1, 3);
  22306. }
  22307. else if (myLevel <= 9) {
  22308. temp = xGame.common.randomNum(-2, 1);
  22309. }
  22310. else {
  22311. temp = xGame.common.randomNum(-4, 0);
  22312. }
  22313. }
  22314. aiLevel = temp + myLevel;
  22315. if (aiLevel <= 1)
  22316. aiLevel = 1;
  22317. if (aiLevel >= 10)
  22318. aiLevel = 10;
  22319. return aiLevel;
  22320. }
  22321. getAISkillType() {
  22322. return xGame.common.randomNum(1, 4);
  22323. let successTimes = DataMgr.getSkillSuccessTimes();
  22324. let info = cfgTable.aiskillData[successTimes];
  22325. if (!info) {
  22326. let max = Object.keys(cfgTable.aiskillData).length - 1;
  22327. info = cfgTable.aiskillData[max];
  22328. }
  22329. let dataArr = info.skillselect;
  22330. let myCfg = {};
  22331. for (let index = 0; index < dataArr.length; index++) {
  22332. let temp = dataArr[index].split('-');
  22333. myCfg[temp[0]] = {};
  22334. myCfg[temp[0]].id = parseInt(temp[0]);
  22335. myCfg[temp[0]].weight = parseInt(temp[1]);
  22336. }
  22337. let aiCfg = xGame.common.initWeight(myCfg);
  22338. let curData = xGame.common.getRandomWeightData(aiCfg);
  22339. return parseInt(curData.id);
  22340. }
  22341. getAISkillData(index) {
  22342. let myLevel = this.skillSelectData[index].skillLevel;
  22343. let aiLevel = this.getAISkillLevel(myLevel);
  22344. let aiType = this.getAISkillType() - 1;
  22345. return { aiLevel, aiType } = { aiLevel, aiType };
  22346. }
  22347. skillSelectFinish(index) {
  22348. let aiInfo = this.getAISkillData(index);
  22349. xGame.common.gameMgr.selfCurSkill = index;
  22350. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  22351. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  22352. this.ui.selfHead.c1.selectedIndex = 1;
  22353. this.ui.aiHead.c1.selectedIndex = 1;
  22354. let myData = this.skillSelectData[index];
  22355. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  22356. let guide = DataMgr.getSkillGuide();
  22357. if (guide == 0) {
  22358. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  22359. }
  22360. else {
  22361. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  22362. }
  22363. let aiData = this.skillSelectData[aiInfo.aiType];
  22364. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  22365. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  22366. this.waitingPeople();
  22367. }
  22368. waitingPeople() {
  22369. let time = xGame.common.randomNum(1000, 3000);
  22370. time += 1000;
  22371. Laya.timer.once(time, this, () => {
  22372. this.matchingSuccess();
  22373. });
  22374. }
  22375. matchingSuccess() {
  22376. let gameUI = xGame.common.gameUI;
  22377. let name = gameUI.ui.topNode.aiNameTxt.text;
  22378. let url = gameUI.ui.topNode.aiHeadLoader.url;
  22379. this.ui.aiHead.nameTxt.text = name;
  22380. this.ui.aiHead.headImg.url = url;
  22381. name = gameUI.ui.topNode.selfNameTxt.text;
  22382. url = gameUI.ui.topNode.selfHeadLoader.url;
  22383. this.ui.selfHead.nameTxt.text = name;
  22384. this.ui.selfHead.headImg.url = url;
  22385. this.ui.t3.play(Laya.Handler.create(this, () => {
  22386. this.callback && this.callback();
  22387. this.ui.t4.play(Laya.Handler.create(this, () => {
  22388. this.destroySelf();
  22389. }));
  22390. }));
  22391. }
  22392. destroySelf() {
  22393. this.callback = null;
  22394. this.skillSelectData = null;
  22395. this.selfPot = null;
  22396. this.aiPot = null;
  22397. if (!this.ui.isDisposed) {
  22398. this.ui.removeFromParent();
  22399. this.ui.dispose();
  22400. }
  22401. xGame.uiMgr.destroyUI(this);
  22402. }
  22403. }
  22404. UIMatching$1.uiName = "UIMatching";
  22405. class SkillDisplay$1 {
  22406. constructor(ui, data, uiIndex) {
  22407. this.starX = 0;
  22408. this.starY = 0;
  22409. this.index = 0;
  22410. this.ui = ui;
  22411. this.data = data;
  22412. this.index = uiIndex;
  22413. this.initSelf();
  22414. console.log('zh:SkillDisplay constructor this.skillData=', data);
  22415. }
  22416. initSelf() {
  22417. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  22418. this.ui.nameTxt.text = this.data.name;
  22419. this.ui.describeTxt.text = this.data.describe;
  22420. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  22421. this.ui.startBtn.onClick(this, this.startGame);
  22422. this.updateSelf();
  22423. }
  22424. updateSelf() {
  22425. this.checkTry();
  22426. let level = DataMgr.getBigSkillByIndex(this.index);
  22427. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  22428. }
  22429. checkTry() {
  22430. let index = this.index;
  22431. let level = DataMgr.getBigSkillByIndex(index);
  22432. if (level == null) {
  22433. DataMgr.setBigSkill(index, 1, false);
  22434. level = 1;
  22435. }
  22436. this.ui.levelTxt.text = "LV." + level;
  22437. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  22438. this.ui.tryNode.visible = true;
  22439. else
  22440. this.ui.tryNode.visible = false;
  22441. }
  22442. clickAddLevel() {
  22443. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22444. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  22445. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  22446. if (Laya.Browser.onAndroid) {
  22447. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  22448. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22449. }
  22450. else {
  22451. console.log('zh:AD 失败,直接发放奖励');
  22452. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22453. }
  22454. }
  22455. else {
  22456. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22457. }
  22458. }
  22459. qjff_AD_for_skilldisplay_clickAddLevel() {
  22460. DataMgr.setBigSkill(this.data.index, 1);
  22461. this.updateSelf();
  22462. xGame.common.upSkillLevel = true;
  22463. }
  22464. startGame() {
  22465. console.log('zh:rod skill startgame');
  22466. if (this.data.index == 3) {
  22467. alert('Coming soon!');
  22468. return;
  22469. }
  22470. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22471. let needCoin = xGame.common.bigMoveNeedCoin;
  22472. xGame.common.passAwardCoin = 2000;
  22473. let guide = DataMgr.getSkillGuide();
  22474. console.log('zh:startGame guide=' + guide);
  22475. xGame.common.temSelfLevel = 0;
  22476. if (guide == 0) {
  22477. needCoin = 0;
  22478. xGame.common.temSelfLevel = 100;
  22479. }
  22480. if (DataMgr.coinEnough(needCoin)) {
  22481. DataMgr.setCoin(-needCoin);
  22482. xGame.common.curPlayerSkillType = this.index;
  22483. if (guide == 0)
  22484. xGame.common.curPlayerSkillType = 0;
  22485. console.log('zh: skilldisplay 1');
  22486. xGame.uiMgr.Show(UIGame$1);
  22487. xGame.uiMgr.Hide(UIMain$1);
  22488. xGame.uiMgr.Show(UIMatching$1, () => {
  22489. xGame.common.gameUI.ui.alpha = 1;
  22490. xGame.common.gameUI.startGame();
  22491. xGame.uiMgr.Hide(UISkill$1);
  22492. });
  22493. this.logEventForRod_start();
  22494. }
  22495. else {
  22496. console.log('zh: skilldisplay 2');
  22497. xGame.uiMgr.Show(UIAddProp$1, 0);
  22498. Moyu.sendDataEvent("AddCoinVideo");
  22499. }
  22500. }
  22501. logEventForRod_start() {
  22502. let gfmsIdx = xGame.common.curPlayerSkillType;
  22503. console.log('zh:选择的技能=' + gfmsIdx);
  22504. let gfmc = 'Skyfall Shot';
  22505. if (gfmsIdx == 0) {
  22506. gfmc = 'Skyfall Shot';
  22507. }
  22508. if (gfmsIdx == 1) {
  22509. gfmc = 'Surging break';
  22510. }
  22511. if (gfmsIdx == 2) {
  22512. gfmc = 'Frost Lock';
  22513. }
  22514. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22515. let jsonStr = {
  22516. "count": 0,
  22517. "name": gfmc
  22518. };
  22519. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22520. const d = LocalStorageManager.getItem(keyStr);
  22521. jsonStr.count = d.count + 1;
  22522. LocalStorageManager.setItem(keyStr, jsonStr);
  22523. }
  22524. else {
  22525. LocalStorageManager.setItem(keyStr, jsonStr);
  22526. }
  22527. const reqStr = JSON.stringify(jsonStr);
  22528. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22529. }
  22530. }
  22531. class UISkill$1 extends UIBase {
  22532. constructor() {
  22533. super();
  22534. this.skillData = [];
  22535. }
  22536. onConstructor() {
  22537. this.ui = ui_UISkill.createInstance();
  22538. this.contentPane = this.ui;
  22539. this.isEject = false;
  22540. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22541. this.initSkillData();
  22542. console.log('zh:aaaaaa1111111111');
  22543. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22544. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22545. console.log('zh:aaaaaa22222222');
  22546. this.displayList = [];
  22547. this.ui.skillNode.skillList.numItems = 3;
  22548. this.addUIClick(this.ui, this.interuptSecretary);
  22549. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22550. this.ui.talkNode.visible = false;
  22551. if (Moyu.isKs)
  22552. this.ui.closeNode.closeBtn.x += 100;
  22553. }
  22554. show() {
  22555. super.show();
  22556. this.playSecretaryIdle();
  22557. this.moneyNode.ui.c1.selectedIndex = 1;
  22558. Laya.timer.clearAll(this);
  22559. xGame.soundMgr.playSound("s_start");
  22560. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22561. let guide = 0;
  22562. if (DataMgr.getGuideDefaultModel() === 2) {
  22563. guide = DataMgr.getSkillGuide();
  22564. this.ui.guideNode.visible = guide == 0;
  22565. }
  22566. let item = this.getSkillItemByUIIndex(0);
  22567. if (guide == 0) {
  22568. item.ui.c1.selectedIndex = 1;
  22569. }
  22570. else {
  22571. item.ui.c1.selectedIndex = 0;
  22572. }
  22573. if (DataMgr.getGuideDefaultModel() === 2) {
  22574. this.ui.guideNode.guideBtn.visible = guide == 0;
  22575. }
  22576. for (let index = 0; index < this.displayList.length; index++) {
  22577. this.displayList[index].checkTry();
  22578. }
  22579. this.setGlobalFont(this.ui);
  22580. }
  22581. getSkillItemByUIIndex(cur) {
  22582. for (let index = 0; index < this.displayList.length; index++) {
  22583. if (this.displayList[index].index == cur) {
  22584. return this.displayList[index];
  22585. }
  22586. }
  22587. }
  22588. enterGuideLevel() {
  22589. let item = this.getSkillItemByUIIndex(0);
  22590. item.startGame();
  22591. if (DataMgr.getNewUser())
  22592. Moyu.sendDataEvent("gameStart1");
  22593. }
  22594. initSkillData() {
  22595. this.skillData = [];
  22596. let nameList = xGame.common.skillNameList;
  22597. let iconList = xGame.common.skillIconList;
  22598. let describeList = [
  22599. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22600. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22601. "The power of frost descends—freezing the flow and taking full control of the game!"
  22602. ];
  22603. console.log('zh:initSkillData 111111111');
  22604. let data;
  22605. for (let index = 0; index < nameList.length; index++) {
  22606. data = {};
  22607. data.name = nameList[index];
  22608. data.icon = iconList[index];
  22609. data.describe = describeList[index];
  22610. data.index = index;
  22611. this.skillData.push(data);
  22612. }
  22613. }
  22614. updateSkillItem(index, target) {
  22615. if (this.displayList[index] == null) {
  22616. let uiIndex;
  22617. switch (index) {
  22618. case 0:
  22619. uiIndex = 1;
  22620. break;
  22621. case 1:
  22622. uiIndex = 0;
  22623. break;
  22624. case 2:
  22625. uiIndex = 2;
  22626. break;
  22627. case 3:
  22628. uiIndex = 3;
  22629. break;
  22630. default:
  22631. break;
  22632. }
  22633. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22634. this.displayList.push(temp);
  22635. }
  22636. }
  22637. playSecretaryIdle() {
  22638. let parent = this.ui.secretary.displayObject;
  22639. parent.destroyChildren();
  22640. let xx = this.ui.secretary.width / 2;
  22641. let yy = this.ui.secretary.height;
  22642. let scale = xGame.common.getSecretaryScale();
  22643. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22644. xGame.common.secretary.play(data, 0, true, parent);
  22645. }
  22646. returnUIMain() {
  22647. this.hide();
  22648. xGame.common.stopGirlPop(this.ui.talkNode);
  22649. xGame.uiMgr.Show(UIMain$1);
  22650. }
  22651. interuptSecretary() {
  22652. Laya.timer.clearAll(this);
  22653. this.playSecretaryRandomSound();
  22654. }
  22655. playSecretaryRandomSound() {
  22656. if (this.isHide)
  22657. return;
  22658. let time = xGame.common.randomNum(45000, 60000);
  22659. Laya.timer.once(time, this, () => {
  22660. if (this.isHide)
  22661. return;
  22662. let index = xGame.common.randomNum(4, 7);
  22663. xGame.soundMgr.playSound("s_main0" + index);
  22664. let words = 1;
  22665. switch (index) {
  22666. case 4:
  22667. words = 5;
  22668. break;
  22669. case 5:
  22670. words = 3;
  22671. break;
  22672. case 6:
  22673. words = 6;
  22674. break;
  22675. case 7:
  22676. words = 7;
  22677. break;
  22678. default:
  22679. break;
  22680. }
  22681. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22682. this.playSecretaryRandomSound();
  22683. });
  22684. }
  22685. }
  22686. UISkill$1.uiName = "UISkill";
  22687. class UIAddProp$1 extends UIBase {
  22688. constructor() {
  22689. super();
  22690. this.curType = "";
  22691. }
  22692. onConstructor() {
  22693. this.ui = ui_UIAddProp.createInstance();
  22694. this.contentPane = this.ui;
  22695. this.isEject = false;
  22696. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22697. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22698. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22699. this.updateUI();
  22700. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22701. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22702. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22703. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22704. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22705. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22706. }
  22707. show(type) {
  22708. super.show();
  22709. this.curType = type == 0 ? "coin" : "diamond";
  22710. this.switchBtn("");
  22711. this.ui.t0.play();
  22712. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22713. PlatMgr.showInsert(true);
  22714. this.setGlobalFont(this.ui);
  22715. }
  22716. closeSelf() {
  22717. this.hide();
  22718. }
  22719. updateUI() {
  22720. let data = cfgTable.moneyData;
  22721. let temp;
  22722. let obj;
  22723. for (const key in data) {
  22724. temp = data[key];
  22725. obj = this.ui.myNode["node" + key];
  22726. if (parseInt(key) <= 2) {
  22727. obj.diamondTxt.text = "+" + temp.num;
  22728. }
  22729. else {
  22730. obj.coinTxt.text = temp.num;
  22731. obj.diamondTxt.text = temp.get.split('_')[1];
  22732. }
  22733. }
  22734. this.updateDiamondShare();
  22735. }
  22736. updateDiamondShare() {
  22737. let data = DataMgr.getShareDiamondTimes();
  22738. if (data >= xGame.common.maxShareDiamondTimes) {
  22739. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22740. this.ui.myNode.node1.touchable = false;
  22741. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22742. }
  22743. else {
  22744. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22745. this.ui.myNode.node1.touchable = true;
  22746. }
  22747. }
  22748. switchBtn(type) {
  22749. if (type == "")
  22750. type = this.curType;
  22751. else {
  22752. if (this.curType == type) {
  22753. return;
  22754. }
  22755. else {
  22756. this.curType = type;
  22757. }
  22758. }
  22759. if (type == "coin") {
  22760. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22761. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22762. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22763. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22764. this.ui.myNode.c1.selectedIndex = 0;
  22765. }
  22766. else {
  22767. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22768. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22769. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22770. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22771. this.ui.myNode.c1.selectedIndex = 1;
  22772. }
  22773. }
  22774. convertCoin(index) {
  22775. let data = cfgTable.moneyData[index];
  22776. let coinNum = data.num;
  22777. let str = data.get.split('_')[1];
  22778. let needDiamond = parseInt(str);
  22779. if (DataMgr.diamondEnough(needDiamond)) {
  22780. DataMgr.setDiamond(-needDiamond);
  22781. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22782. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22783. }
  22784. else {
  22785. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22786. this.switchBtn("diamond");
  22787. }
  22788. }
  22789. videoGetDiamond() {
  22790. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22791. if (Laya.Browser.onAndroid) {
  22792. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22793. if (!boo) {
  22794. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22795. return;
  22796. }
  22797. }
  22798. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22799. }
  22800. else {
  22801. console.log('zh:AD 失败,直接发放奖励');
  22802. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22803. }
  22804. }
  22805. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22806. let num = cfgTable.moneyData[2].num;
  22807. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22808. this.closeSelf();
  22809. }
  22810. videoGetCoin() {
  22811. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22812. if (Laya.Browser.onAndroid) {
  22813. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22814. if (!boo) {
  22815. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22816. return;
  22817. }
  22818. }
  22819. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22820. }
  22821. else {
  22822. console.log('zh:AD 失败,直接发放奖励');
  22823. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22824. }
  22825. }
  22826. qjff_AD_for_uiAddProp_videoGetCoin() {
  22827. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22828. this.closeSelf();
  22829. }
  22830. shareGetDiamond() {
  22831. let times = DataMgr.getShareDiamondTimes();
  22832. if (times >= xGame.common.maxShareDiamondTimes) {
  22833. console.log('zh: 233333333333 maxShareDiamondTimes');
  22834. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22835. }
  22836. else {
  22837. console.log('zh:33333333333333ad');
  22838. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22839. if (Laya.Browser.onAndroid) {
  22840. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22841. if (!boo) {
  22842. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22843. return;
  22844. }
  22845. }
  22846. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22847. }
  22848. else {
  22849. console.log('zh:AD 失败,直接发放奖励');
  22850. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22851. }
  22852. }
  22853. }
  22854. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22855. let diamond = xGame.common.randomNum(50, 100);
  22856. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22857. DataMgr.setShareDiamondTimes(1);
  22858. this.updateDiamondShare();
  22859. }
  22860. openPutBallView() {
  22861. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22862. let skill = xGame.uiMgr.getUI(UISkill$1);
  22863. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22864. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22865. if (end && !end.isHide) {
  22866. xGame.uiMgr.Hide(UIGameEnd$1);
  22867. xGame.uiMgr.Show(UIMain$1);
  22868. }
  22869. if (skill && !skill.isHide)
  22870. xGame.uiMgr.Hide(UISkill$1);
  22871. if (uigame && !uigame.isHide)
  22872. xGame.uiMgr.Hide(UIGame$1);
  22873. if (level && !level.isHide) {
  22874. }
  22875. else {
  22876. xGame.uiMgr.Show(UILevelDisplay$1);
  22877. }
  22878. this.closeSelf();
  22879. }
  22880. }
  22881. UIAddProp$1.uiName = "UIAddProp";
  22882. class MoneyNode$1 {
  22883. constructor(ui) {
  22884. this.leftTime = 0;
  22885. this.ui = ui;
  22886. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22887. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22888. this.ui.addPowerBtn.onClick(this, this.addPower);
  22889. this.ui.c1.selectedIndex = 1;
  22890. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22891. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22892. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22893. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22894. this.coinChange();
  22895. this.diamondChange();
  22896. this.powerChange();
  22897. }
  22898. addPower() {
  22899. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22900. xGame.uiMgr.Show(UIPower$1);
  22901. }
  22902. powerChange() {
  22903. let powerNum = DataMgr.getPower();
  22904. this.ui.powerTxt.text = powerNum + "";
  22905. }
  22906. checkPowerTime() {
  22907. let cur = new Date().getTime();
  22908. let last = DataMgr.getPowerTime();
  22909. if (last == 0) {
  22910. last = cur;
  22911. DataMgr.setPowerTime(cur);
  22912. }
  22913. let power = DataMgr.getPower();
  22914. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22915. Laya.timer.clearAll(this);
  22916. if (power >= xGame.common.natureMaxPower) {
  22917. this.ui.powerTimeTxt.text = "";
  22918. DataMgr.setPowerTime(cur);
  22919. return;
  22920. }
  22921. if (power + offset >= xGame.common.natureMaxPower) {
  22922. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22923. this.ui.powerTimeTxt.text = "";
  22924. DataMgr.setPowerTime(cur);
  22925. }
  22926. else {
  22927. if (offset > 0) {
  22928. DataMgr.setPower(offset);
  22929. DataMgr.setPowerTime(cur);
  22930. }
  22931. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22932. this.leftTime = xGame.common.powerRecoverNum - time;
  22933. if (this.leftTime <= 0)
  22934. this.leftTime = 0;
  22935. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22936. Laya.timer.loop(1000, this, this.updatePowerTime);
  22937. }
  22938. }
  22939. updatePowerTime() {
  22940. this.leftTime -= 1;
  22941. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22942. if (this.leftTime <= 0) {
  22943. this.checkPowerTime();
  22944. }
  22945. }
  22946. coinChange() {
  22947. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22948. }
  22949. diamondChange() {
  22950. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22951. }
  22952. addCoin() {
  22953. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22954. Moyu.sendDataEvent("AddCoinBtn");
  22955. xGame.uiMgr.Show(UIAddProp$1, 0);
  22956. }
  22957. addDiamond() {
  22958. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22959. Moyu.sendDataEvent("AddDiamondBtn");
  22960. xGame.uiMgr.Show(UIAddProp$1, 1);
  22961. }
  22962. }
  22963. class SettingNode$1 {
  22964. constructor(ui) {
  22965. this.showSetting = false;
  22966. this.openSound = true;
  22967. this.openShake = true;
  22968. this.ui = ui;
  22969. this.ui.soundBtn.onClick(this, this.switchSound);
  22970. this.ui.shakeBtn.onClick(this, this.switchShake);
  22971. this.ui.xyBtn.onClick(this, this.onXy);
  22972. this.ui.clickNode.onClick(this, this.changeSetting);
  22973. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22974. this.ui.xyBtn.visible = false;
  22975. this.ui.shakeBtn.visible = false;
  22976. }
  22977. changeSetting() {
  22978. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22979. this.showSetting = !this.showSetting;
  22980. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22981. }
  22982. switchSound() {
  22983. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22984. this.openSound = !this.openSound;
  22985. Moyu.onSetting(this.openSound, this.openShake);
  22986. xGame.soundMgr.onSetting(this.openSound);
  22987. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22988. }
  22989. switchShake() {
  22990. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22991. this.openShake = !this.openShake;
  22992. Moyu.onSetting(this.openSound, this.openShake);
  22993. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22994. }
  22995. onXy() {
  22996. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22997. MoyuMgr$1.showXy(1);
  22998. }
  22999. }
  23000. class UIDraw$1 extends UIBase {
  23001. constructor() {
  23002. super();
  23003. this.curKey = 0;
  23004. }
  23005. onConstructor() {
  23006. this.ui = ui_UIDraw.createInstance();
  23007. this.contentPane = this.ui;
  23008. this.isEject = false;
  23009. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23010. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23011. this.addUIClick(this.ui.drawBtn, this.startDraw);
  23012. this.initDraw();
  23013. this.initUI();
  23014. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  23015. }
  23016. show() {
  23017. super.show();
  23018. this.ui.t0.play();
  23019. this.playSecretaryIdle();
  23020. this.updateDraw();
  23021. this.checkFree();
  23022. if (PlatMgr.bannerDelay > 0) {
  23023. this.ui.closeNode.closeBtn.visible = false;
  23024. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  23025. this.ui.closeNode.closeBtn.visible = true;
  23026. });
  23027. }
  23028. PlatMgr.showRateBanner();
  23029. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23030. this.setGlobalFont(this.ui);
  23031. }
  23032. hide() {
  23033. Laya.timer.clearAll(this);
  23034. super.hide();
  23035. }
  23036. checkFree() {
  23037. let isFree = DataMgr.getDailyfreeDrawTimes();
  23038. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  23039. }
  23040. initDraw() {
  23041. this.drawObj = [];
  23042. let data = cfgTable.drawData;
  23043. let temp;
  23044. let weight = 0;
  23045. for (const key in data) {
  23046. temp = data[key];
  23047. weight += temp.weight;
  23048. this.drawObj.push(weight);
  23049. }
  23050. this.allWeight = weight;
  23051. }
  23052. initUI() {
  23053. let data = cfgTable.drawData;
  23054. let temp;
  23055. let img;
  23056. let txt;
  23057. for (const key in data) {
  23058. temp = data[key];
  23059. img = this.ui.myNode.rotNode["img" + key];
  23060. txt = this.ui.myNode.rotNode["txt" + key];
  23061. img.url = xGame.common.getGameIconUrl(temp.icon);
  23062. txt.visible = true;
  23063. if (temp.award > 2) {
  23064. img.rotation = 0;
  23065. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  23066. }
  23067. else {
  23068. img.rotation = temp.rotation;
  23069. txt.text = temp.num;
  23070. }
  23071. }
  23072. }
  23073. getCurkey() {
  23074. let rand = Math.random() * this.allWeight;
  23075. let temp;
  23076. for (let index = 0; index < this.drawObj.length - 1; index++) {
  23077. temp = this.drawObj[index];
  23078. if (index == 0) {
  23079. if (rand < temp) {
  23080. return index + 1;
  23081. }
  23082. }
  23083. else {
  23084. if (rand >= temp && rand < this.drawObj[index + 1]) {
  23085. return index + 1;
  23086. }
  23087. }
  23088. }
  23089. return 2;
  23090. }
  23091. startDraw() {
  23092. console.log('zh:开始抽奖');
  23093. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  23094. if (freeTimes > 0) {
  23095. console.log('zh:freeTimes=' + freeTimes);
  23096. this.beginDraw();
  23097. DataMgr.setDailyfreeDrawTimes(0);
  23098. this.checkFree();
  23099. }
  23100. else {
  23101. if (Laya.Browser.onAndroid) {
  23102. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23103. if (!boo) {
  23104. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23105. return;
  23106. }
  23107. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  23108. }
  23109. else {
  23110. console.log('zh:AD 失败,直接发放奖励');
  23111. this.qjff_chouJiang();
  23112. }
  23113. }
  23114. else {
  23115. this.qjff_chouJiang();
  23116. }
  23117. }
  23118. }
  23119. qjff_chouJiang() {
  23120. this.beginDraw();
  23121. }
  23122. beginDraw() {
  23123. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  23124. this.ui.drawBtn.touchable = false;
  23125. this.curKey = this.getCurkey();
  23126. console.log("zh:当前key", this.curKey);
  23127. let cell = 60;
  23128. let lap = 3;
  23129. let angle = cell * (this.curKey - 1) + lap * 360;
  23130. let target = this.ui.myNode.rotNode;
  23131. target.rotation = 0;
  23132. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  23133. console.log("zh:旋转完成");
  23134. this.ui.drawBtn.touchable = true;
  23135. this.getAward();
  23136. }));
  23137. }
  23138. getAward() {
  23139. let data = cfgTable.drawData[this.curKey];
  23140. let temp = new AwardType();
  23141. temp.type = data.award;
  23142. temp.num = data.num;
  23143. xGame.common.getAward([temp], () => {
  23144. DataMgr.setDrawTimes(1);
  23145. this.updateDraw();
  23146. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  23147. });
  23148. }
  23149. updateDraw() {
  23150. let drawTimes = DataMgr.getDrawTimes();
  23151. let awardTimes = DataMgr.getDrawAwardTimes();
  23152. if (Math.floor(drawTimes / 3) > awardTimes) {
  23153. this.ui.extraNode.boxBtn.t0.play(null, -1);
  23154. this.ui.extraNode.boxBtn.touchable = true;
  23155. this.ui.extraNode.tipsTxt.text = "3/3";
  23156. this.ui.extraNode.barNode.width = 265;
  23157. this.getExtraAward();
  23158. }
  23159. else {
  23160. this.ui.extraNode.boxBtn.t0.stop();
  23161. this.ui.extraNode.boxBtn.touchable = false;
  23162. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  23163. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  23164. }
  23165. let data = cfgTable.drawData[1];
  23166. if (awardTimes == 0) {
  23167. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  23168. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  23169. this.ui.myNode.rotNode.img1.rotation = 0;
  23170. }
  23171. else {
  23172. let award = data.nextid;
  23173. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  23174. this.ui.myNode.rotNode.txt1.text = award[1];
  23175. this.ui.myNode.rotNode.img1.rotation = 0;
  23176. }
  23177. }
  23178. getExtraAward() {
  23179. let drawTimes = DataMgr.getDrawTimes();
  23180. let awardTimes = DataMgr.getDrawAwardTimes();
  23181. let data = cfgTable.drawData[1];
  23182. let award = new AwardType();
  23183. if (awardTimes == 0) {
  23184. award.num = data.num;
  23185. award.type = data.award;
  23186. xGame.common.getAward([award], () => {
  23187. let all = Math.floor(drawTimes / 3);
  23188. DataMgr.setDrawAwardTimes(all);
  23189. this.updateDraw();
  23190. });
  23191. }
  23192. else {
  23193. award.num = parseInt(data.nextid[1]);
  23194. award.type = parseInt(data.nextid[0]);
  23195. xGame.common.getAward([award], () => {
  23196. let all = Math.floor(drawTimes / 3);
  23197. DataMgr.setDrawAwardTimes(all);
  23198. this.updateDraw();
  23199. });
  23200. }
  23201. }
  23202. closeSelf() {
  23203. this.hide();
  23204. }
  23205. playSecretaryIdle() {
  23206. let parent = this.ui.secretary.displayObject;
  23207. parent.destroyChildren();
  23208. let xx = this.ui.secretary.width / 2;
  23209. let yy = this.ui.secretary.height;
  23210. let scale = xGame.common.getSecretaryScale();
  23211. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23212. xGame.common.secretary.play(data, 0, true, parent);
  23213. }
  23214. }
  23215. UIDraw$1.uiName = "UIDraw";
  23216. class UIRanking$1 extends UIBase {
  23217. constructor() {
  23218. super();
  23219. this.showSelf = true;
  23220. this.rankType = 1;
  23221. this.rankList = [];
  23222. this.topX = 10;
  23223. this.myIndex = this.topX + 1;
  23224. this.myStar = 0;
  23225. }
  23226. onConstructor() {
  23227. this.ui = ui_UIRanking.createInstance();
  23228. this.contentPane = this.ui;
  23229. this.isEject = false;
  23230. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  23231. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  23232. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  23233. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  23234. this.ui.myNode.myList.setVirtual();
  23235. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  23236. }
  23237. show() {
  23238. super.show();
  23239. this.getPaiHangBangDataFormJosnFile();
  23240. this.updateSelf();
  23241. let self = Moyu.getUserInfo();
  23242. if (!self.isAuth) {
  23243. Moyu.initUser(this, () => {
  23244. DataMgr.upRankData();
  23245. });
  23246. }
  23247. this.setGlobalFont(this.ui);
  23248. }
  23249. getPaiHangBangDataFormJosnFile() {
  23250. const rankingList = cfgTable.paiHangBangData.list;
  23251. this.updateItemData(rankingList);
  23252. }
  23253. updateSelfItem() {
  23254. console.log('zh:Moyu.platType =' + Moyu.platType);
  23255. let self = Moyu.getUserInfo();
  23256. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  23257. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  23258. if (this.myIndex > this.topX) {
  23259. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  23260. }
  23261. else {
  23262. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  23263. }
  23264. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  23265. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  23266. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  23267. }
  23268. updateItemData(data) {
  23269. this.myStar = xGame.common.getAllStarNum();
  23270. if (this.rankList.length < 2) {
  23271. this.rankList = data;
  23272. let self = Moyu.getUserInfo();
  23273. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  23274. self.headIcon = self.headIcon;
  23275. for (let i = 0; i < data.length; i++) {
  23276. let data = this.rankList[i];
  23277. if (data.userId == self.userId) {
  23278. this.rankList.splice(i, 1);
  23279. break;
  23280. }
  23281. }
  23282. for (let i = 0; i < data.length; i++) {
  23283. let data = this.rankList[i];
  23284. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  23285. this.myIndex = i + 1;
  23286. let user = { headIcon: self.headIcon, nickName: "myself" };
  23287. let ud = { user: user, data: {} };
  23288. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  23289. console.log('zh:Moyu.platType = ' + Moyu.platType);
  23290. if (Moyu.platType < 11) {
  23291. user.headIcon = self.headIcon;
  23292. user.nickName = self.nickName;
  23293. }
  23294. this.rankList.splice(i, 0, md);
  23295. break;
  23296. }
  23297. }
  23298. }
  23299. this.updateSelfItem();
  23300. this.ui.myNode.myList.numItems = this.rankList.length;
  23301. }
  23302. updateItemUI(index, obj) {
  23303. let data = this.rankList[index];
  23304. let userData = JSON.parse(data.userData).user;
  23305. obj.nameTxt.text = userData.nickName.toString();
  23306. obj.valueTxt.text = data.rankScore;
  23307. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  23308. obj.rankTxt.text = index + 1;
  23309. switch (index) {
  23310. case 0:
  23311. this.setImg(obj, 1, 0, 0);
  23312. obj.rankTxt.color = "#FFC047";
  23313. break;
  23314. case 1:
  23315. this.setImg(obj, 0, 1, 0);
  23316. obj.rankTxt.color = "#ACACAC";
  23317. break;
  23318. case 2:
  23319. this.setImg(obj, 0, 0, 1);
  23320. obj.rankTxt.color = "#D09672";
  23321. break;
  23322. default:
  23323. this.setImg(obj, 0, 0, 0);
  23324. obj.rankTxt.color = "#496FAB";
  23325. break;
  23326. }
  23327. }
  23328. setImg(obj, a, b, c) {
  23329. obj.img1.visible = a ? true : false;
  23330. obj.img2.visible = b ? true : false;
  23331. obj.img3.visible = c ? true : false;
  23332. }
  23333. changeList(type) {
  23334. this.rankType = type;
  23335. this.updateSelf();
  23336. }
  23337. changeSelfNode() {
  23338. this.showSelf = !this.showSelf;
  23339. this.updateSelf();
  23340. }
  23341. updateSelf() {
  23342. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  23343. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  23344. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23345. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  23346. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23347. }
  23348. }
  23349. UIRanking$1.uiName = "UIRanking";
  23350. class UISecretary$1 extends UIBase {
  23351. constructor() {
  23352. super();
  23353. this.curIndex = 1;
  23354. }
  23355. onConstructor() {
  23356. this.ui = ui_UISecretary.createInstance();
  23357. this.contentPane = this.ui;
  23358. this.isEject = false;
  23359. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23360. this.nodeObj = { left: null, right: null, cur: null };
  23361. this.nodeObj.cur = this.ui.myNode.gameNode3;
  23362. }
  23363. show() {
  23364. super.show();
  23365. this.ui.t0.play();
  23366. this.updateData();
  23367. this.setGlobalFont(this.ui);
  23368. }
  23369. addSecretarySpine(node, spineName) {
  23370. if (spineName == "mishu") {
  23371. if (this.secretarySpine1) {
  23372. node.displayObject.destroyChildren();
  23373. this.playWoman(this.secretarySpine1, node.displayObject);
  23374. }
  23375. else {
  23376. let spine1 = new SpineMgr("mishu", () => {
  23377. this.secretarySpine1 = spine1;
  23378. this.playWoman(this.secretarySpine1, node.displayObject);
  23379. });
  23380. }
  23381. }
  23382. else {
  23383. if (this.secretarySpine2) {
  23384. node.displayObject.destroyChildren();
  23385. this.playWoman(this.secretarySpine2, node.displayObject);
  23386. }
  23387. else {
  23388. let spine2 = new SpineMgr("xiaomishu2", () => {
  23389. this.secretarySpine2 = spine2;
  23390. this.playWoman(this.secretarySpine2, node.displayObject);
  23391. });
  23392. }
  23393. }
  23394. }
  23395. playWoman(node, parent) {
  23396. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  23397. let yy = this.ui.myNode.gameNode3.secretary.height;
  23398. let scale = 1.5;
  23399. if (node == this.secretarySpine2) {
  23400. scale = 1.2;
  23401. }
  23402. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23403. node.play(data, 0, true, parent);
  23404. }
  23405. turnLeft() {
  23406. this.curIndex--;
  23407. if (this.curIndex < 1) {
  23408. this.curIndex = 2;
  23409. }
  23410. let left = this.nodeObj.left;
  23411. let right = this.nodeObj.right;
  23412. let cur = this.nodeObj.cur;
  23413. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23414. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23415. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23416. this.updateData();
  23417. }));
  23418. this.ui.myNode.setChildIndex(right, 2);
  23419. this.nodeObj.left = cur;
  23420. this.nodeObj.right = left;
  23421. this.nodeObj.cur = right;
  23422. }
  23423. turnRight() {
  23424. this.curIndex++;
  23425. if (this.curIndex > 2) {
  23426. this.curIndex = 1;
  23427. }
  23428. let left = this.nodeObj.left;
  23429. let right = this.nodeObj.right;
  23430. let cur = this.nodeObj.cur;
  23431. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23432. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23433. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23434. this.updateData();
  23435. }));
  23436. this.ui.myNode.setChildIndex(left, 2);
  23437. this.nodeObj.left = right;
  23438. this.nodeObj.right = cur;
  23439. this.nodeObj.cur = left;
  23440. }
  23441. updateData() {
  23442. console.log('zh: updateData FFFFFFFFFF');
  23443. let data = cfgTable.secretaryshopData;
  23444. let children = this.ui.myNode._children;
  23445. let temp;
  23446. let curData;
  23447. for (let index = 0; index < children.length; index++) {
  23448. temp = children[index];
  23449. curData = data[1];
  23450. temp.heightTxt.text = curData.height;
  23451. temp.foodTxt.text = curData.food;
  23452. temp.historyTxt.text = curData.history;
  23453. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  23454. this.addSecretarySpine(temp.secretary, curData.spine);
  23455. let womanIndex = curData.id - 1;
  23456. let getWoman = DataMgr.getSecretary(womanIndex);
  23457. let curUse = DataMgr.getCurSecretary();
  23458. if (getWoman) {
  23459. if (curUse == womanIndex) {
  23460. temp.purchaseBtn.c1.selectedIndex = 1;
  23461. }
  23462. else {
  23463. temp.purchaseBtn.c1.selectedIndex = 2;
  23464. }
  23465. }
  23466. else {
  23467. temp.purchaseBtn.c1.selectedIndex = 0;
  23468. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23469. }
  23470. temp.purchaseBtn.visible = false;
  23471. }
  23472. }
  23473. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23474. console.log('zh: 点击了clickSecretary ');
  23475. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23476. if (getWoman) {
  23477. if (curUse != womanIndex) {
  23478. console.log();
  23479. DataMgr.setCurSecretary(womanIndex);
  23480. this.updateData();
  23481. }
  23482. }
  23483. else {
  23484. console.log('zh:点击购买了');
  23485. let need = needDiamond;
  23486. if (DataMgr.diamondEnough(need)) {
  23487. DataMgr.setDiamond(-need);
  23488. DataMgr.setSecretary(womanIndex, 1);
  23489. DataMgr.setCurSecretary(womanIndex);
  23490. this.updateData();
  23491. }
  23492. else {
  23493. xGame.uiMgr.Show(UIAddProp$1, 1);
  23494. }
  23495. }
  23496. }
  23497. closeSelf() {
  23498. this.hide();
  23499. }
  23500. }
  23501. UISecretary$1.uiName = "UISecretary";
  23502. class BallRodDisplay$1 {
  23503. constructor(ui, index) {
  23504. this.index = 0;
  23505. this.uiIndex = 0;
  23506. this.ui = ui;
  23507. this.index = index;
  23508. this.initData();
  23509. }
  23510. initData() {
  23511. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23512. let data = cfgTable.ballrodData[this.index + 1];
  23513. this.ui.nameTxt.text = data.name;
  23514. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23515. this.ui.levelNode.c1.selectedIndex = data.quality;
  23516. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23517. if (data.spine) {
  23518. this.mySpine = new SpineMgr(data.spine, () => {
  23519. let xx = 150;
  23520. let yy = 70;
  23521. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23522. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23523. });
  23524. }
  23525. }
  23526. updateSelf() {
  23527. let get = DataMgr.getBallRod(this.index);
  23528. if (get == null)
  23529. get = 1;
  23530. let curUse = DataMgr.getCurBallRod();
  23531. if (get) {
  23532. if (curUse == this.index) {
  23533. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23534. }
  23535. else {
  23536. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23537. }
  23538. }
  23539. else {
  23540. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23541. }
  23542. }
  23543. buyBallRod() {
  23544. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23545. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23546. switch (selectedIndex) {
  23547. case 0:
  23548. break;
  23549. case 1:
  23550. console.log('zh:点击了 USE THIS');
  23551. DataMgr.setCurBallRod(this.index);
  23552. let curUse = DataMgr.getCurBallRod();
  23553. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23554. let ui = xGame.uiMgr.getUI(UIShop$1);
  23555. ui.updateBallRod();
  23556. break;
  23557. case 2:
  23558. let data = cfgTable.ballrodData[this.index + 1];
  23559. let need = data.price;
  23560. if (DataMgr.diamondEnough(need)) {
  23561. this.buyQiuGan(data);
  23562. DataMgr.setDiamond(-need);
  23563. DataMgr.setBallRod(this.index, 1);
  23564. DataMgr.setCurBallRod(this.index);
  23565. let ui = xGame.uiMgr.getUI(UIShop$1);
  23566. ui.updateBallRod();
  23567. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23568. }
  23569. else {
  23570. xGame.uiMgr.Show(UIAddProp$1, 1);
  23571. }
  23572. break;
  23573. default:
  23574. break;
  23575. }
  23576. }
  23577. buyQiuGan(qgItem) {
  23578. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23579. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23580. if (userInfo == null) {
  23581. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23582. return;
  23583. }
  23584. let reqData = xGame.httpMgr.getReqData();
  23585. let pd = JSON.parse(reqData);
  23586. pd.qiuGanData = qgItem;
  23587. reqData = JSON.stringify(pd);
  23588. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23589. try {
  23590. console.log('zh:buySp res = ' + JSON.stringify(res));
  23591. let code = res.code;
  23592. let msg = res.msg;
  23593. if (code == 401) {
  23594. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23595. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23596. return;
  23597. }
  23598. if (code == 200) {
  23599. xGame.uiMgr.Show(UIMsg$1, msg);
  23600. DataMgr.getUserZiChanInfo(false);
  23601. }
  23602. else {
  23603. xGame.uiMgr.Show(UIMsg$1, msg);
  23604. }
  23605. }
  23606. catch (error) {
  23607. console.log('error=' + error);
  23608. alert(error);
  23609. }
  23610. finally {
  23611. }
  23612. });
  23613. }
  23614. logEventForGouMaiGan(qiuGanName) {
  23615. const ev = {
  23616. value: qiuGanName
  23617. };
  23618. const jsonStr = JSON.stringify(ev);
  23619. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23620. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23621. }
  23622. }
  23623. class DaoJuDisplay$1 {
  23624. constructor(ui, index) {
  23625. this.index = 0;
  23626. this.uiIndex = 0;
  23627. this.ggSpid = "";
  23628. this.spid = 0;
  23629. this.ui = ui;
  23630. this.index = index;
  23631. this.initData();
  23632. }
  23633. initData() {
  23634. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23635. let data = cfgTable.daoJuData[this.index + 1];
  23636. this.ui.nameTxt.text = data.spbt;
  23637. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23638. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23639. this.ggSpid = data.ggSpid;
  23640. this.spid = data.spid;
  23641. let baseUrl = "asset/sound/ogg/";
  23642. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23643. }
  23644. gotoBuy() {
  23645. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23646. if (userInfo != null) {
  23647. let token = userInfo.token;
  23648. let ggSpid = this.ggSpid;
  23649. let spid = this.spid;
  23650. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23651. console.log('zh:gotoBuy1 spid =' + spid);
  23652. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23653. return;
  23654. }
  23655. else {
  23656. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23657. }
  23658. }
  23659. gotoBuy1() {
  23660. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23661. let djItem = cfgTable.daoJuData[this.index + 1];
  23662. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23663. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23664. if (userInfo == null) {
  23665. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23666. return;
  23667. }
  23668. let reqData = xGame.httpMgr.getReqData();
  23669. let pd = JSON.parse(reqData);
  23670. pd.spItem = djItem;
  23671. reqData = JSON.stringify(pd);
  23672. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23673. try {
  23674. console.log('zh:buySp res = ' + JSON.stringify(res));
  23675. let code = res.code;
  23676. let msg = res.msg;
  23677. if (code == 401) {
  23678. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23679. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23680. return;
  23681. }
  23682. if (code == 200) {
  23683. xGame.uiMgr.Show(UIMsg$1, msg);
  23684. DataMgr.getUserZiChanInfo(false);
  23685. }
  23686. else {
  23687. xGame.uiMgr.Show(UIMsg$1, msg);
  23688. }
  23689. }
  23690. catch (error) {
  23691. console.log('error=' + error);
  23692. alert(error);
  23693. }
  23694. finally {
  23695. }
  23696. });
  23697. }
  23698. }
  23699. class UIShop$1 extends UIBase {
  23700. constructor() {
  23701. super();
  23702. this.itemNums = 0;
  23703. this.itemNumsForDj = 0;
  23704. this.curType = "";
  23705. }
  23706. onConstructor() {
  23707. this.ui = ui_UIShop.createInstance();
  23708. this.contentPane = this.ui;
  23709. this.isEject = false;
  23710. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23711. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23712. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23713. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23714. this.addUIClick(this.ui, this.interuptSecretary);
  23715. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23716. this.ballRodArr = [];
  23717. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23718. this.ui.myNode.myList.numItems = this.itemNums;
  23719. this.loadDjdata_old();
  23720. }
  23721. loadDjdata_old() {
  23722. let fff = cfgTable.daoJuData;
  23723. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23724. this.daoJuArr = [];
  23725. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23726. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23727. }
  23728. getProductList() {
  23729. let reqData = xGame.httpMgr.getReqData();
  23730. let pd = JSON.parse(reqData);
  23731. pd.splx = "Consumable";
  23732. reqData = JSON.stringify(pd);
  23733. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23734. try {
  23735. let code = res.code;
  23736. let msg = res.msg;
  23737. if (code == 401) {
  23738. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23739. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23740. return;
  23741. }
  23742. if (code == 200) {
  23743. let data = res.data;
  23744. for (let index = 0; index < data.length; index++) {
  23745. let element = data[index];
  23746. cfgTable.daoJuData[element.spid] = element;
  23747. }
  23748. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23749. }
  23750. else {
  23751. xGame.uiMgr.Show(UIMsg, msg);
  23752. }
  23753. }
  23754. catch (error) {
  23755. console.log('error=' + error);
  23756. alert(error);
  23757. }
  23758. finally {
  23759. }
  23760. });
  23761. }
  23762. show(type) {
  23763. super.show();
  23764. this.curType = type == 0 ? "qiugan" : "daoju";
  23765. this.switchBtn("");
  23766. this.playSecretaryIdle();
  23767. this.updateBallRod();
  23768. this.setGlobalFont(this.ui);
  23769. }
  23770. test123() {
  23771. console.log('zh:test123 ');
  23772. }
  23773. switchBtn(type) {
  23774. console.log('zh:1111切換 sel type=' + type);
  23775. if (type == "") {
  23776. type = this.curType;
  23777. }
  23778. else {
  23779. if (this.curType == type) {
  23780. return;
  23781. }
  23782. else {
  23783. this.curType = type;
  23784. }
  23785. }
  23786. if (type == "qiugan") {
  23787. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23788. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23789. this.ui.myNode.c1.selectedIndex = 0;
  23790. this.ui.myNode.myList.visible = true;
  23791. this.ui.myNode.djList.visible = false;
  23792. }
  23793. else {
  23794. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23795. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23796. this.ui.myNode.c1.selectedIndex = 1;
  23797. this.ui.myNode.myList.visible = false;
  23798. this.ui.myNode.djList.visible = true;
  23799. }
  23800. }
  23801. updateBallRod() {
  23802. for (let index = 0; index < this.ballRodArr.length; index++) {
  23803. this.ballRodArr[index].updateSelf();
  23804. }
  23805. }
  23806. renderBallRod(sort, obj) {
  23807. let index = this.getIndexBySort(sort + 1) - 1;
  23808. let ballRod = new BallRodDisplay$1(obj, index);
  23809. this.ballRodArr.push(ballRod);
  23810. }
  23811. renderDaoJu(idx, obj) {
  23812. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23813. let b = new DaoJuDisplay$1(obj, index);
  23814. this.daoJuArr.push(b);
  23815. }
  23816. getIndexBySort(sort) {
  23817. let object = cfgTable.ballrodData;
  23818. for (const key in object) {
  23819. if (object[key].sort == sort) {
  23820. return parseInt(key);
  23821. }
  23822. }
  23823. }
  23824. getIndexBySortForDj(idx) {
  23825. let object = cfgTable.daoJuData;
  23826. for (const key in object) {
  23827. if (object[key].idx == idx) {
  23828. return parseInt(key);
  23829. }
  23830. }
  23831. }
  23832. playSecretaryIdle() {
  23833. let parent = this.ui.secretary.displayObject;
  23834. parent.destroyChildren();
  23835. let xx = this.ui.secretary.width / 2;
  23836. let yy = this.ui.secretary.height;
  23837. let scale = xGame.common.getSecretaryScale();
  23838. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23839. xGame.common.secretary.play(data, 0, true, parent);
  23840. }
  23841. interuptSecretary() {
  23842. Laya.timer.clearAll(this);
  23843. this.playSecretaryRandomSound();
  23844. }
  23845. playSecretaryRandomSound() {
  23846. if (this.isHide)
  23847. return;
  23848. let time = xGame.common.randomNum(45000, 60000);
  23849. Laya.timer.once(time, this, () => {
  23850. if (this.isHide)
  23851. return;
  23852. let index = xGame.common.randomNum(4, 7);
  23853. xGame.soundMgr.playSound("s_main0" + index);
  23854. let words = 1;
  23855. switch (index) {
  23856. case 4:
  23857. words = 5;
  23858. break;
  23859. case 5:
  23860. words = 3;
  23861. break;
  23862. case 6:
  23863. words = 6;
  23864. break;
  23865. case 7:
  23866. words = 7;
  23867. break;
  23868. default:
  23869. break;
  23870. }
  23871. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23872. this.playSecretaryRandomSound();
  23873. });
  23874. }
  23875. closeSelf() {
  23876. this.hide();
  23877. }
  23878. }
  23879. UIShop$1.uiName = "UIShop";
  23880. class SignMax$1 {
  23881. constructor(ui) {
  23882. this.ui = ui;
  23883. }
  23884. updateSelf(index, sameDay, curDayIndex) {
  23885. let data = cfgTable.signData[index + 1];
  23886. this.ui.titleTxt.text = data.title;
  23887. let arr1 = data.award[0].split('-');
  23888. let arr2 = data.award[1].split('-');
  23889. let num1 = parseInt(arr1[1]);
  23890. let num2 = parseInt(arr2[1]);
  23891. this.ui.numTxt1.text = num1 + "";
  23892. this.ui.numTxt2.text = num2 + "";
  23893. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23894. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23895. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23896. this.ui.numTxt1.visible = false;
  23897. }
  23898. else {
  23899. this.ui.numTxt1.visible = true;
  23900. }
  23901. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23902. this.ui.numTxt2.visible = false;
  23903. }
  23904. else {
  23905. this.ui.numTxt2.visible = true;
  23906. }
  23907. if (index < curDayIndex) {
  23908. this.ui.c1.selectedIndex = 1;
  23909. }
  23910. else if (index == curDayIndex) {
  23911. if (sameDay) {
  23912. this.ui.c1.selectedIndex = 2;
  23913. }
  23914. else {
  23915. this.ui.c1.selectedIndex = 2;
  23916. }
  23917. }
  23918. else {
  23919. this.ui.c1.selectedIndex = 0;
  23920. }
  23921. }
  23922. }
  23923. class SignNormal$1 {
  23924. constructor(ui) {
  23925. this.ui = ui;
  23926. }
  23927. updateSelf(index, sameDay, curDayIndex) {
  23928. let data = cfgTable.signData[index + 1];
  23929. this.ui.titleTxt.text = data.title;
  23930. let arr = data.award[0].split('-');
  23931. let type = parseInt(arr[0]);
  23932. let num = parseInt(arr[1]);
  23933. this.ui.numTxt.text = num + "";
  23934. if (type > 2) {
  23935. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23936. this.ui.myIcon.rotation = 0;
  23937. }
  23938. else {
  23939. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23940. this.ui.myIcon.rotation = 0;
  23941. }
  23942. if (xGame.common.signAwardContainsRod(data.award)) {
  23943. this.ui.numTxt.visible = false;
  23944. }
  23945. else {
  23946. this.ui.numTxt.visible = true;
  23947. }
  23948. if (index < curDayIndex) {
  23949. this.ui.c1.selectedIndex = 1;
  23950. }
  23951. else if (index == curDayIndex) {
  23952. if (sameDay) {
  23953. this.ui.c1.selectedIndex = 2;
  23954. }
  23955. else {
  23956. this.ui.c1.selectedIndex = 2;
  23957. }
  23958. }
  23959. else {
  23960. this.ui.c1.selectedIndex = 0;
  23961. }
  23962. }
  23963. }
  23964. class UISign$1 extends UIBase {
  23965. constructor() {
  23966. super();
  23967. this.curDayIndex = 0;
  23968. this.starX = 0;
  23969. }
  23970. onConstructor() {
  23971. this.ui = ui_UISign.createInstance();
  23972. this.contentPane = this.ui;
  23973. this.isEject = false;
  23974. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23975. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23976. this.initSignItem();
  23977. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23978. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23979. }
  23980. show() {
  23981. super.show();
  23982. this.ui.t0.play();
  23983. this.playSecretaryIdle();
  23984. this.updateSign();
  23985. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23986. this.setGlobalFont(this.ui);
  23987. }
  23988. initSignItem() {
  23989. this.signArr = [];
  23990. for (let index = 0; index < 6; index++) {
  23991. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23992. this.signArr.push(temp);
  23993. }
  23994. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23995. if (Moyu.isKs)
  23996. this.ui.closeNode.closeBtn.x += 100;
  23997. }
  23998. updateSign() {
  23999. let sameDay = xGame.common.judgeSameDay();
  24000. let max = 7;
  24001. this.curDayIndex = DataMgr.getSignData();
  24002. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  24003. this.curDayIndex = 0;
  24004. if (!sameDay) {
  24005. this.ui.normalBtn.visible = true;
  24006. this.ui.tipsNode.visible = false;
  24007. this.ui.againBtn.visible = false;
  24008. }
  24009. else {
  24010. this.ui.normalBtn.visible = false;
  24011. let again = DataMgr.getExtraSign();
  24012. let isCurrency = false;
  24013. let index = this.curDayIndex;
  24014. if (index == 0)
  24015. index = 7;
  24016. let award = cfgTable.signData[index].award;
  24017. let num = award[0].split("-")[0];
  24018. if (num == "1" || num == "2")
  24019. isCurrency = true;
  24020. let showAgain = again == 0 && isCurrency;
  24021. this.ui.againBtn.visible = showAgain;
  24022. this.ui.tipsNode.visible = !showAgain;
  24023. }
  24024. for (let index = 0; index < this.signArr.length; index++) {
  24025. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  24026. }
  24027. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  24028. }
  24029. playSecretaryIdle() {
  24030. let parent = this.ui.secretary.displayObject;
  24031. parent.destroyChildren();
  24032. let xx = this.ui.secretary.width / 2;
  24033. let yy = this.ui.secretary.height;
  24034. let scale = xGame.common.getSecretaryScale();
  24035. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24036. xGame.common.secretary.play(data, 0, true, parent);
  24037. }
  24038. closeSelf() {
  24039. this.hide();
  24040. }
  24041. normalGetAward() {
  24042. let sameDay = xGame.common.judgeSameDay();
  24043. if (!sameDay) {
  24044. let award = cfgTable.signData[this.curDayIndex + 1].award;
  24045. let temp;
  24046. let type;
  24047. let num;
  24048. let arr = [];
  24049. for (let index = 0; index < award.length; index++) {
  24050. temp = award[index].split("-");
  24051. type = parseInt(temp[0]);
  24052. num = parseInt(temp[1]);
  24053. let awardType = new AwardType();
  24054. awardType.num = num;
  24055. awardType.type = type;
  24056. arr.push(awardType);
  24057. }
  24058. xGame.common.getAward(arr, (watchVideo) => {
  24059. this.curDayIndex++;
  24060. if (this.curDayIndex > 7)
  24061. this.curDayIndex = 0;
  24062. DataMgr.setSignData(this.curDayIndex);
  24063. this.updateSignData2Server(this.curDayIndex);
  24064. DataMgr.setSignTime(new Date().getTime());
  24065. if (watchVideo) {
  24066. DataMgr.setExtraSign(1);
  24067. Moyu.sendDataEvent("signIn1");
  24068. }
  24069. this.updateSign();
  24070. });
  24071. }
  24072. }
  24073. againGetAward() {
  24074. Moyu.sendDataEvent("signIn2");
  24075. console.log('zh:qjff_AD_for_uisign');
  24076. if (Laya.Browser.onAndroid) {
  24077. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24078. if (!boo) {
  24079. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24080. return;
  24081. }
  24082. }
  24083. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  24084. }
  24085. else {
  24086. console.log('zh:AD 失败,直接发放奖励');
  24087. this.qjff_AD_for_uisign();
  24088. }
  24089. }
  24090. qjff_AD_for_uisign() {
  24091. let index = this.curDayIndex;
  24092. if (index == 0)
  24093. index = 7;
  24094. let award = cfgTable.signData[index].award;
  24095. let temp;
  24096. let type;
  24097. let num;
  24098. for (let index = 0; index < award.length; index++) {
  24099. temp = award[index].split("-");
  24100. type = parseInt(temp[0]);
  24101. num = parseInt(temp[1]) * 3;
  24102. xGame.common.playObjFlyAnim(num, type);
  24103. }
  24104. DataMgr.setExtraSign(1);
  24105. this.updateSign();
  24106. }
  24107. updateSignData2Server(day) {
  24108. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24109. if (userInfo == null) {
  24110. return;
  24111. }
  24112. let reqData = xGame.httpMgr.getReqData();
  24113. let pd = JSON.parse(reqData);
  24114. pd.signData = day;
  24115. reqData = JSON.stringify(pd);
  24116. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  24117. try {
  24118. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  24119. let code = res.code;
  24120. let msg = res.msg;
  24121. if (code == 401) {
  24122. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24123. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24124. return;
  24125. }
  24126. if (code == 200) {
  24127. let data = res.data;
  24128. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  24129. }
  24130. else {
  24131. xGame.uiMgr.Show(UIMsg$1, msg);
  24132. }
  24133. }
  24134. catch (error) {
  24135. console.log('error=' + error);
  24136. alert(error);
  24137. }
  24138. finally {
  24139. }
  24140. });
  24141. }
  24142. }
  24143. UISign$1.uiName = "UISign";
  24144. class UIModeSelection$1 extends UIBase {
  24145. constructor() {
  24146. super();
  24147. }
  24148. onConstructor() {
  24149. this.ui = ui_UIModeSelection.createInstance();
  24150. this.contentPane = this.ui;
  24151. this.isEject = false;
  24152. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  24153. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  24154. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  24155. this.addUIClick(this.ui.closeBtn, this.hide);
  24156. this.peopleArr = [65, 990, 580];
  24157. this.peopleOffest = [5, 10, 10];
  24158. }
  24159. show(callback) {
  24160. this.updateSelf();
  24161. super.show();
  24162. this.ui.t0.play();
  24163. this.callback = callback;
  24164. this.setGlobalFont(this.ui);
  24165. }
  24166. updateSelf() {
  24167. let cfg = cfgTable.modeselectData;
  24168. for (let index = 1; index <= 3; index++) {
  24169. let node = this.ui.myNode["type" + index];
  24170. node.need.text = cfg[index].need;
  24171. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  24172. node.peopleTxt.text = this.getRandPeople(index - 1);
  24173. }
  24174. }
  24175. enterGame(type) {
  24176. console.log('zh: 进入经典模式 type: ' + type);
  24177. xGame.common.classicRoomType = type;
  24178. let cfg = cfgTable.modeselectData[type];
  24179. let need = cfg.need;
  24180. xGame.common.passAwardCoin = cfg.award;
  24181. if (DataMgr.coinEnough(need)) {
  24182. DataMgr.setCoin(-need);
  24183. this.ui.myNode["type" + type].t0.play();
  24184. Laya.timer.once(200, this, () => {
  24185. this.callback && this.callback();
  24186. });
  24187. this.logEventForClassic_start();
  24188. }
  24189. else {
  24190. Moyu.sendDataEvent("AddCoinVideo");
  24191. xGame.uiMgr.Show(UIAddProp$1, 0);
  24192. }
  24193. }
  24194. getRandPeople(index) {
  24195. let rand = this.peopleOffest[index];
  24196. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  24197. }
  24198. logEventForClassic_start() {
  24199. let rtype = xGame.common.classicRoomType;
  24200. let msmc = '';
  24201. if (rtype == 1) {
  24202. msmc = 'beginner';
  24203. }
  24204. if (rtype == 2) {
  24205. msmc = 'expert';
  24206. }
  24207. if (rtype == 3) {
  24208. msmc = 'master';
  24209. }
  24210. let keyStr = 'sjmd_classic_start_' + rtype;
  24211. let jsonStr = {
  24212. "difficulty": msmc,
  24213. "classic_count": 1,
  24214. "difficulty_count": 1
  24215. };
  24216. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24217. const d = LocalStorageManager.getItem(keyStr);
  24218. jsonStr.classic_count = d.classic_count + 1;
  24219. jsonStr.difficulty_count = d.difficulty_count + 1;
  24220. LocalStorageManager.setItem(keyStr, jsonStr);
  24221. }
  24222. else {
  24223. LocalStorageManager.setItem(keyStr, jsonStr);
  24224. }
  24225. const reqStr = JSON.stringify(jsonStr);
  24226. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  24227. }
  24228. }
  24229. UIModeSelection$1.uiName = "UIModeSelection";
  24230. class UILogin$1 extends UIBase {
  24231. constructor() {
  24232. super();
  24233. this.fontStr = 'big-john-woff2-2';
  24234. try {
  24235. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24236. console.log("zh: constructor加载arial字体成功");
  24237. }
  24238. catch (error) {
  24239. console.log("zh: constructor加载arial字体失败");
  24240. }
  24241. }
  24242. onFontLoaded() {
  24243. try {
  24244. Laya.Text.defaultFont = this.fontStr;
  24245. this.ui.txt_ua.font = this.fontStr;
  24246. this.ui.txt_up.font = this.fontStr;
  24247. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24248. }
  24249. catch (error) {
  24250. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24251. }
  24252. }
  24253. onConstructor() {
  24254. this.ui = ui_UILogin.createInstance();
  24255. this.contentPane = this.ui;
  24256. this.isEject = false;
  24257. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24258. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  24259. this.addUIClick(this.ui.btn_login, this.userLogin);
  24260. }
  24261. show() {
  24262. super.show();
  24263. this.x = (Laya.stage.width - this.width) / 2;
  24264. this.y = (Laya.stage.height - this.height) / 2;
  24265. this.onFontLoaded();
  24266. }
  24267. closeSelf() {
  24268. this.hide();
  24269. }
  24270. userLogin() {
  24271. let ua = this.ui.txt_ua.text;
  24272. let up = this.ui.txt_up.text;
  24273. console.log('zh:ua font' + this.ui.txt_ua.font);
  24274. if (ua && up) {
  24275. let reqData = JSON.stringify({
  24276. username: ua.trim(),
  24277. password: up.trim(),
  24278. fromMark: 'app_game'
  24279. });
  24280. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  24281. try {
  24282. console.log('zh:res = ' + JSON.stringify(res));
  24283. let code = res.code;
  24284. let msg = res.msg;
  24285. if (code == 200) {
  24286. let keyStr = keyForLoginInfo;
  24287. let jsonStr = {
  24288. "username": res.username,
  24289. "token": res.token,
  24290. "buySpids": { 1: false, 7: false }
  24291. };
  24292. LocalStorageManager.setItem(keyStr, jsonStr);
  24293. let myu = Moyu.getUserInfo();
  24294. console.log('zh:myu = ' + JSON.stringify(myu));
  24295. DataMgr.updateUserNickName(res.username);
  24296. Moyu.updateUserInfo(res.username);
  24297. xGame.uiMgr.Show(UIMsg$1, msg);
  24298. DataMgr.loadUserSpOrderForAd();
  24299. DataMgr.getUserZiChanInfo(false);
  24300. xGame.eventMgr.event(LOGIN_IN);
  24301. this.closeSelf();
  24302. }
  24303. else {
  24304. xGame.uiMgr.Show(UIMsg$1, msg);
  24305. }
  24306. }
  24307. catch (error) {
  24308. console.log('error=' + error);
  24309. alert(error);
  24310. }
  24311. finally {
  24312. }
  24313. });
  24314. }
  24315. else {
  24316. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24317. }
  24318. }
  24319. gotoRegPage() {
  24320. this.closeSelf();
  24321. xGame.uiMgr.Show(UIReg$1);
  24322. }
  24323. }
  24324. UILogin$1.uiName = "UILogin";
  24325. class UIReg$1 extends UIBase {
  24326. constructor() {
  24327. super();
  24328. this.fontStr = 'big-john-woff2-2';
  24329. try {
  24330. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24331. console.log("zh: constructor加载arial字体成功");
  24332. }
  24333. catch (error) {
  24334. console.log("zh: constructor加载arial字体失败");
  24335. }
  24336. }
  24337. onFontLoaded() {
  24338. try {
  24339. Laya.Text.defaultFont = this.fontStr;
  24340. this.ui.txt_ua.font = this.fontStr;
  24341. this.ui.txt_up1.font = this.fontStr;
  24342. this.ui.txt_up2.font = this.fontStr;
  24343. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24344. }
  24345. catch (error) {
  24346. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24347. }
  24348. }
  24349. onConstructor() {
  24350. this.ui = ui_UIReg.createInstance();
  24351. this.contentPane = this.ui;
  24352. this.isEject = false;
  24353. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24354. this.addUIClick(this.ui.btn_reg, this.regUser);
  24355. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  24356. }
  24357. show() {
  24358. super.show();
  24359. this.x = (Laya.stage.width - this.width) / 2;
  24360. this.y = (Laya.stage.height - this.height) / 2;
  24361. this.onFontLoaded();
  24362. }
  24363. closeSelf() {
  24364. this.hide();
  24365. }
  24366. regUser() {
  24367. this.ui.lab_tip.visible = false;
  24368. let ua = this.ui.txt_ua.text;
  24369. let up1 = this.ui.txt_up1.text;
  24370. let up2 = this.ui.txt_up2.text;
  24371. if (ua && up1 && up2 && up1 == up2) {
  24372. let reqData = JSON.stringify({
  24373. username: ua.trim(),
  24374. password: up1.trim(),
  24375. fromMark: 'app_game'
  24376. });
  24377. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  24378. try {
  24379. console.log('zh:res = ' + JSON.stringify(res));
  24380. let code = res.code;
  24381. let msg = res.msg;
  24382. xGame.uiMgr.Show(UIMsg$1, msg);
  24383. if (code == 200) {
  24384. this.ui.lab_tip.color = "#FFFFFF";
  24385. xGame.uiMgr.Show(UIMsg$1, msg);
  24386. this.closeSelf();
  24387. }
  24388. else {
  24389. this.ui.lab_tip.color = "#FF0000";
  24390. xGame.uiMgr.Show(UIMsg$1, msg);
  24391. }
  24392. }
  24393. catch (error) {
  24394. console.log('error=' + error);
  24395. alert(error);
  24396. }
  24397. finally {
  24398. }
  24399. });
  24400. }
  24401. else {
  24402. if (up1 != up2) {
  24403. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  24404. }
  24405. else {
  24406. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24407. }
  24408. }
  24409. }
  24410. gotoLogin() {
  24411. this.closeSelf();
  24412. xGame.uiMgr.Show(UILogin$1);
  24413. }
  24414. }
  24415. UIReg$1.uiName = "UIReg";
  24416. class UITry$1 extends UIBase {
  24417. constructor() {
  24418. super();
  24419. this.closeTime = 0;
  24420. this.closeNum = 0;
  24421. this.skillUrl = xGame.common.skillIconList;
  24422. }
  24423. onConstructor() {
  24424. this.ui = ui_UITry.createInstance();
  24425. this.contentPane = this.ui;
  24426. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24427. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24428. }
  24429. show() {
  24430. super.show();
  24431. this.closeNum = 0;
  24432. this.closeTime = 15;
  24433. this.ui.t0.play();
  24434. PlatMgr.showRateBanner();
  24435. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24436. Laya.timer.loop(1000, this, this.updateTime);
  24437. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24438. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24439. xGame.common.gameMgr.gamePause = true;
  24440. this.setGlobalFont(this.ui);
  24441. }
  24442. updateTime() {
  24443. if (this.closeTime > 1) {
  24444. this.closeTime--;
  24445. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24446. }
  24447. else
  24448. this.hide();
  24449. }
  24450. hide() {
  24451. Laya.timer.clearAll(this);
  24452. Moyu.showBannerAd(false);
  24453. super.hide();
  24454. xGame.common.gameMgr.gamePause = false;
  24455. }
  24456. onTry() {
  24457. console.log('zh:qjff_AD_for_uitry');
  24458. if (Laya.Browser.onAndroid) {
  24459. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24460. if (!boo) {
  24461. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24462. return;
  24463. }
  24464. }
  24465. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24466. }
  24467. else {
  24468. console.log('zh:AD 失败,直接发放奖励');
  24469. this.qjff_AD_for_uitry();
  24470. }
  24471. }
  24472. qjff_AD_for_uitry() {
  24473. let select = xGame.common.curPlayerSkillType;
  24474. DataMgr.gameData.trySkill = select;
  24475. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24476. DataMgr.saveGameData();
  24477. DataMgr.setBigSkill(select, 1);
  24478. xGame.showTip("Trial Successful");
  24479. this.hide();
  24480. }
  24481. onCancel() {
  24482. if (this.closeNum > 0) {
  24483. this.closeNum--;
  24484. if (this.closeNum < 2)
  24485. this.hide();
  24486. return;
  24487. }
  24488. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24489. this.onTry();
  24490. }
  24491. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24492. this.closeNum = 3;
  24493. }
  24494. else
  24495. this.hide();
  24496. }
  24497. }
  24498. UITry$1.uiName = "UITry";
  24499. class UIGetAward$1 extends UIBase {
  24500. constructor() {
  24501. super();
  24502. this.showTriple = true;
  24503. }
  24504. onConstructor() {
  24505. this.ui = ui_UIGetAward.createInstance();
  24506. this.contentPane = this.ui;
  24507. this.isEject = false;
  24508. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24509. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24510. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24511. }
  24512. show(arr, showTriple, callback) {
  24513. super.show();
  24514. this.ui.t0.play();
  24515. this.ui.eftNode.visible = true;
  24516. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24517. this.ui.eftNode.visible = false;
  24518. }), 1, 0, 0, 0.9);
  24519. this.awardArr = arr;
  24520. this.showTriple = showTriple;
  24521. this.callback = callback;
  24522. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24523. this.ui.myList.numItems = arr.length;
  24524. xGame.soundMgr.playSound("getaward");
  24525. this.setGlobalFont(this.ui);
  24526. }
  24527. updateSelf(index, obj) {
  24528. let temp = this.awardArr[index];
  24529. let icon = this.getIcon(temp.type);
  24530. let str = icon;
  24531. if (temp.type > 2) {
  24532. str = "s" + icon;
  24533. }
  24534. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24535. obj.myIcon.rotation = 0;
  24536. obj.numTxt.text = temp.num + "";
  24537. obj.numTxt.visible = temp.type > 2 ? false : true;
  24538. obj.nameTxt.text = this.getNameStr(temp.type);
  24539. }
  24540. renderItem(index, obj) {
  24541. this.updateSelf(index, obj);
  24542. }
  24543. tripleGetAward() {
  24544. console.log('zh:qjff_AD_for_uigetAward');
  24545. if (Laya.Browser.onAndroid) {
  24546. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24547. if (!boo) {
  24548. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24549. return;
  24550. }
  24551. }
  24552. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24553. }
  24554. else {
  24555. console.log('zh:AD 失败,直接发放奖励');
  24556. this.qjff_AD_for_uigetAward();
  24557. }
  24558. }
  24559. qjff_AD_for_uigetAward() {
  24560. this.getAward(3);
  24561. }
  24562. normalGetAward() {
  24563. if (PlatMgr.isMisVideo())
  24564. this.tripleGetAward();
  24565. else
  24566. this.getAward();
  24567. }
  24568. getAward(times = 1) {
  24569. this.hide();
  24570. for (let index = 0; index < this.awardArr.length; index++) {
  24571. this.awardArr[index].num *= times;
  24572. }
  24573. this.callback && this.callback(times != 1);
  24574. }
  24575. getIcon(type) {
  24576. switch (type) {
  24577. case Prop.diamond:
  24578. return "ty_zs";
  24579. case Prop.coin:
  24580. return "ty_jb";
  24581. case Prop.gan1:
  24582. return "qg1";
  24583. case Prop.gan2:
  24584. return "qg2";
  24585. case Prop.gan3:
  24586. return "qg3";
  24587. case Prop.gan4:
  24588. return "qg4";
  24589. default:
  24590. break;
  24591. }
  24592. }
  24593. getNameStr(type) {
  24594. switch (type) {
  24595. case Prop.diamond:
  24596. return "Diamond";
  24597. case Prop.coin:
  24598. return "Coins";
  24599. case Prop.gan1:
  24600. case Prop.gan2:
  24601. case Prop.gan3:
  24602. case Prop.gan4:
  24603. return cfgTable.ballrodData[type - 1].name;
  24604. default:
  24605. break;
  24606. }
  24607. }
  24608. }
  24609. UIGetAward$1.uiName = "UIGetAward";
  24610. class UIBox$1 extends UIBase {
  24611. constructor() {
  24612. super();
  24613. this.boxNum = 0;
  24614. this.boxMax = 10;
  24615. this.inAd = false;
  24616. this.isClose = false;
  24617. }
  24618. onConstructor() {
  24619. this.ui = ui_UIBox.createInstance();
  24620. this.contentPane = this.ui;
  24621. this.isEject = false;
  24622. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24623. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24624. Laya.timer.loop(1000, this, this.update);
  24625. }
  24626. update() {
  24627. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24628. this.boxNum -= 1;
  24629. this.upBar();
  24630. }
  24631. }
  24632. upBar() {
  24633. if (this.boxNum > this.boxMax)
  24634. this.boxNum = this.boxMax;
  24635. this.ui.bar.value = this.boxNum * 10;
  24636. }
  24637. show() {
  24638. super.show();
  24639. this.isClose = false;
  24640. this.boxNum = 0;
  24641. this.inAd = false;
  24642. this.upBar();
  24643. this.ui.t0.play();
  24644. this.ui.closeBtn.visible = false;
  24645. Laya.timer.once(3000, this, () => {
  24646. this.ui.closeBtn.visible = true;
  24647. this.ui.bar.alpha = 1;
  24648. });
  24649. Laya.timer.once(500, this, () => {
  24650. this.ui.t1.play();
  24651. });
  24652. this.setGlobalFont(this.ui);
  24653. }
  24654. hide() {
  24655. Laya.timer.clearAll(this);
  24656. Moyu.showBannerAd(false);
  24657. super.hide();
  24658. }
  24659. onOpenBox() {
  24660. this.boxNum++;
  24661. if (this.boxNum < this.boxMax) {
  24662. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24663. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24664. }
  24665. }
  24666. else if (this.boxNum == this.boxMax) {
  24667. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24668. this.ui.openBtn.c1.selectedIndex = 13;
  24669. this.inAd = true;
  24670. }
  24671. else
  24672. this.getAward();
  24673. }
  24674. else if (this.inAd) {
  24675. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24676. if (Laya.Browser.onAndroid) {
  24677. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24678. if (!boo) {
  24679. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24680. return;
  24681. }
  24682. }
  24683. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24684. }
  24685. else {
  24686. console.log('zh:AD 失败,直接发放奖励');
  24687. this.qjff_AD_for_UIBOX_onOpenBox();
  24688. }
  24689. }
  24690. this.upBar();
  24691. }
  24692. qjff_AD_for_UIBOX_onOpenBox() {
  24693. this.getAward();
  24694. }
  24695. onCloseBox() {
  24696. if (this.isClose)
  24697. this.hide();
  24698. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24699. this.isClose = true;
  24700. PlatMgr.showBanner(true, 0, 3000);
  24701. }
  24702. else
  24703. this.hide();
  24704. }
  24705. getAward() {
  24706. let str = "";
  24707. if (Math.random() < 0.5) {
  24708. let max = Moyu.isLegal ? 500 : 2500;
  24709. let num = xGame.tools.random(max, 500 + max);
  24710. DataMgr.setCoin(num);
  24711. str = "金币x" + num;
  24712. }
  24713. else {
  24714. let max = Moyu.isLegal ? 10 : 30;
  24715. let num = xGame.tools.random(max, 30 + max);
  24716. DataMgr.setDiamond(num);
  24717. str = "钻石x" + num;
  24718. }
  24719. xGame.showTip("恭喜获得-" + str);
  24720. this.hide();
  24721. }
  24722. }
  24723. UIBox$1.uiName = "UIBox";
  24724. class UIMain$1 extends UIBase {
  24725. constructor() {
  24726. super();
  24727. this.firstEnter = true;
  24728. this.moni_click_count = 0;
  24729. }
  24730. nativeCallJs(msg) {
  24731. let t = msg;
  24732. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24733. switch (t) {
  24734. case 'qjff_chouJiang':
  24735. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24736. dui.qjff_chouJiang();
  24737. break;
  24738. case 'qjff_AD_for_uisign':
  24739. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24740. dui2.qjff_AD_for_uisign();
  24741. break;
  24742. case 'qjff_AD_for_uitry':
  24743. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24744. dui3.qjff_AD_for_uitry();
  24745. break;
  24746. case 'qjff_AD_for_uipower':
  24747. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24748. dui4.qjff_AD_for_uipower();
  24749. break;
  24750. case 'qjff_AD_for_uigetAward':
  24751. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24752. dui5.qjff_AD_for_uigetAward();
  24753. break;
  24754. case 'qjff_AD_for_uiGameEnd':
  24755. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24756. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24757. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24758. break;
  24759. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24760. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24761. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24762. break;
  24763. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24764. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24765. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24766. break;
  24767. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24768. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24769. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24770. break;
  24771. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24772. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24773. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24774. break;
  24775. case 'qjff_AD_for_UIBOX_onOpenBox':
  24776. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24777. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24778. break;
  24779. case 'qjff_AD_for_UIAddCoin':
  24780. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24781. dui12.qjff_AD_for_UIAddCoin();
  24782. break;
  24783. case 'app_sign_for_buyProduct_onSuccess':
  24784. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24785. DataMgr.getUserZiChanInfo(false);
  24786. break;
  24787. case '222axxxxxx':
  24788. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24789. dui15.qjff_AD_for_uisign();
  24790. break;
  24791. case '333axsxxxxxx':
  24792. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24793. dui16.qjff_AD_for_uisign();
  24794. break;
  24795. default:
  24796. console.log('zh:未知的方法名字' + t);
  24797. break;
  24798. }
  24799. }
  24800. onConstructor() {
  24801. console.log('zh: UIMain onConstructor');
  24802. this.ui = ui_UIMain.createInstance();
  24803. this.contentPane = this.ui;
  24804. this.isEject = false;
  24805. this.addEvent();
  24806. this.addClickSpine();
  24807. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24808. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24809. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24810. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24811. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24812. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24813. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24814. xGame.eventMgr.on("gameConfigReadyMark", this, this.event_gameConfigReadyMark);
  24815. let curUse = DataMgr.getCurSecretary();
  24816. this.changeSecretary(curUse);
  24817. this.ui.talkNode.visible = false;
  24818. let guide = DataMgr.getSkillGuide();
  24819. if (xGame.common.isNewDay && guide == 1) {
  24820. xGame.common.isNewDay = false;
  24821. xGame.soundMgr.playSound("s_main01");
  24822. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24823. console.log("zh:播放小秘书每天语音");
  24824. }
  24825. this.onGetUserInfo();
  24826. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24827. DataMgr.getUserZiChanInfo(false);
  24828. }
  24829. this.ui.n83.visible = false;
  24830. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24831. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24832. let ua = d.username;
  24833. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24834. }
  24835. this.c_btn_for_user();
  24836. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24837. }
  24838. Logout() {
  24839. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24840. LocalStorageManager.removeItem(keyForLoginInfo);
  24841. this.freshUser();
  24842. }
  24843. JSBridgeUtils.instance.loginOutForApp();
  24844. this.setUserDefaultNickname();
  24845. DataMgr.setCoin2(4000);
  24846. DataMgr.setDiamond2(0);
  24847. this.setDefaultQiuGanInfo();
  24848. DataMgr.setPlaceBallLevelList("");
  24849. DataMgr.setChallengeMode_overLev(1);
  24850. this.setDefaultSignData();
  24851. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24852. DataMgr.setCurBallRod(5);
  24853. }
  24854. setDefaultSignData() {
  24855. DataMgr.setSignData(1);
  24856. DataMgr.setSignTime(new Date().getTime());
  24857. }
  24858. setDefaultQiuGanInfo() {
  24859. DataMgr.setBallRod(0, 1);
  24860. DataMgr.setBallRod(1, 0);
  24861. DataMgr.setBallRod(2, 0);
  24862. DataMgr.setBallRod(3, 0);
  24863. DataMgr.setBallRod(4, 0);
  24864. DataMgr.setBallRod(5, 1);
  24865. }
  24866. setUserDefaultNickname() {
  24867. let defUsername = "player";
  24868. this.ui.headNode.nameTxt.text = defUsername;
  24869. DataMgr.updateUserNickName(defUsername);
  24870. Moyu.updateUserInfo(defUsername);
  24871. }
  24872. gotoLogin() {
  24873. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24874. xGame.uiMgr.Show(UILogin$1);
  24875. }
  24876. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24877. this.Logout();
  24878. }
  24879. }
  24880. gotoRegUser() {
  24881. xGame.uiMgr.Show(UIReg$1);
  24882. }
  24883. showFuLiSp1() {
  24884. console.log('zh:福利1');
  24885. DataMgr.checkForShowFuLi17AndAlert(1);
  24886. }
  24887. showFuLiSp7() {
  24888. console.log('zh:福利7');
  24889. DataMgr.checkForShowFuLi17AndAlert(7);
  24890. }
  24891. c_btn_for_user() {
  24892. this.ui.n_dengLu.c1.selectedIndex = 0;
  24893. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24894. this.ui.n_dengLu.c1.selectedIndex = 1;
  24895. }
  24896. else {
  24897. this.ui.n_dengLu.c1.selectedIndex = 0;
  24898. }
  24899. }
  24900. changeSecretary(curUse) {
  24901. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24902. xGame.common.secretary && xGame.common.secretary.dispose();
  24903. this.addSecretarySpine(name);
  24904. }
  24905. addSecretarySpine(name) {
  24906. let spine = new SpineMgr(name, () => {
  24907. this.playSecretaryIdle();
  24908. });
  24909. xGame.common.secretary = spine;
  24910. }
  24911. addClickSpine() {
  24912. let clickSpine = new SpineMgr("dianji", () => {
  24913. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24914. let parent = Laya.stage;
  24915. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24916. clickSpine.play(data, 0, false, parent, (spine) => {
  24917. spine.destroy(true);
  24918. });
  24919. });
  24920. });
  24921. }
  24922. addEvent() {
  24923. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24924. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24925. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24926. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24927. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24928. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24929. this.addUIClick(this.ui, this.interuptSecretary);
  24930. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24931. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24932. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24933. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24934. this.addUIClick(this.ui.signBtn, this.openSignView);
  24935. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24936. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24937. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  24938. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  24939. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24940. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24941. }
  24942. show(showFailWords) {
  24943. super.show();
  24944. DataMgr.loadUserSpOrderForAd();
  24945. this.moneyNode.ui.c1.selectedIndex = 1;
  24946. this.playSecretaryIdle();
  24947. xGame.soundMgr.playMusic("caromhall01", 0);
  24948. Laya.timer.clearAll(this);
  24949. this.playSecretaryRandomSound();
  24950. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24951. if (showFailWords) {
  24952. console.log('zh:uimain.ts ');
  24953. setTimeout(() => {
  24954. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24955. let words = -1;
  24956. if (str == "s_main02") {
  24957. words = 2;
  24958. }
  24959. else {
  24960. words = 3;
  24961. }
  24962. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24963. xGame.soundMgr.playSound(str);
  24964. }, 300);
  24965. }
  24966. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24967. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24968. let isGuideOver = false;
  24969. let randTime = xGame.common.randomNum(300, 800);
  24970. if (DataMgr.getGuideDefaultModel() === 1) {
  24971. let guide = DataMgr.getLianXiGuide();
  24972. if (guide == 1) {
  24973. isGuideOver = true;
  24974. this.ui.n_yd_lxms_1.visible = false;
  24975. this.firstEnter = false;
  24976. }
  24977. }
  24978. else {
  24979. let guide = DataMgr.getSkillGuide();
  24980. if (guide == 1) {
  24981. isGuideOver = true;
  24982. if (this.firstEnter) {
  24983. console.log("zh: firstEnter");
  24984. this.firstEnter = false;
  24985. randTime += 900;
  24986. }
  24987. else {
  24988. console.log("zh: no firstEnter");
  24989. }
  24990. }
  24991. }
  24992. if (isGuideOver) {
  24993. Laya.timer.once(randTime, this, () => {
  24994. });
  24995. Laya.timer.once(1000, this, () => {
  24996. console.log('zh: 1秒后 showFuLiSp7');
  24997. this.showFuLiSp7();
  24998. });
  24999. this.showTipForGuest();
  25000. }
  25001. this.setGlobalFont(this.ui);
  25002. }
  25003. event_gameConfigReadyMark() {
  25004. console.log('zh:事件触发,配置加载OK');
  25005. if (DataMgr.getGuideDefaultModel() === 1) {
  25006. this.showGuideForLianxi();
  25007. }
  25008. else {
  25009. this.showGuide();
  25010. }
  25011. }
  25012. showGuideForLianxi() {
  25013. let lianXiGuide = DataMgr.getLianXiGuide();
  25014. console.log('zh: AAAAA练习模式引导判断:lianXiGuide=' + lianXiGuide);
  25015. if (lianXiGuide == 0) {
  25016. let x = this.ui.placeBallBtn.x;
  25017. let y = this.ui.placeBallBtn.y;
  25018. this.ui.n_yd_lxms_1.visible = true;
  25019. this.ui.n_yd_challenge_1_hand.x = x + 150;
  25020. this.ui.n_yd_challenge_1_hand.y = y;
  25021. this.ui.n_yd_challenge_1_btn.x = x;
  25022. this.ui.n_yd_challenge_1_btn.y = y;
  25023. console.log('zh:yinDaoForLianxi set ok');
  25024. }
  25025. else {
  25026. this.ui.n_yd_lxms_1.visible = false;
  25027. }
  25028. }
  25029. showTipForGuest() {
  25030. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  25031. if (userInfo == null) {
  25032. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  25033. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  25034. let woman = "this is an important notice.";
  25035. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  25036. return;
  25037. }
  25038. }
  25039. checkActive(show) {
  25040. }
  25041. showGuide() {
  25042. let guide = DataMgr.getSkillGuide();
  25043. this.ui.guideBtn.visible = guide == 0;
  25044. this.ui.enterGuide.visible = false;
  25045. this.ui.secretaryGuide.visible = guide == 0;
  25046. if (guide == 0) {
  25047. console.log("zh:显示引导");
  25048. xGame.soundMgr.playSound("s_guide");
  25049. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25050. }
  25051. else {
  25052. console.log("zh:不需要显示引导");
  25053. }
  25054. }
  25055. ensureSecretary() {
  25056. console.log('zh: ensureSecretary ');
  25057. this.ui.secretaryGuide.visible = false;
  25058. this.ui.enterGuide.visible = true;
  25059. this.ui.wordsNode.t0.play();
  25060. if (DataMgr.getNewUser())
  25061. Moyu.sendDataEvent("gameReady");
  25062. }
  25063. playSecretaryIdle() {
  25064. let parent = this.ui.secretary.displayObject;
  25065. parent.destroyChildren();
  25066. let xx = this.ui.secretary.width / 2;
  25067. let yy = this.ui.secretary.height;
  25068. let scale = xGame.common.getSecretaryScale();
  25069. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  25070. xGame.common.secretary.play(data, 0, true, parent);
  25071. }
  25072. startGame(type) {
  25073. if (!this.isReadyForLoadNetSource()) {
  25074. return;
  25075. }
  25076. xGame.common.gameMode = type;
  25077. Moyu.sendDataEvent("PlayGame", { type: type });
  25078. let gm = xGame.common.gameMode;
  25079. console.log('zh:进入游戏gameMode =' + gm);
  25080. switch (gm) {
  25081. case GameMode.classic:
  25082. console.log('zh:进入经典模式111111111');
  25083. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  25084. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25085. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  25086. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  25087. console.log('zh:判断是否可以玩该模式classic =NO');
  25088. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  25089. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25090. return;
  25091. }
  25092. else {
  25093. console.log('zh:可以玩该模式classic');
  25094. this.beginGame();
  25095. }
  25096. }
  25097. else {
  25098. console.log('zh:不需要判断是否可以玩该classic');
  25099. let challengeTimes = DataMgr.getChallengeTimes();
  25100. if (challengeTimes == 0) {
  25101. xGame.uiMgr.Show(UIInvitation$1);
  25102. }
  25103. else {
  25104. this.beginGame();
  25105. }
  25106. }
  25107. break;
  25108. case GameMode.bigMove:
  25109. console.info('zh:bigMove check 大招');
  25110. let guide = DataMgr.getSkillGuide();
  25111. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  25112. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25113. console.log('zh:bigMove db_over_lev=', db_over_lev);
  25114. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  25115. console.log('zh:提示不可以玩');
  25116. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  25117. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25118. return;
  25119. }
  25120. else {
  25121. console.log('zh:可以玩该模式 bigMove');
  25122. this.beginGame();
  25123. if (DataMgr.getNewUser())
  25124. Moyu.sendDataEvent("gameStart0");
  25125. }
  25126. }
  25127. else {
  25128. this.beginGame();
  25129. if (DataMgr.getNewUser())
  25130. Moyu.sendDataEvent("gameStart0");
  25131. }
  25132. break;
  25133. default:
  25134. console.error('zh:未知错误!!!!');
  25135. break;
  25136. }
  25137. }
  25138. beginGame(isNice = false) {
  25139. console.log('zh:beginGame ');
  25140. let guide = DataMgr.getSkillGuide();
  25141. if (guide == 1) {
  25142. console.log('zh:非新手引导,showInternAd ');
  25143. JSBridgeUtils.instance.showInternAd('beginGame');
  25144. }
  25145. else {
  25146. console.log('zh:新手引导,不显示AD ');
  25147. }
  25148. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  25149. console.log('zh:beginGame 1');
  25150. if (xGame.common.gameMode == GameMode.classic) {
  25151. console.log('zh:beginGame 2');
  25152. if (isNice) {
  25153. console.log('zh:进入巅峰赛');
  25154. this.enterClassic();
  25155. }
  25156. else {
  25157. console.log('zh:beginGame 3-1');
  25158. xGame.uiMgr.Show(UIModeSelection$1, () => {
  25159. console.log('zh:beginGame 3-2');
  25160. this.enterClassic();
  25161. });
  25162. }
  25163. }
  25164. else if (xGame.common.gameMode == GameMode.bigMove) {
  25165. console.log('zh:beginGame 5');
  25166. this.ui.enterGuide.visible = false;
  25167. xGame.uiMgr.Show(UISkill$1);
  25168. }
  25169. }
  25170. enterClassic() {
  25171. console.log('zh:beginGame 7');
  25172. xGame.uiMgr.Show(UIGame$1);
  25173. xGame.uiMgr.Show(UIMatching$1, () => {
  25174. if (!this.isHide)
  25175. this.hide();
  25176. xGame.common.gameUI.ui.alpha = 1;
  25177. console.log('zh:beginGame 8');
  25178. xGame.common.gameUI.startGame();
  25179. xGame.uiMgr.Hide(UIGameEnd$1);
  25180. });
  25181. }
  25182. start_debug_for_moni_payOk() {
  25183. let ccc = this.moni_click_count + 1;
  25184. this.moni_click_count = ccc;
  25185. if (ccc % 5 == 0) {
  25186. console.log('zh:start_debug_for_moni_payOk');
  25187. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  25188. if (userInfo != null) {
  25189. let token = userInfo.token;
  25190. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  25191. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  25192. alert('模拟支付OK');
  25193. return;
  25194. }
  25195. else {
  25196. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  25197. }
  25198. }
  25199. }
  25200. startGlobal() {
  25201. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  25202. }
  25203. startWeekly() {
  25204. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  25205. }
  25206. zhouSaiMonth() {
  25207. console.log('zh: zhouSaiMonth 被调用');
  25208. }
  25209. isReadyForLoadNetSource() {
  25210. let reqCount = xGame.cfgMgr.httpReqCount;
  25211. let ok = xGame.cfgMgr.httpReqOkCount;
  25212. if (reqCount > ok) {
  25213. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  25214. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  25215. Laya.timer.once(5000, this, () => {
  25216. let retryCount = 0;
  25217. const maxRetries = 3;
  25218. const tryFetchConfig = () => {
  25219. try {
  25220. xGame.cfgMgr.getConfigFromServer();
  25221. }
  25222. catch (error) {
  25223. if (retryCount < maxRetries) {
  25224. retryCount++;
  25225. console.log(`🔄 第${retryCount}次重试获取配置...`);
  25226. Laya.timer.once(5000, this, tryFetchConfig);
  25227. }
  25228. else {
  25229. console.error("❌ 达到最大重试次数,配置获取失败");
  25230. }
  25231. }
  25232. };
  25233. tryFetchConfig();
  25234. });
  25235. return false;
  25236. }
  25237. return true;
  25238. }
  25239. startPlaceBall() {
  25240. if (!this.isReadyForLoadNetSource()) {
  25241. return;
  25242. }
  25243. xGame.uiMgr.Show(UILevelDisplay$1);
  25244. }
  25245. hide() {
  25246. console.log('zh:uimain hide ...');
  25247. super.hide();
  25248. xGame.common.stopGirlPop(this.ui.talkNode);
  25249. }
  25250. onGetUserInfo(force = false) {
  25251. if (Moyu.isWx) {
  25252. let info = Moyu.getSystemInfo();
  25253. if (info)
  25254. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  25255. }
  25256. else {
  25257. Moyu.initUser(this, this.freshUser, force);
  25258. }
  25259. this.freshUser();
  25260. console.log('zh:5秒后更新用户信息');
  25261. setTimeout(() => {
  25262. DataMgr.getUserZiChanInfo(true);
  25263. }, 5000);
  25264. }
  25265. event_login_in() {
  25266. console.log("zh:event_login_in被触发");
  25267. this.freshUser();
  25268. }
  25269. freshUser() {
  25270. let user = Moyu.getUserInfo();
  25271. if (!user.isAuth) {
  25272. user.headIcon = 'res/ty_touxiang.png';
  25273. }
  25274. else {
  25275. DataMgr.upRankData();
  25276. }
  25277. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  25278. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  25279. let keyStr = keyForLoginInfo;
  25280. if (LocalStorageManager.hasJosnKey(keyStr)) {
  25281. const d = LocalStorageManager.getItem(keyStr);
  25282. let ua = d.username;
  25283. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  25284. }
  25285. else {
  25286. }
  25287. this.c_btn_for_user();
  25288. }
  25289. interuptSecretary() {
  25290. Laya.timer.clearAll(this);
  25291. this.playSecretaryRandomSound();
  25292. }
  25293. playSecretaryRandomSound() {
  25294. if (this.isHide)
  25295. return;
  25296. let time = xGame.common.randomNum(45000, 60000);
  25297. Laya.timer.once(time, this, () => {
  25298. if (this.isHide)
  25299. return;
  25300. let index = xGame.common.randomNum(4, 7);
  25301. xGame.soundMgr.playSound("s_main0" + index);
  25302. let words = 1;
  25303. switch (index) {
  25304. case 4:
  25305. words = 5;
  25306. break;
  25307. case 5:
  25308. words = 3;
  25309. break;
  25310. case 6:
  25311. words = 6;
  25312. break;
  25313. case 7:
  25314. words = 7;
  25315. break;
  25316. default:
  25317. break;
  25318. }
  25319. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25320. this.playSecretaryRandomSound();
  25321. });
  25322. }
  25323. openSecretaryView() {
  25324. xGame.uiMgr.Show(UISecretary$1);
  25325. Moyu.sendDataEvent("secretary");
  25326. }
  25327. openShopView() {
  25328. xGame.uiMgr.Show(UIShop$1, 1);
  25329. }
  25330. openShopView0() {
  25331. xGame.uiMgr.Show(UIShop$1, 0);
  25332. }
  25333. openSignView() {
  25334. xGame.uiMgr.Show(UISign$1);
  25335. }
  25336. openDrawView() {
  25337. xGame.uiMgr.Show(UIDraw$1);
  25338. }
  25339. openRanking() {
  25340. console.log('zh:phb openRanking');
  25341. xGame.uiMgr.Show(UIRanking$1);
  25342. Moyu.sendDataEvent("rankingList");
  25343. }
  25344. }
  25345. UIMain$1.uiName = "UIMain";
  25346. function InitShader() {
  25347. }
  25348. function appInit() {
  25349. xGame.context.init(getLoadingResList(), initCallback);
  25350. }
  25351. function getLoadingResList() {
  25352. return [
  25353. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  25354. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  25355. ];
  25356. }
  25357. function getGameResList() {
  25358. return [
  25359. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  25360. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  25361. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  25362. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  25363. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  25364. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  25365. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  25366. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  25367. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  25368. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  25369. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  25370. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  25371. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  25372. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  25373. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  25374. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  25375. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  25376. ];
  25377. }
  25378. function initCallback() {
  25379. window["DataMgr"] = DataMgr;
  25380. DataMgr.Init();
  25381. Moyu.init(getPlat(), this, () => {
  25382. DataMgr.isNewDay();
  25383. PlatMgr.initConfig();
  25384. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  25385. }, true);
  25386. console.log('zh:开始sm init1 start');
  25387. xGame.soundMgr.init();
  25388. console.log('zh:开始sm init1 end');
  25389. xGame.uiMgr.init();
  25390. xGame.uiMgr.clearTempData();
  25391. xGame.uiMgr.bindFUI(fguiRes.loading);
  25392. xGame.uiMgr.Show(UILoading);
  25393. }
  25394. function onFontLoaded() {
  25395. try {
  25396. Laya.Text.defaultFont = "arial";
  25397. console.log("zh: onFontLoaded 设置arial字体成功");
  25398. }
  25399. catch (error) {
  25400. console.log("zh: constructor onFontLoaded加载arial字体失败");
  25401. }
  25402. }
  25403. function loadSubRes(callback) {
  25404. var tab = ["asset", "res", "spine"];
  25405. let subDone = 0;
  25406. for (var i = 0; i < tab.length; i++) {
  25407. let sub = tab[i];
  25408. Moyu.loadSubRes(sub, (pro) => {
  25409. callback && callback(pro, false);
  25410. }).then(() => {
  25411. subDone++;
  25412. if (subDone >= tab.length)
  25413. callback && callback(1, true);
  25414. });
  25415. }
  25416. }
  25417. function enterGame() {
  25418. xGame.cfgMgr.init();
  25419. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25420. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25421. xGame.uiMgr.Hide(UILoading);
  25422. fgui.UIPackage.removePackage(fguiRes.loading);
  25423. xGame.uiMgr.bindFUI(fguiRes.game);
  25424. xGame.uiMgr.Show(UIMain$1);
  25425. if (DataMgr.getNewUser())
  25426. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25427. }
  25428. function getPlat() {
  25429. let cfg = new MoyuCfg();
  25430. cfg.plat = MoyuPlat.web;
  25431. cfg.myId = 180;
  25432. cfg.myKey = '8848a885774230a4';
  25433. cfg.version = 0;
  25434. if (window.hasOwnProperty("gamebox")) {
  25435. cfg.plat = MoyuPlat.f399;
  25436. cfg.version = 0;
  25437. }
  25438. else if (window.hasOwnProperty("ks")) {
  25439. cfg.plat = MoyuPlat.ks;
  25440. cfg.version = 0;
  25441. cfg.ads.ksVideoId = '2300002254_01';
  25442. cfg.ads.ksInsertId = '2300002254_02';
  25443. }
  25444. else if (Laya.Browser.onTTMiniGame) {
  25445. cfg.plat = MoyuPlat.tt;
  25446. cfg.version = 0;
  25447. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25448. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25449. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25450. }
  25451. else if (Laya.Browser.onMiniGame) {
  25452. cfg.plat = MoyuPlat.wx;
  25453. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25454. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25455. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25456. }
  25457. else if (Laya.Browser.onQQMiniGame) {
  25458. cfg.plat = MoyuPlat.qq;
  25459. }
  25460. else if (Laya.Browser.onQGMiniGame) {
  25461. cfg.plat = MoyuPlat.op;
  25462. cfg.ads.opVideoId = '455502';
  25463. cfg.ads.opBannerId = '455507';
  25464. }
  25465. else if (Laya.Browser.onVVMiniGame) {
  25466. cfg.plat = MoyuPlat.vv;
  25467. cfg.version = 0;
  25468. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25469. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25470. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25471. }
  25472. else if (Laya.Browser.onHWMiniGame) {
  25473. cfg.plat = MoyuPlat.hw;
  25474. }
  25475. else if (window["mz"]) {
  25476. cfg.plat = MoyuPlat.mz;
  25477. }
  25478. else {
  25479. let cfg = window['conchConfig'];
  25480. if (cfg) {
  25481. var os = cfg.getOS();
  25482. if (os == "Conch-ios") {
  25483. cfg.plat = MoyuPlat.ios;
  25484. }
  25485. else if (os == "Conch-android") {
  25486. }
  25487. }
  25488. }
  25489. return cfg;
  25490. }
  25491. class Main {
  25492. constructor() {
  25493. if (window["Laya3D"])
  25494. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25495. else {
  25496. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25497. this.initMain();
  25498. }
  25499. }
  25500. initMain() {
  25501. Laya["Physics"] && Laya["Physics"].enable();
  25502. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25503. Laya.stage.scaleMode = GameConfig.scaleMode;
  25504. Laya.stage.screenMode = GameConfig.screenMode;
  25505. Laya.stage.alignV = GameConfig.alignV;
  25506. Laya.stage.alignH = GameConfig.alignH;
  25507. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25508. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25509. Laya.enableDebugPanel();
  25510. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25511. Laya["PhysicsDebugDraw"].enable();
  25512. if (GameConfig.stat)
  25513. Laya.Stat.show();
  25514. Laya.alertGlobalError(true);
  25515. this.loadFont();
  25516. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25517. }
  25518. loadFont() {
  25519. try {
  25520. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25521. console.log("zh: constructor加载arial字体成功1");
  25522. }
  25523. catch (error) {
  25524. console.log("zh: constructor加载arial字体失败1");
  25525. }
  25526. }
  25527. onFontLoaded() {
  25528. try {
  25529. Laya.Text.defaultFont = "Arial";
  25530. console.log("zh: onFontLoaded 设置arial字体成功1");
  25531. }
  25532. catch (error) {
  25533. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25534. }
  25535. }
  25536. onVersionLoaded() {
  25537. appInit();
  25538. }
  25539. }
  25540. new Main();
  25541. }());
  25542. //# sourceMappingURL=bundle.js.map